1 8 9 package mx4j.tools.naming; 10 11 import java.lang.reflect.Constructor ; 12 import java.lang.reflect.Method ; 13 14 import mx4j.MBeanDescriptionAdapter; 15 16 21 public class NamingServiceMBeanDescription extends MBeanDescriptionAdapter 22 { 23 public String getMBeanDescription() 24 { 25 return "MBean that wraps rmiregistry"; 26 } 27 28 public String getConstructorDescription(Constructor ctor) 29 { 30 if (ctor.toString().equals("public mx4j.tools.naming.NamingService()")) 31 { 32 return "Creates a new instance of NamingService with the default rmiregistry port (1099)"; 33 } 34 if (ctor.toString().equals("public mx4j.tools.naming.NamingService(int)")) 35 { 36 return "Creates a new instance of NamingService with the specified port"; 37 } 38 return super.getConstructorDescription(ctor); 39 } 40 41 public String getConstructorParameterName(Constructor ctor, int index) 42 { 43 if (ctor.toString().equals("public mx4j.tools.naming.NamingService(int)")) 44 { 45 switch (index) 46 { 47 case 0: 48 return "port"; 49 } 50 } 51 return super.getConstructorParameterName(ctor, index); 52 } 53 54 public String getConstructorParameterDescription(Constructor ctor, int index) 55 { 56 if (ctor.toString().equals("public mx4j.tools.naming.NamingService(int)")) 57 { 58 switch (index) 59 { 60 case 0: 61 return "The port on which rmiregistry will listen for incoming connections"; 62 } 63 } 64 return super.getConstructorParameterDescription(ctor, index); 65 } 66 67 public String getAttributeDescription(String attribute) 68 { 69 if (attribute.equals("Port")) 70 { 71 return "The port on which rmiregistry listens for incoming connections"; 72 } 73 if (attribute.equals("Running")) 74 { 75 return "The running status of this MBean"; 76 } 77 return super.getAttributeDescription(attribute); 78 } 79 80 public String getOperationDescription(Method operation) 81 { 82 String name = operation.getName(); 83 if (name.equals("start")) 84 { 85 return "Starts rmiregistry"; 86 } 87 if (name.equals("stop")) 88 { 89 return "Stops rmiregistry"; 90 } 91 return super.getOperationDescription(operation); 92 } 93 } 94 | Popular Tags |