org.jboss.test.cts.ejb
Class StatefulSessionBean

java.lang.Object
  extended byorg.jboss.test.util.ejb.EnterpriseSupport (src) 
      extended byorg.jboss.test.util.ejb.SessionSupport (src) 
          extended byorg.jboss.test.cts.ejb.StatefulSessionBean
All Implemented Interfaces:
EnterpriseBean (src) , java.io.Serializable, SessionBean (src) , SessionSynchronization (src)

public class StatefulSessionBean
extends SessionSupport (src)
implements SessionSynchronization (src)

The stateful session ejb implementation

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.jboss.test.util.ejb.SessionSupport (src)
sessionCtx
 
Constructor Summary
StatefulSessionBean()
           
 
Method Summary
 void afterBegin()
          The afterBegin method notifies a session Bean instance that a new transaction has started, and that the subsequent business methods on the instance will be invoked in the context of the transaction.
 void afterCompletion(boolean isCommited)
          The afterCompletion method notifies a session Bean instance that a transaction commit protocol has completed, and tells the instance whether the transaction has been committed or rolled back.
 void beforeCompletion()
          The beforeCompletion method notifies a session Bean instance that a transaction is about to be committed.
 void createLocalEntity(AccountPK (src)  pk, java.lang.String personsName)
           
 void createSessionHandle()
           
 void createSessionRef()
           
 void createStatefulSessionHandle(java.lang.String testName)
           
 void decCounter()
           
 void ejbActivate()
          The activate method is called when the instance is activated from its "passive" state.
 void ejbCreate(java.lang.String testName)
           
 void ejbCreateAlt(java.lang.String testName)
           
 void ejbPassivate()
          The passivate method is called before the instance enters the "passive" state.
 BeanContextInfo (src) getBeanContextInfo()
           
 int getCounter()
           
 Handle (src) getHandle()
           
 java.lang.String getTestName()
           
 boolean getWasActivated()
           
 boolean getWasPassivated()
           
 void incCounter()
           
 void loopbackTest()
           
 void loopbackTest(EJBObject (src)  obj)
           
 java.lang.String method1(java.lang.String msg)
           
 void ping()
           
 java.lang.String readAndRemoveEntity()
           
 void setCounter(int value)
           
 void sleep(long wait)
           
 java.lang.String useSessionHandle(java.lang.String arg)
           
 java.lang.String useSessionRef()
           
 void useStatefulSessionHandle()
           
 
Methods inherited from class org.jboss.test.util.ejb.SessionSupport (src)
ejbCreate, ejbRemove, setSessionContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StatefulSessionBean

public StatefulSessionBean()
Method Detail

ejbCreate

public void ejbCreate(java.lang.String testName)

ejbCreateAlt

public void ejbCreateAlt(java.lang.String testName)

ejbActivate

public void ejbActivate()
Description copied from interface: SessionBean (src)

The activate method is called when the instance is activated from its "passive" state. The instance should acquire any resource that it has released earlier in the ejbPassivate() method.

This method is called with no transaction context.

Specified by:
ejbActivate in interface SessionBean (src)
Overrides:
ejbActivate in class SessionSupport (src)

ejbPassivate

public void ejbPassivate()
Description copied from interface: SessionBean (src)

The passivate method is called before the instance enters the "passive" state. The instance should release any resources that it can re-acquire later in the ejbActivate() method.

After the passivate method completes, the instance must be in a state that allows the container to use the Java Serialization protocol to externalize and store away the instance's state.

This method is called with no transaction context.

Specified by:
ejbPassivate in interface SessionBean (src)
Overrides:
ejbPassivate in class SessionSupport (src)

afterBegin

public void afterBegin()
Description copied from interface: SessionSynchronization (src)

The afterBegin method notifies a session Bean instance that a new transaction has started, and that the subsequent business methods on the instance will be invoked in the context of the transaction.

The instance can use this method, for example, to read data from a database and cache the data in the instance fields.

This method executes in the proper transaction context.

Specified by:
afterBegin in interface SessionSynchronization (src)

afterCompletion

public void afterCompletion(boolean isCommited)
Description copied from interface: SessionSynchronization (src)

The afterCompletion method notifies a session Bean instance that a transaction commit protocol has completed, and tells the instance whether the transaction has been committed or rolled back.

This method executes with no transaction context.

This method executes with no transaction context.

Specified by:
afterCompletion in interface SessionSynchronization (src)
Parameters:
isCommited - - True if the transaction has been committed, false if is has been rolled back.

beforeCompletion

public void beforeCompletion()
Description copied from interface: SessionSynchronization (src)

The beforeCompletion method notifies a session Bean instance that a transaction is about to be committed. The instance can use this method, for example, to write any cached data to a database.

This method executes in the proper transaction context.

Note: The instance may still cause the container to rollback the transaction by invoking the setRollbackOnly() method on the instance context, or by throwing an exception.

Specified by:
beforeCompletion in interface SessionSynchronization (src)

getTestName

public java.lang.String getTestName()

method1

public java.lang.String method1(java.lang.String msg)

incCounter

public void incCounter()

decCounter

public void decCounter()

getCounter

public int getCounter()

setCounter

public void setCounter(int value)

getBeanContextInfo

public BeanContextInfo (src)  getBeanContextInfo()
                                   throws java.rmi.RemoteException
Throws:
java.rmi.RemoteException

loopbackTest

public void loopbackTest()
                  throws java.rmi.RemoteException
Throws:
java.rmi.RemoteException

loopbackTest

public void loopbackTest(EJBObject (src)  obj)
                  throws java.rmi.RemoteException
Throws:
java.rmi.RemoteException

ping

public void ping()

sleep

public void sleep(long wait)

getWasActivated

public boolean getWasActivated()

getWasPassivated

public boolean getWasPassivated()

createLocalEntity

public void createLocalEntity(AccountPK (src)  pk,
                              java.lang.String personsName)
                       throws CreateException (src) 
Throws:
CreateException (src)

readAndRemoveEntity

public java.lang.String readAndRemoveEntity()
                                     throws RemoveException (src) 
Throws:
RemoveException (src)

createSessionHandle

public void createSessionHandle()

useSessionHandle

public java.lang.String useSessionHandle(java.lang.String arg)

createStatefulSessionHandle

public void createStatefulSessionHandle(java.lang.String testName)

useStatefulSessionHandle

public void useStatefulSessionHandle()

createSessionRef

public void createSessionRef()
                      throws java.rmi.RemoteException
Throws:
java.rmi.RemoteException

useSessionRef

public java.lang.String useSessionRef()
                               throws java.rmi.RemoteException
Throws:
java.rmi.RemoteException

getHandle

public Handle (src)  getHandle()