org.demac.process.base.persistence
Class ProcessPersistenceService

java.lang.Object
  extended by org.demac.process.base.persistence.ProcessPersistenceService
Direct Known Subclasses:
ProcessPersistenceServiceImpl

public abstract class ProcessPersistenceService
extends java.lang.Object

The ProcessPersistenceService loads a process and it's extensional data from the persistence storage only once. This is needed, because there can be concurrent actions an the same process. If two Threads would both load the process data direct from the storage, they would overwrite the changes of the other Thread.


Constructor Summary
ProcessPersistenceService()
           
 
Method Summary
abstract  AmplifiedPackage getProcess(int id)
          Gets an AmplifiedPackage of the process.
static ProcessPersistenceService getProcessPersistenceService()
           
abstract  void updateProcess(AmplifiedPackage ap)
          Saves the state of the process in the persistence storage
abstract  void updateProcess(DataSet ds, Package pack)
          Saves the state of the process in the persistence storage, but leaves the data-extensions untouched
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProcessPersistenceService

public ProcessPersistenceService()
Method Detail

getProcessPersistenceService

public static ProcessPersistenceService getProcessPersistenceService()
Returns:
null if the service has not been started yet

getProcess

public abstract AmplifiedPackage getProcess(int id)
                                     throws ParserException
Gets an AmplifiedPackage of the process. If it is already in the memory, that instance is returned. Otherwhise, a new instance is created from the storage.

Parameters:
id - storage id in the persistence storage
Throws:
ParserException

updateProcess

public abstract void updateProcess(AmplifiedPackage ap)
                            throws StorageException
Saves the state of the process in the persistence storage

Parameters:
ap - Process
Throws:
StorageException

updateProcess

public abstract void updateProcess(DataSet ds,
                                   Package pack)
                            throws StorageException
Saves the state of the process in the persistence storage, but leaves the data-extensions untouched

Parameters:
ds - DataSet, where the process is stored
pack - Process
Throws:
StorageException