org.openejb.core.transaction
Class TxNever

java.lang.Object
  |
  +--org.openejb.core.transaction.TransactionPolicy
        |
        +--org.openejb.core.transaction.TxNever

public class TxNever
extends TransactionPolicy

17.6.2.6 Never The Container invokes an enterprise Bean method whose transaction attribute is set to Never without a transaction context defined by the EJB spec. The client is required to call without a transaction context. • If the client calls with a transaction context, the Container throws the java.rmi.RemoteException exception if the client is a remote client, or the javax.ejb.EJBException if the client is a local client. • If the client calls without a transaction context, the Container performs the same steps as described in the NotSupported case.

Version:
$Revision: 1.1 $ $Date: 2002/01/21 08:09:03 $

Fields inherited from class org.openejb.core.transaction.TransactionPolicy
BeanManaged, container, logger, Manditory, Never, NotSupported, policyType, Required, RequiresNew, Supports
 
Constructor Summary
TxNever()
           
TxNever(TransactionContainer container)
           
 
Method Summary
 void afterInvoke(javax.ejb.EnterpriseBean instance, TransactionContext context)
           
 void beforeInvoke(javax.ejb.EnterpriseBean instance, TransactionContext context)
           
 void handleApplicationException(java.lang.Throwable appException, TransactionContext context)
          Container's action
 void handleSystemException(java.lang.Throwable sysException, javax.ejb.EnterpriseBean instance, TransactionContext context)
          A system exception is any exception that is not an Application Exception.
 
Methods inherited from class org.openejb.core.transaction.TransactionPolicy
beginTransaction, commitTransaction, discardBeanInstance, getContainer, getTxMngr, handleCallbackException, logSystemException, markTxRollbackOnly, rollbackTransaction, throwAppExceptionToServer, throwExceptionToServer, throwTxExceptionToServer
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TxNever

public TxNever(TransactionContainer container)

TxNever

public TxNever()
Method Detail

beforeInvoke

public void beforeInvoke(javax.ejb.EnterpriseBean instance,
                         TransactionContext context)
                  throws SystemException,
                         ApplicationException
Overrides:
beforeInvoke in class TransactionPolicy

afterInvoke

public void afterInvoke(javax.ejb.EnterpriseBean instance,
                        TransactionContext context)
                 throws ApplicationException,
                        SystemException
Overrides:
afterInvoke in class TransactionPolicy

handleApplicationException

public void handleApplicationException(java.lang.Throwable appException,
                                       TransactionContext context)
                                throws ApplicationException
Container's action

Re-throw AppException

Client's view

Receives AppException. If the client executes in a transaction, the client's transaction is not marked for rollback, and client can continue its work.

Overrides:
handleApplicationException in class TransactionPolicy

handleSystemException

public void handleSystemException(java.lang.Throwable sysException,
                                  javax.ejb.EnterpriseBean instance,
                                  TransactionContext context)
                           throws ApplicationException,
                                  SystemException
A system exception is any exception that is not an Application Exception. Container's action

  1. Log the exception or error so that the System Administrator is alerted of the problem.
  2. Discard instance. The Container must not invoke any business methods or container callbacks on the instance.
  3. Throw RemoteException to remote client; throw EJBException to local client.

Client's view

Receives RemoteException or EJBException. If the client executes in a transaction, the client's transaction may or may not be marked for rollback.

Overrides:
handleSystemException in class TransactionPolicy