| |
|
| java.lang.Object org.objectweb.jonas_ejb.container.JContext org.objectweb.jonas_ejb.container.JEntityContext
All known Subclasses: org.objectweb.jonas_ejb.container.jorm.JEntityContext,
JEntityContext | public class JEntityContext extends JContext implements EntityContext,Synchronization(Code) | | 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.
author: Philippe Coq, Philippe Durieux |
Constructor Summary | |
public | JEntityContext(JEntityFactory bf, EntityBean eb) Constructs an EntityContext the Context has to be initialized after this. |
beanCoord | Transaction beanCoord(Code) | | Transaction related to this synchronization
|
ismarkedremoved | boolean ismarkedremoved(Code) | | true between a remove and the commit
|
isnewinstance | boolean isnewinstance(Code) | | true if just created in this transaction
|
JEntityContext | public JEntityContext(JEntityFactory bf, EntityBean eb)(Code) | | Constructs an EntityContext the Context has to be initialized after this.
Parameters: bf - - the JEntityFactory Parameters: eb - - the Enterprise Bean instance |
activate | public void activate(boolean doactivate)(Code) | | Activate instance.
Parameters: doactivate - True if ejbActivate() is called before ejbLoad() |
afterCompletion | public void afterCompletion(int status)(Code) | | This method is typically called after the transaction is committed.
Parameters: status - The status of the transaction completion. |
beforeCompletion | public void beforeCompletion()(Code) | | This method is typically called at beforeCompletion
|
detachTx | public void detachTx()(Code) | | Detach this Context from tx
|
get2EJBLocalObject | public EJBLocalObject get2EJBLocalObject() throws IllegalStateException(Code) | | Obtain a reference to the EJB local object that is currently associated
with the instance.
(internal use of getEJBLocalObject with no check).
The EJB local object currently associated with the instance. throws: IllegalStateException - - if the instance invokes this method whilethe instance is in a state that does not allow the instance toinvoke this method, or if the instance does not have a localinterface. |
getEJBLocalObject | public EJBLocalObject getEJBLocalObject() throws IllegalStateException(Code) | | Obtain a reference to the EJB local object that is currently associated
with the instance.
The EJB local object currently associated with the instance. throws: IllegalStateException - - if the instance invokes this method whilethe instance is in a state that does not allow the instance toinvoke this method, or if the instance does not have a localinterface. |
getEJBObject | public EJBObject getEJBObject() throws IllegalStateException(Code) | | Obtains a reference to the EJB object that is currently associated with
the instance.
The EJB object currently associated with the instance. throws: IllegalStateException - Thrown if the instance invokes this methodwhile the instance is in a state that does not allow the instanceto invoke this method. |
getEntityFactory | public JEntityFactory getEntityFactory()(Code) | | JEntityFactory accessor
the JEntityFactory |
getEntitySwitch | public JEntitySwitch getEntitySwitch()(Code) | | JEntitySwitch accessor
the JEntitySwitch |
getInstance | public EntityBean getInstance() throws RemoteException(Code) | | Returns the bean instance of this context Used in the generated classes
to retrieve the instance
the bean instance throws: RemoteException - if no instance. |
getMyTx | public Transaction getMyTx()(Code) | | the transaction associated to this context. |
getPrimaryKey | public Object getPrimaryKey() throws IllegalStateException(Code) | | Obtains the primary key of the EJB object that is currently associated
with this instance.
The EJB object currently associated with the instance. throws: IllegalStateException - Thrown if the instance invokes this methodwhile the instance is in a state that does not allow the instanceto invoke this method. |
initEntityContext | public boolean initEntityContext(JEntitySwitch bs)(Code) | | Reinit Context for reuse
Parameters: bs - - The Bean Switch this Context belongs to. |
isDirty | public boolean isDirty()(Code) | | true if instance has been modified |
isInitialized | public boolean isInitialized()(Code) | | True if Entity Switch has been already associated |
isMarkedRemoved | public boolean isMarkedRemoved()(Code) | | Check if context has been marked removed
true when instance is marked removed. |
isNewInstance | public boolean isNewInstance()(Code) | | Check if context is a newly created instance
true when instance has been created in the current transaction. |
passivate | public boolean passivate()(Code) | | passivate this instance
true if passivated. |
razEntityContext | public void razEntityContext()(Code) | | Raz Context before freeing it. This is mainly for garbage collector.
|
reuseEntityContext | public void reuseEntityContext(boolean newtrans)(Code) | | reuse EntityContext for another transaction. optimization: don't pass it
by the pool.
Parameters: newtrans - true if new transaction |
setDirty | public void setDirty(boolean d)(Code) | | Set the dirty flag: true = instance modified.
|
setEntitySwitch | public void setEntitySwitch(JEntitySwitch bs)(Code) | | set the EntitySwitch
Parameters: bs - - the EntitySwitch |
setNewInstance | public void setNewInstance()(Code) | | Set new instance flag
|
setRemoved | public void setRemoved() throws RemoteException, RemoveException(Code) | | Mark this context as removed. Complete removing will be achieved at the
end of the transaction.
throws: RemoteException - ejbRemove failed throws: RemoveException - ejbRemove failed |
setRunningTx | public boolean setRunningTx(Transaction tx)(Code) | | Associate transaction to ths Context
Parameters: tx - true if correctly associated, false if was already done. |
storeIfModified | public void storeIfModified()(Code) | | Persistence: write data on storage
|
|
|
|