|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--org.objectweb.jonas_ejb.container.JContext
|
+--org.objectweb.jonas_ejb.container.JEntityContext
This class implements javax.ejb.EntityContext interface. An Entitycontext is bound to a bean instance. To be used, it must be associated to a JEntitySwitch, and possibly to a Transaction. In case the Context is used inside a Transaction, we use the Synchronization interface to be aware of transaction demarcations.
| Fields inherited from class org.objectweb.jonas_ejb.container.JContext |
bf, cont, home, instance, localhome, roleGuard, tm |
| Constructor Summary | |
JEntityContext(JEntityFactory bf,
javax.ejb.EntityBean eb)
Constructs an EntityContext the Context has to be initialized after this. |
|
| Method Summary | |
void |
activate(boolean doactivate)
Activate instance. |
void |
afterCompletion(int status)
The afterCompletion method is called by the transaction manager after the transaction is committed or rolled back. |
void |
beforeCompletion()
This beforeCompletion method is called by the transaction manager prior to the start of the transaction completion process. |
javax.ejb.EJBLocalObject |
getEJBLocalObject()
Obtain a reference to the EJB local object that is currently associated with the instance. |
javax.ejb.EJBObject |
getEJBObject()
Obtains a reference to the EJB object that is currently associated with the instance. |
JEntityFactory |
getEntityFactory()
JEntityFactory accessor |
JEntitySwitch |
getEntitySwitch()
JEntitySwitch accessor |
javax.ejb.EntityBean |
getInstance()
Returns the bean instance of this context Used in the generated classes to retrieve the instance |
java.lang.Object |
getPrimaryKey()
Obtains the primary key of the EJB object that is currently associated with this instance. |
void |
initEntityContext(JEntitySwitch bs,
javax.transaction.Transaction tx)
Reinit Context for reuse |
boolean |
isMarkedRemoved()
Check if context has been marked removed |
void |
passivate()
passivate this instance |
void |
razEntityContext()
Raz Context before freeing it. |
void |
reuseEntityContext(javax.transaction.Transaction tx)
reuse EntityContext for another transaction. optimization: don't pass it by the pool. |
void |
setEntitySwitch(JEntitySwitch bs)
set the EntitySwitch |
void |
setNewInstance()
Set new instance flag |
void |
setRemoved()
Mark this context as removed. |
void |
storeIfModified()
Persistence: write data on storage |
| Methods inherited from class org.objectweb.jonas_ejb.container.JContext |
getCallerIdentity, getCallerPrincipal, getEJBHome, getEJBLocalHome, getEnvironment, getRollbackOnly, getUserTransaction, isCallerInRole, isCallerInRole, setRollbackOnly |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface javax.ejb.EJBContext |
getCallerIdentity, getCallerPrincipal, getEJBHome, getEJBLocalHome, getEnvironment, getRollbackOnly, getUserTransaction, isCallerInRole, isCallerInRole, setRollbackOnly |
| Constructor Detail |
public JEntityContext(JEntityFactory bf,
javax.ejb.EntityBean eb)
bf - - the JEntityFactoryeb - - the Enterprise Bean instance| Method Detail |
public javax.ejb.EJBObject getEJBObject()
throws java.lang.IllegalStateException
getEJBObject in interface javax.ejb.EntityContextIllegalStateException: - Thrown if the instance invokes this
method while the instance is in a state that does not allow the
instance to invoke this method.
public javax.ejb.EJBLocalObject getEJBLocalObject()
throws java.lang.IllegalStateException
getEJBLocalObject in interface javax.ejb.EntityContextjava.lang.IllegalStateException - - if the instance invokes this
method while the instance is in a state that does not allow the instance to
invoke this method, or if the instance does not have a local interface.
public java.lang.Object getPrimaryKey()
throws java.lang.IllegalStateException
getPrimaryKey in interface javax.ejb.EntityContextjava.lang.IllegalStateException - Thrown if the instance invokes this
method while the instance is in a state that does not allow
the instance to invoke this method.public void beforeCompletion()
beforeCompletion in interface javax.transaction.Synchronizationpublic void afterCompletion(int status)
afterCompletion in interface javax.transaction.Synchronizationstatus - The status of the transaction completion.public void razEntityContext()
public void initEntityContext(JEntitySwitch bs,
javax.transaction.Transaction tx)
bs - - The Bean Switch this Context belongs to.tx - - the Transaction where this instance will be usedpublic void reuseEntityContext(javax.transaction.Transaction tx)
tx - - the Transaction where this instance will be usedpublic void setNewInstance()
public void setRemoved()
throws java.rmi.RemoteException,
javax.ejb.RemoveException
public boolean isMarkedRemoved()
public javax.ejb.EntityBean getInstance()
throws java.rmi.RemoteException
java.rmi.RemoteException - if no instance.public JEntityFactory getEntityFactory()
public JEntitySwitch getEntitySwitch()
public void setEntitySwitch(JEntitySwitch bs)
bs - - the EntitySwitchpublic void storeIfModified()
public void passivate()
public void activate(boolean doactivate)
doactivate - True if ejbActivate() is called before ejbLoad()java.rmi.RemoteException - if a system problem occured.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||