org.sape.ejbutils.adapters
Class EntityBeanAdapter

java.lang.Object
  extended byorg.sape.ejbutils.adapters.EntityBeanAdapter
All Implemented Interfaces:
javax.ejb.EnterpriseBean, javax.ejb.EntityBean, Serializable

public class EntityBeanAdapter
extends Object
implements javax.ejb.EntityBean

Provides default implementations of the EJB callback methods for an Entity Bean.

See Also:
Serialized Form

Field Summary
protected  javax.ejb.EntityContext ctx
          The EntityContext for this instance of the EntityBean
private static org.apache.commons.logging.Log log
           
 
Constructor Summary
EntityBeanAdapter()
           
 
Method Summary
 void ejbActivate()
          Default implementation of ejbActivate().
 void ejbLoad()
          Default implementation of ejbLoad().
 void ejbPassivate()
          Default implementation of ejbPassivate().
 void ejbRemove()
          Default implementation of ejbRemove().
 void ejbStore()
          Default implementation of ejbStore().
 javax.ejb.EntityContext getCtx()
          Returns the EntityContext
 String id()
          Returns a string representation of the primary key of this entity bean.
 void setEntityContext(javax.ejb.EntityContext ctx)
          The container calls this method after creating the EntityBean to set its EntityContext.
 void unsetEntityContext()
          Unset the associated entity context.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private static final org.apache.commons.logging.Log log

ctx

protected javax.ejb.EntityContext ctx
The EntityContext for this instance of the EntityBean

Constructor Detail

EntityBeanAdapter

public EntityBeanAdapter()
Method Detail

ejbActivate

public void ejbActivate()
                 throws javax.ejb.EJBException,
                        RemoteException
Default implementation of ejbActivate(). Simply logs a debug message.

Specified by:
ejbActivate in interface javax.ejb.EntityBean
Throws:
javax.ejb.EJBException
RemoteException

ejbLoad

public void ejbLoad()
             throws javax.ejb.EJBException,
                    RemoteException
Default implementation of ejbLoad(). Simply logs a debug message.

Specified by:
ejbLoad in interface javax.ejb.EntityBean
Throws:
javax.ejb.EJBException
RemoteException

ejbPassivate

public void ejbPassivate()
                  throws javax.ejb.EJBException,
                         RemoteException
Default implementation of ejbPassivate(). Simply logs a debug message.

Specified by:
ejbPassivate in interface javax.ejb.EntityBean
Throws:
javax.ejb.EJBException
RemoteException

ejbRemove

public void ejbRemove()
               throws javax.ejb.RemoveException,
                      javax.ejb.EJBException,
                      RemoteException
Default implementation of ejbRemove(). Simply logs a debug message.

Specified by:
ejbRemove in interface javax.ejb.EntityBean
Throws:
javax.ejb.RemoveException
javax.ejb.EJBException
RemoteException

ejbStore

public void ejbStore()
              throws javax.ejb.EJBException,
                     RemoteException
Default implementation of ejbStore(). Simply logs a debug message.

Specified by:
ejbStore in interface javax.ejb.EntityBean
Throws:
javax.ejb.EJBException
RemoteException

getCtx

public javax.ejb.EntityContext getCtx()
Returns the EntityContext

Returns:
the EntityContext

setEntityContext

public void setEntityContext(javax.ejb.EntityContext ctx)
                      throws javax.ejb.EJBException,
                             RemoteException
The container calls this method after creating the EntityBean to set its EntityContext. This method stores the EntityContext in a member variable.

Specified by:
setEntityContext in interface javax.ejb.EntityBean
Parameters:
ctx - The EntityContext for this instance of the EntityBean.
Throws:
javax.ejb.EJBException
RemoteException

unsetEntityContext

public void unsetEntityContext()
                        throws javax.ejb.EJBException,
                               RemoteException
Unset the associated entity context. The container calls this method before removing the instance.

Specified by:
unsetEntityContext in interface javax.ejb.EntityBean
Throws:
javax.ejb.EJBException
RemoteException

id

public String id()
Returns a string representation of the primary key of this entity bean.

Returns:
a string representation of the primary key


Copyright 2003 Sapient Corporation. All Rights Reserved.