Please help: 1) How can a bean pass a reference of itself to some other beans?
2) Which of the following technology uses Proxy design pattern ? RMI,JMS,Corba,EJB, and JNDI? I know RMI using Proxy, therefore, EJB. CORBA also ? Thanks, Ruilin [This message has been edited by ruilin yang (edited November 01, 2001).]
Here is some inf for Passing an Enterprise Bean's Object Reference Suppose that your enterprise bean needs to pass a reference to itself to another bean. You might want to pass the reference, for example, so that the second bean can call the first bean's methods. You can't pass the this reference because it points to the bean's instance, which is running in the EJB container. Only the container may directly invoke methods on the bean's instance. Clients access the instance indirectly by invoking methods on the object whose type is the bean's remote interface. It is the reference to this object (the bean's remote reference) that the first bean would pass to the second bean. A session bean obtains its remote reference by calling the getEJBObject method of the SessionContext interface. An entity bean would call the getEJBObject method of the EntityContext interface. These interfaces provide beans with access to the instance contexts maintained by the EJB container. Typically, the bean saves the context in the setSessionContext method. The following code fragment shows how a session bean might use these methods. public class WagonBean implements SessionBean {
I miss the old days when I would think up a sinister scheme for world domination and you would show a little emotional support. So just look at this tiny ad: