org.objectweb.jac.aspects.transaction
Class DispatchTransactionWrapper

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

public class DispatchTransactionWrapper
extends Wrapper

This wrapper wraps all JAC objects that can be part of a transaction in order to dispatch the transactions to local clones and to commit them.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.objectweb.jac.core.Wrapper
ac, cr
 
Constructor Summary
DispatchTransactionWrapper(AspectComponent ac)
           
 
Method Summary
 void commit(Wrappee wrappee, Integer transactionId)
          Commits the transaction on the wrappee (role method).
 Object construct(ConstructorInvocation invocation)
           
 Object dispatch(Interaction interaction)
          Dispatches a call on a wrappee transaction-clone depending on the current transaction if any (if not, it performs a regular call).
 Object invoke(MethodInvocation invocation)
           
 void rollback(Wrappee wrappee, Integer transactionId)
          Rollbacks the transaction on the wrappee (role method).
 
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

DispatchTransactionWrapper

public DispatchTransactionWrapper(AspectComponent ac)
Method Detail

dispatch

public Object dispatch(Interaction interaction)
Dispatches a call on a wrappee transaction-clone depending on the current transaction if any (if not, it performs a regular call).


commit

public void commit(Wrappee wrappee,
                   Integer transactionId)
            throws Exception
Commits the transaction on the wrappee (role method).

This method copies the transaction-clone state to the original object.

Parameters:
transactionId - the transaction to be commited
Exception

rollback

public void rollback(Wrappee wrappee,
                     Integer transactionId)
Rollbacks the transaction on the wrappee (role method).

Parameters:
transactionId - the transaction to be rollbacked

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