1 22 package org.jboss.test.jmx.compliance.standard.support; 23 24 import javax.management.MBeanAttributeInfo ; 25 import javax.management.MBeanConstructorInfo ; 26 import javax.management.MBeanInfo ; 27 import javax.management.MBeanOperationInfo ; 28 import javax.management.MBeanParameterInfo ; 29 import javax.management.StandardMBean ; 30 31 public class MyStandardMBean 32 extends StandardMBean 33 implements MyManagementInterface 34 { 35 public static final String MBEAN_CLASSNAME = "MBEAN_CLASSNAME"; 36 public static final String MBEAN_DESCRIPTION = "MBEAN_DESCRIPTION"; 37 public static final String MBEAN_ATTRIBUTE_DESCRIPTION = "MBEAN_ATTRIBUTE_DESCRIPTION"; 38 public static final String MBEAN_CONSTRUCTOR_DESCRIPTION = "MBEAN_CONSTRUCTOR_DESCRIPTION"; 39 public static final String MBEAN_OPERATION_DESCRIPTION = "MBEAN_OPERATION_DESCRIPTION"; 40 public static final String MBEAN_PARAMETER = "MBEAN_PARAMETER"; 41 public static final String MBEAN_PARAMETER_DESCRIPTION = "MBEAN_PARAMETER_DESCRIPTION"; 42 43 public MyStandardMBean() 44 throws Exception 45 { 46 super(MyManagementInterface.class); 47 } 48 49 public MyStandardMBean(String param1, String param2) 50 throws Exception 51 { 52 super(MyManagementInterface.class); 53 } 54 55 public String getAnAttribute() 56 { 57 return null; 58 } 59 60 public void setAnAttribute(String value) 61 { 62 } 63 64 public void anOperation(String param1, String param2) 65 { 66 } 67 68 protected String getClassName(MBeanInfo info) 69 { 70 return MBEAN_CLASSNAME; 71 } 72 73 protected String getDescription(MBeanInfo info) 74 { 75 return MBEAN_DESCRIPTION; 76 } 77 78 protected String getDescription(MBeanAttributeInfo info) 79 { 80 return MBEAN_ATTRIBUTE_DESCRIPTION + info.getName(); 81 } 82 83 protected String getDescription(MBeanConstructorInfo info) 84 { 85 return MBEAN_CONSTRUCTOR_DESCRIPTION + info.getSignature().length; 86 } 87 88 protected String getDescription(MBeanOperationInfo info) 89 { 90 return MBEAN_OPERATION_DESCRIPTION + info.getName(); 91 } 92 93 protected String getDescription(MBeanConstructorInfo info, MBeanParameterInfo param, int sequence) 94 { 95 return MBEAN_PARAMETER_DESCRIPTION + sequence; 96 } 97 98 protected String getDescription(MBeanOperationInfo info, MBeanParameterInfo param, int sequence) 99 { 100 return MBEAN_PARAMETER_DESCRIPTION + info.getName() + sequence; 101 } 102 103 protected String getParameterName(MBeanConstructorInfo info, MBeanParameterInfo param, int sequence) 104 { 105 return MBEAN_PARAMETER + sequence; 106 } 107 108 protected String getParameterName(MBeanOperationInfo info, MBeanParameterInfo param, int sequence) 109 { 110 return MBEAN_PARAMETER + info.getName() + sequence; 111 } 112 113 protected int getImpact(MBeanOperationInfo info) 114 { 115 return MBeanOperationInfo.ACTION; 116 } 117 } 118 | Popular Tags |