WebLogic Server 7.0 Code Examples, BEA Systems, Inc.

examples.wtc.atmi.qsample
Class QsampleBean

java.lang.Object
  |
  +--examples.wtc.atmi.qsample.QsampleBean
All Implemented Interfaces:
javax.ejb.EnterpriseBean, java.io.Serializable, javax.ejb.SessionBean

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

QsampleBean is a stateful SessionBean. This EJBean illustrates:

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

Field Summary
(package private) static boolean VERBOSE
           
 
Constructor Summary
QsampleBean()
           
 
Method Summary
 void ejbActivate()
          This method is required by the EJB Specification, but is not used by this example.
 void ejbCreate()
          This method corresponds to the create method in the home interface "QsampleHome.java".
 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.
 java.lang.String qtoupper(java.lang.String toConvert)
          This is the classic STRING qsample method, which takes the string argument, and converts it to all upper case.
 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
 

Field Detail

VERBOSE

static final boolean VERBOSE
Constructor Detail

QsampleBean

public QsampleBean()
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 corresponds to the create method in the home interface "QsampleHome.java". The parameter sets of the two methods are identical. When the client calls QsampleHome.create(), the container allocates an instance of the EJBean and calls ejbCreate().
Throws:
javax.ejb.CreateException - if there is a problem creating the bean

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

qtoupper

public java.lang.String qtoupper(java.lang.String toConvert)
                          throws weblogic.wtc.jatmi.TPException
This is the classic STRING qsample method, which takes the string argument, and converts it to all upper case. This implementation will get the TuxedoConnectionFactory from JNDI, and use it to get a Tuxedo object, which can then be used to do the actual tpcall. Of course, we must first convert the java String object to the TypedBuffer TypedString object.
Parameters:
toConvert - A string to be converted (not null)
Returns:
the above string, converted to upper case

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/docs70

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