1 8 9 package mx4j; 10 11 import java.lang.reflect.Constructor ; 12 import java.lang.reflect.Method ; 13 14 19 public class MBeanDescriptionAdapter implements MBeanDescription 20 { 21 public String getMBeanDescription() 22 { 23 return "Manageable Bean"; 24 } 25 26 public String getConstructorDescription(Constructor ctor) 27 { 28 return "Constructor exposed for management"; 29 } 30 31 public String getConstructorParameterName(Constructor ctor, int index) 32 { 33 switch (index) 34 { 35 case 0: 36 return "param1"; 37 case 1: 38 return "param2"; 39 case 2: 40 return "param3"; 41 case 3: 42 return "param4"; 43 default: 44 return "param" + (index + 1); 45 } 46 } 47 48 public String getConstructorParameterDescription(Constructor ctor, int index) 49 { 50 switch (index) 51 { 52 case 0: 53 return "Constructor's parameter n. 1"; 54 case 1: 55 return "Constructor's parameter n. 2"; 56 case 2: 57 return "Constructor's parameter n. 3"; 58 case 3: 59 return "Constructor's parameter n. 4"; 60 default: 61 return "Constructor's parameter n. " + (index + 1); 62 } 63 } 64 65 public String getAttributeDescription(String attribute) 66 { 67 return "Attribute exposed for management"; 68 } 69 70 public String getOperationDescription(Method operation) 71 { 72 return "Operation exposed for management"; 73 } 74 75 public String getOperationParameterName(Method method, int index) 76 { 77 switch (index) 78 { 79 case 0: 80 return "param1"; 81 case 1: 82 return "param2"; 83 case 2: 84 return "param3"; 85 case 3: 86 return "param4"; 87 default: 88 return "param" + (index + 1); 89 } 90 } 91 92 public String getOperationParameterDescription(Method method, int index) 93 { 94 switch (index) 95 { 96 case 0: 97 return "Operation's parameter n. 1"; 98 case 1: 99 return "Operation's parameter n. 2"; 100 case 2: 101 return "Operation's parameter n. 3"; 102 case 3: 103 return "Operation's parameter n. 4"; 104 default: 105 return "Operation's parameter n. " + (index + 1); 106 } 107 } 108 } 109 | Popular Tags |