1 17 package org.apache.servicemix.jbi.management; 18 19 import javax.management.DynamicMBean ; 20 import javax.management.JMException ; 21 import javax.management.StandardMBean ; 22 23 import edu.emory.mathcs.backport.java.util.concurrent.ExecutorService; 24 25 30 class MBeanBuilder { 31 32 33 43 static DynamicMBean buildStandardMBean(Object theObject, Class interfaceMBean, String description, ExecutorService executorService) throws JMException { 44 DynamicMBean result = null; 45 if (theObject != null) { 46 if (theObject instanceof MBeanInfoProvider) { 47 MBeanInfoProvider info = (MBeanInfoProvider) theObject; 48 result = new BaseStandardMBean( 49 info.getObjectToManage(), 50 interfaceMBean, 51 description, 52 info.getAttributeInfos(), 53 info.getOperationInfos(), 54 executorService); 55 info.setPropertyChangeListener((BaseStandardMBean)result); 56 } 57 else { 58 return new StandardMBean (theObject, interfaceMBean); 59 } 60 } 61 return result; 62 } 63 } | Popular Tags |