org.ow2.jonas.lib.ejb21
Class JEntitySwitchCS

java.lang.Object
  extended by org.ow2.jonas.lib.ejb21.JEntitySwitch
      extended by org.ow2.jonas.lib.ejb21.JEntitySwitchCST
          extended by org.ow2.jonas.lib.ejb21.JEntitySwitchCS

public class JEntitySwitchCS
extends JEntitySwitchCST

Container Serialized (CS) lock-policy. Transaction Isolation managed by the container. Non transactional methods of the bean can modify the bean.

Author:
Philippe Durieux

Field Summary
protected  long passivationTimeout
          time in millisec.
protected  long ptimestamp
          timestamp uses for passivationTimeout
 
Fields inherited from class org.ow2.jonas.lib.ejb21.JEntitySwitchCST
itContext
 
Fields inherited from class org.ow2.jonas.lib.ejb21.JEntitySwitch
bf, blockedtx, counter, countIH, countIT, deadlockTimeout, estimestamp, FEW_SECONDS, ident, inactivityTimeout, inDirtyList, isdetached, isremoved, lazyregister, local, lockpolicy, mustReload, mustStore, myTimerService, pk, readTimeout, reentrant, remote, runningtx, shared, todiscard, txUpdates, waiters, writingtx
 
Constructor Summary
JEntitySwitchCS()
          empty constructor.
 
Method Summary
 void endIH()
          Instance is ready to use for new transaction.
protected  void initpolicy(JEntityFactory bf)
           
 int passivateIH(boolean store, boolean passivate)
          try to passivate instances
 void waitmyturn(Transaction tx)
          Wait until I'm allowed to work on this instance.
 
Methods inherited from class org.ow2.jonas.lib.ejb21.JEntitySwitchCST
getContext4Tx, getState, removeContext4Tx, setContext4Tx, tryBindICtx
 
Methods inherited from class org.ow2.jonas.lib.ejb21.JEntitySwitch
bindICtx, detachPk, discardContext, forceDiscardICtx, getBeanFactory, getBlockingTx, getEntityTimerService, getICtx, getICtx, getLocal, getPolicy, getPrimaryKey, getRemote, init, lazyRegistering, mapICtx, notifyTimeout, notifyWriting, registerCtx, releaseICtx, terminate, txCompleted
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

passivationTimeout

protected long passivationTimeout
time in millisec. to keep instance state in memory without storing it After this time, instance is stored on database. before.


ptimestamp

protected long ptimestamp
timestamp uses for passivationTimeout

Constructor Detail

JEntitySwitchCS

public JEntitySwitchCS()
empty constructor. Object is initialized via init() because it is implemented differently according to jorm mappers.

Method Detail

initpolicy

protected void initpolicy(JEntityFactory bf)
Overrides:
initpolicy in class JEntitySwitchCST

waitmyturn

public void waitmyturn(Transaction tx)
Description copied from class: JEntitySwitchCST
Wait until I'm allowed to work on this instance. Transaction isolation may be done here, depending on lock-policy.

Overrides:
waitmyturn in class JEntitySwitchCST
Parameters:
tx - Transaction

passivateIH

public int passivateIH(boolean store,
                       boolean passivate)
try to passivate instances

Overrides:
passivateIH in class JEntitySwitchCST
Parameters:
store - If we want to store the bean state first.
passivate - If we want to pasivate the bean also
Returns:
int result of operation: ALL_DONE = just remove from dirty list. STORED = remove from dirty list and call endIH NOT_DONE = keep it in the list.

endIH

public void endIH()
Instance is ready to use for new transaction.

Overrides:
endIH in class JEntitySwitchCST


Copyright © 2010 OW2 Consortium. All Rights Reserved.