01: package org.concern.controller.spring;
02:
03: import org.concern.*;
04: import org.springframework.beans.factory.FactoryBean;
05:
06: import java.util.*;
07:
08: public class LocalControllerLookup extends ControllerLookup implements
09: FactoryBean {
10: private Map controllers = new HashMap();
11: private Worklist worklist;
12: private Collaboration collaboration;
13:
14: public LocalControllerLookup() {
15: }
16:
17: public Object getObject() throws Exception {
18: System.setProperty("concern.controller.lookup",
19: LocalControllerLookup.class.getName());
20: return getInstance();
21: }
22:
23: public Class getObjectType() {
24: return ControllerLookup.class;
25: }
26:
27: public boolean isSingleton() {
28: return true;
29: }
30:
31: public void add(Controller controller) {
32: controllers.put(controller.getProcessName(), controller);
33: }
34:
35: public void remove(String processName) {
36: controllers.remove(processName);
37: }
38:
39: public Controller getController(String processName) {
40: return (Controller) controllers.get(processName);
41: }
42:
43: public String[] getControllerNames() {
44: List names = new ArrayList(controllers.size());
45: for (Iterator iterator = controllers.keySet().iterator(); iterator
46: .hasNext();) {
47: String name = (String) iterator.next();
48: names.add(name);
49: }
50: return (String[]) names.toArray(new String[names.size()]);
51: }
52:
53: public Worklist getWorklist() {
54: return worklist;
55: }
56:
57: public void setWorklist(Worklist worklist) {
58: this .worklist = worklist;
59: }
60:
61: public Collaboration getCollaboration() {
62: return collaboration;
63: }
64:
65: public void setCollaboration(Collaboration collaboration) {
66: this.collaboration = collaboration;
67: }
68: }
|