Class JMXNodeConnectionWrapper

All Implemented Interfaces:
Serializable, AutoCloseable, JPPFAdminMBean, JPPFNodeAdminMBean

public class JMXNodeConnectionWrapper extends JMXConnectionWrapper implements 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:
  • Constructor Details

    • JMXNodeConnectionWrapper

      public JMXNodeConnectionWrapper()
      Initialize a local connection to the MBean server.
    • JMXNodeConnectionWrapper

      public JMXNodeConnectionWrapper(String host, int port)
      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

      public JMXNodeConnectionWrapper(String host, int port, boolean secure)
      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

      public JPPFNodeState state() throws Exception
      Get the latest state information from the node.
      Specified by:
      state in interface JPPFNodeAdminMBean
      Returns:
      a JPPFNodeState information.
      Throws:
      Exception - if an error occurs while invoking the Node MBean.
    • updateThreadPoolSize

      public void updateThreadPoolSize(Integer size) throws Exception
      Set the size of the node's thread pool.
      Specified by:
      updateThreadPoolSize in interface JPPFNodeAdminMBean
      Parameters:
      size - the size as an int.
      Throws:
      Exception - if an error occurs while invoking the Node MBean.
    • systemInformation

      public JPPFSystemInformation systemInformation() throws Exception
      Get detailed information about the node's JVM properties, environment variables and runtime information such as memory usage and available processors.
      Specified by:
      systemInformation in interface JPPFAdminMBean
      Overrides:
      systemInformation in class JMXConnectionWrapper
      Returns:
      a JPPFSystemInformation instance.
      Throws:
      Exception - if an error occurs while invoking the Node MBean.
    • shutdown

      public void shutdown() throws Exception
      Shutdown the node.
      Specified by:
      shutdown in interface JPPFNodeAdminMBean
      Throws:
      Exception - if an error is raised when invoking the node mbean.
    • shutdown

      public void shutdown(Boolean interruptIfRunning) throws Exception
      Shutdown the node.
      Specified by:
      shutdown in interface JPPFNodeAdminMBean
      Parameters:
      interruptIfRunning - when true, then shutdown the node even if it is executing tasks, when false, then only shutdown the node when it is no longer executing.
      Throws:
      Exception - if any error occurs.
      Since:
      5.0
    • restart

      public void restart() throws Exception
      Restart the node.
      Specified by:
      restart in interface JPPFNodeAdminMBean
      Throws:
      Exception - if an error is raised when invoking the node mbean.
    • restart

      public void restart(Boolean interruptIfRunning) throws Exception
      Restart the node.
      Specified by:
      restart in interface JPPFNodeAdminMBean
      Parameters:
      interruptIfRunning - when true, then restart the node even if it is executing tasks, when false, then only restart the node when it is no longer executing.
      Throws:
      Exception - if any error occurs.
      Since:
      5.0
    • reconnect

      public void reconnect(Boolean interruptIfRunning) throws Exception
      Force the node to reconnect without restarting.
      Specified by:
      reconnect in interface JPPFNodeAdminMBean
      Parameters:
      interruptIfRunning - when true, then reconnect the node even if it is executing tasks, when false, then only restart the node when it is no longer executing.
      Throws:
      Exception - if any error occurs.
      Since:
      6.3
    • resetTaskCounter

      public void resetTaskCounter() throws Exception
      Reset the node's executed tasks counter to zero.
      Specified by:
      resetTaskCounter in interface JPPFNodeAdminMBean
      Throws:
      Exception - if an error is raised when invoking the node mbean.
    • setTaskCounter

      public void setTaskCounter(Integer n) throws Exception
      Set the node's executed tasks counter to the specified value.
      Specified by:
      setTaskCounter in interface JPPFNodeAdminMBean
      Parameters:
      n - the new value of the task counter.
      Throws:
      Exception - if an error is raised when invoking the node mbean.
    • updateThreadsPriority

      public void updateThreadsPriority(Integer newPriority) throws Exception
      Update the priority of all execution threads.
      Specified by:
      updateThreadsPriority in interface JPPFNodeAdminMBean
      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 Exception
      Update the configuration properties of the node.
      Specified by:
      updateConfiguration in interface JPPFNodeAdminMBean
      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 Exception
      Update the configuration properties of the node.
      Specified by:
      updateConfiguration in interface JPPFNodeAdminMBean
      Parameters:
      configOverrides - the set of properties to update.
      restart - specifies whether the node should be restarted after updating the properties.
      interruptIfRunning - when true, then restart the node even if it is executing tasks, when false, then only shutdown the node when it is no longer executing. This parameter only applies when the restart parameter is true.
      Throws:
      Exception - if an error is raised when invoking the node mbean.
      Since:
      5.2
    • cancelJob

      public void cancelJob(String jobUuid, Boolean requeue) throws Exception
      Cancel the job with the specified id.
      Specified by:
      cancelJob in interface JPPFNodeAdminMBean
      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

      public DelegationModel getDelegationModel() throws Exception
      Description copied from interface: JPPFNodeAdminMBean
      Get the current class loader delegation model for the node.
      Specified by:
      getDelegationModel in interface JPPFNodeAdminMBean
      Returns:
      either PARENT_FIRST or LOCAL_FIRST.
      Throws:
      Exception - if any error occurs.
    • setDelegationModel

      public void setDelegationModel(DelegationModel model) throws Exception
      Description copied from interface: JPPFNodeAdminMBean
      Set the current class loader delegation model for the node.
      Specified by:
      setDelegationModel in interface JPPFNodeAdminMBean
      Parameters:
      model - either either PARENT_FIRST or LOCAL_FIRST. If any other value is specified then this method has no effect.
      Throws:
      Exception - if any error occurs.
    • getDiagnosticsProxy

      public DiagnosticsMBean getDiagnosticsProxy() throws Exception
      Description copied from class: JMXConnectionWrapper
      Get a proxy to the diagnostics/JVM health MBean.
      Overrides:
      getDiagnosticsProxy in class JMXConnectionWrapper
      Returns:
      a DiagnosticsMBean instance.
      Throws:
      Exception - if any error occurs.
    • pendingAction

      public NodePendingAction pendingAction()
      Description copied from interface: JPPFNodeAdminMBean
      Determine wether a deffered shutdwon or restartd was requested and not yet performed for the node.
      Specified by:
      pendingAction in interface JPPFNodeAdminMBean
      Returns:
      one of the possible pending actions specified in the enum NodePendingAction.
    • cancelPendingAction

      public boolean cancelPendingAction()
      Description copied from interface: JPPFNodeAdminMBean
      Cancel a previous deferred shutdown or restart request, if any.
      Specified by:
      cancelPendingAction in interface JPPFNodeAdminMBean
      Returns:
      true if the node has a pending action and it was cancelled, false otherwise.
    • getJPPFNodeMaintenanceMProxy

      public JPPFNodeMaintenanceMBean getJPPFNodeMaintenanceMProxy() throws Exception
      Deprecated.
      A shortcut method for getProxy(JPPFNodeMaintenanceMBean.MBEAN_NAME, JPPFNodeMaintenanceMBean.class).
      Returns:
      a dynamic proxy implementing the JPPFNodeMaintenanceMBean interface.
      Throws:
      Exception - if any error occurs.
      Since:
      5.2
    • getNodeMaintenance

      public JPPFNodeMaintenanceMBean getNodeMaintenance() throws Exception
      A shortcut method for getProxy(JPPFNodeMaintenanceMBean.MBEAN_NAME, JPPFNodeMaintenanceMBean.class).
      Returns:
      a dynamic proxy implementing the JPPFNodeMaintenanceMBean interface.
      Throws:
      Exception - if any error occurs.
      Since:
      6.2
    • getJPPFNodeTaskMonitorProxy

      public JPPFNodeTaskMonitorMBean getJPPFNodeTaskMonitorProxy() throws Exception
      Deprecated.
      A shortcut method for getProxy(JPPFNodeTaskMonitorMBean.MBEAN_NAME, JPPFNodeTaskMonitorMBean.class).
      Returns:
      a dynamic proxy implementing the JPPFNodeTaskMonitorMBean interface.
      Throws:
      Exception - if any error occurs.
      Since:
      5.2
    • getNodeTaskMonitor

      public JPPFNodeTaskMonitorMBean getNodeTaskMonitor() throws Exception
      A shortcut method for getProxy(JPPFNodeTaskMonitorMBean.MBEAN_NAME, JPPFNodeTaskMonitorMBean.class).
      Returns:
      a dynamic proxy implementing the JPPFNodeTaskMonitorMBean interface.
      Throws:
      Exception - if any error occurs.
      Since:
      6.2
    • getJPPFNodeProvisioningProxy

      public JPPFNodeProvisioningMBean getJPPFNodeProvisioningProxy() throws Exception
      Deprecated.
      A shortcut method for getProxy(JPPFNodeProvisioningMBean.MBEAN_NAME, JPPFNodeProvisioningMBean.class).
      Returns:
      a dynamic proxy implementing the JPPFNodeProvisioningMBean interface.
      Throws:
      Exception - if any error occurs.
      Since:
      5.2
    • getNodeProvisioner

      public JPPFNodeProvisioningMBean getNodeProvisioner() throws Exception
      A shortcut method for getProxy(JPPFNodeProvisioningMBean.MBEAN_NAME, JPPFNodeProvisioningMBean.class).
      Returns:
      a dynamic proxy implementing the JPPFNodeProvisioningMBean interface.
      Throws:
      Exception - if any error occurs.
      Since:
      6.2