-
how to call a bean instance from another bean (6 messages)
- Posted by: raghuveer sribhashyam
- Posted on: April 19 2004 07:13 EDT
can anyone plz tell me how to call a bean instance from another bean instanceThreaded Messages (6)
- how to call a bean instance from another bean by Senthil Chinnaiyan on April 19 2004 07:26 EDT
- Local Lookup by Leslie Bertels on April 19 2004 10:09 EDT
- how to call a bean instance from another bean by regonda suresh on April 20 2004 01:45 EDT
- how to call a bean instance from another bean by ramesh kesavanarayanan on April 20 2004 07:22 EDT
- how to call a bean instance from another bean by Senthil Chinnaiyan on April 20 2004 14:12 EDT
- how to call a bean instance from another bean by Senthil Chinnaiyan on April 20 2004 02:55 EDT
- how to call a bean instance from another bean by Senthil Chinnaiyan on April 20 2004 14:12 EDT
-
how to call a bean instance from another bean[ Go to top ]
- Posted by: Senthil Chinnaiyan
- Posted on: April 19 2004 07:26 EDT
- in response to raghuveer sribhashyam
All the business logic of a bean should be invoked through its component interface(Remote/Local) only, even if your beans are in the same container and same ear file.
You should JNDI lookup another bean and execute method calls. And also if you want to pass your bean instance reference to another bean, you should pass the reference of EJBObject or EJBLocalObject, like ctx.getEJBObject() or ctx.getEJBLocalObject(). -
Local Lookup[ Go to top ]
- Posted by: Leslie Bertels
- Posted on: April 19 2004 10:09 EDT
- in response to Senthil Chinnaiyan
Hi,
I've read the comment and believe that there should be some more explanation on how EJB communicate with each other.
Remember that your beans are running inside the container and that you can access them using the Home and Remote interfaces. This is in fact using RMI (Remote Method Invocation)... communication between the web-container and the EJB-container for example.
This means that when accessing an EJB from a POJO, use the Home interface to retrieve an instance of that EJB.
If you are communicating between two EJB's however (running in the same EJB container), you should use the LocalHome object to retrieve an instandce of that EJB. At that moment no RMI is used but just plain old class loading. This will result in quite an increase of speed.
Hope this helps a bit ??
Rgds,
Les. -
how to call a bean instance from another bean[ Go to top ]
- Posted by: regonda suresh
- Posted on: April 20 2004 01:45 EDT
- in response to raghuveer sribhashyam
can anyone plz tell me how to call a bean instance from another bean instance
-
how to call a bean instance from another bean[ Go to top ]
- Posted by: ramesh kesavanarayanan
- Posted on: April 20 2004 07:22 EDT
- in response to raghuveer sribhashyam
why dont you use <ejb-ref> for this -
how to call a bean instance from another bean[ Go to top ]
- Posted by: Senthil Chinnaiyan
- Posted on: April 20 2004 14:12 EDT
- in response to ramesh kesavanarayanan
why dont you use <ejb-ref> for this
<ejb-ref> is a logical name for an existing ejb. To avoid hardcoding JNDI names inside your bean code, you will use <ejb-ref>. In ejb-ref also, the container will look up the bean instance. -
how to call a bean instance from another bean[ Go to top ]
- Posted by: Senthil Chinnaiyan
- Posted on: April 20 2004 14:55 EDT
- in response to Senthil Chinnaiyan
I think this link might help you. http://java.sun.com/blueprints/qanda/ejb_tier/index.html#references