Class JMXProvider
- java.lang.Object
-
- org.apache.openjpa.lib.instrumentation.AbstractInstrumentationProvider
-
- org.apache.openjpa.instrumentation.jmx.JMXProvider
-
- All Implemented Interfaces:
Configurable
,InstrumentationProvider
public class JMXProvider extends AbstractInstrumentationProvider
A simple MBean JMX instrumentation provider
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String[]
JMX_INSTRUMENT_ALIASES
static java.lang.String
MBEAN_DOMAIN
The MBean domain for OpenJPA
-
Constructor Summary
Constructors Constructor Description JMXProvider()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static javax.management.ObjectName
createObjectName(JMXInstrument instrument, java.util.Map<java.lang.String,java.lang.String> props)
Creates an object name for the supplied instrument and key propertiesjava.lang.String[]
getInstrumentAliases()
Returns aliases for built-in instruments.java.util.Set<javax.management.MBeanServer>
getMBeanServer()
Returns the mbean serverprotected void
registerMBean(JMXInstrument mBean)
Register an MBean with the mbean server.void
start()
Stops the instrumentation providervoid
startInstrument(Instrument instrument)
Start an instrument.void
stop()
Stops all instruments registered with this provider and releases the reference to the Platform MBean server instance.void
stopInstrument(Instrument instrument, boolean force)
Stop an instrument.-
Methods inherited from class org.apache.openjpa.lib.instrumentation.AbstractInstrumentationProvider
addInstrument, endConfiguration, getConfiguration, getInstrument, getInstrumentByName, getInstruments, getOptions, initializeInstrument, initializeInstrument, isStarted, removeInstrumentByName, setConfiguration, setInstrument, setOptions, setStarted, startConfiguration, startInstruments, stopInstrument, stopInstruments
-
-
-
-
Field Detail
-
JMX_INSTRUMENT_ALIASES
public static final java.lang.String[] JMX_INSTRUMENT_ALIASES
-
MBEAN_DOMAIN
public static final java.lang.String MBEAN_DOMAIN
The MBean domain for OpenJPA- See Also:
- Constant Field Values
-
-
Method Detail
-
registerMBean
protected void registerMBean(JMXInstrument mBean)
Register an MBean with the mbean server.
-
getMBeanServer
public java.util.Set<javax.management.MBeanServer> getMBeanServer()
Returns the mbean server
-
start
public void start()
Description copied from interface:InstrumentationProvider
Stops the instrumentation provider- Specified by:
start
in interfaceInstrumentationProvider
- Specified by:
start
in classAbstractInstrumentationProvider
-
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 interfaceInstrumentationProvider
- Specified by:
stop
in classAbstractInstrumentationProvider
-
createObjectName
public static javax.management.ObjectName createObjectName(JMXInstrument instrument, java.util.Map<java.lang.String,java.lang.String> props) throws java.lang.Exception
Creates an object name for the supplied instrument and key properties- Parameters:
instrument
- the instrumentprops
- additional key properties- Returns:
- the JMX object name
- Throws:
java.lang.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 stopforce
- forces the stop if the instrument does not stop gracefully.
-
getInstrumentAliases
public java.lang.String[] getInstrumentAliases()
Returns aliases for built-in instruments.- Specified by:
getInstrumentAliases
in interfaceInstrumentationProvider
- Overrides:
getInstrumentAliases
in classAbstractInstrumentationProvider
- Returns:
- a string array of identifier, class name pairs.
-
-