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