org.objectweb.jonas_ejb.container.JEntityContext Class Reference

Inherits org.objectweb.jonas_ejb.container.JContext.

Inherited by org.objectweb.jonas_ejb.container.jorm.JEntityContext.

Inheritance diagram for org.objectweb.jonas_ejb.container.JEntityContext:

Inheritance graph
[legend]
Collaboration diagram for org.objectweb.jonas_ejb.container.JEntityContext:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 JEntityContext (JEntityFactory bf, EntityBean eb)
TimerService getTimerService () throws IllegalStateException
EJBObject getEJBObject () throws IllegalStateException
EJBLocalObject getEJBLocalObject () throws IllegalStateException
EJBLocalObject get2EJBLocalObject () throws IllegalStateException
Object getPrimaryKey () throws IllegalStateException
void beforeCompletion ()
void afterCompletion (int status)
void razEntityContext ()
void detachTx ()
void initEntityContext (JEntitySwitch bs)
void reuseEntityContext (boolean newtrans)
void setNewInstance ()
void setRemoved () throws RemoteException, RemoveException
boolean isMarkedRemoved ()
boolean isNewInstance ()
EntityBean getInstance () throws RemoteException
JEntityFactory getEntityFactory ()
JEntitySwitch getEntitySwitch ()
void setEntitySwitch (JEntitySwitch bs)
boolean isDirty ()
void setDirty (boolean d)
void storeIfModified ()
void passivate ()
void activate (boolean doactivate)

Package Attributes

Transaction beanCoord = null
boolean ismarkedremoved
boolean isnewinstance = false

Detailed Description

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

Definition at line 55 of file JEntityContext.java.


Constructor & Destructor Documentation

org.objectweb.jonas_ejb.container.JEntityContext.JEntityContext JEntityFactory  bf,
EntityBean  eb
 

Constructs an EntityContext the Context has to be initialized after this.

Parameters:
bf - the JEntityFactory
eb - the Enterprise Bean instance

Reimplemented in org.objectweb.jonas_ejb.container.jorm.JEntityContext.

Definition at line 90 of file JEntityContext.java.

References org.objectweb.jonas_ejb.container.JEntityFactory.getHome(), and org.objectweb.jonas_ejb.container.JEntityFactory.getLocalHome().

Here is the call graph for this function:


Member Function Documentation

void org.objectweb.jonas_ejb.container.JEntityContext.activate boolean  doactivate  ) 
 

Activate instance.

Parameters:
doactivate True if ejbActivate() is called before ejbLoad()

Definition at line 544 of file JEntityContext.java.

References org.objectweb.jonas_ejb.container.JContext.setState().

Referenced by org.objectweb.jonas_ejb.container.JEntitySwitchRO.mapICtx(), org.objectweb.jonas_ejb.container.JEntitySwitchCRU.mapICtx(), and org.objectweb.jonas_ejb.container.JEntitySwitch.mapICtx().

Here is the call graph for this function:

void org.objectweb.jonas_ejb.container.JEntityContext.afterCompletion int  status  ) 
 

This method is typically called after the transaction is committed.

Parameters:
status The status of the transaction completion.

Definition at line 286 of file JEntityContext.java.

References org.objectweb.jonas_ejb.container.JEntityContext.beanCoord, and org.objectweb.jonas_ejb.container.JEntitySwitch.txCompleted().

Referenced by org.objectweb.jonas_ejb.container.TxListener.afterCompletion().

Here is the call graph for this function:

void org.objectweb.jonas_ejb.container.JEntityContext.beforeCompletion  ) 
 

This method is typically called at beforeCompletion

Definition at line 244 of file JEntityContext.java.

References org.objectweb.jonas_ejb.container.JEntityContext.beanCoord, org.objectweb.jonas_ejb.container.JEntityContext.getPrimaryKey(), and org.objectweb.jonas_ejb.container.JEntityContext.storeIfModified().

Here is the call graph for this function:

