00001 00025 package org.objectweb.jonas.jmx; 00026 00027 import javax.management.Attribute; 00028 import javax.management.AttributeList; 00029 import javax.management.AttributeNotFoundException; 00030 import javax.management.InstanceNotFoundException; 00031 import javax.management.IntrospectionException; 00032 import javax.management.InvalidAttributeValueException; 00033 import javax.management.MBeanException; 00034 import javax.management.MBeanInfo; 00035 import javax.management.MBeanServer; 00036 import javax.management.NotificationFilter; 00037 import javax.management.NotificationListener; 00038 import javax.management.ObjectName; 00039 import javax.management.QueryExp; 00040 import javax.management.ReflectionException; 00041 import javax.rmi.PortableRemoteObject; 00042 import java.rmi.RemoteException; 00043 00044 00051 public class RMIConnectorImpl extends PortableRemoteObject implements RMIConnector { 00052 protected MBeanServer server; 00053 00054 public RMIConnectorImpl(MBeanServer server) throws RemoteException { 00055 super(); 00056 this.server = server; 00057 } 00058 00066 public java.util.Set queryNames(ObjectName name, 00067 QueryExp query) 00068 throws RemoteException { 00069 return server.queryNames(name, query); 00070 } 00071 00077 public boolean isRegistered(ObjectName name) 00078 throws RemoteException 00079 { 00080 return server.isRegistered(name); 00081 } 00082 00089 public java.lang.Object getAttribute(ObjectName name, 00090 java.lang.String attribute) 00091 throws MBeanException, 00092 AttributeNotFoundException, 00093 InstanceNotFoundException, 00094 ReflectionException, 00095 RemoteException { 00096 return server.getAttribute(name, attribute); 00097 } 00098 00099 public AttributeList getAttributes(ObjectName name, 00100 String[] attributes) 00101 throws InstanceNotFoundException, 00102 ReflectionException, 00103 RemoteException { 00104 return server.getAttributes(name, attributes); 00105 } 00110 public void setAttribute(ObjectName name, 00111 Attribute attribute) 00112 throws InstanceNotFoundException, 00113 AttributeNotFoundException, 00114 InvalidAttributeValueException, 00115 MBeanException, 00116 ReflectionException, 00117 RemoteException { 00118 server.setAttribute(name, attribute); 00119 } 00120 00121 public AttributeList setAttributes(ObjectName name, 00122 AttributeList attributes) 00123 throws InstanceNotFoundException, 00124 ReflectionException, 00125 RemoteException { 00126 return server.setAttributes(name, attributes); 00127 } 00138 public Object invoke(ObjectName name, 00139 java.lang.String operationName, 00140 java.lang.Object[] params, 00141 java.lang.String[] signature) 00142 throws InstanceNotFoundException, 00143 MBeanException, 00144 ReflectionException, 00145 RemoteException 00146 { 00147 return server.invoke(name, operationName, params, signature); 00148 } 00149 00157 public MBeanInfo getMBeanInfo(ObjectName name) 00158 throws InstanceNotFoundException, 00159 IntrospectionException, 00160 ReflectionException, 00161 RemoteException 00162 { 00163 return this.server.getMBeanInfo(name); 00164 } 00165 00174 public void addNotificationListener(ObjectName name, 00175 NotificationListener listener, 00176 NotificationFilter filter, 00177 Object handback) 00178 throws InstanceNotFoundException, 00179 RemoteException 00180 { 00181 this.server.addNotificationListener(name, listener, filter, handback); 00182 } 00183 00192 public void addNotificationListener(ObjectName name, 00193 ObjectName listener, 00194 NotificationFilter filter, 00195 Object handback) 00196 throws InstanceNotFoundException, 00197 RemoteException 00198 { 00199 this.server.addNotificationListener(name, listener, filter, handback); 00200 } 00201 }