org.objectweb.jac.aspects.persistence
Class CollectionWrapper

java.lang.Object
  extended byorg.objectweb.jac.core.Wrapper
      extended byorg.objectweb.jac.aspects.persistence.AbstractPersistenceWrapper
          extended byorg.objectweb.jac.aspects.persistence.CollectionWrapper
All Implemented Interfaces:
Advice, ConstructorInterceptor, Interceptor, MethodInterceptor, Serializable
Direct Known Subclasses:
ListWrapper, MapWrapper, SetWrapper

public abstract class CollectionWrapper
extends AbstractPersistenceWrapper

Base class for collection wrappers

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class org.objectweb.jac.aspects.persistence.AbstractPersistenceWrapper
AbstractPersistenceWrapper.InvalidOidException
 
Field Summary
 
Fields inherited from class org.objectweb.jac.aspects.persistence.AbstractPersistenceWrapper
ATTR_ADDED
 
Fields inherited from class org.objectweb.jac.core.Wrapper
ac, cr
 
Constructor Summary
CollectionWrapper(AspectComponent ac, Object substance, CollectionItem collection, boolean isLoaded)
           
 
Method Summary
abstract  Object clear(Interaction interaction)
          Remove all instances from the collection
protected  Object convert(Object value, Object wrappee)
           
protected abstract  void doLoad(Wrappee wrappee)
          Really load the whole collection.
protected abstract  long getCollectionSize(OID oid)
           
 long getUseDate(Wrappee wrappee)
           
 boolean isCache()
           
 Object isEmpty(Interaction interaction)
           
 boolean isLoaded()
           
abstract  Object iterator(Interaction interaction)
           
 void load(Wrappee wrappee)
          Load the whole collection if it is not already loaded
 Object preload(Interaction interaction)
           
 void setCache(boolean b)
           
 Object size(Interaction interaction)
           
protected  void touch()
          Sets useDate to current time
 void unload(Wrappee wrappee)
          Unload the collection.
 
Methods inherited from class org.objectweb.jac.aspects.persistence.AbstractPersistenceWrapper
checkOid, getAC, getOID, getStorage, isPersistent, normalizeInput, normalizeOutput
 
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
 

Constructor Detail

CollectionWrapper

public CollectionWrapper(AspectComponent ac,
                         Object substance,
                         CollectionItem collection,
                         boolean isLoaded)
Method Detail

load

public void load(Wrappee wrappee)
          throws Exception
Load the whole collection if it is not already loaded

Throws:
Exception

isLoaded

public boolean isLoaded()

unload

public void unload(Wrappee wrappee)
Unload the collection.


doLoad

protected abstract void doLoad(Wrappee wrappee)
                        throws Exception
Really load the whole collection. This is an abstract method must be overriden by subclasses.

Throws:
Exception

clear

public abstract Object clear(Interaction interaction)
                      throws Exception
Remove all instances from the collection

Throws:
Exception

preload

public Object preload(Interaction interaction)
               throws Exception
Throws:
Exception

size

public Object size(Interaction interaction)
            throws Exception
Throws:
Exception

getCollectionSize

protected abstract long getCollectionSize(OID oid)
                                   throws Exception
Throws:
Exception

isEmpty

public Object isEmpty(Interaction interaction)
               throws Exception
Throws:
Exception

getUseDate

public long getUseDate(Wrappee wrappee)

touch

protected void touch()
Sets useDate to current time


iterator

public abstract Object iterator(Interaction interaction)

isCache

public boolean isCache()

setCache

public void setCache(boolean b)

convert

protected Object convert(Object value,
                         Object wrappee)
                  throws Exception
Throws:
Exception