KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > mq > server > JMSServerInterceptor


1 /*
2 * JBoss, Home of Professional Open Source
3 * Copyright 2005, JBoss Inc., and individual contributors as indicated
4 * by the @authors tag. See the copyright.txt in the distribution for a
5 * full listing of individual contributors.
6 *
7 * This is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU Lesser General Public License as
9 * published by the Free Software Foundation; either version 2.1 of
10 * the License, or (at your option) any later version.
11 *
12 * This software is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this software; if not, write to the Free
19 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
21 */

22 package org.jboss.mq.server;
23
24 import javax.jms.Destination JavaDoc;
25 import javax.jms.JMSException JavaDoc;
26 import javax.jms.Queue JavaDoc;
27 import javax.jms.TemporaryQueue JavaDoc;
28 import javax.jms.TemporaryTopic JavaDoc;
29 import javax.jms.Topic JavaDoc;
30
31 import org.jboss.mq.AcknowledgementRequest;
32 import org.jboss.mq.ConnectionToken;
33 import org.jboss.mq.DurableSubscriptionID;
34 import org.jboss.mq.SpyDestination;
35 import org.jboss.mq.SpyMessage;
36 import org.jboss.mq.SpyTopic;
37 import org.jboss.mq.Subscription;
38 import org.jboss.mq.TransactionRequest;
39
40 /**
41  * Interceptor interface for clients IL accessing the JMSServer.
42  *
43  * Using an iterface for this layer makes it possible to put in logic
44  * without having to modify the server objet. And also makes this
45  * pluggable.
46  *
47  *
48  * @author <a HREF="mailto:pra@tim.se">Peter Antman</a>
49  * @version $Revision: 45306 $
50  */

