WebLogic Server 6.0 Code Examples, BEA Systems, Inc.

examples.jta.jmsjdbc
Class ReceiveInTxBean

java.lang.Object
  |
  +--examples.jta.jmsjdbc.ReceiveInTxBean
All Implemented Interfaces:
javax.ejb.EnterpriseBean, java.io.Serializable, javax.ejb.SessionBean

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

ReceiveInTxBean is a stateless session bean using bean-managed transaction. This EJBean illustrates distributed transactions and two phase commit across two XA resources: JMS queue, and Cloudscape database. It begins a distributed transaction, receives messages from the JMS queue, updates the database, and then commits the distributed transaction.

Author:
Copyright (c) 1999-2000 by BEA Systems, Inc. All Rights Reserved.

Constructor Summary
ReceiveInTxBean()
           
 
Method Summary
 void ejbActivate()
          This method is required by the EJB Specification, but is not used by this example.
 void ejbCreate()
          This method is required by the EJB Specification, but is not used by this example.
 void ejbPassivate()
          This method is required by the EJB Specification, but is not used by this example.
 void ejbRemove()
          This method is required by the EJB Specification, but is not used by this example.
 void receiveMessages()
          This method implements the receiveMessages method in the ReceiveInTx remote interface.
 void setSessionContext(javax.ejb.SessionContext ctx)
          Sets the session context.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReceiveInTxBean

public ReceiveInTxBean()
Method Detail

ejbActivate

public void ejbActivate()
This method is required by the EJB Specification, but is not used by this example.
Specified by:
ejbActivate in interface javax.ejb.SessionBean

ejbCreate

public void ejbCreate()
               throws javax.ejb.CreateException
This method is required by the EJB Specification, but is not used by this example.

ejbPassivate

public void ejbPassivate()
This method is required by the EJB Specification, but is not used by this example.
Specified by:
ejbPassivate in interface javax.ejb.SessionBean

ejbRemove

public void ejbRemove()
This method is required by the EJB Specification, but is not used by this example.
Specified by:
ejbRemove in interface javax.ejb.SessionBean

receiveMessages

public void receiveMessages()
This method implements the receiveMessages method in the ReceiveInTx remote interface. This method begins a distributed transaction, receives messages from the JMS queue, updates the database, and then commit the distributed transaction.

setSessionContext

public void setSessionContext(javax.ejb.SessionContext ctx)
Sets the session context.
Specified by:
setSessionContext in interface javax.ejb.SessionBean
Parameters:
ctx - SessionContext Context for session

Documentation is available at
http://e-docs.bea.com/wls/docs60

Copyright © 2000 BEA Systems, Inc. All Rights Reserved.