public abstract class AbstractJMXHelper extends Object
Sub-classes must register these MBeans into the MBean server then provide an ObjectName
for each MBean.
This helper exposes two connector servers, one over RMI and one over RO (Remote Objects). Each connector server exposes the anonymous MBean for anonymous users and same for admin users.
The service url of the connector server over RMI for anonymous access is built like
service:jmx:rmi:///jndi/rmi://HOSTNAME_OR_IP:PORT/NAME
where
HOSTNAME_OR_IP
is specified by the ProActive network configuration.
PORT
is provided by sub-classes by the getJMXRMIConnectorServerPort()
method.
NAME
is provided by sub-classes by the getConnectorServerName()
method.
Once booted with boot(Authentication)
infrastructure can be shutdown with the shutdown()
method.
Modifier | Constructor and Description |
---|---|
protected |
AbstractJMXHelper()
Can be called only by sub-classes
|
protected |
AbstractJMXHelper(org.apache.log4j.Logger logger)
Can be called only by sub-classes
|
Modifier and Type | Method and Description |
---|---|
boolean |
boot(Authentication auth)
Starts the boot sequence of of the JMX monitoring infrastructure with a new JMX server.
|
boolean |
boot(Authentication auth,
boolean createNewServer,
PermissionChecker permissionChecker)
Starts the boot sequence of of the JMX monitoring infrastructure.
|
JMXServiceURL |
getAddress(JMXTransportProtocol protocol)
Returns the address of the JMX connector server depending on the specified protocol.
|
abstract String |
getConnectorServerName()
Sub-classes must provide the name of the connector server.
|
RRDDataStore |
getDataStore()
Gets the RRD data base with statistics.
|
abstract int |
getJMXRMIConnectorServerPort()
Sub-classes must provide the port to be used by the JMX RMI connector server.
|
abstract void |
registerMBeans(MBeanServer mbs)
Sub-class must register the MBeans into the MBean server.
|
void |
setDataStore(RRDDataStore rrdDataStore)
Sets the rrd data store.
|
void |
shutdown()
Shutdown the JMX monitoring infrastructure.
|
protected AbstractJMXHelper()
protected AbstractJMXHelper(org.apache.log4j.Logger logger)
public final boolean boot(Authentication auth)
auth
- the object responsible for authenticationtrue
if the boot sequence was successful (at least one of two connector servers were started), otherwise returns false
public final boolean boot(Authentication auth, boolean createNewServer, PermissionChecker permissionChecker)
auth
- the object responsible for authenticationcreateNewServer
- defined is new JMX server will be created or default will be used.permissionChecker
- additional permission checkertrue
if the boot sequence was successful (at least one of two connector servers were started), otherwise returns false
public abstract void registerMBeans(MBeanServer mbs)
mbs
- the MBean serverpublic abstract String getConnectorServerName()
public abstract int getJMXRMIConnectorServerPort()
public void shutdown()
public JMXServiceURL getAddress(JMXTransportProtocol protocol) throws JMException
protocol
- the JMX transport protocolJMException
- in case of boot sequence failurepublic void setDataStore(RRDDataStore rrdDataStore)
rrdDataStore
- public RRDDataStore getDataStore()