com.ibm.websphere.samples.activitysessions.ASContainerManagedEJB2
Class ASContainerManagedEJB2Bean

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

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

See Also:
Serialized Form

Constructor Summary
ASContainerManagedEJB2Bean()
           
 
Method Summary
 boolean checkValues(boolean completeLTC, boolean completionDirection)
          This method checks that the values have the expected values at the end of the ActivitySession.
 void ejbActivate()
          ejbActivate
 void ejbCreate()
          ejbCreate
 void ejbPassivate()
          ejbPassivate
 void ejbRemove()
          ejbRemove
 void endLTC(boolean completionDirection)
          This method will end the LTC in the direction being indicated by the value of the completionDirection parameter.
 javax.ejb.SessionContext getSessionContext()
          getSessionContext
 void open()
          This remote method is the first method the client calls on the EJB.
 void performUpdates()
          This method uses the ActivitySession that is created in startActivitySession.
 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

ASContainerManagedEJB2Bean

public ASContainerManagedEJB2Bean()
Method Detail

open

public void open()
          throws java.lang.Exception
This remote method is the first method the client calls on the EJB. It looks up the datasource, stores it and opens a connection.

Throws:
java.lang.Exception - Signals that an exception of some sort has occurred.

performUpdates

public void performUpdates()
                    throws java.lang.Exception
This method uses the ActivitySession that is created in startActivitySession. It performs some JDBC to update data stored in a non-transactional one phase datasource.

Throws:
java.lang.Exception - indicates an unexpected error performing the method

endLTC

public void endLTC(boolean completionDirection)
            throws java.lang.Exception
This method will end the LTC in the direction being indicated by the value of the completionDirection parameter.

Parameters:
completionDirection - boolean - LTC completion direction is determined by the value of this parameter. true indicates commit, false indicates rollback.
Throws:
java.lang.Exception - indicates an unexpected error performing the method

checkValues

public boolean checkValues(boolean completeLTC,
                           boolean completionDirection)
                    throws java.lang.Exception
This method checks that the values have the expected values at the end of the ActivitySession. The completeLTC and completionDirection parameters indicate whether the LTC has been completed by the application and if so in which direction.

Parameters:
completeLTC - boolean - true indicates that the application explicitly ended the LTC.
completionDirection - boolean - true indicates that the LTC was committed, false indicates that the LTC was rolled back. This is only relevant when completeLTC is true.
Returns:
boolean indicates whether the values are those expected
Throws:
java.lang.Exception - indicates an unexpected error performing the method

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