public class JMXDriverConnectionWrapper extends JMXConnectionWrapper implements JPPFDriverAdminMBean
JPPFDriverAdminMBean
.closed, connected, CONNECTION_NAME_PREFIX, connectionThread, displayName, env, host, idString, jmxc, local, mbeanConnection, port, sslEnabled, url
stopped
MBEAN_NAME
Constructor and Description |
---|
JMXDriverConnectionWrapper()
Initialize a local connection to the MBean server.
|
JMXDriverConnectionWrapper(String host,
int port)
Initialize a plain (non-secure) connection to the remote MBean server.
|
JMXDriverConnectionWrapper(String host,
int port,
boolean secure)
Initialize the connection to the remote MBean server.
|
Modifier and Type | Method and Description |
---|---|
void |
cancelJob(String jobId)
Cancel the job with the specified id.
|
String |
changeLoadBalancerSettings(String algorithm,
Map<Object,Object> parameters)
Change the bundle size tuning settings.
|
Map<String,Object> |
forwardGetAttribute(NodeSelector selector,
String name,
String attribute)
Get the value of an attribute of the specified MBean for each specified node.
|
Map<String,Object> |
forwardInvoke(NodeSelector selector,
String name,
String methodName)
Convenience method to invoke an MBean method that has no parameter.
|
Map<String,Object> |
forwardInvoke(NodeSelector selector,
String name,
String methodName,
Object[] params,
String[] signature)
Invoke a method on the specified MBean of all nodes attached to the driver.
|
Map<String,Object> |
forwardSetAttribute(NodeSelector selector,
String name,
String attribute,
Object value)
Set the value of an attribute of the specified MBean on the specified nodes attached to the driver.
|
Map<String,Boolean> |
getActiveState(NodeSelector selector)
Get the active states of the nodes specified vith a
NodeSelector . |
String[] |
getAllJobIds()
Deprecated.
|
boolean |
getBroadcasting()
Determine whether the driver is broadcasting or not.
|
DiagnosticsMBean |
getDiagnosticsProxy()
Get a proxy to the diagnostics/JVM health MBean.
|
JobInformation |
getJobInformation(String jobId)
Get an object describing the job with the specified id.
|
DriverJobManagementMBean |
getJobManager()
This convenience method creates a proxy to the driver's mbean which manages and monitors jobs.
|
LoadBalancerPersistenceManagement |
getLoadBalancerPersistenceManagement()
This convenience method creates a proxy to the driver's mbean that manages the load-balancers persisted states.
|
JPPFNodeForwardingMBean |
getNodeForwarder()
This convenience method creates a proxy to the driver's mbean which forwards requests to its nodes.
|
NodeJobInformation[] |
getNodeInformation(String jobId)
Get a list of objects describing the nodes to which the whole or part of a job was dispatched.
|
Collection<JPPFManagementInfo> |
idleNodesInformation()
Request the JMX connection information for all the idle nodes attached to the server.
|
Collection<JPPFManagementInfo> |
idleNodesInformation(NodeSelector selector)
Request the JMX connection information for all the idle nodes attached to the server which satisfy the specified selector.
|
LoadBalancingInformation |
loadBalancerInformation()
Obtain the current load-balancing settings.
|
Integer |
nbIdleNodes()
Get the number of nodes currently idle.
|
Integer |
nbIdleNodes(NodeSelector selector)
Get the number of idle nodes attached to the driver that satisfy the specified selector.
|
Integer |
nbIdleNodes(NodeSelector selector,
boolean includePeers)
Get the number of idle nodes attached to the driver that satisfy the specified selector.
|
Integer |
nbNodes()
Get the number of nodes attached to the driver.
|
Integer |
nbNodes(NodeSelector selector)
Get the number of nodes attached to the driver that satisfy the specified selector.
|
Collection<JPPFManagementInfo> |
nodesInformation()
Request the JMX connection information for all the nodes attached to the server.
|
Collection<JPPFManagementInfo> |
nodesInformation(NodeSelector selector)
Request the JMX connection information for all the nodes attached to the server which satisfy the specified selector.
|
Collection<JPPFManagementInfo> |
nodesInformation(NodeSelector selector,
boolean includePeers)
Request the JMX connection information for all the nodes attached to the server which satisfy the specified selector.
|
String |
registerForwardingNotificationListener(NodeSelector selector,
String mBeanName,
javax.management.NotificationListener listener,
javax.management.NotificationFilter filter,
Object handback)
Register a notification listener which will receive notifications from from the specified MBean on the selected nodes.
|
void |
resetStatistics()
Reset this server's statistics.
|
String |
restartShutdown(Long shutdownDelay,
Long restartDelay)
Perform a shutdown or restart of the server.
|
void |
resumeJob(String jobId)
Resume the job with the specified id.
|
void |
setActiveState(NodeSelector selector,
boolean active)
Set the active state of the specified nodes.
|
void |
setBroadcasting(boolean broadcasting)
Activate or deactivate the broadcasting of the driver's connection information.
|
JPPFStatistics |
statistics()
Get the latest statistics snapshot from the JPPF driver.
|
void |
suspendJob(String jobId,
Boolean requeue)
Suspend the job with the specified id.
|
JPPFSystemInformation |
systemInformation()
Get detailed information about the node's JVM properties, environment variables
and runtime information such as memory usage and available processors.
|
void |
toggleActiveState(NodeSelector selector)
Toggle the activate state of the specified nodes.
|
void |
unregisterForwardingNotificationListener(String listenerID)
Register a notification listener which will receive notifications from from the specified MBean on the selected nodes.
|
void |
updateJobPriority(String jobId,
Integer newPriority)
Update the priority of a job.
|
void |
updateMaxNodes(String jobId,
Integer maxNodes)
Update the maximum number of nodes a node can run on.
|
addNotificationListener, addNotificationListener, close, connect, connectAndWait, getAttribute, getJmxconnector, getMbeanConnection, getNotificationInfo, getPort, getProxy, getProxy, getURL, invoke, invoke, isConnected, isSecure, removeNotificationListener, removeNotificationListener, setAttribute
addJMXWrapperListener, fireConnected, fireTimeout, getDisplayName, getHost, getId, getProtocol, removeJMXWrapperListener, setHost, toString
goToSleep, goToSleep, goToSleep, isStopped, setStopped, wakeUp
public JMXDriverConnectionWrapper()
public JMXDriverConnectionWrapper(String host, int port)
host
- the host the server is running on.port
- the port used by the server.public JMXDriverConnectionWrapper(String host, int port, boolean secure)
host
- the host the server is running on.port
- the port used by the server.secure
- specifies whether the connection should be established over SSL/TLS.public Integer nbNodes() throws Exception
JPPFDriverAdminMBean
nbNodes(null)
.nbNodes
in interface JPPFDriverAdminMBean
Exception
- if any error occurs.public Integer nbNodes(NodeSelector selector) throws Exception
JPPFDriverAdminMBean
nbNodes
in interface JPPFDriverAdminMBean
selector
- specifies which nodes shouyld be counted. If null, then NodeSelector.ALL_NODES
will be used.Exception
- if any error occurs.public Collection<JPPFManagementInfo> nodesInformation() throws Exception
JPPFDriverAdminMBean
nodesInformation(null, false)
.nodesInformation
in interface JPPFDriverAdminMBean
JPPFManagementInfo
instances, or null
if information on the nodes could not be retrieved.Exception
- if any error occurs.public Collection<JPPFManagementInfo> nodesInformation(NodeSelector selector) throws Exception
JPPFDriverAdminMBean
nodesInformation(selector, false)
.nodesInformation
in interface JPPFDriverAdminMBean
selector
- specifies which nodes shouyld be counted. If null
, then NodeSelector.ALL_NODES
will be used.JPPFManagementInfo
instances, or null
if information on the nodes could not be retrieved.Exception
- if any error occurs.public Collection<JPPFManagementInfo> nodesInformation(NodeSelector selector, boolean includePeers) throws Exception
JPPFDriverAdminMBean
nodesInformation
in interface JPPFDriverAdminMBean
selector
- specifies which nodes shouyld be counted. If null
, then NodeSelector.ALL_NODES
will be used.includePeers
- whether peer drivers should be counted as nodes and included.JPPFManagementInfo
instances, or null
if information on the nodes could not be retrieved.Exception
- if any error occurs.public JPPFStatistics statistics() throws Exception
JPPFDriverAdminMBean
statistics
in interface JPPFDriverAdminMBean
JPPFStatistics
instance.Exception
- if any error occurs.public String restartShutdown(Long shutdownDelay, Long restartDelay) throws Exception
JPPFDriverAdminMBean
restartShutdown
in interface JPPFDriverAdminMBean
shutdownDelay
- the delay before shutting down the server, once the command is received.restartDelay
- the delay before restarting, once the server is shutdown. If it is < 0, no restart occurs.Exception
- if any error occurs.public String changeLoadBalancerSettings(String algorithm, Map<Object,Object> parameters) throws Exception
JPPFDriverAdminMBean
changeLoadBalancerSettings
in interface JPPFDriverAdminMBean
algorithm
- the name opf the load-balancing algorithm to set.parameters
- the algorithm's parameters.Exception
- if an error occurred while updating the settings.public LoadBalancingInformation loadBalancerInformation() throws Exception
JPPFDriverAdminMBean
loadBalancerInformation
in interface JPPFDriverAdminMBean
LoadBalancingInformation
.Exception
- if an error occurred while fetching the settings.public void cancelJob(String jobId) throws Exception
jobId
- the id of the job to cancel.Exception
- if any error occurs.public void suspendJob(String jobId, Boolean requeue) throws Exception
jobId
- the id of the job to suspend.requeue
- true if the sub-jobs running on each node should be canceled and requeued,
false if they should be left to execute until completion.Exception
- if any error occurs.public void resumeJob(String jobId) throws Exception
jobId
- the id of the job to resume.Exception
- if any error occurs.public void updateMaxNodes(String jobId, Integer maxNodes) throws Exception
jobId
- the id of the job to update.maxNodes
- the new maximum number of nodes for the job.Exception
- if any error occurs.public void updateJobPriority(String jobId, Integer newPriority) throws Exception
jobId
- the id of the job to update.newPriority
- the new priority of the job.Exception
- if any error occurs.public String[] getAllJobIds() throws Exception
Exception
- if any error occurs.public JobInformation getJobInformation(String jobId) throws Exception
jobId
- the id of the job to get information about.JobInformation
.Exception
- if any error occurs.public NodeJobInformation[] getNodeInformation(String jobId) throws Exception
jobId
- the id of the job for which to find node information.NodeManagementInfo
, JobInformation
instances.Exception
- if any error occurs.public void resetStatistics() throws Exception
JPPFDriverAdminMBean
reset()
event via the JPPFDriverStatsManager
instance.resetStatistics
in interface JPPFDriverAdminMBean
Exception
- if any error occurs.public JPPFSystemInformation systemInformation() throws Exception
JPPFAdminMBean
systemInformation
in interface JPPFAdminMBean
systemInformation
in class JMXConnectionWrapper
JPPFSystemInformation
instance.Exception
- if any error occurs.public Integer nbIdleNodes() throws Exception
JPPFDriverAdminMBean
nbIdleNodes(null)
.nbIdleNodes
in interface JPPFDriverAdminMBean
Exception
- if any error occurs.public Integer nbIdleNodes(NodeSelector selector) throws Exception
JPPFDriverAdminMBean
nbIdleNodes
in interface JPPFDriverAdminMBean
selector
- specifies which nodes should be counted. If null
, then NodeSelector.ALL_NODES
will be used.Exception
- if any error occurs.public Integer nbIdleNodes(NodeSelector selector, boolean includePeers) throws Exception
JPPFDriverAdminMBean
nbIdleNodes
in interface JPPFDriverAdminMBean
selector
- specifies which nodes should be counted. If null
, then NodeSelector.ALL_NODES
will be used.includePeers
- whether peer drivers should be counted as nodes and included.Exception
- if any error occurs.public Collection<JPPFManagementInfo> idleNodesInformation() throws Exception
JPPFDriverAdminMBean
idleNodesInformation(null)
.idleNodesInformation
in interface JPPFDriverAdminMBean
JPPFManagementInfo
instances, or null
if information on the nodes could not be retrieved.Exception
- if any error occurs.public Collection<JPPFManagementInfo> idleNodesInformation(NodeSelector selector) throws Exception
JPPFDriverAdminMBean
idleNodesInformation
in interface JPPFDriverAdminMBean
selector
- specifies which nodes shouyld be counted. If null
, then NodeSelector.ALL_NODES
will be used.JPPFManagementInfo
instances, or null
if information on the nodes could not be retrieved.Exception
- if any error occurs.public void toggleActiveState(NodeSelector selector) throws Exception
JPPFDriverAdminMBean
toggleActiveState
in interface JPPFDriverAdminMBean
selector
- determines which nodes will be activated or deactivated. If null
, then NodeSelector.ALL_NODES
will be used.Exception
- if any error occurs.public Map<String,Boolean> getActiveState(NodeSelector selector) throws Exception
JPPFDriverAdminMBean
NodeSelector
.getActiveState
in interface JPPFDriverAdminMBean
selector
- specifies for which nodes to retrieve the active states. If null
, then NodeSelector.ALL_NODES
will be used.Exception
- if any error occurs.public void setActiveState(NodeSelector selector, boolean active) throws Exception
JPPFDriverAdminMBean
setActiveState
in interface JPPFDriverAdminMBean
selector
- determines which nodes will be activated or deactivated. If null
, then NodeSelector.ALL_NODES
will be used.active
- specifies the activer state to set on the selected nodes.Exception
- if any error occurs.public void setBroadcasting(boolean broadcasting) throws Exception
JPPFDriverAdminMBean
setBroadcasting
in interface JPPFDriverAdminMBean
broadcasting
- true
to activate the broadcast, false
to deactivate it.Exception
- if any error occurs.public boolean getBroadcasting() throws Exception
JPPFDriverAdminMBean
getBroadcasting
in interface JPPFDriverAdminMBean
true
if the broadcasting service is on, false
if it is off.Exception
- if any error occurs.public JPPFNodeForwardingMBean getNodeForwarder() throws Exception
getProxy(JPPFNodeForwardingMBean.MBEAN_NAME, JPPFNodeForwardingMBean.class)
.JPPFNodeForwardingMBean
.Exception
- if a proxy could not be created for any reason.public DriverJobManagementMBean getJobManager() throws Exception
getProxy(DriverJobManagementMBean.MBEAN_NAME, DriverJobManagementMBean.class)
.DriverJobManagementMBean
.Exception
- if a proxy could not be created for any reason.public LoadBalancerPersistenceManagement getLoadBalancerPersistenceManagement() throws Exception
getProxy(LoadBalancerPersistenceManagerMBean.MBEAN_NAME, LoadBalancerPersistenceManagerMBean.class)
.PersistedJobsManagerMBean
.Exception
- if a proxy could not be created for any reason.public String registerForwardingNotificationListener(NodeSelector selector, String mBeanName, javax.management.NotificationListener listener, javax.management.NotificationFilter filter, Object handback) throws Exception
selector
- determines which nodes will be selected.mBeanName
- the name of the MBean from which to receive notificaztions from the selected nodes.listener
- the listener to register.filter
- the notification filter.handback
- the handback object.JMXDriverConnectionWrapper.unregisterForwardingNotificationListener(String)
.Exception
- if any error occurs.public void unregisterForwardingNotificationListener(String listenerID) throws Exception
listenerID
- the id of a listener previously registered with JMXDriverConnectionWrapper.registerForwardingNotificationListener(NodeSelector,String,NotificationListener,NotificationFilter,Object)
.Exception
- if the listener with this id was not found or if any other error occurss.public Map<String,Object> forwardInvoke(NodeSelector selector, String name, String methodName, Object[] params, String[] signature) throws Exception
selector
- a filter on the nodes attached tot he driver, determines the nodes to which this method applies.name
- the name of the MBean.methodName
- the name of the method to invoke.params
- the method parameter values.signature
- the types of the method parameters.null
, in particular if the invoked method has a void
return type.Exception
- if the invocation failed.public Map<String,Object> forwardInvoke(NodeSelector selector, String name, String methodName) throws Exception
forwardInvoke(selector, name, methodName, (Object[]) null, (String[]) null)
.selector
- a filter on the nodes attached to the driver, determines the nodes to which this method applies.name
- the name of the node MBean to invoke.methodName
- the name of the method to invoke.null
, in particular if the invoked method has a void
return type.Exception
- if the invocation failed.public Map<String,Object> forwardGetAttribute(NodeSelector selector, String name, String attribute) throws Exception
selector
- a filter on the nodes attached tot he driver, determines the nodes to which this method applies.name
- the name of the MBean to invoke for each node.attribute
- the name of the MBean attribute to read.Exception
- if the invocation failed.public Map<String,Object> forwardSetAttribute(NodeSelector selector, String name, String attribute, Object value) throws Exception
selector
- a filter on the nodes attached to the driver, determines the nodes to which this method applies.name
- the name of the MBean to invoke for each node.attribute
- the name of the MBean attribute to set.value
- the value to set on the attribute.Exception
- if the invocation failed.public DiagnosticsMBean getDiagnosticsProxy() throws Exception
JMXConnectionWrapper
getDiagnosticsProxy
in class JMXConnectionWrapper
Exception
- if any error occurs.Copyright © 2005-2018 JPPF Team.