1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.apache.commons.messenger;
17
18 import java.io.Serializable;
19
20 import javax.jms.BytesMessage;
21 import javax.jms.Connection;
22 import javax.jms.ConnectionConsumer;
23 import javax.jms.Destination;
24 import javax.jms.JMSException;
25 import javax.jms.MapMessage;
26 import javax.jms.Message;
27 import javax.jms.MessageConsumer;
28 import javax.jms.MessageListener;
29 import javax.jms.ObjectMessage;
30 import javax.jms.QueueBrowser;
31 import javax.jms.ServerSessionPool;
32 import javax.jms.Session;
33 import javax.jms.StreamMessage;
34 import javax.jms.TextMessage;
35
36
37
38
39
40
41
42
43
44
45 public interface Messenger {
46
47
48 public String getName();
49
50
51 public Destination getDestination(String subject) throws JMSException;
52
53
54 public Destination createTemporaryDestination() throws JMSException;
55
56
57 public void send(Destination destination, Message message) throws JMSException;
58
59
60 public Message call(Destination destination, Message message)
61 throws JMSException;
62
63
64 public Message call(
65 Destination destination,
66 Message message,
67 long timeoutMillis)
68 throws JMSException;
69
70
71 public Message receive(Destination destination) throws JMSException;
72
73
74 public Message receive(Destination destination, String selector)
75 throws JMSException;
76
77
78 public Message receive(Destination destination, long timeoutMillis)
79 throws JMSException;
80
81
82 public Message receive(
83 Destination destination,
84 String selector,
85 long timeoutMillis)
86 throws JMSException;
87
88
89 public Message receiveNoWait(Destination destination) throws JMSException;
90
91
92 public Message receiveNoWait(Destination destination, String selector)
93 throws JMSException;
94
95
96
97 public MessageConsumer createConsumer(Destination destination)
98 throws JMSException;
99
100
101
102 public MessageConsumer createConsumer(Destination destination, String selector)
103 throws JMSException;
104
105
106
107
108
109 public QueueBrowser createBrowser(Destination destination) throws JMSException;
110
111
112
113
114
115 public void run();
116
117
118 public Connection getConnection() throws JMSException;
119
120
121
122
123
124 public Session getSession() throws JMSException;
125
126
127
128
129
130 public Session getAsyncSession() throws JMSException;
131
132
133
134
135 public ConnectionConsumer createConnectionConsumer(
136 Destination destination,
137 ServerSessionPool sessionPool,
138 int maxMessages)
139 throws JMSException;
140
141
142
143 public ConnectionConsumer createConnectionConsumer(
144 Destination destination,
145 String selector,
146 ServerSessionPool sessionPool,
147 int maxMessages)
148 throws JMSException;
149
150
151
152
153 public ServerSessionPool createServerSessionPool(
154 MessageListener messageListener,
155 int maxThreads)
156 throws JMSException;
157
158
159
160
161
162 public void addListener(Destination destination, MessageListener listener)
163 throws JMSException;
164
165 public void addListener(
166 Destination destination,
167 String selector,
168 MessageListener listener)
169 throws JMSException;
170
171 public void removeListener(Destination destination, MessageListener listener)
172 throws JMSException;
173
174 public void removeListener(
175 Destination destination,
176 String selector,
177 MessageListener listener)
178 throws JMSException;
179
180
181
182
183
184 public BytesMessage createBytesMessage() throws JMSException;
185
186 public MapMessage createMapMessage() throws JMSException;
187
188 public Message createMessage() throws JMSException;
189
190 public ObjectMessage createObjectMessage() throws JMSException;
191
192 public ObjectMessage createObjectMessage(Serializable object)
193 throws JMSException;
194
195 public StreamMessage createStreamMessage() throws JMSException;
196
197 public TextMessage createTextMessage() throws JMSException;
198
199 public TextMessage createTextMessage(String text) throws JMSException;
200
201
202
203
204
205 public void commit() throws JMSException;
206
207
208 public void rollback() throws JMSException;
209
210
211 public void close() throws JMSException;
212
213
214
215
216
217
218
219
220
221
222 public SessionFactory getSessionFactory() throws JMSException;
223
224
225 public int getDeliveryMode(Destination destination) throws JMSException;
226
227 public boolean getDisableMessageID(Destination destination)
228 throws JMSException;
229
230 public boolean getDisableMessageTimestamp(Destination destination)
231 throws JMSException;
232
233 public int getPriority(Destination destination) throws JMSException;
234
235 public long getTimeToLive(Destination destination) throws JMSException;
236
237 public void setDeliveryMode(Destination destination, int deliveryMode)
238 throws JMSException;
239
240 public void setDisableMessageID(Destination destination, boolean value)
241 throws JMSException;
242
243 public void setDisableMessageTimestamp(Destination destination, boolean value)
244 throws JMSException;
245
246 public void setPriority(Destination destination, int defaultPriority)
247 throws JMSException;
248
249 public void setTimeToLive(Destination destination, long timeToLive)
250 throws JMSException;
251 }