Class JMXProvider
java.lang.Object
org.apache.openjpa.lib.instrumentation.AbstractInstrumentationProvider
org.apache.openjpa.instrumentation.jmx.JMXProvider
- All Implemented Interfaces:
Configurable
,InstrumentationProvider
A simple MBean JMX instrumentation provider
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic ObjectName
createObjectName
(JMXInstrument instrument, Map<String, String> props) Creates an object name for the supplied instrument and key propertiesString[]
Returns aliases for built-in instruments.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 Details
-
JMX_INSTRUMENT_ALIASES
-
MBEAN_DOMAIN
The MBean domain for OpenJPA- See Also:
-
-
Constructor Details
-
JMXProvider
public JMXProvider()
-
-
Method Details
-
registerMBean
Register an MBean with the mbean server. -
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 ObjectName createObjectName(JMXInstrument instrument, Map<String, String> props) throws ExceptionCreates an object name for the supplied instrument and key properties- Parameters:
instrument
- the instrumentprops
- additional key properties- Returns:
- the JMX object name
- Throws:
Exception
- a generic JMX-type exception
-
startInstrument
Start an instrument. Registers an mbean with the server.- Parameters:
instrument
- this instrument to start
-
stopInstrument
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
Returns aliases for built-in instruments.- Specified by:
getInstrumentAliases
in interfaceInstrumentationProvider
- Overrides:
getInstrumentAliases
in classAbstractInstrumentationProvider
- Returns:
- a string array of identifier, class name pairs.
-