Hi,
the below is my understanding of the whole
EJB functionality.Correct me if iam wrong.
Initially to start with, we define home interface,remote interface and a bean class.
First , we have to get a reference to Home interface.During deployment,the server automatically generates a class which implements this home interface(Let this class be denoted by A).During JNDI lookup,the object to this class is returned.
CustomerHome cust = Context.lookup("Customer");
Customer remote = cust.create();
Like above,during deployment,the server generates a class which implements the remote interface(let this class be denoted by B).When the create method is called,an object to this class is created and its reference is returned.Also an instance to the bean class is created either by calling the beans constructor or by taking the instance from the pool.So the remote variable contains the reference to the class generated by the server.
Now when a method is called,
remote.<method_name>
the control goes to the stub which performs marshalling.The stub transfers the data through network and the skeleton unmarshalls the arguements and calls the method in the class B.This inturn calls the actual bean implementation method.
This is my overall understanding of the working of EJB.Kindly correct me if iam wrong.
Regards,
Sathya