void org.objectweb.jonas_ejb.container.JEntityContext.detachTx  ) 
 

Detach this Context from tx

Definition at line 332 of file JEntityContext.java.

References org.objectweb.jonas_ejb.container.JEntityContext.beanCoord, org.objectweb.jonas_ejb.container.JEntityContext.ismarkedremoved, and org.objectweb.jonas_ejb.container.JEntityContext.isnewinstance.

Referenced by org.objectweb.jonas_ejb.container.JEntitySwitch.txCompleted().

EJBLocalObject org.objectweb.jonas_ejb.container.JEntityContext.get2EJBLocalObject  )  throws IllegalStateException
 

Obtain a reference to the EJB local object that is currently associated with the instance. (internal use of getEJBLocalObject with no check).

Returns:
The EJB local object currently associated with the instance.
Exceptions:
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.

Definition at line 212 of file JEntityContext.java.

References org.objectweb.jonas_ejb.container.JEntityContext.getEJBLocalObject().

Here is the call graph for this function:

EJBLocalObject org.objectweb.jonas_ejb.container.JEntityContext.getEJBLocalObject  )  throws IllegalStateException
 

Obtain a reference to the EJB local object that is currently associated with the instance.

Returns:
The EJB local object currently associated with the instance.
Exceptions:
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.

Definition at line 198 of file JEntityContext.java.

Referenced by org.objectweb.jonas_ejb.container.JEntityContext.get2EJBLocalObject().

EJBObject org.objectweb.jonas_ejb.container.JEntityContext.getEJBObject  )  throws IllegalStateException
 

Obtains a reference to the EJB object that is currently associated with the instance.

Returns:
The EJB object currently associated with the instance.
Exceptions:
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.

Definition at line 139 of file JEntityContext.java.

References org.objectweb.jonas_ejb.container.JEntitySwitch.getRemote().

Here is the call graph for this function:

JEntityFactory org.objectweb.jonas_ejb.container.JEntityContext.getEntityFactory  ) 
 

JEntityFactory accessor

Returns:
the JEntityFactory

Definition at line 439 of file JEntityContext.java.

JEntitySwitch org.objectweb.jonas_ejb.container.JEntityContext.getEntitySwitch  ) 
 

JEntitySwitch accessor

Returns:
the JEntitySwitch

Definition at line 447 of file JEntityContext.java.

Referenced by org.objectweb.jonas_ejb.container.JEntityFactory.getJContext(), and org.objectweb.jonas_ejb.container.JEntityFactory.rebindEJB().

EntityBean org.objectweb.jonas_ejb.container.JEntityContext.getInstance  )  throws RemoteException
 

Returns the bean instance of this context Used in the generated classes to retrieve the instance

Returns:
the bean instance
Exceptions:
RemoteException if no instance.

Definition at line 427 of file JEntityContext.java.

Referenced by org.objectweb.jonas_ejb.container.JEntitySwitch.notifyTimeout().

Object org.objectweb.jonas_ejb.container.JEntityContext.getPrimaryKey  )  throws IllegalStateException
 

Obtains the primary key of the EJB object that is currently associated with this instance.

Returns:
The EJB object currently associated with the instance.
Exceptions:
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.

Reimplemented in org.objectweb.jonas_ejb.container.jorm.JEntityContext.

Definition at line 224 of file JEntityContext.java.

References org.objectweb.jonas_ejb.container.JEntitySwitch.getPrimaryKey().

Referenced by org.objectweb.jonas_ejb.container.JEntityContext.beforeCompletion().

Here is the call graph for this function:

TimerService org.objectweb.jonas_ejb.container.JEntityContext.getTimerService  )  throws IllegalStateException [virtual]
 

Get access to the EJB Timer Service.

Returns:
the EJB Timer Service
Exceptions:
IllegalStateException Thrown if the instance is not allowed to use this method

Implements org.objectweb.jonas_ejb.container.JContext.

Definition at line 107 of file JEntityContext.java.

References org.objectweb.jonas_ejb.container.JEntitySwitch.getEntityTimerService(), org.objectweb.jonas_ejb.container.JContext.getState(), and org.objectweb.jonas_ejb.container.JFactory.getTimerService().

Here is the call graph for this function:

void org.objectweb.jonas_ejb.container.JEntityContext.initEntityContext JEntitySwitch  bs  ) 
 

Reinit Context for reuse

Parameters:
bs - The Bean Switch this Context belongs to.

Definition at line 343 of file JEntityContext.java.

References org.objectweb.jonas_ejb.container.JEntitySwitch.getPolicy(), and org.objectweb.jonas_ejb.container.JEntityContext.ismarkedremoved.

Referenced by org.objectweb.jonas_ejb.container.JEntitySwitchRO.mapICtx(), org.objectweb.jonas_ejb.container.JEntitySwitchCRU.mapICtx(), and org.objectweb.jonas_ejb.container.JEntitySwitch.mapICtx().

Here is the call graph for this function:

boolean org.objectweb.jonas_ejb.container.JEntityContext.isDirty  ) 
 

Returns:
true if instance has been modified

Definition at line 462 of file JEntityContext.java.

boolean org.objectweb.jonas_ejb.container.JEntityContext.isMarkedRemoved  ) 
 

Check if context has been marked removed

Returns:
true when instance is marked removed.

Definition at line 408 of file JEntityContext.java.

Referenced by org.objectweb.jonas_ejb.container.JEntitySwitchRO.getState(), org.objectweb.jonas_ejb.container.JEntitySwitchDB.getState(), org.objectweb.jonas_ejb.container.JEntitySwitchCS.getState(), org.objectweb.jonas_ejb.container.JEntitySwitchCRU.getState(), org.objectweb.jonas_ejb.container.JEntitySwitchCRC.getState(), org.objectweb.jonas_ejb.container.JEntitySwitchCS.passivateIH(), org.objectweb.jonas_ejb.container.JEntitySwitch.releaseICtx(), org.objectweb.jonas_ejb.container.JEntitySwitch.terminate(), and org.objectweb.jonas_ejb.container.JEntitySwitch.txCompleted().

boolean org.objectweb.jonas_ejb.container.JEntityContext.isNewInstance  ) 
 

Check if context is a newly created instance

Returns:
true when instance has been created in the current transaction.

Definition at line 416 of file JEntityContext.java.

Referenced by org.objectweb.jonas_ejb.container.JEntitySwitch.txCompleted().

void org.objectweb.jonas_ejb.container.JEntityContext.passivate  ) 
 

passivate this instance

Definition at line 524 of file JEntityContext.java.

References org.objectweb.jonas_ejb.container.JContext.setState().

Referenced by org.objectweb.jonas_ejb.container.JEntitySwitchCS.passivateIH(), org.objectweb.jonas_ejb.container.JEntitySwitchCRC.passivateIH(), org.objectweb.jonas_ejb.container.JEntitySwitch.terminate(), and org.objectweb.jonas_ejb.container.JEntitySwitch.txCompleted().

Here is the call graph for this function:

void org.objectweb.jonas_ejb.container.JEntityContext.razEntityContext  ) 
 

Raz Context before freeing it. This is mainly for garbage collector.

Definition at line 321 of file JEntityContext.java.

References org.objectweb.jonas_ejb.container.JEntityContext.beanCoord, org.objectweb.jonas_ejb.container.JEntityContext.ismarkedremoved, and org.objectweb.jonas_ejb.container.JEntityContext.isnewinstance.

Referenced by org.objectweb.jonas_ejb.container.JEntityFactory.releaseJContext().

void org.objectweb.jonas_ejb.container.JEntityContext.reuseEntityContext boolean  newtrans  ) 
 

reuse EntityContext for another transaction. optimization: don't pass it by the pool.

