Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

EJB local objects

 
Ashok Paulraj
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Ranchers,
I am just learning a bit on EJBs.
CLARIFY THIS:
In order to access the business methods, there are two options::
OPTION I: client calls stub - stub does marshalling & contacts skeleton - skeleton does unmarshalling & contacts EJBObject to get an instance of the bean - EJBObject contacts business methods & response comes back thru' the same process.
OPTION II: client calls an interface that implements EJBlocalHome --which further contacts an interface that implements EJBlocalObject - which creates an instance of the bean and contacts the bean to run the logic.
Ofcourse I knew that OPTION II is valid only when the bean is deployed in the same machine as the client.
Am I right?... Through out your version of understanding to get this right!!
Thanks,
Shalini
 
Manish Malhotra
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OPTION I: client calls stub - stub does marshalling & contacts skeleton - skeleton does unmarshalling & contacts EJBObject to get an instance of the bean - EJBObject contacts business methods & response comes back thru' the same process.
======================
General -->> When you call create method on Home then your home create or get the instance of your bean from the pool, and then it associates the EJBObject's object with your bean instance & EJBObject impelements the remote interface.
The concept of stub is correct as per my knowledge what you are thinking. But I think now there is no skeleton on the server side.

OPTION II: client calls an interface that implements EJBlocalHome --which further contacts an interface that implements EJBlocalObject - which creates an instance of the bean and contacts the bean to run the logic.
=====
I dont know much about the local interface concept in EJB2.0
regards,
Manish Malhotra
SE, PCS. IND
 
anjan
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Taurean Lord:
Hello Ranchers,
I am just learning a bit on EJBs.
CLARIFY THIS:
In order to access the business methods, there are two options::
OPTION I: client calls stub - stub does marshalling & contacts skeleton - skeleton does unmarshalling & contacts EJBObject to get an instance of the bean - EJBObject contacts business methods & response comes back thru' the same process.
OPTION II: client calls an interface that implements EJBlocalHome --which further contacts an interface that implements EJBlocalObject - which creates an instance of the bean and contacts the bean to run the logic.

Ofcourse I knew that OPTION II is valid only when the bean is deployed in the same machine as the client.
Am I right?... Through out your version of understanding to get this right!!

Thanks,
Shalini

<< OPTION II ;
<<client looks up for LocalHome interface reference ( i.e the <<implementation class for the interface that extends EJBLocalHome) and <<get's tha handle of the LocalEJBObject (i.e the implementation class of <<interface that extends EJBLocalObject )
<<yes it's right only thing is this time there is no stub &
<<Skeleton overhead ...... and it's just plain method calls.
Regards
Anjan
 
Srikanth Shenoy
author
Ranch Hand
Posts: 184
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Taurean Lord:
Hello Ranchers,
I am just learning a bit on EJBs.
CLARIFY THIS:
....
.....
OPTION II: client calls an interface that implements EJBlocalHome --which further contacts an interface that implements EJBlocalObject - which creates an instance of the bean and contacts the bean to run the logic.
Ofcourse I knew that OPTION II is valid only when the bean is deployed in the same machine as the client.
Thanks,
Shalini

Slight correction on this one.
A client can access a EJBLocalObject only when the client is part of the same EAR as the EJB Local Object, not the same machine.
Hope that helps,
Srikanth Shenoy
Author
Struts Survival Guide : Basics to Best Practices
J2EE Project Survival Guide
 
Ashok Paulraj
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Mr. Shenoy,
Could you add 2 more cents on EAR ?
~ Shalini
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic