1 22 package org.jboss.test.jmx.xmbean; 23 24 import javax.management.Attribute ; 25 26 import org.jboss.system.ServiceMBeanSupport; 27 28 32 public class ServiceUsingCustomAttribute extends ServiceMBeanSupport 33 { 34 private CustomType attr; 35 36 public CustomType getAttr() 37 { 38 return attr; 39 } 40 41 public void setAttr(CustomType attr) 42 { 43 this.attr = attr; 44 } 45 46 public void selfTest() throws Exception 47 { 48 CustomType ct = new CustomType(666, 999); 49 getServer().setAttribute(getServiceName(), new Attribute ("Attr", ct)); 50 } 51 52 public String show() 53 { 54 if (attr == null) 55 return "null"; 56 else 57 return attr.toString(); 58 } 59 } 60 | Popular Tags |