站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JBoss 4.0.1 sp1 aspects API Documentation 英文版文档

TxSupport (JBoss Aspects API) - JBoss 4.0.1 sp1 aspects API Documentation 英文版文档


org.jboss.aspects.tx
Class TxSupport

java.lang.Object
  extended byorg.jboss.aspects.tx.TxSupport
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
TxSupport.Mandatory, TxSupport.Never, TxSupport.NotSupported, TxSupport.Required, TxSupport.RequiresNew, TxSupport.Supports

public abstract class TxSupport
extends Object
implements Serializable

TxSupport.java encapsulates the transaction handling possibilities from the ejb spec. The Tx interceptors call the clientInvoke and serverInvoke methods on the subclass determined by the method's transaction support. Created: Sun Feb 2 23:25:09 2003

Version:
Author:
David Jencks, Bill Burke
See Also:
Serialized Form

Nested Class Summary
static class TxSupport.Mandatory
           
static class TxSupport.Never
           
static class TxSupport.NotSupported
           
static class TxSupport.Required
           
static class TxSupport.RequiresNew
           
static class TxSupport.Supports
           
 
Field Summary
static TxSupport DEFAULT
           
protected static org.jboss.logging.Logger log
           
static TxSupport MANDATORY
           
static TxSupport NEVER
           
static TxSupport NOT_SUPPORTED
           
static TxSupport REQUIRED
           
static TxSupport REQUIRES_NEW
           
static TxSupport SUPPORTS
           
 
Method Summary
static TxSupport byName(String name)
           
protected  void endTransaction(TransactionManager tm, Transaction tx)
          The endTransaction method ends a transaction and translates any exceptions into TransactionRolledBack[Local]Exception or SystemException.
protected  Object internalReadResolve()
           
protected  Object invokeInCallerTx(org.jboss.aop.joinpoint.Invocation invocation, Transaction tx)
          The invokeInCallerTx method implements the behavior described in the ejb 2.1 spec, section 18.3, table 15, lines 1 and 2.
protected  Object invokeInNoTx(org.jboss.aop.joinpoint.Invocation invocation)
          The invokeInNoTx method implements the behavior in the ejb 2.1 spec section 18.3 table 15 lines 5 and 6, in the case where there is no transaction.
protected  Object invokeInOurTx(org.jboss.aop.joinpoint.Invocation invocation, TransactionManager tm)
          The invokeInOurTx method implements the behavior described in the ejb 2.1 spec, section 18.3, table 15, lines 3 and 4.
protected  void rethrowApplicationException(org.jboss.aop.joinpoint.Invocation inv, Throwable e)
          The rethrowApplicationException method determines if the supplied Throwable is an application exception and rethrows it if it is.
protected  void rethrowAsTxRolledbackException(Throwable cause)
          The rethrowAsTxRolledbackException method translates the supplied exception into an appropriate TransactionRolledback[Local]Exception, unwrapping as appropriate.
abstract  Object serverInvoke(org.jboss.aop.joinpoint.Invocation invocation, TransactionManager tm)
           
protected  void setRollbackOnly(Transaction tx)
          The setRollbackOnly method calls setRollbackOnly() on the invocation's transaction and logs any exceptions than may occur.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

log

protected static final org.jboss.logging.Logger log

NEVER

public static final TxSupport NEVER

NOT_SUPPORTED

public static final TxSupport NOT_SUPPORTED

SUPPORTS

public static final TxSupport SUPPORTS

REQUIRED

public static final TxSupport REQUIRED

REQUIRES_NEW

public static final TxSupport REQUIRES_NEW

MANDATORY

public static final TxSupport MANDATORY

DEFAULT

public static final TxSupport DEFAULT
Method Detail

byName

public static TxSupport byName(String name)

toString

public String toString()

internalReadResolve

protected Object internalReadResolve()
                              throws ObjectStreamException
Throws:
ObjectStreamException

serverInvoke

public abstract Object serverInvoke(org.jboss.aop.joinpoint.Invocation invocation,
                                    TransactionManager tm)
                             throws Throwable
Throws:
Throwable

invokeInNoTx

protected Object invokeInNoTx(org.jboss.aop.joinpoint.Invocation invocation)
                       throws Throwable
The invokeInNoTx method implements the behavior in the ejb 2.1 spec section 18.3 table 15 lines 5 and 6, in the case where there is no transaction.

Parameters:
invocation - an Invocation value
Returns:
an Object value
Throws:
Exception - if an error occurs
Throwable

invokeInOurTx

protected Object invokeInOurTx(org.jboss.aop.joinpoint.Invocation invocation,
                               TransactionManager tm)
                        throws Throwable
The invokeInOurTx method implements the behavior described in the ejb 2.1 spec, section 18.3, table 15, lines 3 and 4.

Parameters:
invocation - an Invocation value
tm - a TransactionManager value
Returns:
an Object value
Throws:
Exception - if an error occurs
Throwable

invokeInCallerTx

protected Object invokeInCallerTx(org.jboss.aop.joinpoint.Invocation invocation,
                                  Transaction tx)
                           throws Throwable
The invokeInCallerTx method implements the behavior described in the ejb 2.1 spec, section 18.3, table 15, lines 1 and 2.

Parameters:
invocation - an Invocation value
tx - a Transaction value
Returns:
an Object value
Throws:
Exception - if an error occurs
Throwable

endTransaction

protected void endTransaction(TransactionManager tm,
                              Transaction tx)
                       throws TransactionRolledbackException,
                              SystemException
The endTransaction method ends a transaction and translates any exceptions into TransactionRolledBack[Local]Exception or SystemException.

Parameters:
tm - a TransactionManager value
tx - a Transaction value
Throws:
TransactionRolledbackException - if an error occurs
SystemException - if an error occurs

rethrowAsTxRolledbackException

protected void rethrowAsTxRolledbackException(Throwable cause)
                                       throws TransactionRolledbackException
The rethrowAsTxRolledbackException method translates the supplied exception into an appropriate TransactionRolledback[Local]Exception, unwrapping as appropriate.

Throws:
TransactionRolledbackException - if an error occurs

setRollbackOnly

protected void setRollbackOnly(Transaction tx)
The setRollbackOnly method calls setRollbackOnly() on the invocation's transaction and logs any exceptions than may occur.


rethrowApplicationException

protected void rethrowApplicationException(org.jboss.aop.joinpoint.Invocation inv,
                                           Throwable e)
                                    throws Throwable
The rethrowApplicationException method determines if the supplied Throwable is an application exception and rethrows it if it is.

Parameters:
e - a Throwable value
Throws:
Exception - if an error occurs
Throwable


Copyright © 2002 JBoss Group, LLC. All Rights Reserved.