Package com.opensymphony.workflow.config
Class DefaultConfiguration
java.lang.Object
com.opensymphony.workflow.config.DefaultConfiguration
- All Implemented Interfaces:
Configuration,Serializable
Default implementation for a configuration object.
This configuration object is passed to the
Workflow.setConfiguration(Configuration)
method. If the configuration is not initialized, the load(java.net.URL) method will be called by
the workflow. Alternatively, the caller can explicitly load the configuration by calling that method before
calling Workflow.setConfiguration(Configuration).
The loading behaviour comes into play when specifying a configuration remotely, for example in an EJB environment. It might be desirable to ensure that the configuration is loaded from within the EJB server, rather than in the calling client.
- Version:
- $Revision: 1.15 $
- Author:
- Hani Suleiman
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected InputStreamgetInputStream(URL url) Load the default configuration from the current context classloader.Get the fully qualified class name of the persistence store.Get the persistence args for the persistence store.Return the resolver to use for all variables specified in scriptsgetWorkflow(String name) Get the named workflow descriptor.String[]Get a list of all available workflow descriptor names.booleanbooleanisModifiable(String name) Check if a particular workflow can be modified or not.voidLoad the specified configuration file.booleanremoveWorkflow(String workflow) Remove the specified workflow.booleansaveWorkflow(String name, WorkflowDescriptor descriptor, boolean replace) voidsetPersistence(String persistence)
-
Field Details
-
INSTANCE
-
-
Constructor Details
-
DefaultConfiguration
public DefaultConfiguration()
-
-
Method Details
-
isInitialized
public boolean isInitialized()- Specified by:
isInitializedin interfaceConfiguration- Returns:
- true if this factory has been initialised.
If the factory is not initialised, then
Configuration.load(java.net.URL)will be called.
-
isModifiable
Description copied from interface:ConfigurationCheck if a particular workflow can be modified or not.- Specified by:
isModifiablein interfaceConfiguration- Parameters:
name- The workflow name.- Returns:
- true if the workflow can be modified, false otherwise.
-
setPersistence
-
getPersistence
Description copied from interface:ConfigurationGet the fully qualified class name of the persistence store.- Specified by:
getPersistencein interfaceConfiguration
-
getPersistenceArgs
Description copied from interface:ConfigurationGet 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:
getPersistenceArgsin interfaceConfiguration
-
getVariableResolver
Description copied from interface:ConfigurationReturn the resolver to use for all variables specified in scripts- Specified by:
getVariableResolverin interfaceConfiguration
-
getWorkflow
Description copied from interface:ConfigurationGet the named workflow descriptor.- Specified by:
getWorkflowin interfaceConfiguration- Parameters:
name- the workflow name- Throws:
FactoryException- if there was an error looking up the descriptor or if it could not be found.
-
getWorkflowNames
Description copied from interface:ConfigurationGet a list of all available workflow descriptor names.- Specified by:
getWorkflowNamesin interfaceConfiguration- Throws:
FactoryException- if the underlying factory does not support this method or if there was an error looking up workflow names.
-
getWorkflowStore
- Specified by:
getWorkflowStorein interfaceConfiguration- Throws:
StoreException
-
load
Description copied from interface:ConfigurationLoad the specified configuration file.- Specified by:
loadin interfaceConfiguration- Parameters:
url- url to the configuration file.- Throws:
FactoryException
-
removeWorkflow
Description copied from interface:ConfigurationRemove the specified workflow.- Specified by:
removeWorkflowin interfaceConfiguration- 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:
saveWorkflowin interfaceConfiguration- Throws:
FactoryException
-
getInputStream
Load the default configuration from the current context classloader. The search order is:- Specified URL
- osworkflow.xml
- /osworkflow.xml
- META-INF/osworkflow.xml
- /META-INF/osworkflow.xml
-