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 ans
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
Constructor Summary |
JSessionSwitch(JSessionFactory bf)
constructor.
a new object is build when the pool managed by JSessionFactory becomes empty. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
bf
protected JSessionFactory bf
local
protected JSessionLocal local
remote
protected JSessionRemote remote
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
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 seconds 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
releaseICtx
public abstract void releaseICtx(javax.transaction.Transaction tx)
setMustCommit
public abstract void setMustCommit(boolean mc)