|
JAC project AOPSYS CEDRIC & LIP6 labs |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.objectweb.jac.core.Wrapper | +--org.objectweb.jac.aspects.persistence.PersistenceWrapper
This wrapper defines persistence extensions for objects that a defined persitent by a persistent aspect component.
Nested Class Summary | |
static class |
PersistenceWrapper.InvalidOidException
|
Field Summary | |
static String |
ATTR_ADDED
|
Fields inherited from class org.objectweb.jac.core.Wrapper |
ac |
Constructor Summary | |
PersistenceWrapper(AspectComponent ac)
|
Method Summary | |
protected void |
addToCollection(Interaction interaction,
CollectionItem collection,
Object value)
This method stores the persistent object that is added to the collection into the storage. |
Object |
applyPersistence(Interaction interaction)
This wrapping method apply the persistence aspect for a given call on a persistent object. |
void |
checkOid(Wrappee wrappee)
|
PersistenceAC |
getAC()
|
void |
getCollection(Wrappee wrappee,
CollectionItem collection)
This method loads alls the persistent objects that are contained in this collection from the storage. |
OID |
getOID(Wrappee wrappee)
|
void |
getReference(Wrappee wrappee,
FieldItem reference)
This method loads the persistent object that is pointed by the reference from the storage. |
Storage |
getStorage()
|
Object |
handleStatic(Interaction interaction)
This wrapping method is called on static objects constructors as defined by the pointcut of PersistenceAC . |
void |
initAllFields(Wrappee wrappee)
Initialize all fields of an object in the storage. |
void |
initCollections(Wrappee wrappee,
CollectionItem[] collections)
|
boolean |
isPersistent(Wrappee wrappee)
Tells if the current object is persistent (role method). |
void |
loadAllFields(Wrappee wrappee)
Load all the fields of an object from the storage and initialize the object. |
void |
makePersistent(Wrappee wrappee)
Makes an object persistent if it is not already. |
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. |
protected void |
removeFromCollection(Interaction interaction,
CollectionItem collection,
Object value)
This method delete the persistent object that is removed from the collection from the storage. |
protected void |
setField(Wrappee wrappee,
FieldItem field)
This method stores the field into the storage. |
protected void |
setReference(Wrappee wrappee,
FieldItem reference,
Wrappee value)
This method stores the persistent object that is pointed by the reference into the storage. |
void |
updateCollection(CollectionItem collection,
int position)
Update the element of a collection at a gievn position |
void |
wrapCollections(Wrappee wrappee,
boolean isNew)
This role method wraps all the collection of the current wrappee so that they will trigger the needed loads from the storage when they are accessed. |
Methods inherited from class org.objectweb.jac.core.Wrapper |
attr, attrdef, defines, getAspectComponent, getAspectComponentName, getExceptionHandlers, proceed, setAspectComponent, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final String ATTR_ADDED
Constructor Detail |
public PersistenceWrapper(AspectComponent ac)
Method Detail |
public Object normalizeOutput(Object value) throws Exception
value
- the "storage" value
Exception
normalizeInput(Object)
public Object normalizeInput(Object value) throws Exception
value
- the value to be stored
Exception
normalizeInput(Object)
public OID getOID(Wrappee wrappee)
public boolean isPersistent(Wrappee wrappee)
public Object handleStatic(Interaction interaction)
PersistenceAC
.
PersistenceAC.registerStatics(java.lang.String, java.lang.String)
public void makePersistent(Wrappee wrappee)
wrappee
- the object to make persistentpublic void loadAllFields(Wrappee wrappee) throws Exception
wrappee
- the object
Exception
public void wrapCollections(Wrappee wrappee, boolean isNew)
isNew
- must true if the object is newly created, false if
loaded from storagepublic Object applyPersistence(Interaction interaction) throws Exception
It uses the RTTI aspect to determine the accessed and written field types.
Default behavior is:
Exception
AbstractMethodItem.getAccessedFields()
,
getCollection(Wrappee,CollectionItem)
,
getReference(Wrappee,FieldItem)
,
addToCollection(Interaction,CollectionItem,Object)
,
removeFromCollection(Interaction,CollectionItem,Object)
,
setReference(Wrappee,FieldItem,Wrappee)
,
setField(Wrappee,FieldItem)
,
AbstractMethodItem.getWrittenFields()
,
org.objectweb.jac.core.rttipublic void getCollection(Wrappee wrappee, CollectionItem collection) throws Exception
If the collection has already been loaded from the storage, do nothing.
collection
- the collection to load
Exception
protected void addToCollection(Interaction interaction, CollectionItem collection, Object value) throws Exception
collection
- the collection to add to
Exception
removeFromCollection(Interaction,CollectionItem,Object)
,
getCollection(Wrappee,CollectionItem)
protected void removeFromCollection(Interaction interaction, CollectionItem collection, Object value) throws Exception
collection
- the collection to remove from
Exception
addToCollection(Interaction,CollectionItem,Object)
,
getCollection(Wrappee,CollectionItem)
public void updateCollection(CollectionItem collection, int position) throws Exception
Exception
public void getReference(Wrappee wrappee, FieldItem reference) throws Exception
If the reference has already been loaded from the storage, do nothing.
reference
- the reference to load
Exception
setReference(Wrappee,FieldItem,Wrappee)
protected void setReference(Wrappee wrappee, FieldItem reference, Wrappee value) throws Exception
reference
- the reference to store
Exception
getReference(Wrappee,FieldItem)
protected void setField(Wrappee wrappee, FieldItem field) throws Exception
field
- the field to store
Exception
public void initCollections(Wrappee wrappee, CollectionItem[] collections) throws Exception
Exception
public void initAllFields(Wrappee wrappee) throws Exception
This method is called when a new object is made persistent. The references and collections are also recursively saved into the storage.
wrappee
- the initializer object
Exception
public Storage getStorage()
public final PersistenceAC getAC()
public void checkOid(Wrappee wrappee) throws PersistenceWrapper.InvalidOidException
PersistenceWrapper.InvalidOidException
|
Contact JAC development team: Renaud Pawlak Lionel Seinturier Laurent Martelli |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |