public class ComponentAdmin extends Object implements ComponentAdminMBean
Constructor and Description |
---|
ComponentAdmin(String name,
IntegrityMonitor integrityMonitor,
StateManagement stateManager)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
static MBeanServer |
createMBeanServer()
Creates the MBeanServer (intended for unit testing only).
|
static MBeanServer |
findMBeanServer()
Finds the MBeanServer.
|
static ObjectName |
getObjectName(String componentName)
Get the MBean object name for the specified feature name.
|
boolean |
isRegistered()
Checks if this MBean is registered with the MBeanServer.
|
void |
lock()
Administratively lock component.
|
void |
register()
Registers with the MBean server.
|
void |
test()
Test health of component.
|
String |
toString() |
void |
unlock()
Administratively unlock component.
|
void |
unregister()
Unregisters with the MBean server.
|
public ComponentAdmin(String name, IntegrityMonitor integrityMonitor, StateManagement stateManager) throws Exception
name
- the MBean nameintegrityMonitor
- stateManager
- Exception
public void register() throws MalformedObjectNameException, MBeanRegistrationException, InstanceNotFoundException, InstanceAlreadyExistsException, NotCompliantMBeanException
MalformedObjectNameException
- a JMX exceptionInstanceNotFoundException
- a JMX exceptionMBeanRegistrationException
- a JMX exceptionNotCompliantMBeanException
- a JMX exceptionInstanceAlreadyExistsException
- a JMX exceptionpublic boolean isRegistered()
public void unregister() throws MBeanRegistrationException, InstanceNotFoundException
InstanceNotFoundException
- a JMX exceptionMBeanRegistrationException
- a JMX exceptionpublic static MBeanServer findMBeanServer()
public static MBeanServer createMBeanServer()
public static ObjectName getObjectName(String componentName) throws MalformedObjectNameException
componentName
- component nameMalformedObjectNameException
- a JMX exceptionpublic void test() throws Exception
ComponentAdminMBean
test
in interface ComponentAdminMBean
Exception
- if the component fails the health checkpublic void lock() throws Exception
ComponentAdminMBean
lock
in interface ComponentAdminMBean
Exception
- if the component lock failspublic void unlock() throws Exception
ComponentAdminMBean
unlock
in interface ComponentAdminMBean
Exception
- if the component unlock failsCopyright © 2017. All rights reserved.