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
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ObjectNamecreateObjectName(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 voidregisterMBean(JMXInstrument mBean) Register an MBean with the mbean server.voidstart()Stops the instrumentation providervoidstartInstrument(Instrument instrument) Start an instrument.voidstop()Stops all instruments registered with this provider and releases the reference to the Platform MBean server instance.voidstopInstrument(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:InstrumentationProviderStops the instrumentation provider- Specified by:
startin interfaceInstrumentationProvider- Specified by:
startin classAbstractInstrumentationProvider
-
stop
public void stop()Stops all instruments registered with this provider and releases the reference to the Platform MBean server instance.- Specified by:
stopin interfaceInstrumentationProvider- Specified by:
stopin 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:
getInstrumentAliasesin interfaceInstrumentationProvider- Overrides:
getInstrumentAliasesin classAbstractInstrumentationProvider- Returns:
- a string array of identifier, class name pairs.
-