KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > ubermq > jms > server > admin > RemoteConnectionAdminProxy


1 package com.ubermq.jms.server.admin;
2
3 import java.rmi.*;
4 import java.rmi.server.*;
5
6 /**
7  * Creates a remote administrative proxy for
8  * a connection administration interface that
9  * delegates incoming remote requests to a local
10  * implementation of the <code>ConnectionAdmin</code>
11  * interface.
12  */

13 public class RemoteConnectionAdminProxy
14     extends UnicastRemoteObject
15     implements ConnectionAdmin
16 {
17     private ConnectionAdmin delegate;
18
19     public RemoteConnectionAdminProxy(ConnectionAdmin a)
20         throws RemoteException
21     {
22         super();
23         this.delegate = a;
24     }
25
26     public boolean equals(Object JavaDoc o)
27     {
28         return delegate.equals(o);
29     }
30
31     /**
32      * Forcibly closes the connection. This can be useful if the connection
33      * is unresponsive.
34      */

35     public void close() throws RemoteException
36     {
37         delegate.close();
38     }
39
40     /**
41      * Resumes delivery of messages to the connection.
42      */

43     public void start() throws RemoteException
44     {
45         delegate.start();
46     }
47
48     /**
49      * Determines the current subscriptions registered for this
50      * connection. Each subscription is represented by a
51      * String object.
52      *
53      * @return a Collection of String objects representing
54      * subscriptions.
55      */

56     public java.util.Collection JavaDoc getSubscriptions() throws RemoteException
57     {
58         return delegate.getSubscriptions();
59     }
60
61     /**
62      * Describes the connection. For TCP connections, for instance, this should
63      * indicate the foreign host. Other connections may describe
64      * themselves in other ways.
65      * @return a name describing the connection
66      */

67     public String JavaDoc getName() throws RemoteException
68     {
69         return delegate.getName();
70     }
71
72     /**
73      * Stops delivery to the connection. This keeps resources open, and message
74      * delivery can be restarted using the <code>start</code> method.
75      */

76     public void stop() throws RemoteException
77     {
78         delegate.stop();
79     }
80
81     /**
82      * Indicates whether the connection is active. A connection
83      * is active unless it has been stopped using the <code>stop</code>
84      * method. Closed connections are not available administratively.
85      *
86      * @return true if the connection is active, false otherwise.
87      */

88     public boolean isActive() throws RemoteException
89     {
90         return delegate.isActive();
91     }
92
93
94 }
95
Popular Tags