KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > opensymphony > workflow > config > Configuration


1 /*
2  * Copyright (c) 2002-2003 by OpenSymphony
3  * All rights reserved.
4  */

5 package com.opensymphony.workflow.config;
6
7 import com.opensymphony.workflow.FactoryException;
8 import com.opensymphony.workflow.StoreException;
9 import com.opensymphony.workflow.loader.WorkflowDescriptor;
10 import com.opensymphony.workflow.spi.WorkflowStore;
11
12 import java.net.URL JavaDoc;
13
14 import java.util.Map JavaDoc;
15
16
17 /**
18  * Configuration object that is responsible for all 'static' workflow information.
19  * This includes loading of workflow configurations, setting up the workflow
20  * descriptor factory, as well as proxying calls to the underlying descriptor
21  * factory.
22  * Date: Mar 22, 2004
23  * Time: 3:42:19 PM
24  *
25  * @author hani
26  */

27 public interface Configuration {
28     //~ Methods ////////////////////////////////////////////////////////////////
29

30     /**
31      * @return true if this factory has been initialised.
32      * If the factory is not initialised, then {@link #load(java.net.URL)}
33      * will be called.
34      */

35     boolean isInitialized();
36
37     /**
38      * Get the fully qualified class name of the persistence store.
39      */

40     String JavaDoc getPersistence();
41
42     /**
43      * Get the persistence args for the persistence store.
44      * Note that this returns the actual args and not a copy,
45      * so modifications to the returned Map could potentially
46      * affect store behaviour.
47      */

48     Map JavaDoc getPersistenceArgs();
49
50     /**
51      * Get the named workflow descriptor.
52      * @param name the workflow name
53      * @throws FactoryException if there was an error looking up the descriptor or if it could not be found.
54      */

55     WorkflowDescriptor getWorkflow(String JavaDoc name) throws FactoryException;
56
57     /**
58      * Get a list of all available workflow descriptor names.
59      * @throws FactoryException if the underlying factory does not support this method
60      * or if there was an error looking up workflow names.
61      */

62     String JavaDoc[] getWorkflowNames() throws FactoryException;
63
64     WorkflowStore getWorkflowStore() throws StoreException;
65
66     /**
67      * Load the specified configuration file.
68      * @param url url to the configuration file.
69      */

70     void load(URL JavaDoc url) throws FactoryException;
71
72     /**
73      * Remove the specified workflow.
74      * @param workflow The workflow name of the workflow to remove.
75      * @return true if the workflow was removed, false otherwise.
76      * @throws FactoryException If the underlying workflow factory has an error removing the workflow,
77      * or if it does not support the removal of workflows.
78      */

79     boolean removeWorkflow(String JavaDoc workflow) throws FactoryException;
80
81     boolean saveWorkflow(String JavaDoc name, WorkflowDescriptor descriptor, boolean replace) throws FactoryException;
82 }
83
Popular Tags