|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.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.
| Field Summary |
| Fields inherited from class org.objectweb.jonas_ejb.container.JContext |
bf, myinstance, 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)
This method is typically called after the transaction is committed. |
void |
beforeCompletion()
This method is typically called at beforeCompletion |
void |
detachTx()
Detach this Context from tx |
javax.ejb.EJBLocalObject |
get2EJBLocalObject()
Obtain a reference to the EJB local object that is currently associated with the instance. |
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 |
javax.transaction.Transaction |
getMyTx()
|
java.lang.Object |
getPrimaryKey()
Obtains the primary key of the EJB object that is currently associated with this instance. |
javax.ejb.TimerService |
getTimerService()
Get access to the EJB Timer Service. |
void |
initEntityContext(JEntitySwitch bs)
Reinit Context for reuse |
boolean |
isDirty()
|
boolean |
isInitialized()
|
boolean |
isMarkedRemoved()
Check if context has been marked removed |
boolean |
isNewInstance()
Check if context is a newly created instance |
boolean |
passivate()
passivate this instance |
void |
razEntityContext()
Raz Context before freeing it. |
void |
reuseEntityContext(boolean newtrans)
reuse EntityContext for another transaction. |
void |
setDirty(boolean d)
Set the dirty flag: true = instance modified. |
void |
setEntitySwitch(JEntitySwitch bs)
set the EntitySwitch |
void |
setNewInstance()
Set new instance flag |
void |
setRemoved()
Mark this context as removed. |
void |
setRunningTx(javax.transaction.Transaction tx)
|
void |
storeIfModified()
Persistence: write data on storage |
| Methods inherited from class org.objectweb.jonas_ejb.container.JContext |
getCallerIdentity, getCallerPrincipal, getEJBHome, getEJBLocalHome, getEnvironment, getRollbackOnly, getState, getUserTransaction, getWorkManager, isCallerInRole, isCallerInRole, setRollbackOnly, setState |
| 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.transaction.Transaction getMyTx()
public javax.ejb.TimerService getTimerService()
throws java.lang.IllegalStateException
getTimerService in interface javax.ejb.EJBContextgetTimerService in class JContextjava.lang.IllegalStateException - Thrown if the instance is not allowed to
use this method
public javax.ejb.EJBObject getEJBObject()
throws java.lang.IllegalStateException
getEJBObject 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 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 javax.ejb.EJBLocalObject get2EJBLocalObject()
throws java.lang.IllegalStateException
java.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 detachTx()
public void initEntityContext(JEntitySwitch bs)
bs - - The Bean Switch this Context belongs to.public void setRunningTx(javax.transaction.Transaction tx)
public void reuseEntityContext(boolean newtrans)
newtrans - true if new transactionpublic void setNewInstance()
public void setRemoved()
throws java.rmi.RemoteException,
javax.ejb.RemoveException
java.rmi.RemoteException - ejbRemove failed
javax.ejb.RemoveException - ejbRemove failedpublic boolean isMarkedRemoved()
public boolean isNewInstance()
public javax.ejb.EntityBean getInstance()
throws java.rmi.RemoteException
java.rmi.RemoteException - if no instance.public JEntityFactory getEntityFactory()
public JEntitySwitch getEntitySwitch()
public boolean isInitialized()
public void setEntitySwitch(JEntitySwitch bs)
bs - - the EntitySwitchpublic boolean isDirty()
public void setDirty(boolean d)
public void storeIfModified()
public boolean passivate()
public void activate(boolean doactivate)
doactivate - True if ejbActivate() is called before ejbLoad()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||