org.objectweb.jac.aspects.persistence
Class AbstractPersistenceWrapper

java.lang.Object
  |
  +--org.objectweb.jac.core.Wrapper
        |
        +--org.objectweb.jac.aspects.persistence.AbstractPersistenceWrapper
All Implemented Interfaces:
Advice, ConstructorInterceptor, Interceptor, MethodInterceptor, Serializable
Direct Known Subclasses:
CollectionWrapper, PersistenceWrapper

public abstract class AbstractPersistenceWrapper
extends Wrapper

This wrapper defines persistence extensions for objects that a defined persitent by a persistent aspect component.

See Also:
Serialized Form

Nested Class Summary
static class AbstractPersistenceWrapper.InvalidOidException
           
 
Field Summary
static String ATTR_ADDED
           
 
Fields inherited from class org.objectweb.jac.core.Wrapper
ac, cr
 
Constructor Summary
AbstractPersistenceWrapper(AspectComponent ac)
           
 
Method Summary
 void checkOid(Wrappee wrappee)
           
 PersistenceAC getAC()
           
 OID getOID(Wrappee wrappee)
           
 Storage getStorage(ClassItem cli)
          Returns the storage for a given class
 boolean isPersistent(Wrappee wrappee)
          Tells if the current object is persistent (role method).
 Object normalizeInput(Object value)
          Performs various stuff before storing a value in a storage.
 Object normalizeOutput(Object value)
          Gets the object in memory object for a "storage" value.
 
Methods inherited from class org.objectweb.jac.core.Wrapper
attr, attrdef, construct, defines, getAspectComponent, getAspectComponentName, getExceptionHandlers, invoke, proceed, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ATTR_ADDED

public static final String ATTR_ADDED
See Also:
Constant Field Values
Constructor Detail

AbstractPersistenceWrapper

public AbstractPersistenceWrapper(AspectComponent ac)
Method Detail

normalizeOutput

public final Object normalizeOutput(Object value)
                             throws Exception
Gets the object in memory object for a "storage" value.

Parameters:
value - the "storage" value
Returns:
if value is an OID, a reference to the object with that OID is returned, otherwise, value is returned.
Exception
See Also:
normalizeInput(Object)

normalizeInput

public final Object normalizeInput(Object value)
                            throws Exception
Performs various stuff before storing a value in a storage. If the value is a Wrappee, it is made persistent.

Parameters:
value - the value to be stored
Returns:
if value is a wrappee, the OID of the object is returned, otherwise, value is returned.
Exception
See Also:
normalizeInput(Object)

getOID

public final OID getOID(Wrappee wrappee)

isPersistent

public final boolean isPersistent(Wrappee wrappee)
Tells if the current object is persistent (role method).

Returns:
true if persistent

getStorage

public final Storage getStorage(ClassItem cli)
Returns the storage for a given class

Parameters:
cli - a class
Returns:
the storage of the class, or null.

getAC

public final PersistenceAC getAC()

checkOid

public final void checkOid(Wrappee wrappee)
                    throws AbstractPersistenceWrapper.InvalidOidException
AbstractPersistenceWrapper.InvalidOidException