org.openejb.test.stateful
Class BMTStatefulBean

java.lang.Object
  extended by org.openejb.test.stateful.BMTStatefulBean
All Implemented Interfaces:
java.io.Serializable, javax.ejb.EnterpriseBean, javax.ejb.SessionBean

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

A Stateful SessionBean with bean-managed transaction demarcation

Author:
David Blevins, Richard Monson-Haefel
See Also:
Serialized Form

Constructor Summary
BMTStatefulBean()
           
 
Method Summary
 java.lang.String businessMethod(java.lang.String text)
          Maps to BasicStatefulObject.businessMethod
 void ejbActivate()
          The activate method is called when the instance is activated from its "passive" state.
 void ejbCreate(java.lang.String name)
          Maps to BasicStatefulHome.create
 void ejbPassivate()
          The passivate method is called before the instance enters the "passive" state.
 void ejbRemove()
          A container invokes this method before it ends the life of the session object.
 OperationsPolicy getAllowedOperationsReport(java.lang.String methodName)
          Maps to BasicStatefulObject.getAllowedOperationsReport Returns a report of the allowed opperations for one of the bean's methods.
 java.util.Properties getPermissionsReport()
          Maps to BasicStatefulObject.getPermissionsReport Returns a report of the bean's runtime permissions
 void setSessionContext(javax.ejb.SessionContext ctx)
          Set the associated session context.
protected  void testAllowedOperations(java.lang.String methodName)
           
 void throwApplicationException()
          Throws an ApplicationException when invoked
 void throwSystemException_NullPointer()
          Throws a java.lang.NullPointerException when invoked This is a system exception and should result in the destruction of the instance and invalidation of the remote reference.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BMTStatefulBean

public BMTStatefulBean()
Method Detail

ejbCreate

public void ejbCreate(java.lang.String name)
               throws javax.ejb.CreateException
Maps to BasicStatefulHome.create

Parameters:
name -
Throws:
javax.ejb.CreateException
See Also:
BasicStatefulHome.create

businessMethod

public java.lang.String businessMethod(java.lang.String text)
Maps to BasicStatefulObject.businessMethod

Returns:
See Also:
BasicStatefulObject.businessMethod

throwApplicationException

public void throwApplicationException()
                               throws ApplicationException
Throws an ApplicationException when invoked

Throws:
ApplicationException

throwSystemException_NullPointer

public void throwSystemException_NullPointer()
Throws a java.lang.NullPointerException when invoked This is a system exception and should result in the destruction of the instance and invalidation of the remote reference.


getPermissionsReport

public java.util.Properties getPermissionsReport()
Maps to BasicStatefulObject.getPermissionsReport Returns a report of the bean's runtime permissions

Returns:
See Also:
BasicStatefulObject.getPermissionsReport

getAllowedOperationsReport

public OperationsPolicy getAllowedOperationsReport(java.lang.String methodName)
Maps to BasicStatefulObject.getAllowedOperationsReport Returns a report of the allowed opperations for one of the bean's methods.

Parameters:
methodName - The method for which to get the allowed opperations report
Returns:
See Also:
BasicStatefulObject.getAllowedOperationsReport

setSessionContext

public void setSessionContext(javax.ejb.SessionContext ctx)
                       throws javax.ejb.EJBException,
                              java.rmi.RemoteException
Set the associated session context. The container calls this method after the instance creation.

Specified by:
setSessionContext in interface javax.ejb.SessionBean
Throws:
javax.ejb.EJBException
java.rmi.RemoteException

ejbRemove

public void ejbRemove()
               throws javax.ejb.EJBException,
                      java.rmi.RemoteException
A container invokes this method before it ends the life of the session object. This happens as a result of a client's invoking a remove operation, or when a container decides to terminate the session object after a timeout.

Specified by:
ejbRemove in interface javax.ejb.SessionBean
Throws:
javax.ejb.EJBException
java.rmi.RemoteException

ejbActivate

public void ejbActivate()
                 throws javax.ejb.EJBException,
                        java.rmi.RemoteException
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.

Specified by:
ejbActivate in interface javax.ejb.SessionBean
Throws:
javax.ejb.EJBException
java.rmi.RemoteException

ejbPassivate

public void ejbPassivate()
                  throws javax.ejb.EJBException,
                         java.rmi.RemoteException
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.

Specified by:
ejbPassivate in interface javax.ejb.SessionBean
Throws:
javax.ejb.EJBException
java.rmi.RemoteException

testAllowedOperations

protected void testAllowedOperations(java.lang.String methodName)


Copyright © 1999-2011 OpenEJB. All Rights Reserved.