1 22 package test.implementation.util.support; 23 24 import javax.management.modelmbean.ModelMBeanInfo ; 25 import javax.management.modelmbean.ModelMBeanInfoSupport ; 26 import javax.management.modelmbean.ModelMBeanAttributeInfo ; 27 import javax.management.modelmbean.ModelMBeanOperationInfo ; 28 29 33 public class Resource 34 { 35 public ModelMBeanInfo getMBeanInfo() 36 { 37 ModelMBeanAttributeInfo [] attributes = new ModelMBeanAttributeInfo [] 38 { 39 new ModelMBeanAttributeInfo ( 40 "AttributeName", "java.lang.String", "description", 41 false, true, false 42 ), 43 new ModelMBeanAttributeInfo ( 44 "AttributeName2", "java.lang.String", "description", 45 true, true, false 46 ) 47 }; 48 49 ModelMBeanOperationInfo [] operations = new ModelMBeanOperationInfo [] 50 { 51 new ModelMBeanOperationInfo ( 52 "doOperation", "description", null, "java.lang.Object", 1 53 ) 54 }; 55 56 ModelMBeanInfoSupport info = new ModelMBeanInfoSupport ( 57 "test.implementation.util.support.Resource", "description", 58 attributes, null, operations, null 59 ); 60 61 return info; 62 } 63 64 65 public Object doOperation() 66 { 67 return "tamppi"; 68 } 69 70 } 71 72 73 74 75 | Popular Tags |