Class JMXProvider

All Implemented Interfaces:
Configurable, InstrumentationProvider

public class JMXProvider extends AbstractInstrumentationProvider
A simple MBean JMX instrumentation provider
  • Field Details

    • JMX_INSTRUMENT_ALIASES

      public static final String[] JMX_INSTRUMENT_ALIASES
    • MBEAN_DOMAIN

      public static final String MBEAN_DOMAIN
      The MBean domain for OpenJPA
      See Also:
  • Constructor Details

    • JMXProvider

      public JMXProvider()
  • Method Details

    • registerMBean

      protected void registerMBean(JMXInstrument mBean)
      Register an MBean with the mbean server.
    • getMBeanServer

      public Set<MBeanServer> getMBeanServer()
      Returns the mbean server
    • start

      public void start()
      Description copied from interface: InstrumentationProvider
      Stops the instrumentation provider
      Specified by:
      start in interface InstrumentationProvider
      Specified by:
      start in class AbstractInstrumentationProvider
    • stop

      public void stop()
      Stops all instruments registered with this provider and releases the reference to the Platform MBean server instance.
      Specified by:
      stop in interface InstrumentationProvider
      Specified by:
      stop in class AbstractInstrumentationProvider
    • createObjectName

      public static ObjectName createObjectName(JMXInstrument instrument, Map<String,String> props) throws Exception
      Creates an object name for the supplied instrument and key properties
      Parameters:
      instrument - the instrument
      props - additional key properties
      Returns:
      the JMX object name
      Throws:
      Exception - a generic JMX-type exception
    • startInstrument

      public void startInstrument(Instrument instrument)
      Start an instrument. Registers an mbean with the server.
      Parameters:
      instrument - this instrument to start
    • stopInstrument

      public void stopInstrument(Instrument instrument, boolean force)
      Stop an instrument. Unregisters an mbean with the server.
      Parameters:
      instrument - the instrument to stop
      force - forces the stop if the instrument does not stop gracefully.
    • getInstrumentAliases

      public String[] getInstrumentAliases()
      Returns aliases for built-in instruments.
      Specified by:
      getInstrumentAliases in interface InstrumentationProvider
      Overrides:
      getInstrumentAliases in class AbstractInstrumentationProvider
      Returns:
      a string array of identifier, class name pairs.