com.ibm.websphere.samples.activitysessions.ASBeanManagedEJB
Class ASBeanManagedEJBBean

java.lang.Object
  extended by com.ibm.websphere.samples.activitysessions.ASBeanManagedEJB.ASBeanManagedEJBBean
All Implemented Interfaces:
java.io.Serializable, javax.ejb.EnterpriseBean, javax.ejb.SessionBean

public class ASBeanManagedEJBBean
extends java.lang.Object
implements javax.ejb.SessionBean

See Also:
Serialized Form

Constructor Summary
ASBeanManagedEJBBean()
           
 
Method Summary
 void ejbActivate()
          ejbActivate
 void ejbCreate()
          ejbCreate
 void ejbPassivate()
          ejbPassivate
 void ejbRemove()
          ejbRemove
 javax.ejb.SessionContext getSessionContext()
          getSessionContext
 java.lang.String performTasks()
          This remote method is called by the client to run the sample.
 void setSessionContext(javax.ejb.SessionContext ctx)
          setSessionContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ASBeanManagedEJBBean

public ASBeanManagedEJBBean()
Method Detail

performTasks

public java.lang.String performTasks()
This remote method is called by the client to run the sample.

The bean performs three variations of the same basic sequence

  1. starts an ActivitySession
  2. calls a method on an instance of ASContainerManagedEJB2 that opens a connection to a non-transactional one phase datasource, thereby starting a Resource Manager Local Transaction (RMLT)
  3. calls a method on an instance of ASContainerManagedEJB2 that updates data in the datasource
  4. either calls a method on an instance of ASContainerManagedEJB2 that commits or rolls back the RMLT. Note if this isn't called the RMLT is left active (or dangling).
  5. ends the ActivitySession with an end mode of EndModeCheckPoint.
  6. calls a method on an instance of ASContainerManagedEJB2 to obtain results and checks them.

The first sequence uses the commit option, the second uses the rollback option and the third leaves the local transaction active.

Returns:
String[] that the client can output to the user.

getSessionContext

public javax.ejb.SessionContext getSessionContext()
getSessionContext


setSessionContext

public void setSessionContext(javax.ejb.SessionContext ctx)
setSessionContext

Specified by:
setSessionContext in interface javax.ejb.SessionBean

ejbActivate

public void ejbActivate()
ejbActivate

Specified by:
ejbActivate in interface javax.ejb.SessionBean

ejbCreate

public void ejbCreate()
ejbCreate


ejbPassivate

public void ejbPassivate()
ejbPassivate

Specified by:
ejbPassivate in interface javax.ejb.SessionBean

ejbRemove

public void ejbRemove()
ejbRemove

Specified by:
ejbRemove in interface javax.ejb.SessionBean