Interview Questions

A client wants to preserve the reference to the EJBHome object of an enterprise bean instance ...

BEA WebLogic Questions and Answers


(Continued from previous question...)

A client wants to preserve the reference to the EJBHome object of an enterprise bean instance ...

A client wants to preserve the reference to the EJBHome object of an enterprise bean instance and use it later. Which of the following can be serialized for this purpose ?
a. Home
b. Handle
c. HomeHandle
d. EJBHomeHandle
e. HomeObject


Choice C is correct. Once a client has obtained the EJBHome object for an EJB instance, it can create a reference to the home object by calling getHomeHandle(). getHomeHandle() returns a HomeHandle object, which can be used to obtain the home interface to the same EJB instance at a later time.
A client can pass the HomeHandle object as arguments to another client, and the receiving client can use the handle to obtain a reference to the same EJBHome object. Clients can also serialize the HomeHandle and store it in a file for later use. The HomeHandle interface has only one method getEJBHome(), which returns the EJBHome reference.

(Continued on next question...)

Other Interview Questions