|
Hi all..
I can't find a clear answer on this, so i thought i
would ask the gurus. ;-)
Is it safe to store home interface(s) objects
within a stateless session bean?
Should I do anything when
ejbPassivate/ejbActivate() is called?
eg..
public class RouterBean implements SessionBean,
RouterSessionBeanBusinessInterface {
private static final boolean
VERBOSE = true; // set to false for release....
AgentHome
agentBeanHome; // an entity bean home is
this permitted on a stateless session bean?
public RouterBean()
{
} public void ejbCreate()
{
if ( VERBOSE ) System.out.println("In ejbCreate" );
InitialContext jndiContext1 = new
InitialContext(); Object ref = jndiContext1.lookup("AgentBean"); agentBeanHome = (AgentHome)PortableRemoteObject.narrow (ref, AgentHome.class); } public void ejbActivate() throws javax.ejb.EJBException, java.rmi.RemoteException { if ( VERBOSE ) System.out.println("In ejbActivate"); } public void ejbPassivate() throws
javax.ejb.EJBException, java.rmi.RemoteException
{
if ( VERBOSE ) System.out.println("In ejbPassivate"); } public void ejbRemove() throws javax.ejb.EJBException,
java.rmi.RemoteException {
//TODO: Implement this javax.ejb.SessionBean method }
|
