Hello Kathy and all EJB Developers! My question is: In this statement: �A client can pass a local home object reference to another application through its local interface.� What does �...through its local interface� mean? Does it mean a local home object reference CAN be passed by one of the methods defined in its local interface? Thank you very much! EJB Specs: 6.7.2 References to session object local interfaces: _______________________________ ... It is invalid to reference a session object that does not exist. Attempted invocations on a session object that does not exist result in javax.ejb.NoSuchObjectLocalException. A reference to a session object�s local interface (i.e., a session EJBLocalObject) must not be passed out of the JVM in which it was created. A client can pass a local home object reference to another application through its local interface. A local home object reference cannot be passed as an argument or result of a method on an enterprise bean�s remote home or remote interface. _______________________________ [ May 22, 2003: Message edited by: Seid Myadiyev ] [ May 22, 2003: Message edited by: Seid Myadiyev ] [ May 22, 2003: Message edited by: Seid Myadiyev ]
IMO, 'through its local interface' refers to application's local interface. It means the local reference can be passed as an argument to another application if local interfaces are used (if all aplications reside in the same JVM). Passing it to a remote bean wouldn't make much sense. I suppose it's a contract restriction(as you quoted in the last part of your message). From the point of view of Java language, there's nothing wrong with it as long as the method accepts it. To illustrate, think about a web application calling EJBs through local interfaces (do not do this at home ). At some point in time it obtains a reference to a local interface of the bean. Then, it's possible for this web application to call (again, only through local interface) another bean and pass this local interface to the bean as a method parameter. The example stated above is only for illustrative purpose, it is in fact, a very bad design if you try to implement it in production system. Anyone else with comments?
And inside of my fortune cookie was this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop