In version 2.1 of the EJB Spec, for Stateless session beans it states that ejbCreate and ejbRemove methods can access getEJBObject() and getEJBLocalObject() methods of the SessionContext. However if one looks at the Object Interaction Diagrams from page 103 - page 108 of the Spec, one can clearly see that ejbCreate and ejbRemove have nothing to do with create and remove calls issued by Client. EJBObject always corresponds to the Client. If the client does not exist, then there is no EJBObject instance for that stateless bean.
My question is, since ejbCreate and ejbRemove method calls are independent of the existence of clients(Container can just decide to create a bunch of bean instances and pool them in method-ready state even before a single client makes a create call), how come the Spec says that these methods can access the EJBObject instance for that particular instance of the bean? How is this possible?
I can think of following case where this would be possible
All that the Spec means when it says that EJB Object references are can be retrieved from ejbCreate and ejbRemove it that the container is not going to throw IllegalStateException when those methods call getEJBObject or getEJBLocalObject on SessionContext and that the value returned would always be null.