Package org.jppf.management
Class JMXNodeConnectionWrapper
java.lang.Object
org.jppf.utils.concurrent.ThreadSynchronization
org.jppf.management.AbstractJMXConnectionWrapper
org.jppf.management.JMXConnectionWrapper
org.jppf.management.JMXNodeConnectionWrapper
- All Implemented Interfaces:
Serializable,AutoCloseable,JPPFAdminMBean,JPPFNodeAdminMBean
Node-specific JMX connection wrapper, implementing a user-friendly interface for the monitoring and management of a node.
Note that this class implements the interface
JPPFNodeAdminMBean.- Author:
- Laurent Cohen
- See Also:
-
Field Summary
Fields inherited from class org.jppf.utils.concurrent.ThreadSynchronization
stoppedFields inherited from interface org.jppf.management.JPPFNodeAdminMBean
MBEAN_NAME -
Constructor Summary
ConstructorsConstructorDescriptionInitialize a local connection to the MBean server.JMXNodeConnectionWrapper(String host, int port) Initialize the connection to the remote MBean server.JMXNodeConnectionWrapper(String host, int port, boolean secure) Initialize the connection to the remote MBean server. -
Method Summary
Modifier and TypeMethodDescriptionvoidCancel the job with the specified id.booleanCancel a previous deferred shutdown or restart request, if any.Get the current class loader delegation model for the node.Get a proxy to the diagnostics/JVM health MBean.Deprecated.Deprecated.usegetNodeProvisioner()instead.Deprecated.usegetNodeTaskMonitor()instead.A shortcut method forgetProxy(JPPFNodeMaintenanceMBean.MBEAN_NAME, JPPFNodeMaintenanceMBean.class).A shortcut method forgetProxy(JPPFNodeProvisioningMBean.MBEAN_NAME, JPPFNodeProvisioningMBean.class).A shortcut method forgetProxy(JPPFNodeTaskMonitorMBean.MBEAN_NAME, JPPFNodeTaskMonitorMBean.class).Determine wether a deffered shutdwon or restartd was requested and not yet performed for the node.voidForce the node to reconnect without restarting.voidReset the node's executed tasks counter to zero.voidrestart()Restart the node.voidRestart the node.voidSet the current class loader delegation model for the node.voidSet the node's executed tasks counter to the specified value.voidshutdown()Shutdown the node.voidShutdown the node.state()Get the latest state information from the node.Get detailed information about the node's JVM properties, environment variables and runtime information such as memory usage and available processors.voidupdateConfiguration(Map<Object, Object> configOverrides, Boolean restart) Update the configuration properties of the node.voidupdateConfiguration(Map<Object, Object> configOverrides, Boolean restart, Boolean interruptIfRunning) Update the configuration properties of the node.voidupdateThreadPoolSize(Integer size) Set the size of the node's thread pool.voidupdateThreadsPriority(Integer newPriority) Update the priority of all execution threads.Methods inherited from class org.jppf.management.JMXConnectionWrapper
addJMXConnectionWrapperListener, addNotificationListener, addNotificationListener, close, connect, connectAndWait, getAttribute, getHost, getJmxconnector, getMbeanConnection, getNotificationInfo, getPort, getProxy, getProxy, getURL, invoke, invoke, isConnected, isSecure, removeJMXConnectionWrapperListener, removeNotificationListener, removeNotificationListener, setAttributeMethods inherited from class org.jppf.management.AbstractJMXConnectionWrapper
getDisplayName, getId, getLastConnectionException, getProtocol, isReconnectOnError, setReconnectOnError, toStringMethods inherited from class org.jppf.utils.concurrent.ThreadSynchronization
goToSleep, goToSleep, goToSleep, isStopped, setStopped, wakeUp
-
Constructor Details
-
JMXNodeConnectionWrapper
public JMXNodeConnectionWrapper()Initialize a local connection to the MBean server. -
JMXNodeConnectionWrapper
Initialize the connection to the remote MBean server.- Parameters:
host- the host the server is running on.port- the RMI port used by the server.
-
JMXNodeConnectionWrapper
Initialize the connection to the remote MBean server.- Parameters:
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.
-
-
Method Details
-
state
Get the latest state information from the node.- Specified by:
statein interfaceJPPFNodeAdminMBean- Returns:
- a
JPPFNodeStateinformation. - Throws:
Exception- if an error occurs while invoking the Node MBean.
-
updateThreadPoolSize
Set the size of the node's thread pool.- Specified by:
updateThreadPoolSizein interfaceJPPFNodeAdminMBean- Parameters:
size- the size as an int.- Throws:
Exception- if an error occurs while invoking the Node MBean.
-
systemInformation
Get detailed information about the node's JVM properties, environment variables and runtime information such as memory usage and available processors.- Specified by:
systemInformationin interfaceJPPFAdminMBean- Overrides:
systemInformationin classJMXConnectionWrapper- Returns:
- a
JPPFSystemInformationinstance. - Throws:
Exception- if an error occurs while invoking the Node MBean.
-
shutdown
Shutdown the node.- Specified by:
shutdownin interfaceJPPFNodeAdminMBean- Throws:
Exception- if an error is raised when invoking the node mbean.
-
shutdown
Shutdown the node.- Specified by:
shutdownin interfaceJPPFNodeAdminMBean- Parameters:
interruptIfRunning- whentrue, then shutdown the node even if it is executing tasks, whenfalse, then only shutdown the node when it is no longer executing.- Throws:
Exception- if any error occurs.- Since:
- 5.0
-
restart
Restart the node.- Specified by:
restartin interfaceJPPFNodeAdminMBean- Throws:
Exception- if an error is raised when invoking the node mbean.
-
restart
Restart the node.- Specified by:
restartin interfaceJPPFNodeAdminMBean- Parameters:
interruptIfRunning- whentrue, then restart the node even if it is executing tasks, whenfalse, then only restart the node when it is no longer executing.- Throws:
Exception- if any error occurs.- Since:
- 5.0
-
reconnect
Force the node to reconnect without restarting.- Specified by:
reconnectin interfaceJPPFNodeAdminMBean- Parameters:
interruptIfRunning- whentrue, then reconnect the node even if it is executing tasks, whenfalse, then only restart the node when it is no longer executing.- Throws:
Exception- if any error occurs.- Since:
- 6.3
-
resetTaskCounter
Reset the node's executed tasks counter to zero.- Specified by:
resetTaskCounterin interfaceJPPFNodeAdminMBean- Throws:
Exception- if an error is raised when invoking the node mbean.
-
setTaskCounter
Set the node's executed tasks counter to the specified value.- Specified by:
setTaskCounterin interfaceJPPFNodeAdminMBean- Parameters:
n- the new value of the task counter.- Throws:
Exception- if an error is raised when invoking the node mbean.
-
updateThreadsPriority
Update the priority of all execution threads.- Specified by:
updateThreadsPriorityin interfaceJPPFNodeAdminMBean- Parameters:
newPriority- the new priority to set.- Throws:
Exception- if an error is raised when invoking the node mbean.
-
updateConfiguration
public void updateConfiguration(Map<Object, Object> configOverrides, Boolean restart) throws ExceptionUpdate the configuration properties of the node.- Specified by:
updateConfigurationin interfaceJPPFNodeAdminMBean- Parameters:
configOverrides- the set of properties to update.restart- specifies whether the node should be restarted after updating the properties.- Throws:
Exception- if an error is raised when invoking the node mbean.
-
updateConfiguration
public void updateConfiguration(Map<Object, Object> configOverrides, Boolean restart, Boolean interruptIfRunning) throws ExceptionUpdate the configuration properties of the node.- Specified by:
updateConfigurationin interfaceJPPFNodeAdminMBean- Parameters:
configOverrides- the set of properties to update.restart- specifies whether the node should be restarted after updating the properties.interruptIfRunning- whentrue, then restart the node even if it is executing tasks, whenfalse, then only shutdown the node when it is no longer executing. This parameter only applies when therestartparameter istrue.- Throws:
Exception- if an error is raised when invoking the node mbean.- Since:
- 5.2
-
cancelJob
Cancel the job with the specified id.- Specified by:
cancelJobin interfaceJPPFNodeAdminMBean- Parameters:
jobUuid- the id of the job to cancel.requeue- true if the job should be requeued on the server side, false otherwise.- Throws:
Exception- if any error occurs.
-
getDelegationModel
Description copied from interface:JPPFNodeAdminMBeanGet the current class loader delegation model for the node.- Specified by:
getDelegationModelin interfaceJPPFNodeAdminMBean- Returns:
- either
PARENT_FIRSTorLOCAL_FIRST. - Throws:
Exception- if any error occurs.
-
setDelegationModel
Description copied from interface:JPPFNodeAdminMBeanSet the current class loader delegation model for the node.- Specified by:
setDelegationModelin interfaceJPPFNodeAdminMBean- Parameters:
model- either eitherPARENT_FIRSTorLOCAL_FIRST. If any other value is specified then this method has no effect.- Throws:
Exception- if any error occurs.
-
getDiagnosticsProxy
Description copied from class:JMXConnectionWrapperGet a proxy to the diagnostics/JVM health MBean.- Overrides:
getDiagnosticsProxyin classJMXConnectionWrapper- Returns:
- a DiagnosticsMBean instance.
- Throws:
Exception- if any error occurs.
-
pendingAction
Description copied from interface:JPPFNodeAdminMBeanDetermine wether a deffered shutdwon or restartd was requested and not yet performed for the node.- Specified by:
pendingActionin interfaceJPPFNodeAdminMBean- Returns:
- one of the possible pending actions specified in the enum
NodePendingAction.
-
cancelPendingAction
public boolean cancelPendingAction()Description copied from interface:JPPFNodeAdminMBeanCancel a previous deferred shutdown or restart request, if any.- Specified by:
cancelPendingActionin interfaceJPPFNodeAdminMBean- Returns:
trueif the node has a pending action and it was cancelled,falseotherwise.
-
getJPPFNodeMaintenanceMProxy
Deprecated.usegetNodeMaintenance()instead.A shortcut method forgetProxy(JPPFNodeMaintenanceMBean.MBEAN_NAME, JPPFNodeMaintenanceMBean.class).- Returns:
- a dynamic proxy implementing the
JPPFNodeMaintenanceMBeaninterface. - Throws:
Exception- if any error occurs.- Since:
- 5.2
-
getNodeMaintenance
A shortcut method forgetProxy(JPPFNodeMaintenanceMBean.MBEAN_NAME, JPPFNodeMaintenanceMBean.class).- Returns:
- a dynamic proxy implementing the
JPPFNodeMaintenanceMBeaninterface. - Throws:
Exception- if any error occurs.- Since:
- 6.2
-
getJPPFNodeTaskMonitorProxy
Deprecated.usegetNodeTaskMonitor()instead.A shortcut method forgetProxy(JPPFNodeTaskMonitorMBean.MBEAN_NAME, JPPFNodeTaskMonitorMBean.class).- Returns:
- a dynamic proxy implementing the
JPPFNodeTaskMonitorMBeaninterface. - Throws:
Exception- if any error occurs.- Since:
- 5.2
-
getNodeTaskMonitor
A shortcut method forgetProxy(JPPFNodeTaskMonitorMBean.MBEAN_NAME, JPPFNodeTaskMonitorMBean.class).- Returns:
- a dynamic proxy implementing the
JPPFNodeTaskMonitorMBeaninterface. - Throws:
Exception- if any error occurs.- Since:
- 6.2
-
getJPPFNodeProvisioningProxy
Deprecated.usegetNodeProvisioner()instead.A shortcut method forgetProxy(JPPFNodeProvisioningMBean.MBEAN_NAME, JPPFNodeProvisioningMBean.class).- Returns:
- a dynamic proxy implementing the
JPPFNodeProvisioningMBeaninterface. - Throws:
Exception- if any error occurs.- Since:
- 5.2
-
getNodeProvisioner
A shortcut method forgetProxy(JPPFNodeProvisioningMBean.MBEAN_NAME, JPPFNodeProvisioningMBean.class).- Returns:
- a dynamic proxy implementing the
JPPFNodeProvisioningMBeaninterface. - Throws:
Exception- if any error occurs.- Since:
- 6.2
-
getNodeMaintenance()instead.