1 package org.oddjob.jmx.server; 2 3 import javax.management.MBeanAttributeInfo ; 4 import javax.management.MBeanNotificationInfo ; 5 import javax.management.MBeanOperationInfo ; 6 import javax.management.MBeanParameterInfo ; 7 8 import org.oddjob.Stoppable; 9 10 12 public class StoppableInfo implements InterfaceInfo { 13 14 public Class interfaceClass() { 15 return Stoppable.class; 16 } 17 18 public MBeanAttributeInfo [] getMBeanAttributeInfo() { 19 return new MBeanAttributeInfo [0]; 20 } 21 22 public MBeanOperationInfo [] getMBeanOperationInfo() { 23 return new MBeanOperationInfo [] { 24 new MBeanOperationInfo ("stop", "Stop the job.", 25 new MBeanParameterInfo [0], Void.TYPE.getName(), 26 MBeanOperationInfo.ACTION) 27 }; 28 } 29 30 public MBeanNotificationInfo [] getMBeanNotificationInfo() { 31 return new MBeanNotificationInfo [0]; 32 } 33 34 35 public InterfaceHandler attach(Object target, OddjobMBean ojmb) { 36 return new OperationsHandler(target); 37 } 38 39 } | Popular Tags |