01: package org.enhydra.shark.ejb;
02:
03: import java.util.HashMap;
04: import java.util.Map;
05:
06: import org.enhydra.shark.api.client.wfmodel.InvalidPerformer;
07: import org.enhydra.shark.api.client.wfmodel.WfRequester;
08:
09: /**
10: * WfRequesterImpl - Workflow Requester implementation
11: */
12: public class WfLinkingRequesterForSS implements WfRequester {
13:
14: static Map requesters = new HashMap();
15:
16: static boolean ignoreProblematicRequester = true;
17:
18: public WfLinkingRequesterForSS() {
19: }
20:
21: public static synchronized void setIgnoreProblematicRequesterProcess(
22: boolean ignore) {
23: ignoreProblematicRequester = ignore;
24: }
25:
26: public static synchronized void setRequester(String procId,
27: WfRequesterSS myRequester) {
28: requesters.put(procId, myRequester);
29: }
30:
31: public static synchronized void removeRequester(String procId) {
32: requesters.remove(procId);
33: }
34:
35: public static WfRequesterSS getRequester(String procId) {
36: return (WfRequesterSS) requesters.get(procId);
37: }
38:
39: /**
40: * Gets the number of processes.
41: */
42: public int how_many_performer() throws Exception {
43: throw new org.enhydra.shark.api.client.wfbase.BaseException();
44: }
45:
46: /**
47: * Gets an iterator of processes.
48: */
49: public org.enhydra.shark.api.client.wfmodel.WfProcessIterator get_iterator_performer()
50: throws Exception {
51: throw new org.enhydra.shark.api.client.wfbase.BaseException();
52: }
53:
54: /**
55: * A list of processes
56: *
57: * @return List of WfProcess objects.
58: */
59: public org.enhydra.shark.api.client.wfmodel.WfProcess[] get_sequence_performer(
60: int max_number) throws Exception {
61: throw new org.enhydra.shark.api.client.wfbase.BaseException();
62: }
63:
64: /**
65: * Checks if a WfProcess is associated with this requester object
66: *
67: * @return true if the process is found.
68: */
69: public boolean is_member_of_performer(
70: org.enhydra.shark.api.client.wfmodel.WfProcess member)
71: throws Exception {
72: throw new org.enhydra.shark.api.client.wfbase.BaseException();
73: }
74:
75: public void receive_event(
76: org.enhydra.shark.api.client.wfmodel.WfEventAudit event)
77: throws Exception, InvalidPerformer {
78: try {
79: WfRequesterSS req = getRequester(event.process_key());
80: if (req != null) {
81: req.receive_event(SharkEJBUtilities
82: .makeSSEventAudit(event));
83: } else {
84: }
85: } catch (Throwable ex) {
86: }
87: }
88: }
|