@SuppressWarnings({ "unchecked", "rawtypes" }) public static void registerMBean(ManagementContext context, Object object, ObjectName objectName) throws Exception { String mbeanName = object.getClass().getName() + "MBean"; for (Class c : object.getClass().getInterfaces()) { if (mbeanName.equals(c.getName())) { context.registerMBean(new AnnotatedMBean(object, c, objectName), objectName); return; } } context.registerMBean(object, objectName); }
@SuppressWarnings({ "unchecked", "rawtypes" }) public static ObjectInstance registerMBean(ExecutorService executor, long timeout, ManagementContext context, Object object, ObjectName objectName) throws Exception { if (timeout < 0 && executor != null) { throw new IllegalArgumentException("async timeout cannot be negative."); } if (timeout > 0 && executor == null) { throw new NullPointerException("timeout given but no ExecutorService instance given."); } String mbeanName = object.getClass().getName() + "MBean"; for (Class c : object.getClass().getInterfaces()) { if (mbeanName.equals(c.getName())) { if (timeout == 0) { return context.registerMBean(new AnnotatedMBean(object, c, objectName), objectName); } else { return context.registerMBean(new AsyncAnnotatedMBean(executor, timeout, object, c, objectName), objectName); } } } return context.registerMBean(object, objectName); }
@SuppressWarnings({ "unchecked", "rawtypes" }) public static void registerMBean(ManagementContext context, Object object, ObjectName objectName) throws Exception { String mbeanName = object.getClass().getName() + "MBean"; for (Class c : object.getClass().getInterfaces()) { if (mbeanName.equals(c.getName())) { context.registerMBean(new AnnotatedMBean(object, c), objectName); return; } } context.registerMBean(object, objectName); }
@SuppressWarnings({ "unchecked", "rawtypes" }) public static void registerMBean(ManagementContext context, Object object, ObjectName objectName) throws Exception { String mbeanName = object.getClass().getName() + "MBean"; for (Class c : object.getClass().getInterfaces()) { if (mbeanName.equals(c.getName())) { context.registerMBean(new AnnotatedMBean(object, c), objectName); return; } } context.registerMBean(object, objectName); }
@SuppressWarnings({ "unchecked", "rawtypes" }) public static void registerMBean(ManagementContext context, Object object, ObjectName objectName) throws Exception { String mbeanName = object.getClass().getName() + "MBean"; for (Class c : object.getClass().getInterfaces()) { if (mbeanName.equals(c.getName())) { context.registerMBean(new AnnotatedMBean(object, c), objectName); return; } } context.registerMBean(object, objectName); }
@SuppressWarnings("unchecked") public static void registerMBean(ManagementContext context, Object object, ObjectName objectName) throws Exception { String mbeanName = object.getClass().getName() + "MBean"; for (Class c : object.getClass().getInterfaces()) { if (mbeanName.equals(c.getName())) { context.registerMBean(new AnnotatedMBean(object, c), objectName); return; } } context.registerMBean(object, objectName); }
public ObjectInstance registerMBean(Object bean, ObjectName name) throws Exception { if (bean instanceof AnnotatedMBean) { Object impl = ((AnnotatedMBean) bean).getImplementation(); if (impl instanceof SubscriptionViewMBean) { return null; } } else if (bean instanceof SubscriptionViewMBean) { return null; } return super.registerMBean(bean, name); } }
public ObjectInstance registerMBean(Object bean, ObjectName name) throws Exception { if (bean instanceof AnnotatedMBean) { Object impl = ((AnnotatedMBean) bean).getImplementation(); if (impl instanceof SubscriptionViewMBean) { return null; } } else if (bean instanceof SubscriptionViewMBean) { return null; } return super.registerMBean(bean, name); } }
@SuppressWarnings({ "unchecked", "rawtypes" }) public static void registerMBean(ExecutorService executor, long timeout, ManagementContext context, Object object, ObjectName objectName) throws Exception { if (timeout < 0 && executor != null) { throw new IllegalArgumentException("async timeout cannot be negative."); } if (timeout > 0 && executor == null) { throw new NullPointerException("timeout given but no ExecutorService instance given."); } String mbeanName = object.getClass().getName() + "MBean"; for (Class c : object.getClass().getInterfaces()) { if (mbeanName.equals(c.getName())) { if (timeout == 0) { context.registerMBean(new AnnotatedMBean(object, c), objectName); } else { context.registerMBean(new AsyncAnnotatedMBean(executor, timeout, object, c), objectName); } return; } } context.registerMBean(object, objectName); }
@SuppressWarnings({ "unchecked", "rawtypes" }) public static void registerMBean(ExecutorService executor, long timeout, ManagementContext context, Object object, ObjectName objectName) throws Exception { if (timeout < 0 && executor != null) { throw new IllegalArgumentException("async timeout cannot be negative."); } if (timeout > 0 && executor == null) { throw new NullPointerException("timeout given but no ExecutorService instance given."); } String mbeanName = object.getClass().getName() + "MBean"; for (Class c : object.getClass().getInterfaces()) { if (mbeanName.equals(c.getName())) { if (timeout == 0) { context.registerMBean(new AnnotatedMBean(object, c), objectName); } else { context.registerMBean(new AsyncAnnotatedMBean(executor, timeout, object, c), objectName); } return; } } context.registerMBean(object, objectName); }
@SuppressWarnings({ "unchecked", "rawtypes" }) public static void registerMBean(ExecutorService executor, long timeout, ManagementContext context, Object object, ObjectName objectName) throws Exception { if (timeout < 0 && executor != null) { throw new IllegalArgumentException("async timeout cannot be negative."); } if (timeout > 0 && executor == null) { throw new NullPointerException("timeout given but no ExecutorService instance given."); } String mbeanName = object.getClass().getName() + "MBean"; for (Class c : object.getClass().getInterfaces()) { if (mbeanName.equals(c.getName())) { if (timeout == 0) { context.registerMBean(new AnnotatedMBean(object, c), objectName); } else { context.registerMBean(new AsyncAnnotatedMBean(executor, timeout, object, c), objectName); } return; } } context.registerMBean(object, objectName); }
@Override protected void registerMbean() { if (getBrokerService().isUseJmx()) { ManagementContext managementContext = getBrokerService().getManagementContext(); try { objectName = new ObjectName(getBrokerService().getBrokerObjectName().toString() + objectNamePropsAppendage); managementContext.registerMBean(new RuntimeConfigurationView(this), objectName); } catch (Exception ignored) { LOG.debug("failed to register RuntimeConfigurationMBean", ignored); } } }