org.objectweb.jac.aspects.transaction
Class TransactionAC.TransactionWrapper

java.lang.Object
  |
  +--org.objectweb.jac.core.Wrapper
        |
        +--org.objectweb.jac.aspects.transaction.TransactionAC.TransactionWrapper
All Implemented Interfaces:
Advice, ConstructorInterceptor, Interceptor, MethodInterceptor, Serializable
Enclosing class:
TransactionAC

public static class TransactionAC.TransactionWrapper
extends Wrapper

This wrapper defines the transaction wrapper.

It defines a wrapping method that starts a transaction when a method is called and that commits it when the method returns normally. Within the transaction, the cloning and the dispatching is ensured by an external DispatchTransactionWrapper.

See Also:
DispatchTransactionWrapper, Serialized Form

Field Summary
 
Fields inherited from class org.objectweb.jac.core.Wrapper
ac, cr
 
Constructor Summary
TransactionAC.TransactionWrapper(AspectComponent ac)
           
 
Method Summary
 void beginOfTransaction(Interaction interaction)
          Initializes the transaction.
 void catchException(Interaction interaction, Exception e)
          Handles an exception within a transaction (rollback).
 Object construct(ConstructorInvocation invocation)
           
 void endOfTransaction(Interaction interaction)
          Ends the transaction (when success).
 Object handleTransaction(Interaction interaction)
          This wrapping method wraps a transactional method.
 Object invoke(MethodInvocation invocation)
           
 
Methods inherited from class org.objectweb.jac.core.Wrapper
attr, attrdef, defines, getAspectComponent, getAspectComponentName, getExceptionHandlers, proceed, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TransactionAC.TransactionWrapper

public TransactionAC.TransactionWrapper(AspectComponent ac)
Method Detail

handleTransaction

public Object handleTransaction(Interaction interaction)
This wrapping method wraps a transactional method.


beginOfTransaction

public void beginOfTransaction(Interaction interaction)
Initializes the transaction.


endOfTransaction

public void endOfTransaction(Interaction interaction)
Ends the transaction (when success).


catchException

public void catchException(Interaction interaction,
                           Exception e)
                    throws Exception
Handles an exception within a transaction (rollback).

Exception

invoke

public Object invoke(MethodInvocation invocation)
              throws Throwable
Specified by:
invoke in interface MethodInterceptor
Overrides:
invoke in class Wrapper
Throwable

construct

public Object construct(ConstructorInvocation invocation)
                 throws Throwable
Specified by:
construct in interface ConstructorInterceptor
Overrides:
construct in class Wrapper
Throwable