KickJava   Java API By Example, From Geeks To Geeks.

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


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.AbstractWorkflowFactory;
10 import com.opensymphony.workflow.loader.WorkflowDescriptor;
11 import com.opensymphony.workflow.spi.WorkflowStore;
12
13 import java.net.URL JavaDoc;
14
15 import java.util.Map JavaDoc;
16
17
18 /**
19  * @author Quake Wang
20  * @since 2004-5-2
21  * @version $Revision: 1.1 $
22  *
23  **/

24 public class SpringConfiguration implements Configuration {
25     //~ Instance fields ////////////////////////////////////////////////////////
26

27     private AbstractWorkflowFactory factory;
28     private WorkflowStore store;
29
30     //~ Methods ////////////////////////////////////////////////////////////////
31

32     public void setFactory(AbstractWorkflowFactory factory) {
33         this.factory = factory;
34     }
35
36     /* (non-Javadoc)
37      * @see com.opensymphony.workflow.config.Configuration#isInitialized()
38      */

39     public boolean isInitialized() {
40         // TODO Auto-generated method stub
41
return false;
42     }
43
44     /* (non-Javadoc)
45      * @see com.opensymphony.workflow.config.Configuration#getPersistence()
46      */

47     public String JavaDoc getPersistence() {
48         // TODO Auto-generated method stub
49
return null;
50     }
51
52     /* (non-Javadoc)
53      * @see com.opensymphony.workflow.config.Configuration#getPersistenceArgs()
54      */

55     public Map JavaDoc getPersistenceArgs() {
56         // TODO Auto-generated method stub
57
return null;
58     }
59
60     public void setStore(WorkflowStore store) {
61         this.store = store;
62     }
63
64     public WorkflowDescriptor getWorkflow(String JavaDoc name) throws FactoryException {
65         WorkflowDescriptor workflow = factory.getWorkflow(name);
66
67         if (workflow == null) {
68             throw new FactoryException("Unknown workflow name");
69         }
70
71         return workflow;
72     }
73
74     public String JavaDoc[] getWorkflowNames() throws FactoryException {
75         return factory.getWorkflowNames();
76     }
77
78     public WorkflowStore getWorkflowStore() throws StoreException {
79         return store;
80     }
81
82     /* (non-Javadoc)
83      * @see com.opensymphony.workflow.config.Configuration#load(java.net.URL)
84      */

85     public void load(URL JavaDoc url) throws FactoryException {
86         // TODO Auto-generated method stub
87
}
88
89     public boolean removeWorkflow(String JavaDoc workflow) throws FactoryException {
90         return factory.removeWorkflow(workflow);
91     }
92
93     public boolean saveWorkflow(String JavaDoc name, WorkflowDescriptor descriptor, boolean replace) throws FactoryException {
94         return factory.saveWorkflow(name, descriptor, replace);
95     }
96 }
97
Popular Tags