org.objectweb.jac.aspects.distrans.persistence
Class WriteWrapper

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

public class WriteWrapper
extends Wrapper

This class define a wrapping method (write) for wrappees that perform write operations on transactional ressources. This wrapper may wrap several wrappees from different classes. Each wrappee field is mapped onto a SQL table attribute. The SQL tables contain one more attribute which is the name of the wrappee, and which is also the primary key of the table.

Version:
1.0
Author:
Lionel Seinturier
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.objectweb.jac.core.Wrapper
ac, cr
 
Constructor Summary
WriteWrapper(AspectComponent ac, PersistenceItf storage, org.enhydra.jdbc.standard.StandardXADataSource ds)
           
 
Method Summary
 Object construct(ConstructorInvocation invocation)
           
 Object invoke(MethodInvocation invocation)
          Wrapping method for wrappees that perform write operations on transactional ressources.
 
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

WriteWrapper

public WriteWrapper(AspectComponent ac,
                    PersistenceItf storage,
                    org.enhydra.jdbc.standard.StandardXADataSource ds)
Parameters:
ac - the AC managing this wrapper
storage - the technical instance for persistence
ds - the data source used to create a connection towards the database where the data is stored
Method Detail

invoke

public Object invoke(MethodInvocation invocation)
              throws Throwable
Wrapping method for wrappees that perform write operations on transactional ressources. After proceeding the interaction, fields value are saved into the database. Fetching (ie reading) the data before, is a way to let the database manage the blocking mechanism whenever concurrent transactions occur.

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