org.apache.activemq.broker.jmx
Class AsyncAnnotatedMBean

java.lang.Object
  extended by javax.management.StandardMBean
      extended by org.apache.activemq.broker.jmx.AnnotatedMBean
          extended by org.apache.activemq.broker.jmx.AsyncAnnotatedMBean
All Implemented Interfaces:
DynamicMBean, MBeanRegistration

public class AsyncAnnotatedMBean
extends AnnotatedMBean

MBean that invokes the requested operation using an async operation and waits for the result if the operation times out then an exception is thrown.


Constructor Summary
protected AsyncAnnotatedMBean(Class<?> mbeanInterface)
           
  AsyncAnnotatedMBean(ExecutorService executor, long timeout, T impl, Class<T> mbeanInterface)
           
 
Method Summary
protected  Object asyncInvole(String s, Object[] objects, String[] strings)
           
 Object invoke(String s, Object[] objects, String[] strings)
           
static void registerMBean(ExecutorService executor, long timeout, ManagementContext context, Object object, ObjectName objectName)
           
 
Methods inherited from class org.apache.activemq.broker.jmx.AnnotatedMBean
getDescription, getDescription, getParameterName, registerMBean
 
Methods inherited from class javax.management.StandardMBean
cacheMBeanInfo, getAttribute, getAttributes, getCachedMBeanInfo, getClassName, getConstructors, getDescription, getDescription, getDescription, getDescription, getDescription, getImpact, getImplementation, getImplementationClass, getMBeanInfo, getMBeanInterface, getParameterName, postDeregister, postRegister, preDeregister, preRegister, setAttribute, setAttributes, setImplementation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AsyncAnnotatedMBean

public AsyncAnnotatedMBean(ExecutorService executor,
                           long timeout,
                           T impl,
                           Class<T> mbeanInterface)
                    throws NotCompliantMBeanException
Throws:
NotCompliantMBeanException

AsyncAnnotatedMBean

protected AsyncAnnotatedMBean(Class<?> mbeanInterface)
                       throws NotCompliantMBeanException
Throws:
NotCompliantMBeanException
Method Detail

asyncInvole

protected Object asyncInvole(String s,
                             Object[] objects,
                             String[] strings)
                      throws MBeanException,
                             ReflectionException
Throws:
MBeanException
ReflectionException

registerMBean

public static void registerMBean(ExecutorService executor,
                                 long timeout,
                                 ManagementContext context,
                                 Object object,
                                 ObjectName objectName)
                          throws Exception
Throws:
Exception

invoke

public Object invoke(String s,
                     Object[] objects,
                     String[] strings)
              throws MBeanException,
                     ReflectionException
Specified by:
invoke in interface DynamicMBean
Overrides:
invoke in class AnnotatedMBean
Throws:
MBeanException
ReflectionException


Copyright © 2005-2012 The Apache Software Foundation. All Rights Reserved.