KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > mq > server > jmx > Queue


1 /*
2  * JBoss, Home of Professional Open Source
3  * Copyright 2006, Red Hat Middleware LLC, and individual contributors
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.jmx;
23
24 import java.util.Hashtable JavaDoc;
25 import java.util.List JavaDoc;
26
27 import javax.management.MBeanRegistration JavaDoc;
28 import javax.management.MBeanServer JavaDoc;
29 import javax.management.NotificationFilter JavaDoc;
30 import javax.management.NotificationListener JavaDoc;
31 import javax.management.ObjectName JavaDoc;
32
33 import org.w3c.dom.Element JavaDoc;
34
35 /**
36  * Portability class that maps the mbean ops onto the
37  * org.jboss.jms.server.destination.Queue
38  *
39  * @author Scott.Stark@jboss.org
40  * @version $Revision:$
41  */

42 public class Queue
43    implements MBeanRegistration JavaDoc, QueueMBean
44 {
45    private org.jboss.jms.server.destination.Queue delegate;
46
47    public Queue()
48    {
49       delegate = new org.jboss.jms.server.destination.Queue();
50    }
51    public Queue(boolean createProgramatically)
52    {
53       delegate = new org.jboss.jms.server.destination.Queue(createProgramatically);
54    }
55
56    public void addNotificationListener(NotificationListener JavaDoc listener, NotificationFilter JavaDoc filter, Object JavaDoc handback)
57    {
58       delegate.addNotificationListener(listener, filter, handback);
59    }
60
61    /* (non-Javadoc)
62     * @see org.jboss.mq.server.jmx.QueueMBean#create()
63     */

64    public void create() throws Exception JavaDoc
65    {
66       delegate.create();
67    }
68
69    /* (non-Javadoc)
70     * @see org.jboss.mq.server.jmx.QueueMBean#destroy()
71     */

72    public void destroy()
73    {
74       delegate.destroy();
75    }
76
77    /* (non-Javadoc)
78     * @see org.jboss.mq.server.jmx.QueueMBean#getDownCacheSize()
79     */

80    public int getDownCacheSize()
81    {
82       return delegate.getDownCacheSize();
83    }
84
85    /* (non-Javadoc)
86     * @see org.jboss.mq.server.jmx.QueueMBean#getFullSize()
87     */

88    public int getFullSize()
89    {
90       return delegate.getFullSize();
91    }
92
93    /* (non-Javadoc)
94     * @see org.jboss.mq.server.jmx.QueueMBean#getJNDIName()
95     */

96    public String JavaDoc getJNDIName()
97    {
98       return delegate.getJNDIName();
99    }
100
101    /* (non-Javadoc)
102     * @see org.jboss.mq.server.jmx.QueueMBean#getMessageCount()
103     */

104    public int getMessageCount() throws Exception JavaDoc
105    {
106       return delegate.getMessageCount();
107    }
108
109    /* (non-Javadoc)
110     * @see org.jboss.mq.server.jmx.QueueMBean#getName()
111     */

112    public String JavaDoc getName()
113    {
114       return delegate.getName();
115    }
116
117    /* (non-Javadoc)
118     * @see org.jboss.mq.server.jmx.QueueMBean#getPageSize()
119     */

120    public int getPageSize()
121    {
122       return delegate.getPageSize();
123    }
124
125    /* (non-Javadoc)
126     * @see org.jboss.mq.server.jmx.QueueMBean#getServerPeer()
127     */

128    public ObjectName JavaDoc getServerPeer()
129    {
130       return delegate.getServerPeer();
131    }
132
133    public ObjectName JavaDoc getServiceName()
134    {
135       return delegate.getServiceName();
136    }
137
138    /* (non-Javadoc)
139     * @see org.jboss.mq.server.jmx.QueueMBean#isCreatedProgrammatically()
140     */

141    public boolean isCreatedProgrammatically()
142    {
143       return delegate.isCreatedProgrammatically();
144    }
145
146    /* (non-Javadoc)
147     * @see org.jboss.mq.server.jmx.QueueMBean#listMessages(java.lang.String)
148     */

149    public List JavaDoc listMessages(String JavaDoc arg0) throws Exception JavaDoc
150    {
151       return delegate.listMessages(arg0);
152    }
153
154    /* (non-Javadoc)
155     * @see org.jboss.mq.server.jmx.QueueMBean#removeAllMessages()
156     */

157    public void removeAllMessages() throws Exception JavaDoc
158    {
159       delegate.removeAllMessages();
160    }
161
162    /* (non-Javadoc)
163     * @see org.jboss.mq.server.jmx.QueueMBean#setDownCacheSize(int)
164     */

165    public void setDownCacheSize(int arg0)
166    {
167       delegate.setDownCacheSize(arg0);
168    }
169
170    /* (non-Javadoc)
171     * @see org.jboss.mq.server.jmx.QueueMBean#setFullSize(int)
172     */

173    public void setFullSize(int arg0)
174    {
175       delegate.setFullSize(arg0);
176    }
177
178    /* (non-Javadoc)
179     * @see org.jboss.mq.server.jmx.QueueMBean#setJNDIName(java.lang.String)
180     */

181    public void setJNDIName(String JavaDoc arg0)
182    {
183       delegate.setJNDIName(arg0);
184    }
185
186    /* (non-Javadoc)
187     * @see org.jboss.mq.server.jmx.QueueMBean#setPageSize(int)
188     */

189    public void setPageSize(int arg0)
190    {
191       delegate.setPageSize(arg0);
192    }
193
194    /* (non-Javadoc)
195     * @see org.jboss.mq.server.jmx.QueueMBean#setSecurityConfig(org.w3c.dom.Element)
196     */

197    public void setSecurityConfig(Element JavaDoc arg0) throws Exception JavaDoc
198    {
199       delegate.setSecurityConfig(arg0);
200    }
201    public void setSecurityConf(Element JavaDoc arg0) throws Exception JavaDoc
202    {
203       delegate.setSecurityConfig(arg0);
204    }
205
206    public void setSecurityManager(ObjectName JavaDoc arg0)
207    {
208       // noop
209
}
210
211    /* (non-Javadoc)
212     * @see org.jboss.mq.server.jmx.QueueMBean#setServerPeer(javax.management.ObjectName)
213     */

214    public void setServerPeer(ObjectName JavaDoc arg0)
215    {
216       delegate.setServerPeer(arg0);
217    }
218    public void setDestinationManager(ObjectName JavaDoc arg0) throws Exception JavaDoc
219    {
220       ObjectName JavaDoc peer = new ObjectName JavaDoc("jboss.messaging:service=ServerPeer");
221       delegate.setServerPeer(peer);
222    }
223
224    /* (non-Javadoc)
225     * @see org.jboss.mq.server.jmx.QueueMBean#start()
226     */

227    public void start() throws Exception JavaDoc
228    {
229       delegate.start();
230    }
231
232    /* (non-Javadoc)
233     * @see org.jboss.mq.server.jmx.QueueMBean#stop()
234     */

235    public void stop()
236    {
237       delegate.stop();
238    }
239
240    public void setMessageCounterHistoryDayLimit(int arg0)
241    {
242       // noop
243
}
244
245    public ObjectName JavaDoc getExpiryDestination()
246    {
247       return null;
248    }
249    public void setExpiryDestination(ObjectName JavaDoc destination)
250    {
251       System.err.println("There is no ExpiryDestination currently");
252    }
253
254    public String JavaDoc toString()
255    {
256       return delegate.toString();
257    }
258
259    public void postDeregister()
260    {
261       delegate.postDeregister();
262    }
263    public void postRegister(Boolean JavaDoc registrationDone)
264    {
265       delegate.postRegister(registrationDone);
266    }
267    public void preDeregister() throws Exception JavaDoc
268    {
269       delegate.preDeregister();
270    }
271    public ObjectName JavaDoc preRegister(MBeanServer JavaDoc server, ObjectName JavaDoc name)
272       throws Exception JavaDoc
273    {
274       return delegate.preRegister(server, name);
275    }
276 }
277
Popular Tags