Wednesday, 8 May 2013

What are the ways for a client application to get an EJB object? | EJB Interview Questions

1.    The client has the JNDI name of the EJB object; this name is used to get the EJB object.
2. The client has the JNDI name of the Home object, this is a more usual case; this name is used to get the Home object, then a finder method is invoked on this Home to obtain one or several entity bean objects. The client may also invoke a "create" method on the Home object to create a new EJB object (session or entity).
3. The client has got a handle on an EJB object. A handle is an object that identifies an EJB object; it may be serialized, stored, and used later by a client to obtain a reference to the EJB Object, using the getEJBObject method().
4. The client has got a reference to an EJB object, and some methods defined on the remote interface of this Enterprise Bean return EJB objects.


No comments: