KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > tools > ant > taskdefs > optional > jmx > connector > jboss > JBossMBeanServer


1 package org.apache.tools.ant.taskdefs.optional.jmx.connector.jboss;
2
3 /*
4  * ============================================================================
5  * The Apache Software License, Version 1.1
6  * ============================================================================
7  *
8  * Copyright (C) 2000-2002 The Apache Software Foundation. All
9  * rights reserved.
10  *
11  * Redistribution and use in source and binary forms, with or without modifica-
12  * tion, are permitted provided that the following conditions are met:
13  *
14  * 1. Redistributions of source code must retain the above copyright notice,
15  * this list of conditions and the following disclaimer.
16  *
17  * 2. Redistributions in binary form must reproduce the above copyright notice,
18  * this list of conditions and the following disclaimer in the documentation
19  * and/or other materials provided with the distribution.
20  *
21  * 3. The end-user documentation included with the redistribution, if any, must
22  * include the following acknowledgment: "This product includes software
23  * developed by the Apache Software Foundation (http://www.apache.org/)."
24  * Alternately, this acknowledgment may appear in the software itself, if
25  * and wherever such third-party acknowledgments normally appear.
26  *
27  * 4. The names "Ant" and "Apache Software Foundation" must not be used to
28  * endorse or promote products derived from this software without prior
29  * written permission. For written permission, please contact
30  * apache@apache.org.
31  *
32  * 5. Products derived from this software may not be called "Apache", nor may
33  * "Apache" appear in their name, without prior written permission of the
34  * Apache Software Foundation.
35  *
36  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
37  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
38  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
39  * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
40  * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
41  * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
42  * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
43  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
44  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
45  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
46  *
47  * This software consists of voluntary contributions made by many individuals
48  * on behalf of the Apache Software Foundation. For more information on the
49  * Apache Software Foundation, please see <http://www.apache.org/>.
50  *
51  */

52
53 import java.io.ObjectInputStream JavaDoc;
54 import java.util.Set JavaDoc;
55 import javax.management.*;
56 import org.jboss.jmx.connector.RemoteMBeanServer;
57
58 /**
59  * Wraps org.jboss.jmx.connector.RemoteMBeanServer to expose a standard
60  * javax.management.MBeanServer interface.
61  *
62  * @author <a HREF="mailto:bdueck@yahoo.com">Brian Dueck</a>
63  * @version $Id: JBossMBeanServer.java,v 1.3 2003/05/28 22:28:26 bdueck Exp $
64  */

