1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.apache.commons.scxml.env;
18
19 import java.io.Serializable;
20 import java.util.List;
21 import java.util.Map;
22
23 import org.apache.commons.logging.Log;
24 import org.apache.commons.logging.LogFactory;
25 import org.apache.commons.scxml.EventDispatcher;
26
27 /***
28 * Trivial EventDispatcher implementation.
29 * No remote eventing.
30 *
31 */
32 public final class SimpleDispatcher implements EventDispatcher, Serializable {
33
34 /*** Serial version UID. */
35 private static final long serialVersionUID = 1L;
36 /*** Implementation independent log category. */
37 private Log log = LogFactory.getLog(EventDispatcher.class);
38
39 /***
40 * Constructor.
41 */
42 public SimpleDispatcher() {
43 super();
44 }
45
46 /***
47 * @see EventDispatcher#cancel(String)
48 */
49 public void cancel(final String sendId) {
50 if (log.isInfoEnabled()) {
51 log.info("cancel( sendId: " + sendId + ")");
52 }
53 }
54
55 /***
56 @see EventDispatcher#send(String,String,String,String,Map,Object,long,List)
57 */
58 public void send(final String sendId, final String target,
59 final String targetType, final String event, final Map params,
60 final Object hints, final long delay, final List externalNodes) {
61 if (log.isInfoEnabled()) {
62 StringBuffer buf = new StringBuffer();
63 buf.append("send ( sendId: ").append(sendId);
64 buf.append(", target: ").append(target);
65 buf.append(", targetType: ").append(targetType);
66 buf.append(", event: ").append(event);
67 buf.append(", params: ").append(String.valueOf(params));
68 buf.append(", hints: ").append(String.valueOf(hints));
69 buf.append(", delay: ").append(delay);
70 buf.append(')');
71 log.info(buf.toString());
72 }
73
74 }
75
76 }
77