Parameters:
newtrans true if new transaction

Definition at line 360 of file JEntityContext.java.

References org.objectweb.jonas_ejb.container.JEntityContext.isnewinstance.

Referenced by org.objectweb.jonas_ejb.container.JEntitySwitchRO.mapICtx(), org.objectweb.jonas_ejb.container.JEntitySwitchCRU.mapICtx(), and org.objectweb.jonas_ejb.container.JEntitySwitch.mapICtx().

void org.objectweb.jonas_ejb.container.JEntityContext.setDirty boolean  d  ) 
 

Set the dirty flag: true = instance modified.

Definition at line 469 of file JEntityContext.java.

References org.objectweb.jonas_ejb.container.JEntitySwitch.notifyWriting().

Here is the call graph for this function:

void org.objectweb.jonas_ejb.container.JEntityContext.setEntitySwitch JEntitySwitch  bs  ) 
 

set the EntitySwitch

Parameters:
bs - the EntitySwitch

Definition at line 455 of file JEntityContext.java.

void org.objectweb.jonas_ejb.container.JEntityContext.setNewInstance  ) 
 

Set new instance flag

Definition at line 379 of file JEntityContext.java.

References org.objectweb.jonas_ejb.container.JEntityContext.isnewinstance.

void org.objectweb.jonas_ejb.container.JEntityContext.setRemoved  )  throws RemoteException, RemoveException
 

Mark this context as removed. Complete removing will be achieved at the end of the transaction.

Exceptions:
RemoteException ejbRemove failed
RemoveException ejbRemove failed

Definition at line 389 of file JEntityContext.java.

References org.objectweb.jonas_ejb.container.JEntityContext.ismarkedremoved.

void org.objectweb.jonas_ejb.container.JEntityContext.storeIfModified  ) 
 

Persistence: write data on storage

Definition at line 491 of file JEntityContext.java.

Referenced by org.objectweb.jonas_ejb.container.JEntityContext.beforeCompletion(), org.objectweb.jonas_ejb.container.JEntitySwitchCS.passivateIH(), org.objectweb.jonas_ejb.container.JEntitySwitch.releaseICtx(), and org.objectweb.jonas_ejb.container.JEntitySwitch.terminate().


Member Data Documentation

Transaction org.objectweb.jonas_ejb.container.JEntityContext.beanCoord = null [package]
 

Transaction related to this synchronization

Definition at line 65 of file JEntityContext.java.

Referenced by org.objectweb.jonas_ejb.container.JEntityContext.afterCompletion(), org.objectweb.jonas_ejb.container.JEntityContext.beforeCompletion(), org.objectweb.jonas_ejb.container.JEntityContext.detachTx(), and org.objectweb.jonas_ejb.container.JEntityContext.razEntityContext().

boolean org.objectweb.jonas_ejb.container.JEntityContext.ismarkedremoved [package]
 

true between a remove and the commit

Definition at line 74 of file JEntityContext.java.

Referenced by org.objectweb.jonas_ejb.container.JEntityContext.detachTx(), org.objectweb.jonas_ejb.container.JEntityContext.initEntityContext(), org.objectweb.jonas_ejb.container.JEntityContext.razEntityContext(), and org.objectweb.jonas_ejb.container.JEntityContext.setRemoved().

boolean org.objectweb.jonas_ejb.container.JEntityContext.isnewinstance = false [package]
 

true if just created in this transaction

Definition at line 79 of file JEntityContext.java.

Referenced by org.objectweb.jonas_ejb.container.JEntityContext.detachTx(), org.objectweb.jonas_ejb.container.JEntityContext.razEntityContext(), org.objectweb.jonas_ejb.container.JEntityContext.reuseEntityContext(), and org.objectweb.jonas_ejb.container.JEntityContext.setNewInstance().


The documentation for this class was generated from the following file:
Generated on Tue Feb 15 15:10:05 2005 for JOnAS by  doxygen 1.3.9.1