1
2
3
4
5
6
7
8
9
10 package org.apache.commons.messagelet.model;
11
12 import org.apache.commons.digester.Digester;
13
14
15
16
17
18
19
20 public class SubscriptionDigester extends Digester {
21
22
23 private String subscriptionsClass = "org.apache.commons.messagelet.model.SubscriptionList";
24 private String subscriptionClass = "org.apache.commons.messagelet.model.Subscription";
25 private String listenerClass = "org.apache.commons.messagelet.impl.MessageServletDispatcher";
26 private String bridgeClass = "org.apache.commons.messagelet.BridgeMDO";
27 private String distributeBridgeClass = "org.apache.commons.messagelet.DistributeBridgeMDO";
28 private String stopWatchClass = "org.apache.commons.messenger.tool.StopWatchMessageListener";
29 private String consumerThreadClass = "org.apache.commons.messagelet.ConsumerThread";
30
31 public SubscriptionDigester() {
32 }
33
34
35
36
37
38
39
40 protected void configure() {
41 if (configured) {
42 return;
43 }
44 else {
45 configured = true;
46 }
47
48 String path = "subscriptions";
49
50 addObjectCreate( path, subscriptionsClass, "className" );
51 addSetProperties( path );
52
53 path = "subscriptions/subscription";
54 addObjectCreate( path, subscriptionClass, "className" );
55 addSetProperties( path );
56 addSetNext( path, "addSubscription",
57 "org.apache.commons.messagelet.model.Subscription"
58 );
59
60 addCallMethod( "subscriptions/subscription/servlet", "setServlet", 0);
61
62 path = "subscriptions/subscription/consumerThread";
63 addObjectCreate( path, consumerThreadClass, "className" );
64 addSetProperties( path );
65 addSetNext( path, "setConsumerThread",
66 consumerThreadClass
67 );
68
69 path = "subscriptions/subscription/listener";
70 addObjectCreate( path, listenerClass, "className" );
71 addSetProperties( path );
72 addSetNext( path, "setMessageListener",
73 "javax.jms.MessageListener"
74 );
75
76
77
78 path = "subscriptions/subscription/stopWatch";
79 addObjectCreate( path, stopWatchClass, "className" );
80 addSetProperties( path );
81 addSetNext( path, "setMessageListener",
82 "javax.jms.MessageListener"
83 );
84
85
86 path = "subscriptions/subscription/bridge";
87 addObjectCreate( path, bridgeClass, "className" );
88 addSetProperties( path );
89 addSetNext( path, "setMessageListener",
90 "javax.jms.MessageListener"
91 );
92
93 path = "subscriptions/subscription/distributeBridge";
94 addObjectCreate( path, distributeBridgeClass, "className" );
95 addSetProperties( path );
96 addSetNext( path, "setMessageListener",
97 "javax.jms.MessageListener"
98 );
99
100 addCallMethod("subscriptions/subscription/distributeBridge/subject", "addOutputSubject", 0);
101 }
102 }