|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.objectweb.jonas_ejb.container.JEntitySwitch
JEntitySwitch is used internally to synchronize accesses to the entity context and thus to the entity bean instance. All parts common to EJBObject and EJBLocalObject should be here. Different policies can be applied to manage context/instance pairs: - only 1 pair (container manages the transaction isolation) - 1 pair for each transaction (transaction isolation managed by DataBase) - 2 pairs (1 for transactional accesses, 1 for non transaction accesses)
Field Summary | |
protected JEntityFactory |
bf
The Factory for this bean |
Constructor Summary | |
JEntitySwitch()
empty constructor. |
Method Summary | |
void |
bindICtx(javax.transaction.Transaction tx,
JEntityContext bctx)
bind a JEntityContext for a create method. |
void |
discardICtx(javax.transaction.Transaction tx)
Discard a context/instance at end of request. |
void |
endIH()
Instance is ready to use for new transaction. |
javax.transaction.Transaction |
getBlockedTx()
|
javax.transaction.Transaction |
getBlockingTx()
|
javax.ejb.TimerService |
getEntityTimerService()
Obtains the TimerService associated for this Entity Bean (one / pk) |
JEntityContext |
getICtx(javax.transaction.Transaction tx)
Get a context/instance associated with this transaction Called at each request on the bean (including remove) |
JEntityContext |
getICtx(javax.transaction.Transaction tx,
JEntityContext newctx)
bind a JEntityContext for a remove method. |
JEntityLocal |
getLocal()
|
int |
getPolicy()
|
java.lang.Object |
getPrimaryKey()
|
JEntityRemote |
getRemote()
|
int |
getState()
|
void |
init(JEntityFactory bf,
java.lang.Object pk)
constructor. |
JEntityContext |
mapICtx(javax.transaction.Transaction tx,
JEntityContext bctx,
boolean forced,
boolean holdit)
Map a context and its instance. |
void |
notifyTimeout(javax.ejb.Timer timer)
Notify a timeout for this bean and this Pk |
void |
notifyWriting(javax.transaction.Transaction tx,
JEntityContext bctx)
This transaction has just modified this instance. |
boolean |
passivateIH(boolean passivation)
try to passivate IH (called from swapper) |
void |
releaseICtx(javax.transaction.Transaction tx)
Release a context/instance at end of request. |
void |
tryBindICtx(javax.transaction.Transaction tx,
JEntityContext bctx)
Try to bind a JEntityContext if none already bound. |
void |
txCompleted(javax.transaction.Transaction tx,
boolean committed)
This transaction is now over. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected JEntityFactory bf
Constructor Detail |
public JEntitySwitch()
Method Detail |
public void init(JEntityFactory bf, java.lang.Object pk)
bf
- The Entity Factorypk
- The Primary Keypublic JEntityLocal getLocal()
public JEntityRemote getRemote()
public javax.ejb.TimerService getEntityTimerService()
public void notifyTimeout(javax.ejb.Timer timer)
timer
- timer whose expiration caused this notification.public java.lang.Object getPrimaryKey()
public void bindICtx(javax.transaction.Transaction tx, JEntityContext bctx)
tx
- - the Transaction objectbctx
- - the JEntityContext to bindpublic void tryBindICtx(javax.transaction.Transaction tx, JEntityContext bctx) throws javax.ejb.ObjectNotFoundException
tx
- - the Transaction objectbctx
- The Entity Context
javax.ejb.ObjectNotFoundException
public JEntityContext getICtx(javax.transaction.Transaction tx, JEntityContext newctx)
tx
- - the Transaction objectnewctx
- - the JEntityContext to bind
public JEntityContext getICtx(javax.transaction.Transaction tx)
tx
- - the Transaction object
public JEntityContext mapICtx(javax.transaction.Transaction tx, JEntityContext bctx, boolean forced, boolean holdit)
tx
- - the Transaction objectbctx
- - the JEntityContext to bind if not nullforced
- - force to take this context. (case of create)holdit
- - increment count to hold it, a release will be called later.
public javax.transaction.Transaction getBlockedTx()
public javax.transaction.Transaction getBlockingTx()
public void releaseICtx(javax.transaction.Transaction tx)
tx
- - transaction associated to this contextpublic void discardICtx(javax.transaction.Transaction tx)
tx
- - transaction associated to this contextpublic void txCompleted(javax.transaction.Transaction tx, boolean committed)
tx
- the transaction objectcommitted
- true if transaction was committed.public void endIH()
public void notifyWriting(javax.transaction.Transaction tx, JEntityContext bctx)
tx
- transactionpublic boolean passivateIH(boolean passivation)
passivation
- false if only store bean state.
public int getPolicy()
public int getState()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |