KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > mq > il > rmi > RMIServerIL


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.il.rmi;
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.TransactionRequest;
37 import org.jboss.mq.il.Invoker;
38 import org.jboss.mq.il.ServerIL;
39
40 /**
41  * The JVM implementation of the ServerIL object
42  *
43  * @author Hiram Chirino (Cojonudo14@hotmail.com)
44  * @author Norbert Lataille (Norbert.Lataille@m4x.org)
45  * @author <a HREF="pra@tim.se">Peter Antman</a>
46  * @version $Revision: 37459 $
47  * @created August 16, 2001
48  */

49 public class RMIServerIL extends java.rmi.server.UnicastRemoteObject JavaDoc implements RMIServerILRemote
50 {
51
52    /** The serialVersionUID */
53    private static final long serialVersionUID = -7793119336262492395L;
54    
55    //The server implementation
56
private transient Invoker server;
57
58    /**
59     * Constructor for the RMIServerIL object
60     *
61     * @param s Description of Parameter
62     * @exception java.rmi.RemoteException Description of Exception
63     */

64    public RMIServerIL(Invoker s)
65           throws java.rmi.RemoteException JavaDoc
66    {
67       server = s;
68    }
69
70    /**
71     * Sets the ConnectionToken attribute of the RMIServerIL object
72     *
73     * @param newConnectionToken The new ConnectionToken value
74     */

75    public void setConnectionToken(ConnectionToken newConnectionToken)
76    {
77       // We cannot try to cache the token since this IL is stateless
78
}
79
80    /**
81     * Sets the Enabled attribute of the RMIServerIL object
82     *
83     * @param dc The new Enabled value
84     * @param enabled The new Enabled value
85     * @exception Exception Description of Exception
86     */

87    public void setEnabled(ConnectionToken dc, boolean enabled)
88           throws Exception JavaDoc
89    {
90       server.setEnabled(dc, enabled);
91    }
92
93    /**
94     * Gets the ID attribute of the RMIServerIL object
95     *
96     * @return The ID value
97     * @exception JMSException Description of Exception
98     */

99    public String JavaDoc getID()
100           throws JMSException JavaDoc
101    {
102       return server.getID();
103    }
104
105    /**
106     * Gets the TemporaryQueue attribute of the RMIServerIL object
107     *
108     * @param dc Description of Parameter
109     * @return The TemporaryQueue value
110     * @exception JMSException Description of Exception
111     */

112    public TemporaryQueue JavaDoc getTemporaryQueue(ConnectionToken dc)
113           throws JMSException JavaDoc
114    {
115       return server.getTemporaryQueue(dc);
116    }
117
118    /**
119     * Gets the TemporaryTopic attribute of the RMIServerIL object
120     *
121     * @param dc Description of Parameter
122     * @return The TemporaryTopic value
123     * @exception JMSException Description of Exception
124     */

125    public TemporaryTopic JavaDoc getTemporaryTopic(ConnectionToken dc)
126           throws JMSException JavaDoc
127    {
128       return server.getTemporaryTopic(dc);
129    }
130
131    /**
132     * No need to clone because there are no instance variables tha can get
133     * clobbered. All Multiple connections can share the same JVMServerIL object
134     *
135     * @return Description of the Returned Value
136     */

137    public ServerIL cloneServerIL()
138    {
139       return this;
140    }
141
142    /**
143     * Adds a feature to the Message attribute of the RMIServerIL object
144     *
145     * @param dc The feature to be added to the Message attribute
146     * @param val The feature to be added to the Message attribute
147     * @exception JMSException Description of Exception
148     */

149    public void addMessage(ConnectionToken dc, SpyMessage val)
150           throws JMSException JavaDoc
151    {
152       server.addMessage(dc, val);
153    }
154
155    /**
156     * #Description of the Method
157     *
158     * @param dc Description of Parameter
159     * @param dest Description of Parameter
160     * @return Description of the Returned Value
161     * @exception JMSException Description of Exception
162     */

163    public Topic JavaDoc createTopic(ConnectionToken dc, String JavaDoc dest)
164           throws JMSException JavaDoc
165    {
166       return server.createTopic(dc, dest);
167    }
168
169    /**
170     * #Description of the Method
171     *
172     * @param dc Description of Parameter
173     * @param dest Description of Parameter
174     * @return Description of the Returned Value
175     * @exception JMSException Description of Exception
176     */

177    public Queue JavaDoc createQueue(ConnectionToken dc, String JavaDoc dest)
178           throws JMSException JavaDoc
179    {
180       return server.createQueue(dc, dest);
181    }
182
183    /**
184     * #Description of the Method
185     *
186     * @param dc Description of Parameter
187     * @param dest Description of Parameter
188     * @exception JMSException Description of Exception
189     */

190    public void deleteTemporaryDestination(ConnectionToken dc, SpyDestination dest)
191           throws JMSException JavaDoc
192    {
193       server.deleteTemporaryDestination(dc, dest);
194    }
195
196    /**
197     * #Description of the Method
198     *
199     * @param ID Description of Parameter
200     * @exception JMSException Description of Exception
201     */

202    public void checkID(String JavaDoc ID)
203           throws JMSException JavaDoc
204    {
205       server.checkID(ID);
206    }
207
208    /**
209     * #Description of the Method
210     *
211     * @param dc Description of Parameter
212     * @exception JMSException Description of Exception
213     */

214    public void connectionClosing(ConnectionToken dc)
215           throws JMSException JavaDoc
216    {
217       server.connectionClosing(dc);
218    }
219
220    /**
221     * #Description of the Method
222     *
223     * @param dc Description of Parameter
224     * @param item Description of Parameter
225     * @exception Exception Description of Exception
226     * @exception java.rmi.RemoteException Description of Exception
227     */

228    public void acknowledge(ConnectionToken dc, AcknowledgementRequest item)
229           throws Exception JavaDoc, java.rmi.RemoteException JavaDoc
230    {
231       server.acknowledge(dc, item);
232    }
233
234    /**
235     * #Description of the Method
236     *
237     * @param dc Description of Parameter
238     * @param dest Description of Parameter
239     * @param selector Description of Parameter
240     * @return Description of the Returned Value
241     * @exception Exception Description of Exception
242     */

243    public SpyMessage[] browse(ConnectionToken dc, Destination JavaDoc dest, String JavaDoc selector)
244           throws Exception JavaDoc
245    {
246       return server.browse(dc, dest, selector);
247    }
248
249    /**
250     * #Description of the Method
251     *
252     * @param dc Description of Parameter
253     * @param subscriberId Description of Parameter
254     * @param wait Description of Parameter
255     * @return Description of the Returned Value
256     * @exception Exception Description of Exception
257     */

258    public SpyMessage receive(ConnectionToken dc, int subscriberId, long wait)
259           throws Exception JavaDoc
260    {
261       return server.receive(dc, subscriberId, wait);
262    }
263
264    /**
265     * #Description of the Method
266     *
267     * @param dc Description of Parameter
268     * @param subscriptionId Description of Parameter
269     * @exception Exception Description of Exception
270     */

271    public void unsubscribe(ConnectionToken dc, int subscriptionId)
272           throws Exception JavaDoc
273    {
274       server.unsubscribe(dc, subscriptionId);
275    }
276
277    /**
278     * #Description of the Method
279     *
280     * @param id Description of Parameter
281     * @exception Exception Description of Exception
282     */

283    public void destroySubscription(ConnectionToken dc,DurableSubscriptionID id)
284           throws Exception JavaDoc
285    {
286       server.destroySubscription(dc,id);
287    }
288
289    /**
290     * #Description of the Method
291     *
292     * @param userName Description of Parameter
293     * @param password Description of Parameter
294     * @return Description of the Returned Value
295     * @exception JMSException Description of Exception
296     */

297    public String JavaDoc checkUser(String JavaDoc userName, String JavaDoc password)
298           throws JMSException JavaDoc
299    {
300       return server.checkUser(userName, password);
301    }
302
303    public String JavaDoc authenticate(String JavaDoc userName, String JavaDoc password)
304       throws JMSException JavaDoc
305    {
306       return server.authenticate(userName, password);
307    }
308    /**
309     * #Description of the Method
310     *
311     * @param dc Description of Parameter
312     * @param s Description of Parameter
313     * @exception Exception Description of Exception
314     */

315    public void subscribe(ConnectionToken dc, org.jboss.mq.Subscription s)
316           throws Exception JavaDoc
317    {
318       server.subscribe(dc, s);
319    }
320
321    /**
322     * #Description of the Method
323     *
324     * @param dc Description of Parameter
325     * @param t Description of Parameter
326     * @exception JMSException Description of Exception
327     */

328    public void transact(org.jboss.mq.ConnectionToken dc, TransactionRequest t)
329           throws JMSException JavaDoc
330    {
331       server.transact(dc, t);
332    }
333
334    /**
335     * #Description of the Method
336     *
337     * @param dc Description of Parameter
338     * @param clientTime Description of Parameter
339     * @exception JMSException Description of Exception
340     */

341    public void ping(org.jboss.mq.ConnectionToken dc, long clientTime)
342           throws JMSException JavaDoc
343    {
344       server.ping(dc, clientTime);
345    }
346 }
347
348
349
350
351
Popular Tags