A common question I get in classes. The answer is: the stateful session bean has NO IDEA who its client is. The client has to maintain the reference to the stateful session bean, not the other way around.
If the SFSB is a remote bean, you can call the method
to retrieve the beans handle (javax.ejb.Handle), which is a serializable reference to the EJBObject. Then you can store that handle someplace where you can get it again. For example, in a web application you can store the handle in the HttpSession. Later, when you want a connection to the stateful session bean, you take your handle and call
which returns the reference to the EJBObject for the stateful session bean (if the bean still exists.. if it doesn't you'll see a NoSuchObjectException)