The getEJBObject() method is used to obtain a reference to the EJB object that is currently associated with the instance. An instance of a session enterprise Bean can call this method anytime between the ejbCreate() and ejbRemove() methods. An instance can use this method when it wants to pass a reference to itself in a method argument or result. The general format of this method is as follows:
public EJBObject getEJBObject() throws java.lang.IllegalStateException
This method returns the EJB object currently associated with the instance. It will throw the java.lang.IllegalStateException if the instance invokes this method while the instance is in a state that does not allow it to invoke this method, or if the instance does not have a remote interface.
Responses to “What is the getObject() method?”