1 8 9 package mx4j.server.interceptor; 10 11 import java.lang.reflect.Constructor ; 12 import java.lang.reflect.Method ; 13 14 import mx4j.MBeanDescriptionAdapter; 15 16 21 public class MBeanServerInterceptorConfiguratorMBeanDescription extends MBeanDescriptionAdapter 22 { 23 public String getMBeanDescription() 24 { 25 return "Configurator for MBeanServer to MBean interceptors"; 26 } 27 28 public String getConstructorDescription(Constructor ctor) 29 { 30 if (ctor.toString().equals("public mx4j.server.interceptor.MBeanServerInterceptorConfigurator(javax.management.MBeanServer)")) 31 { 32 return "Creates a new instance of MBeanServer to MBean interceptor configurator"; 33 } 34 return super.getConstructorDescription(ctor); 35 } 36 37 public String getConstructorParameterName(Constructor ctor, int index) 38 { 39 if (ctor.toString().equals("public mx4j.server.interceptor.MBeanServerInterceptorConfigurator(javax.management.MBeanServer)")) 40 { 41 switch (index) 42 { 43 case 0: 44 return "server"; 45 } 46 } 47 return super.getConstructorParameterName(ctor, index); 48 } 49 50 public String getConstructorParameterDescription(Constructor ctor, int index) 51 { 52 if (ctor.toString().equals("public mx4j.server.interceptor.MBeanServerInterceptorConfigurator(javax.management.MBeanServer)")) 53 { 54 switch (index) 55 { 56 case 0: 57 return "The MBeanServer that uses this configurator"; 58 } 59 } 60 return super.getConstructorParameterDescription(ctor, index); 61 } 62 63 public String getAttributeDescription(String attribute) 64 { 65 if (attribute.equals("Running")) 66 { 67 return "The running status of the configurator"; 68 } 69 return super.getAttributeDescription(attribute); 70 } 71 72 public String getOperationDescription(Method operation) 73 { 74 String name = operation.getName(); 75 if (name.equals("addInterceptor")) 76 { 77 return "Appends an interceptor to the interceptor chain"; 78 } 79 if (name.equals("registerInterceptor")) 80 { 81 return "Appends an MBean interceptor to the interceptor chain and registers it"; 82 } 83 if (name.equals("clearInterceptors")) 84 { 85 return "Removes all the interceptors added via addInterceptor(MBeanServerInterceptor interceptor)"; 86 } 87 if (name.equals("start")) 88 { 89 return "Starts the configurator so that the MBeanServer can accept incoming calls"; 90 } 91 if (name.equals("stop")) 92 { 93 return "Stops the configurator so that the MBeanServer cannot accept incoming calls"; 94 } 95 return super.getOperationDescription(operation); 96 } 97 98 public String getOperationParameterName(Method method, int index) 99 { 100 String name = method.getName(); 101 if (name.equals("addInterceptor")) 102 { 103 switch (index) 104 { 105 case 0: 106 return "interceptor"; 107 } 108 } 109 if (name.equals("registerInterceptor")) 110 { 111 switch (index) 112 { 113 case 0: 114 return "interceptor"; 115 case 1: 116 return "name"; 117 } 118 } 119 return super.getOperationParameterName(method, index); 120 } 121 122 public String getOperationParameterDescription(Method method, int index) 123 { 124 String name = method.getName(); 125 if (name.equals("addInterceptor")) 126 { 127 switch (index) 128 { 129 case 0: 130 return "The interceptor to be appended to the interceptor chain"; 131 } 132 } 133 if (name.equals("registerInterceptor")) 134 { 135 switch (index) 136 { 137 case 0: 138 return "The interceptor to be appended to the interceptor chain"; 139 case 1: 140 return "The ObjectName under which register the interceptor"; 141 } 142 } 143 return super.getOperationParameterDescription(method, index); 144 } 145 } 146 | Popular Tags |