shocks.framework.workflow.sequence.repository
Class CentralSequenceRepository

java.lang.Object
  extended byshocks.framework.workflow.sequence.repository.CentralSequenceRepository
All Implemented Interfaces:
CentralSequenceRepositoryMBean, SequenceRepository

public class CentralSequenceRepository
extends java.lang.Object
implements SequenceRepository, CentralSequenceRepositoryMBean


Constructor Summary
CentralSequenceRepository()
           
 
Method Summary
 void addWorkflow(Workflow sequence)
          The mechanism by which sequence components are added to the system.
 java.lang.String getVersion(DataSource metadata)
          Returns the current operating version of a workflow sequence.
 java.util.SortedSet getVersions(DataSource metadata)
          Returns a SortedSet of all the existing version strings in descending order.
 Workflow leaseWorkflow(DataSource metadata)
          Leases one instance of the appropriate sequence.
 void release(Workflow instance)
          Releases a leased workflow component back into the instance pool.
 void setCurrentVersion(DataSource metadata, java.lang.String version)
          This method will set the current operating version of a workflow sequence to a previous existing version.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CentralSequenceRepository

public CentralSequenceRepository()
Method Detail

leaseWorkflow

public Workflow leaseWorkflow(DataSource metadata)
Leases one instance of the appropriate sequence. The sequence released will default to the latest version entered into the system, unless the admin opts to override the version controls, in which case they can request a list of sequence versions currently in the system and choose a version to revert to. Unless this override is turned off, the system will load but not adopt the behavior of the new sequences. At this time it makes no sense to support any other type of call than an action call. The next item on the list will probably be display calls, but at this time all display pieces are pluggable through the workflow descriptor, so the matter is moot.

Specified by:
leaseWorkflow in interface SequenceRepository
Parameters:
metadata -
Returns:
Workflow representing the coming sequence of events

release

public void release(Workflow instance)
Description copied from interface: SequenceRepository

Releases a leased workflow component back into the instance pool. The method will sort the workflow component by name and version.

Specified by:
release in interface SequenceRepository
Parameters:
instance -

addWorkflow

public void addWorkflow(Workflow sequence)
The mechanism by which sequence components are added to the system. This method checks to see if a sequence exists with the same name as the incoming component. If there is one with the same name, the method will compare the versions of the existant and the incoming component. If the incoming component's version tag is equal to or lower than the highest version in the system, it will not load and an error will be logged. If the incoming version is higher, however, it will be loaded into the system and an instance pool will be created for it.

Specified by:
addWorkflow in interface SequenceRepository
Parameters:
sequence -

getVersion

public java.lang.String getVersion(DataSource metadata)
Description copied from interface: CentralSequenceRepositoryMBean

Returns the current operating version of a workflow sequence. Each workflow sequence is identified by a metadata component whose values amount to a composite key.

Specified by:
getVersion in interface CentralSequenceRepositoryMBean
Parameters:
metadata -
Returns:
String

setCurrentVersion

public void setCurrentVersion(DataSource metadata,
                              java.lang.String version)
Description copied from interface: CentralSequenceRepositoryMBean

This method will set the current operating version of a workflow sequence to a previous existing version. The string value entered must be one of the previous operating versions existing in the system.

Specified by:
setCurrentVersion in interface CentralSequenceRepositoryMBean
Parameters:
metadata -
version -

getVersions

public java.util.SortedSet getVersions(DataSource metadata)
Description copied from interface: CentralSequenceRepositoryMBean

Returns a SortedSet of all the existing version strings in descending order.

Specified by:
getVersions in interface CentralSequenceRepositoryMBean
Parameters:
metadata -
Returns:
SortedSet