org.objectweb.jonas_ejb.container
Class JSessionSwitch
java.lang.Object
org.objectweb.jonas_ejb.container.JSessionSwitch
- All Implemented Interfaces:
- TimerEventListener
- Direct Known Subclasses:
- JStatefulSwitch, JStatelessSwitch
public abstract class JSessionSwitch
- extends java.lang.Object
- implements TimerEventListener
JSessionSwitch holds all the code that is common to EJBObject and
EJBLocalObject for session beans. It mainly keep a reference on the
SessionContext and is used to manage the timeout for the session. This class
has 2 subclasses, depending if session is stateless or stateful.
- Author:
- Philippe Durieux
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
bf
protected JSessionFactory bf
mylocal
protected JSessionLocal mylocal
myremote
protected JSessionRemote myremote
mytimer
protected TimerEvent mytimer
JSessionSwitch
public JSessionSwitch(JSessionFactory bf)
throws java.rmi.RemoteException
- constructor. a new object is build when the pool managed by
JSessionFactory becomes empty.
- Parameters:
bf
- The Bean Factory
- Throws:
java.rmi.RemoteException
getLocal
public JSessionLocal getLocal()
- Returns:
- the underlaying EJBLocalObject
getRemote
public JSessionRemote getRemote()
- Returns:
- the underlaying EJBObject
getBeanFactory
public JSessionFactory getBeanFactory()
- Returns:
- the BeanFactory
startTimer
public void startTimer(int timeout)
- Start a timer for this Session.
- Parameters:
timeout
- nb of milliseconds max this Session should live.
stopTimer
public void stopTimer()
- Stop the Timer associated to the Session
getICtx
public abstract JSessionContext getICtx(javax.transaction.Transaction tx)
throws java.rmi.RemoteException
- Throws:
java.rmi.RemoteException
releaseICtx
public abstract void releaseICtx(RequestCtx req,
boolean discard)
setMustCommit
public abstract void setMustCommit(boolean mc)
saveBeanTx
public abstract void saveBeanTx()
pushConnectionList
public abstract void pushConnectionList()
popConnectionList
public abstract void popConnectionList()
enlistConnections
public abstract void enlistConnections(javax.transaction.Transaction tx)
delistConnections
public abstract void delistConnections(javax.transaction.Transaction tx)
noLongerUsed
public abstract void noLongerUsed()