Class JmxMBeanAgent


  • public class JmxMBeanAgent
    extends java.lang.Object
    Utility class for registering MBeans with a JMX MBeanServer. This allows AnalysisEngine performance stats to be monitored through JMX, for example.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static boolean jmxAvailable
      Set to true if we can find the required JMX classes and methods
      private static java.lang.String LOG_RESOURCE_BUNDLE
      resource bundle for log messages
      private static javax.management.MBeanServer platformMBeanServer
      The platform MBean server This is available since Java 1.5
    • Constructor Summary

      Constructors 
      Constructor Description
      JmxMBeanAgent()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void registerMBean​(ManagementObject aMBean, java.lang.Object aMBeanServerO)
      Register an MBean with the MBeanServer.
      static void unregisterMBean​(ManagementObject aMBean, java.lang.Object aMBeanServerO)
      Unregister an MBean from the MBeanServer.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • jmxAvailable

        private static boolean jmxAvailable
        Set to true if we can find the required JMX classes and methods
      • platformMBeanServer

        private static javax.management.MBeanServer platformMBeanServer
        The platform MBean server This is available since Java 1.5
      • LOG_RESOURCE_BUNDLE

        private static final java.lang.String LOG_RESOURCE_BUNDLE
        resource bundle for log messages
        See Also:
        Constant Field Values
    • Constructor Detail

      • JmxMBeanAgent

        public JmxMBeanAgent()
    • Method Detail

      • registerMBean

        public static void registerMBean​(ManagementObject aMBean,
                                         java.lang.Object aMBeanServerO)
        Register an MBean with the MBeanServer.
        Parameters:
        aMBean - the MBean to register
        aMBeanServerO - server to register with. If null, the platform MBeanServer will be used if we are running under Java 1.5. Earlier versions of Java did not have a platform MBeanServer; in that case, this method will do nothing.
      • unregisterMBean

        public static void unregisterMBean​(ManagementObject aMBean,
                                           java.lang.Object aMBeanServerO)
        Unregister an MBean from the MBeanServer.
        Parameters:
        aMBean - the MBean to register
        aMBeanServerO - server to unregister from. If null, the platform MBeanServer will be used if we are running under Java 1.5. Earlier versions of Java did not have a platform MBeanServer; in that case, this method will do nothing.