1 22 package org.objectweb.petals.kernel.mx4j.mock; 23 24 import java.io.ObjectInputStream ; 25 import java.util.Set ; 26 27 import javax.management.Attribute ; 28 import javax.management.AttributeList ; 29 import javax.management.AttributeNotFoundException ; 30 import javax.management.InstanceAlreadyExistsException ; 31 import javax.management.InstanceNotFoundException ; 32 import javax.management.IntrospectionException ; 33 import javax.management.InvalidAttributeValueException ; 34 import javax.management.ListenerNotFoundException ; 35 import javax.management.MBeanException ; 36 import javax.management.MBeanInfo ; 37 import javax.management.MBeanRegistrationException ; 38 import javax.management.MBeanServer ; 39 import javax.management.NotCompliantMBeanException ; 40 import javax.management.NotificationFilter ; 41 import javax.management.NotificationListener ; 42 import javax.management.ObjectInstance ; 43 import javax.management.ObjectName ; 44 import javax.management.OperationsException ; 45 import javax.management.QueryExp ; 46 import javax.management.ReflectionException ; 47 import javax.management.loading.ClassLoaderRepository ; 48 49 54 public class MockMBeanServer implements MBeanServer { 55 56 protected boolean unregisterMBean; 57 58 public void addNotificationListener(ObjectName name, 59 NotificationListener listener, NotificationFilter filter, 60 Object handback) throws InstanceNotFoundException { 61 } 62 63 public void addNotificationListener(ObjectName name, ObjectName listener, 64 NotificationFilter filter, Object handback) 65 throws InstanceNotFoundException { 66 } 67 68 public ObjectInstance createMBean(String className, ObjectName name) 69 throws ReflectionException , InstanceAlreadyExistsException , 70 MBeanRegistrationException , MBeanException , NotCompliantMBeanException { 71 return null; 72 } 73 74 public ObjectInstance createMBean(String className, ObjectName name, 75 Object [] params, String [] signature) throws ReflectionException , 76 InstanceAlreadyExistsException , MBeanRegistrationException , 77 MBeanException , NotCompliantMBeanException { 78 return null; 79 } 80 81 public ObjectInstance createMBean(String className, ObjectName name, 82 ObjectName loaderName) throws ReflectionException , 83 InstanceAlreadyExistsException , MBeanRegistrationException , 84 MBeanException , NotCompliantMBeanException , InstanceNotFoundException { 85 return null; 86 } 87 88 public ObjectInstance createMBean(String className, ObjectName name, 89 ObjectName loaderName, Object [] params, String [] signature) 90 throws ReflectionException , InstanceAlreadyExistsException , 91 MBeanRegistrationException , MBeanException , NotCompliantMBeanException , 92 InstanceNotFoundException { 93 return null; 94 } 95 96 public ObjectInputStream deserialize(ObjectName name, byte[] data) 97 throws InstanceNotFoundException , OperationsException { 98 return null; 99 } 100 101 public ObjectInputStream deserialize(String className, byte[] data) 102 throws OperationsException , ReflectionException { 103 return null; 104 } 105 106 public ObjectInputStream deserialize(String className, 107 ObjectName loaderName, byte[] data) throws InstanceNotFoundException , 108 OperationsException , ReflectionException { 109 return null; 110 } 111 112 public Object getAttribute(ObjectName name, String attribute) 113 throws MBeanException , AttributeNotFoundException , 114 InstanceNotFoundException , ReflectionException { 115 return null; 116 } 117 118 public AttributeList getAttributes(ObjectName name, String [] attributes) 119 throws InstanceNotFoundException , ReflectionException { 120 return null; 121 } 122 123 public ClassLoader getClassLoader(ObjectName loaderName) 124 throws InstanceNotFoundException { 125 return null; 126 } 127 128 public ClassLoader getClassLoaderFor(ObjectName mbeanName) 129 throws InstanceNotFoundException { 130 return null; 131 } 132 133 public ClassLoaderRepository getClassLoaderRepository() { 134 return null; 135 } 136 137 public String getDefaultDomain() { 138 return null; 139 } 140 141 public String [] getDomains() { 142 return null; 143 } 144 145 public Integer getMBeanCount() { 146 return null; 147 } 148 149 public MBeanInfo getMBeanInfo(ObjectName name) 150 throws InstanceNotFoundException , IntrospectionException , 151 ReflectionException { 152 return null; 153 } 154 155 public ObjectInstance getObjectInstance(ObjectName name) 156 throws InstanceNotFoundException { 157 return null; 158 } 159 160 public Object instantiate(String className) throws ReflectionException , 161 MBeanException { 162 return null; 163 } 164 165 public Object instantiate(String className, Object [] params, 166 String [] signature) throws ReflectionException , MBeanException { 167 return null; 168 } 169 170 public Object instantiate(String className, ObjectName loaderName) 171 throws ReflectionException , MBeanException , InstanceNotFoundException { 172 return null; 173 } 174 175 public Object instantiate(String className, ObjectName loaderName, 176 Object [] params, String [] signature) throws ReflectionException , 177 MBeanException , InstanceNotFoundException { 178 return null; 179 } 180 181 public Object invoke(ObjectName name, String operationName, 182 Object [] params, String [] signature) throws InstanceNotFoundException , 183 MBeanException , ReflectionException { 184 return null; 185 } 186 187 public boolean isInstanceOf(ObjectName name, String className) 188 throws InstanceNotFoundException { 189 return false; 190 } 191 192 public boolean isRegistered(ObjectName name) { 193 return false; 194 } 195 196 public boolean isUnregisterMBean() { 197 return unregisterMBean; 198 } 199 200 public Set queryMBeans(ObjectName name, QueryExp query) { 201 return null; 202 } 203 204 public Set queryNames(ObjectName name, QueryExp query) { 205 return null; 206 } 207 208 protected boolean registerMBean; 209 210 public ObjectInstance registerMBean(Object object, ObjectName name) 211 throws InstanceAlreadyExistsException , MBeanRegistrationException , 212 NotCompliantMBeanException { 213 registerMBean = true; 214 return null; 215 } 216 217 public void removeNotificationListener(ObjectName name, 218 NotificationListener listener) throws InstanceNotFoundException , 219 ListenerNotFoundException { 220 } 221 222 public void removeNotificationListener(ObjectName name, 223 NotificationListener listener, NotificationFilter filter, 224 Object handback) throws InstanceNotFoundException , 225 ListenerNotFoundException { 226 } 227 228 public void removeNotificationListener(ObjectName name, ObjectName listener) 229 throws InstanceNotFoundException , ListenerNotFoundException { 230 } 231 232 public void removeNotificationListener(ObjectName name, 233 ObjectName listener, NotificationFilter filter, Object handback) 234 throws InstanceNotFoundException , ListenerNotFoundException { 235 } 236 237 public void setAttribute(ObjectName name, Attribute attribute) 238 throws InstanceNotFoundException , AttributeNotFoundException , 239 InvalidAttributeValueException , MBeanException , ReflectionException { 240 } 241 242 public AttributeList setAttributes(ObjectName name, AttributeList attributes) 243 throws InstanceNotFoundException , ReflectionException { 244 return null; 245 } 246 247 public void setUnregisterMBean(boolean unregisterMBean) { 248 this.unregisterMBean = unregisterMBean; 249 } 250 251 public void unregisterMBean(ObjectName name) 252 throws InstanceNotFoundException , MBeanRegistrationException { 253 unregisterMBean = true; 254 } 255 256 public boolean isRegisterMBean() { 257 return registerMBean; 258 } 259 260 public void setRegisterMBean(boolean registerMBean) { 261 this.registerMBean = registerMBean; 262 } 263 264 } 265 | Popular Tags |