Hi Chengwei,
So in your opinion, what is the local home refering to? The container generated stubs?
No, it can't be any generated stub since the home is local (it is just a normal
java reference). I interpret local home as a reference to the local home that you get from the JNDI. Something along the lines of:
Context ctx = new InitialContext();
MyBeanLocalHome home = (MyBeanLocalHome) ctx.lookup("java:comp/env/ejb/mybeanlocal");
As you can see, home is a reference to something that implements MyLocalHome, the local home interface of my bean. The interface that provides the create() methods.
As you said it yourself, the create method is defined in the home interface, the ejbCreate method is implemented in the actual bean class. The bean isn't the local home, don't you agree?
Precisely. But what can be found in the MyBeanLocalHome interface? At least one create() method, that must return a reference to the local component interface. Something like:
So, a client who performed a lookup as I showed above, can use the local home reference he got from JNDI to get a reference to the local component interface, that is, an interface that extends EJBLocalObject by calling the create() method:
This is how I interpreted the question. From my point of view a client that has a local home reference of a session bean can use it to get a reference to the local component (something that is a EJBLocalObject) interface of the session bean by calling the create() method.
Also, you said in the first post that the EJBLocalObject interface has a getEJBLocalObject method, but that is wrong. You have a getEJBLocalHome method there instead.
Regards,
Stefan