65 public class JBossMBeanServer implements javax.management.MBeanServer JavaDoc {
66     
67     RemoteMBeanServer remoteServer;
68     
69     /** Creates a new instance of JBossMBeanServer */
70     public JBossMBeanServer(RemoteMBeanServer remoteServer) {
71         this.remoteServer = remoteServer;
72     }
73     
74     public void addNotificationListener(ObjectName objectName, NotificationListener notificationListener, NotificationFilter notificationFilter, Object JavaDoc obj) throws InstanceNotFoundException {
75         remoteServer.addNotificationListener(objectName, notificationListener, notificationFilter, obj);
76     }
77     
78     public void addNotificationListener(ObjectName objectName, ObjectName objectName1, NotificationFilter notificationFilter, Object JavaDoc obj) throws InstanceNotFoundException {
79         remoteServer.addNotificationListener(objectName, objectName1, notificationFilter, obj);
80     }
81     
82     public ObjectInstance createMBean(String JavaDoc str, ObjectName objectName) throws ReflectionException, InstanceAlreadyExistsException, MBeanRegistrationException, MBeanException, NotCompliantMBeanException {
83         return remoteServer.createMBean(str,objectName);
84     }
85     
86     public ObjectInstance createMBean(String JavaDoc str, ObjectName objectName, ObjectName objectName2) throws ReflectionException, InstanceAlreadyExistsException, MBeanRegistrationException, MBeanException, NotCompliantMBeanException, InstanceNotFoundException {
87         return remoteServer.createMBean(str,objectName,objectName2);
88     }
89     
90     public ObjectInstance createMBean(String JavaDoc str, ObjectName objectName, Object JavaDoc[] obj, String JavaDoc[] str3) throws ReflectionException, InstanceAlreadyExistsException, MBeanRegistrationException, MBeanException, NotCompliantMBeanException {
91         return remoteServer.createMBean(str,objectName,obj,str3);
92     }
93     
94     public ObjectInstance createMBean(String JavaDoc str, ObjectName objectName, ObjectName objectName2, Object JavaDoc[] obj, String JavaDoc[] str4) throws ReflectionException, InstanceAlreadyExistsException, MBeanRegistrationException, MBeanException, NotCompliantMBeanException, InstanceNotFoundException {
95         return remoteServer.createMBean(str, objectName, objectName2, obj, str4);
96     }
97     
98     public ObjectInputStream JavaDoc deserialize(String JavaDoc str, byte[] values) throws OperationsException, ReflectionException {
99         throw new java.lang.RuntimeException JavaDoc("operation not supported");
100     }
101     
102     public ObjectInputStream JavaDoc deserialize(ObjectName objectName, byte[] values) throws InstanceNotFoundException, OperationsException {
103         throw new java.lang.RuntimeException JavaDoc("operation not supported");
104     }
105     
106     public ObjectInputStream JavaDoc deserialize(String JavaDoc str, ObjectName objectName, byte[] values) throws InstanceNotFoundException, OperationsException, ReflectionException {
107         throw new java.lang.RuntimeException JavaDoc("operation not supported");
108     }
109     
110     public Object JavaDoc getAttribute(ObjectName objectName, String JavaDoc str) throws MBeanException, AttributeNotFoundException, InstanceNotFoundException, ReflectionException {
111         return remoteServer.getAttribute(objectName,str);
112     }
113     
114     public AttributeList getAttributes(ObjectName objectName, String JavaDoc[] str) throws InstanceNotFoundException, ReflectionException {
115         return remoteServer.getAttributes(objectName,str);
116     }
117     
118     public String JavaDoc getDefaultDomain() {
119         return remoteServer.getDefaultDomain();
120     }
121     
122     public Integer JavaDoc getMBeanCount() {
123         return remoteServer.getMBeanCount();
124     }
125     
126     public javax.management.MBeanInfo JavaDoc getMBeanInfo(ObjectName objectName) throws InstanceNotFoundException, javax.management.IntrospectionException JavaDoc, ReflectionException {
127         return remoteServer.getMBeanInfo(objectName);
128     }
129     
130     public ObjectInstance getObjectInstance(ObjectName objectName) throws InstanceNotFoundException {
131         return remoteServer.getObjectInstance(objectName);
132     }
133     
134     public Object JavaDoc instantiate(String JavaDoc str) throws ReflectionException, MBeanException {
135         throw new java.lang.RuntimeException JavaDoc("operation not supported");
136     }
137     
138     public Object JavaDoc instantiate(String JavaDoc str, ObjectName objectName) throws ReflectionException, MBeanException, InstanceNotFoundException {
139         throw new java.lang.RuntimeException JavaDoc("operation not supported");
140     }
141     
142     public Object JavaDoc instantiate(String JavaDoc str, Object JavaDoc[] obj, String JavaDoc[] str2) throws ReflectionException, MBeanException {
143         throw new java.lang.RuntimeException JavaDoc("operation not supported");
144     }
145     
146     public Object JavaDoc instantiate(String JavaDoc str, ObjectName objectName, Object JavaDoc[] obj, String JavaDoc[] str3) throws ReflectionException, MBeanException, InstanceNotFoundException {
147         throw new java.lang.RuntimeException JavaDoc("operation not supported");
148     }
149     
150     public Object JavaDoc invoke(ObjectName objectName, String JavaDoc str, Object JavaDoc[] obj, String JavaDoc[] str3) throws InstanceNotFoundException, MBeanException, ReflectionException {
151         return remoteServer.invoke(objectName,str,obj,str3);
152     }
153     
154     public boolean isInstanceOf(ObjectName objectName, String JavaDoc str) throws InstanceNotFoundException {
155         return remoteServer.isInstanceOf(objectName,str);
156     }
157     
158     public boolean isRegistered(ObjectName objectName) {
159         return remoteServer.isRegistered(objectName);
160     }
161     
162     public Set JavaDoc queryMBeans(ObjectName objectName, QueryExp queryExp) {
163         return remoteServer.queryMBeans(objectName,queryExp);
164     }
165     
166     public Set JavaDoc queryNames(ObjectName objectName, QueryExp queryExp) {
167         return remoteServer.queryNames(objectName,queryExp);
168     }
169     
170     public ObjectInstance registerMBean(Object JavaDoc obj, ObjectName objectName) throws InstanceAlreadyExistsException, MBeanRegistrationException, NotCompliantMBeanException {
171         throw new java.lang.RuntimeException JavaDoc("operation not supported");
172     }
173     
174     public void removeNotificationListener(ObjectName objectName, ObjectName objectName1) throws InstanceNotFoundException, ListenerNotFoundException {
175         remoteServer.removeNotificationListener(objectName,objectName1);
176     }
177     
178     public void removeNotificationListener(ObjectName objectName, NotificationListener notificationListener) throws InstanceNotFoundException, ListenerNotFoundException {
179         remoteServer.removeNotificationListener(objectName,notificationListener);
180     }
181     
182     public void setAttribute(ObjectName objectName, javax.management.Attribute JavaDoc attribute) throws InstanceNotFoundException, AttributeNotFoundException, javax.management.InvalidAttributeValueException JavaDoc, MBeanException, ReflectionException {
183         remoteServer.setAttribute(objectName, attribute);
184     }
185     
186     public AttributeList setAttributes(ObjectName objectName, AttributeList attributeList) throws InstanceNotFoundException, ReflectionException {
187         return remoteServer.setAttributes(objectName,attributeList);
188     }
189     
190     public void unregisterMBean(ObjectName objectName) throws InstanceNotFoundException, MBeanRegistrationException {
191         remoteServer.unregisterMBean(objectName);
192     }
193     
194 }
195 /*
196  * $Log: JBossMBeanServer.java,v $
197  * Revision 1.3 2003/05/28 22:28:26 bdueck
198  * *** empty log message ***
199  *
200  * Revision 1.2 2003/04/21 15:29:40 bdueck
201  * Various changes in preparation for version 1.2.
202  *
203  * Revision 1.1 2003/01/17 12:34:00 bdueck
204  * Initial check-in
205  *
206  *
207  */

208
Popular Tags