1 8 9 package test.javax.management.support; 10 11 import javax.management.Attribute ; 12 import javax.management.AttributeList ; 13 import javax.management.AttributeNotFoundException ; 14 import javax.management.DynamicMBean ; 15 import javax.management.InvalidAttributeValueException ; 16 import javax.management.MBeanAttributeInfo ; 17 import javax.management.MBeanConstructorInfo ; 18 import javax.management.MBeanException ; 19 import javax.management.MBeanInfo ; 20 import javax.management.MBeanNotificationInfo ; 21 import javax.management.MBeanOperationInfo ; 22 import javax.management.MBeanRegistration ; 23 import javax.management.MBeanServer ; 24 import javax.management.ObjectName ; 25 import javax.management.ReflectionException ; 26 27 30 public class NullMBeanInfoDMB implements DynamicMBean , MBeanRegistration 31 { 32 private boolean registered; 33 34 public MBeanInfo getMBeanInfo() 35 { 36 return (registered) 37 ? null 38 : new MBeanInfo ("test.javax.management.support.NullMBeanInfoDMB", 39 "A DynamicMBean that returns null in response to getMBeanInfo() invocations", 40 new MBeanAttributeInfo [0], 41 new MBeanConstructorInfo [0], 42 new MBeanOperationInfo [0], 43 new MBeanNotificationInfo [0]); 44 } 45 46 public Object getAttribute(String attribute) 47 throws AttributeNotFoundException , MBeanException , ReflectionException 48 { 49 return null; 50 } 51 52 public void setAttribute(Attribute attribute) 53 throws 54 AttributeNotFoundException , 55 InvalidAttributeValueException , 56 MBeanException , 57 ReflectionException 58 { 59 } 60 61 public AttributeList getAttributes(String [] attributes) 62 { 63 return null; 64 } 65 66 public AttributeList setAttributes(AttributeList attributes) 67 { 68 return null; 69 } 70 71 public Object invoke(String method, Object [] arguments, String [] params) 72 throws MBeanException , ReflectionException 73 { 74 return null; 75 } 76 77 public void postDeregister() 78 { 79 } 80 81 public void postRegister(Boolean registrationDone) 82 { 83 registered = registrationDone.booleanValue(); 84 } 85 86 public void preDeregister() throws Exception 87 { 88 } 89 90 public ObjectName preRegister(MBeanServer server, ObjectName name) 91 throws Exception 92 { 93 return name; 94 } 95 96 } 97 | Popular Tags |