org.jppf.management
Class JMXNodeConnectionWrapper

java.lang.Object
  extended by org.jppf.utils.ThreadSynchronization
      extended by org.jppf.management.JMXConnectionWrapper
          extended by org.jppf.management.JMXNodeConnectionWrapper
All Implemented Interfaces:
Serializable, JPPFAdminMBean, JPPFNodeAdminMBean

public class JMXNodeConnectionWrapper
extends JMXConnectionWrapper
implements JPPFNodeAdminMBean

Node-specific connection wrapper, implementing a user-friendly interface for the monitoring and management of the node.

Author:
Laurent Cohen
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.jppf.management.JMXConnectionWrapper
local
 
Fields inherited from class org.jppf.utils.ThreadSynchronization
stopped
 
Fields inherited from interface org.jppf.management.JPPFAdminMBean
DRIVER_MBEAN_NAME, DRIVER_SUFFIX, NODE_MBEAN_NAME, NODE_SUFFIX
 
Constructor Summary
JMXNodeConnectionWrapper()
          Initialize a local connection to the MBean server.
JMXNodeConnectionWrapper(String host, int port)
          Initialize the connection to the remote MBean server.
 
Method Summary
 void cancelJob(String jobId, Boolean requeue)
          Cancel the job with the specified id.
 void cancelTask(String id)
          Cancel the execution of the tasks with the specified id.
 Serializable notification()
          Get the latest task notification from the node.
 void resetTaskCounter()
          Reset the node's executed tasks counter to zero.
 void restart()
          Restart the node.
 void restartTask(String id)
          Restart the execution of the tasks with the specified id.
 void setTaskCounter(Integer n)
          Set the node's executed tasks counter to the specified value.
 void shutdown()
          Shutdown the node.
 JPPFNodeState state()
          Get the latest state information from the node.
 JPPFSystemInformation systemInformation()
          Get detailed information about the node's JVM properties, environment variables and runtime information such as memory usage and available processors.
 void updateConfiguration(Map config, Boolean reconnect)
          Update the configuration properties of the node.
 void updateThreadPoolSize(Integer size)
          Set the size of the node's thread pool.
 void updateThreadsPriority(Integer newPriority)
          Update the priority of all execution threads.
 
Methods inherited from class org.jppf.management.JMXConnectionWrapper
close, connect, connectAndWait, getAttribute, getHost, getId, getMbeanConnection, getPort, getProxy, getProxy, invoke, isConnected, setConnectedStatus
 
Methods inherited from class org.jppf.utils.ThreadSynchronization
goToSleep, goToSleep, goToSleep, isStopped, setStopped, wakeUp
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

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.
Method Detail

cancelTask

public void cancelTask(String id)
                throws Exception
Cancel the execution of the tasks with the specified id.

Specified by:
cancelTask in interface JPPFNodeAdminMBean
Parameters:
id - the id of the tasks to cancel.
Throws:
Exception - if an error occurs while invoking the Node MBean.
See Also:
JPPFNodeAdminMBean.cancelTask(java.lang.String)

restartTask

public void restartTask(String id)
                 throws Exception
Restart the execution of the tasks with the specified id.
The task(s) will be restarted even if their execution has already completed.

Specified by:
restartTask in interface JPPFNodeAdminMBean
Parameters:
id - the id of the task or tasks to restart.
Throws:
Exception - if an error occurs while invoking the Node MBean.
See Also:
JPPFNodeAdminMBean.restartTask(java.lang.String)

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.
See Also:
JPPFNodeAdminMBean.state()

notification

public Serializable notification()
                          throws Exception
Get the latest task notification from the node.

Specified by:
notification in interface JPPFNodeAdminMBean
Returns:
a the notification as a Serializable object.
Throws:
Exception - if an error occurs while invoking the Node MBean.
See Also:
JPPFNodeAdminMBean.notification()

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.
See Also:
JPPFNodeAdminMBean.updateThreadPoolSize(java.lang.Integer)

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 JPPFNodeAdminMBean
Returns:
a JPPFSystemInformation instance.
Throws:
Exception - if an error occurs while invoking the Node MBean.
See Also:
JPPFNodeAdminMBean.systemInformation()

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.
See Also:
JPPFNodeAdminMBean.shutdown()

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.
See Also:
JPPFNodeAdminMBean.restart()

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.
See Also:
JPPFNodeAdminMBean.resetTaskCounter()

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.
See Also:
JPPFNodeAdminMBean.setTaskCounter(java.lang.Integer)

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.
See Also:
JPPFNodeAdminMBean.updateThreadsPriority(java.lang.Integer)

updateConfiguration

public void updateConfiguration(Map config,
                                Boolean reconnect)
                         throws Exception
Update the configuration properties of the node.

Specified by:
updateConfiguration in interface JPPFNodeAdminMBean
Parameters:
config - the set of properties to update.
reconnect - specifies whether the node should reconnect ot the driver after updating the properties.
Throws:
Exception - if an error is raised when invoking the node mbean.
See Also:
JPPFNodeAdminMBean.updateConfiguration(java.util.Map, java.lang.Boolean)

cancelJob

public void cancelJob(String jobId,
                      Boolean requeue)
               throws Exception
Cancel the job with the specified id.

Specified by:
cancelJob in interface JPPFNodeAdminMBean
Parameters:
jobId - 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.
See Also:
JPPFNodeAdminMBean.cancelJob(java.lang.String,java.lang.Boolean)


Copyright © 2005-2010 JPPF Team.