@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); }
@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); }