51
52 public interface JMSServerInterceptor
53 {
54
55    /**
56     * Set next Interceptor in chain to be called. Is mot often the real JMSServer
57     */

58    public void setNext(JMSServerInterceptor server);
59
60    /**
61     * Get next invoker in chain to be called. Is mot often the real JMSServer
62     */

63    public JMSServerInterceptor getNext();
64
65    /**
66     * Get the thread group of the server.
67     */

68    public ThreadGroup JavaDoc getThreadGroup();
69
70    /**
71     * Gets a clientID from server.
72     *
73     * @return The ID value
74     * @exception JMSException Description of Exception
75     */

76    public String JavaDoc getID() throws JMSException JavaDoc;
77
78    /**
79     * Get a temporary topic.
80     *
81     * @param dc Description of Parameter
82     * @return The TemporaryTopic value
83     * @exception JMSException Description of Exception
84     */

85    public TemporaryTopic JavaDoc getTemporaryTopic(ConnectionToken dc) throws JMSException JavaDoc;
86
87    /**
88     * Get a temporary queue
89     *
90     * @param dc Description of Parameter
91     * @return The TemporaryQueue value
92     * @exception JMSException Description of Exception
93     */

94    public TemporaryQueue JavaDoc getTemporaryQueue(ConnectionToken dc) throws JMSException JavaDoc;
95
96    /**
97     * Close connection.
98     *
99     * @param dc Description of Parameter
100     * @exception JMSException Description of Exception
101     */

102    public void connectionClosing(ConnectionToken dc) throws JMSException JavaDoc;
103
104    /**
105     * Check id, must not be taken.
106     *
107     * @param ID Description of Parameter
108     * @exception JMSException Description of Exception
109     */

110    public void checkID(String JavaDoc ID) throws JMSException JavaDoc;
111
112    /**
113     * Add the message to the destination.
114     *
115     * @param dc The feature to be added to the Message attribute
116     * @param message The feature to be added to the Message attribute
117     * @exception JMSException Description of Exception
118     */

119    public void addMessage(ConnectionToken dc, SpyMessage message) throws JMSException JavaDoc;
120
121    /**
122     * Create a queue.
123     *
124     * The destination name must be the name of an already existing
125     * destination. This method should only be used to skip looking
126     * up a destination through JNDI, not to actually create a new destination.
127     *
128     * @param dc Description of Parameter
129     * @param dest Description of Parameter
130     * @return Description of the Returned Value
131     * @exception JMSException Description of Exception
132     */

133    public Queue JavaDoc createQueue(ConnectionToken dc, String JavaDoc dest) throws JMSException JavaDoc;
134
135    /**
136     * Create a topic.
137     *
138     * The destination name must be the name of an already existing
139     * destination. This method should only be used to skip looking
140     * up a destination through JNDI, not to actually create a new destination.
141     *
142     * @param dc Description of Parameter
143     * @param dest Description of Parameter
144     * @return Description of the Returned Value
145     * @exception JMSException Description of Exception
146     */

147    public Topic JavaDoc createTopic(ConnectionToken dc, String JavaDoc dest) throws JMSException JavaDoc;
148
149    /**
150     * #Description of the Method
151     *
152     * @param dc Description of Parameter
153     * @param dest Description of Parameter
154     * @exception JMSException Description of Exception
155     */

156    public void deleteTemporaryDestination(ConnectionToken dc, SpyDestination dest) throws JMSException JavaDoc;
157
158    /**
159     * #Description of the Method
160     *
161     * @param dc Description of Parameter
162     * @param t Description of Parameter
163     * @exception JMSException Description of Exception
164     */

165    public void transact(ConnectionToken dc, TransactionRequest t) throws JMSException JavaDoc;
166
167    /**
168     * #Description of the Method
169     *
170     * @param dc Description of Parameter
171     * @param item Description of Parameter
172     * @exception JMSException Description of Exception
173     */

174    public void acknowledge(ConnectionToken dc, AcknowledgementRequest item) throws JMSException JavaDoc;
175
176    /**
177     * #Description of the Method
178     *
179     * @param dc Description of Parameter
180     * @param dest Description of Parameter
181     * @param selector Description of Parameter
182     * @return Description of the Returned Value
183     * @exception JMSException Description of Exception
184     */

185    public SpyMessage[] browse(ConnectionToken dc, Destination JavaDoc dest, String JavaDoc selector) throws JMSException JavaDoc;
186
187    /**
188     * #Description of the Method
189     *
190     * @param dc Description of Parameter
191     * @param subscriberId Description of Parameter
192     * @param wait Description of Parameter
193     * @return Description of the Returned Value
194     * @exception JMSException Description of Exception
195     */

196    public SpyMessage receive(ConnectionToken dc, int subscriberId, long wait) throws JMSException JavaDoc;
197
198    /**
199     * Sets the Enabled attribute of the ServerIL object
200     *
201     * @param dc The new Enabled value
202     * @param enabled The new Enabled value
203     * @exception JMSException Description of Exception
204     */

205    public void setEnabled(ConnectionToken dc, boolean enabled) throws JMSException JavaDoc;
206
207    /**
208     * Close the server side message consumer. Client is no longer
209     * available to receive messages.
210     *
211     * @param dc Description of Parameter
212     * @param subscriptionId Description of Parameter
213     * @exception JMSException Description of Exception
214     */

215    public void unsubscribe(ConnectionToken dc, int subscriptionId) throws JMSException JavaDoc;
216
217    /**
218     * Unsubscribe from the durable subscription.
219     *
220     * @param id Description of Parameter
221     * @exception JMSException Description of Exception
222     */

223    public void destroySubscription(ConnectionToken dc, DurableSubscriptionID id) throws JMSException JavaDoc;
224
225    /**
226     * Check user for autentication.
227     *
228     * @param userName Description of Parameter
229     * @param password Description of Parameter
230     * @return a preconfigured clientId.
231     * @exception JMSException if user was not allowed to login
232     */

233    public String JavaDoc checkUser(String JavaDoc userName, String JavaDoc password) throws JMSException JavaDoc;
234
235    /**
236     * Check user for autentication.
237     *
238     * @param userName Description of Parameter
239     * @param password Description of Parameter
240     * @return a sessionId.
241     * @exception JMSException if user was not allowed to login
242     */

243    public String JavaDoc authenticate(String JavaDoc userName, String JavaDoc password) throws JMSException JavaDoc;
244
245    /**
246     * @param dc org.jboss.mq.ConnectionToken
247     * @param s org.jboss.mq.Subscription
248     * @exception JMSException The exception description.
249     */

250    void subscribe(org.jboss.mq.ConnectionToken dc, org.jboss.mq.Subscription s) throws JMSException JavaDoc;
251
252    /**
253     * Ping the server.
254     *
255     * @param dc Description of Parameter
256     * @param clientTime Description of Parameter
257     * @exception JMSException Description of Exception
258     */

259    public void ping(ConnectionToken dc, long clientTime) throws JMSException JavaDoc;
260
261    /**
262     * Get the topic the durable subscription is on.
263     * Primary for internal use in the server, and not for the IL's.
264     */

265    public SpyTopic getDurableTopic(DurableSubscriptionID sub) throws JMSException JavaDoc;
266
267    /**
268     * Get the subscription that match the id.
269     *
270     * @exception JMSException if it can not find the subscription.
271     */

272    public Subscription getSubscription(ConnectionToken dc, int subscriberId) throws JMSException JavaDoc;
273 }
274
Popular Tags