JAC project
AOPSYS
CEDRIC & LIP6 labs

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

java.lang.Object
  |
  +--org.objectweb.jac.core.AspectComponent
        |
        +--org.objectweb.jac.aspects.distrans.persistence.PersistenceAC
All Implemented Interfaces:
BaseProgramListener, Serializable

public class PersistenceAC
extends AspectComponent

Transaction-enabled persistence storage. An instance this AC is mandatory with DisTransAC. This class delegates most of the work (apart from data sources registering) to a technical implementation of the persistence API PersistenceItf. Current implementations of this API: SimpleDbPersistence. Relies on jac.aspects.distrans.JOTMHelper to retrieve the JOTM instance used by JAC.

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

Field Summary
 
Fields inherited from class org.objectweb.jac.core.AspectComponent
application, blockKeywords, firstCall, NOT_SHARED, SHARED, startWeavingCCount, startWeavingCount, startWeavingMethod, startWeavingType, systemListener, wrappers
 
Fields inherited from interface org.objectweb.jac.core.BaseProgramListener
FOUND_OBJECT
 
Constructor Summary
PersistenceAC()
           
 
Method Summary
 void defineDataSource(String sourceName, String driver, String url, String user, String password)
          Define a data source name that will be later on used by the remaining configuration methods of this AC.
 void initStorage(String className, String sourceName)
          Initialize the persistence storage.
 void initStorageIfNeeded(String className, String sourceName)
          Initialize the persistence storage.
 void registerPersistentRessource(String objectNameExpression, String sourceName)
          All objects matching the objectNameExpression are made persistent to a SQL database represented by the data source.
 void setStorageType(String classname)
           
 
Methods inherited from class org.objectweb.jac.core.AspectComponent
addWrapper, afterApplicationStarted, afterRunningWrapper, afterWrap, afterWrappeeInit, attr, attrdef, beforeConfiguration, beforeReload, beforeRunningWrapper, beforeWrappeeInit, configure, defines, defineTimer, doRegister, doUnregister, getApplication, getBlockKeywords, getConfigurationMethods, getConfigurationMethodsName, getConfigurationMethodsName, getDefaultConfigs, getName, getWrappers, init, isConfigurationMethod, isSystemListener, onExit, pointcut, pointcut, pointcut, pointcut, pointcut, pointcut, pointcut, pointcut, setApplication, setAttribute, setAttribute, setAttribute, setSystemListener, simulateUsingNewInstance, unweave, unwrapAll, weave, whenClone, whenCloseDisplay, whenConfigured, whenDeleted, whenDeserialized, whenFree, whenGetObjects, whenNameObject, whenObjectMiss, whenReload, whenRemoteInstantiation, whenSerialized, whenTopologyChanged, whenUsingNewClass, whenUsingNewInstance, whenUsingNewInstance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PersistenceAC

public PersistenceAC()
Method Detail

defineDataSource

public void defineDataSource(String sourceName,
                             String driver,
                             String url,
                             String user,
                             String password)
Define a data source name that will be later on used by the remaining configuration methods of this AC.

Parameters:
sourceName - the data source name
driver - the JDBC driver name (eg org.postgresql.Driver)
url - the JDBC URL (eg jdbc:postgresql://localhost/test)
password - the password to use

setStorageType

public void setStorageType(String classname)

initStorageIfNeeded

public void initStorageIfNeeded(String className,
                                String sourceName)
Initialize the persistence storage. If the storage already exists, do not reinitialize it.

Parameters:
className - the class name for which we want to create a storage
sourceName - the data source name

initStorage

public void initStorage(String className,
                        String sourceName)
Initialize the persistence storage. If the storage already exists, reinitialize it.

Parameters:
className - the class name for which we want to create a storage
sourceName - the data source name

registerPersistentRessource

public void registerPersistentRessource(String objectNameExpression,
                                        String sourceName)
All objects matching the objectNameExpression are made persistent to a SQL database represented by the data source. These objects are ressources that will potentially be used later on in transactions. Even if the objectNameExpression can be any regular expression, it is assumed to designate instances storable in existing storages (eventually call initStorageIfNeeded before).

Parameters:
objectNameExpression - the object name expression
sourceName - the source name

Contact JAC development team:
Renaud Pawlak
Lionel Seinturier
Laurent Martelli