org.apache.derby.impl.services.jmx
Class JMXManagementService
- java.lang.Object
-
- org.apache.derby.impl.services.jmx.JMXManagementService
-
- All Implemented Interfaces:
- ManagementService, ModuleControl, ManagementMBean
public final class JMXManagementService extends java.lang.Object implements ManagementService, ModuleControl
This class implements the ManagementService interface and provides a simple management and monitoring service. An mbean registered with this service remains until it is unregistered. While registered with this service it may be registered and unregistered with the jmx service a number of times.- See Also:
ManagementService
-
-
Field Summary
-
Fields inherited from interface org.apache.derby.iapi.services.jmx.ManagementService
DERBY_JMX_DOMAIN
-
-
Constructor Summary
Constructors Constructor and Description JMXManagementService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidboot(boolean create, java.util.Properties properties)Start the management service if derby.system.jmx is true.java.lang.StringgetSystemIdentifier()Get the system identifier that this MBean is managing.booleanisManagementActive()Is Derby's JMX management active.<T> java.lang.ObjectregisterMBean(T bean, java.lang.Class<T> beanInterface, java.lang.String keyProperties)Registers an MBean with the MBean server as a StandardMBean.voidstartManagement()Inform Derby to start its JMX management by registering MBeans relevant to its current state.voidstop()Stop the module.voidstopManagement()Inform Derby to stop its JMX management by unregistering its MBeans.voidunregisterMBean(java.lang.Object mbeanIdentifier)Unregister an mbean using an object previous returned from registerMBean.
-
-
-
Method Detail
-
boot
public void boot(boolean create, java.util.Properties properties) throws StandardExceptionStart the management service if derby.system.jmx is true.Starting the service means:
- getting the platform MBeanServer which may require starting it
- registering a Version mbean representing the system
- Specified by:
bootin interfaceModuleControl- Throws:
StandardException- Module cannot be started.- See Also:
Monitor,ModuleFactory
-
stop
public void stop()
Description copied from interface:ModuleControlStop the module. The module may be found via a findModule() method until some time after this method returns. Therefore the factory must be prepared to reject requests to it once it has been stopped. In addition other modules may cache a reference to the module and make requests of it after it has been stopped, these requests should be rejected as well.- Specified by:
stopin interfaceModuleControl- See Also:
Monitor,ModuleFactory
-
registerMBean
public <T> java.lang.Object registerMBean(T bean, java.lang.Class<T> beanInterface, java.lang.String keyProperties) throws StandardExceptionRegisters an MBean with the MBean server as a StandardMBean. Use of the StandardMBean allows the implementation details of Derby's mbeans to be hidden from JMX, thus only exposing the MBean's interface in org.apache.derby.mbeans.- Specified by:
registerMBeanin interfaceManagementService- Parameters:
bean- The MBean to wrap with a StandardMBean and registerbeanInterface- The management interface for the MBean.keyProperties- The String representation of the MBean's key properties, they will be added into the ObjectName with Derby's domain. Key type should be first with a short name for the bean, typically the class name without the package.- Returns:
- An idenitifier that can later be used to unregister the mbean.
- Throws:
StandardException
-
unregisterMBean
public void unregisterMBean(java.lang.Object mbeanIdentifier)
Unregister an mbean using an object previous returned from registerMBean.- Specified by:
unregisterMBeanin interfaceManagementService- Parameters:
mbeanIdentifier- An identifier returned by registerMBean.
-
isManagementActive
public boolean isManagementActive()
Description copied from interface:ManagementMBeanIs Derby's JMX management active. If active then Derby has registered MBeans relevant to its current state.- Specified by:
isManagementActivein interfaceManagementMBean- Returns:
- true Derby has registered beans, false Derby has not registered any beans.
-
startManagement
public void startManagement()
Description copied from interface:ManagementMBeanInform Derby to start its JMX management by registering MBeans relevant to its current state. If Derby is not booted then no action is taken.Require
SystemPermission("jmx", "control")if a security manager is installed.- Specified by:
startManagementin interfaceManagementMBean- See Also:
SystemPermission
-
stopManagement
public void stopManagement()
Description copied from interface:ManagementMBeanInform Derby to stop its JMX management by unregistering its MBeans. If Derby is not booted then no action is taken.Require
SystemPermission("jmx", "control")if a security manager is installed.- Specified by:
stopManagementin interfaceManagementMBean- See Also:
SystemPermission
-
getSystemIdentifier
public java.lang.String getSystemIdentifier()
Description copied from interface:ManagementMBeanGet the system identifier that this MBean is managing. The system identifier is a runtime value to disambiguate multiple Derby systems in the same virtual machine but different class loaders.- Specified by:
getSystemIdentifierin interfaceManagementMBean- Returns:
- Runtime identifier for the system, null if Derby is not running.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG