com.opensymphony.workflow.config
Class SpringConfiguration

java.lang.Object
  extended by com.opensymphony.workflow.config.SpringConfiguration
All Implemented Interfaces:
Configuration

public class SpringConfiguration
extends Object
implements Configuration

Since:
2004-5-2
Version:
$Revision: 1.4 $
Author:
Quake Wang

Constructor Summary
SpringConfiguration()
           
 
Method Summary
 String getPersistence()
          Get the fully qualified class name of the persistence store.
 Map getPersistenceArgs()
          Get the persistence args for the persistence store.
 VariableResolver getVariableResolver()
          Return the resolver to use for all variables specified in scripts
 WorkflowDescriptor getWorkflow(String name)
          Get the named workflow descriptor.
 String[] getWorkflowNames()
          Get a list of all available workflow descriptor names.
 WorkflowStore getWorkflowStore()
           
 boolean isInitialized()
           
 boolean isModifiable(String name)
          Check if a particular workflow can be modified or not.
 void load(URL url)
          Load the specified configuration file.
 boolean removeWorkflow(String workflow)
          Remove the specified workflow.
 boolean saveWorkflow(String name, WorkflowDescriptor descriptor, boolean replace)
           
 void setFactory(WorkflowFactory factory)
           
 void setStore(WorkflowStore store)
           
 void setVariableResolver(VariableResolver variableResolver)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SpringConfiguration

public SpringConfiguration()
Method Detail

setFactory

public void setFactory(WorkflowFactory factory)

isInitialized

public boolean isInitialized()
Specified by:
isInitialized in interface Configuration
Returns:
true if this factory has been initialised. If the factory is not initialised, then Configuration.load(java.net.URL) will be called.

isModifiable

public boolean isModifiable(String name)
Description copied from interface: Configuration
Check if a particular workflow can be modified or not.

Specified by:
isModifiable in interface Configuration
Parameters:
name - The workflow name.
Returns:
true if the workflow can be modified, false otherwise.

getPersistence

public String getPersistence()
Description copied from interface: Configuration
Get the fully qualified class name of the persistence store.

Specified by:
getPersistence in interface Configuration

getPersistenceArgs

public Map getPersistenceArgs()
Description copied from interface: Configuration
Get the persistence args for the persistence store. Note that this returns the actual args and not a copy, so modifications to the returned Map could potentially affect store behaviour.

Specified by:
getPersistenceArgs in interface Configuration

setStore

public void setStore(WorkflowStore store)

setVariableResolver

public void setVariableResolver(VariableResolver variableResolver)

getVariableResolver

public VariableResolver getVariableResolver()
Description copied from interface: Configuration
Return the resolver to use for all variables specified in scripts

Specified by:
getVariableResolver in interface Configuration

getWorkflow

public WorkflowDescriptor getWorkflow(String name)
                               throws FactoryException
Description copied from interface: Configuration
Get the named workflow descriptor.

Specified by:
getWorkflow in interface Configuration
Parameters:
name - the workflow name
Throws:
FactoryException - if there was an error looking up the descriptor or if it could not be found.

getWorkflowNames

public String[] getWorkflowNames()
                          throws FactoryException
Description copied from interface: Configuration
Get a list of all available workflow descriptor names.

Specified by:
getWorkflowNames in interface Configuration
Throws:
FactoryException - if the underlying factory does not support this method or if there was an error looking up workflow names.

getWorkflowStore

public WorkflowStore getWorkflowStore()
                               throws StoreException
Specified by:
getWorkflowStore in interface Configuration
Throws:
StoreException

load

public void load(URL url)
          throws FactoryException
Description copied from interface: Configuration
Load the specified configuration file.

Specified by:
load in interface Configuration
Parameters:
url - url to the configuration file.
Throws:
FactoryException

removeWorkflow

public boolean removeWorkflow(String workflow)
                       throws FactoryException
Description copied from interface: Configuration
Remove the specified workflow.

Specified by:
removeWorkflow in interface Configuration
Parameters:
workflow - The workflow name of the workflow to remove.
Returns:
true if the workflow was removed, false otherwise.
Throws:
FactoryException - If the underlying workflow factory has an error removing the workflow, or if it does not support the removal of workflows.

saveWorkflow

public boolean saveWorkflow(String name,
                            WorkflowDescriptor descriptor,
                            boolean replace)
                     throws FactoryException
Specified by:
saveWorkflow in interface Configuration
Throws:
FactoryException

OpenSymphony Workflow Project Page