org.ow2.jonas.lib.ejb21.jorm
Class JEntityContext

java.lang.Object
  extended by org.ow2.jonas.lib.ejb21.JContext
      extended by org.ow2.jonas.lib.ejb21.JEntityContext
          extended by org.ow2.jonas.lib.ejb21.jorm.JEntityContext
All Implemented Interfaces:
EJBContext, EntityContext, Synchronization

public class JEntityContext
extends JEntityContext

This class extends the JEntityContext of the JOnAS container in order to take in consideration the fact that the container manages PName instances and not primary keys. This is the reason why the getPrimaryKey method is overriden.

Author:
Sebastien Chassande-Barrioz

Field Summary
 
Fields inherited from class org.ow2.jonas.lib.ejb21.JContext
bf, CTX_STATE_ACTIVE, CTX_STATE_COMMITTING, CTX_STATE_FINDING, CTX_STATE_INITIAL, CTX_STATE_PASSIVE, myinstance, tm
 
Constructor Summary
JEntityContext(JEntityFactory bf, EntityBean eb)
           
 
Method Summary
 Object getPrimaryKey()
          Obtains the primary key of the EJB object that is currently associated with this instance.
 
Methods inherited from class org.ow2.jonas.lib.ejb21.JEntityContext
activate, afterCompletion, beforeCompletion, detachTx, get2EJBLocalObject, getEJBLocalObject, getEJBObject, getEntityFactory, getEntitySwitch, getInstance, getMyTx, getTimerService, initEntityContext, isDirty, isInitialized, isMarkedRemoved, isNewInstance, passivate, razEntityContext, reuseEntityContext, setDirty, setEntitySwitch, setNewInstance, setRemoved, setRunningTx, storeIfModified
 
Methods inherited from class org.ow2.jonas.lib.ejb21.JContext
getCallerIdentity, getCallerPrincipal, getEJBHome, getEJBLocalHome, getEnvironment, getRollbackOnly, getState, getUserTransaction, getWorkManager, isCallerInRole, isCallerInRole, lookup, setActive, setCommitting, setFinding, setPassive, 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, lookup, setRollbackOnly
 

Constructor Detail

JEntityContext

public JEntityContext(JEntityFactory bf,
                      EntityBean eb)
Method Detail

getPrimaryKey

public Object getPrimaryKey()
                     throws IllegalStateException
Obtains the primary key of the EJB object that is currently associated with this instance.

Specified by:
getPrimaryKey in interface EntityContext
Overrides:
getPrimaryKey in class JEntityContext
Returns:
The EJB object currently associated with the instance.
Throws:
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.


Copyright © 2010 OW2 Consortium. All Rights Reserved.