01: package org.concern;
02:
03: import org.apache.commons.logging.LogFactory;
04:
05: public abstract class ControllerLookup {
06: private static org.apache.commons.logging.Log LOG = LogFactory
07: .getLog(ControllerLookup.class);
08: protected static ControllerLookup instance;
09:
10: protected ControllerLookup() {
11: LOG.info("controller lookup: " + getClass().getName());
12: }
13:
14: public static final ControllerLookup getInstance() {
15: if (instance == null) {
16: String className = System
17: .getProperty("concern.controller.lookup");
18: try {
19: Class clazz = ControllerLookup.class.getClassLoader()
20: .loadClass(className);
21: instance = (ControllerLookup) clazz.newInstance();
22: } catch (Exception e) {
23: throw new ControllerException(e);
24: }
25: }
26: return instance;
27: }
28:
29: protected static void setInstance(ControllerLookup controllerLookup) {
30: instance = controllerLookup;
31: }
32:
33: public abstract Controller getController(String processName);
34:
35: public abstract String[] getControllerNames();
36:
37: public abstract Worklist getWorklist();
38:
39: public abstract Collaboration getCollaboration();
40: }
|