|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.objectweb.easybeans.transaction.interceptors.AbsTransactionInterceptor
public abstract class AbsTransactionInterceptor
Defines an abstract interceptor for transaction with common code used by all transaction interceptors.
Field Summary | |
---|---|
private JLog |
logger
Logger. |
private javax.transaction.TransactionManager |
transactionManager
Transaction manager. |
Constructor Summary | |
---|---|
AbsTransactionInterceptor()
Constructor. Acquire the transaction manager. |
Method Summary | |
---|---|
protected void |
commit()
Commit the current transaction. |
protected void |
discard(EasyBeansInvocationContext invocationContext)
Remove from the factory's pool the bean found in the current invocation context. |
protected ApplicationException |
getApplicationException(EasyBeansInvocationContext invocationContext,
java.lang.Exception e)
Gets the application exception (if any) for the given invocation context and the given exception. Note that a checked Exception is by default an application exception. |
javax.transaction.TransactionManager |
getTransactionManager()
Gets the transaction manager. |
protected void |
handleBeanManagedException(EasyBeansInvocationContext invocationContext,
java.lang.Exception e)
Handle an exception for bean managed transaction. See Chapter 14.3.1. |
protected void |
handleContextClientTransaction(EasyBeansInvocationContext invocationContext,
java.lang.Exception e)
Handle an exception and the transaction is the client transaction. See Chapter 14.3.1. |
protected void |
handleContextContainerTransaction(EasyBeansInvocationContext invocationContext,
java.lang.Exception e)
Handle an exception and the transaction is the container transaction. |
protected void |
handleUnspecifiedTransactionContext(EasyBeansInvocationContext invocationContext,
java.lang.Exception e)
Handle an exception that are in an unspecified transaction context. See Chapter 14.3.1. |
abstract java.lang.Object |
intercept(EasyBeansInvocationContext invocationContext)
Defines the code used by the transaction interceptor on a given method. |
protected boolean |
isMarkedRollbackOnly()
Test if current transaction is with status STATUS_MARKED_ROLLBACK. |
protected void |
markTransactionRollback()
Marks the transaction for rollback. |
protected void |
rollback()
Rollback the current transaction. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private JLog logger
private javax.transaction.TransactionManager transactionManager
Constructor Detail |
---|
public AbsTransactionInterceptor()
Method Detail |
---|
public abstract java.lang.Object intercept(EasyBeansInvocationContext invocationContext) throws java.lang.Exception
intercept
in interface EasyBeansInterceptor
invocationContext
- context with useful attributes on the current
invocation
java.lang.Exception
- if interceptor failspublic javax.transaction.TransactionManager getTransactionManager()
protected ApplicationException getApplicationException(EasyBeansInvocationContext invocationContext, java.lang.Exception e)
invocationContext
- context that provides access to the Method
object.e
- the exception to check
protected void discard(EasyBeansInvocationContext invocationContext) throws PoolException
invocationContext
- the context of the current invocation
PoolException
- if removal is failingprotected void markTransactionRollback()
protected boolean isMarkedRollbackOnly()
protected void rollback()
protected void commit()
protected void handleBeanManagedException(EasyBeansInvocationContext invocationContext, java.lang.Exception e) throws java.lang.Exception
invocationContext
- the context of the current invocatione
- the exception to handle
java.lang.Exception
- when handling the exception.protected void handleUnspecifiedTransactionContext(EasyBeansInvocationContext invocationContext, java.lang.Exception e) throws java.lang.Exception
invocationContext
- the context of the current invocatione
- the exception to handle
java.lang.Exception
- when handling the exception.protected void handleContextClientTransaction(EasyBeansInvocationContext invocationContext, java.lang.Exception e) throws java.lang.Exception
invocationContext
- the context of the current invocatione
- the exception to handle
java.lang.Exception
- when handling the exception.protected void handleContextContainerTransaction(EasyBeansInvocationContext invocationContext, java.lang.Exception e) throws java.lang.Exception
invocationContext
- the context of the current invocatione
- the exception to handle
java.lang.Exception
- when handling the exception.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |