org.jppf.management
Class JPPFNodeAdmin

java.lang.Object
  extended by org.jppf.management.JPPFNodeAdmin
All Implemented Interfaces:
Serializable, EventListener, JPPFAdminMBean, JPPFNodeAdminMBean, NodeListener, JPPFTaskListener

public class JPPFNodeAdmin
extends Object
implements JPPFNodeAdminMBean, JPPFTaskListener, NodeListener

Management bean for a JPPF node.

Author:
Laurent Cohen
See Also:
Serialized Form

Field Summary
 
Fields inherited from interface org.jppf.management.JPPFAdminMBean
DRIVER_MBEAN_NAME, DRIVER_SUFFIX, NODE_MBEAN_NAME, NODE_SUFFIX
 
Constructor Summary
JPPFNodeAdmin(JPPFNode node)
          Initialize this node management bean with the specified node.
 
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.
 void eventOccurred(JPPFTaskEvent event)
          Receive a notification that an event occurred within a task.
 void eventOccurred(NodeEvent event)
          Called to notify a listener that a node event has occurred.
 Serializable notification()
          Get the latest state information 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 taskEnded(String id)
          Notification that a task witht the specified id has ended.
 void taskStarted(String id)
          Notification that a task witht the specified id has started.
 void updateConfiguration(Map<Object,Object> 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 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JPPFNodeAdmin

public JPPFNodeAdmin(JPPFNode node)
Initialize this node management bean with the specified node.

Parameters:
node - the node whose state is monitored.
Method Detail

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

notification

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

Specified by:
notification in interface JPPFNodeAdminMBean
Returns:
a serializable object.
Throws:
Exception - if any error occurs.
See Also:
JPPFNodeAdminMBean.notification()

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 any error occurs.
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 any error occurs.
See Also:
JPPFNodeAdminMBean.restartTask(java.lang.String)

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 any error occurs.
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 any error occurs.
See Also:
JPPFNodeAdminMBean.systemInformation()

restart

public void restart()
             throws Exception
Restart the node.

Specified by:
restart in interface JPPFNodeAdminMBean
Throws:
Exception - if any error occurs.
See Also:
JPPFNodeAdminMBean.restart()

shutdown

public void shutdown()
              throws Exception
Shutdown the node.

Specified by:
shutdown in interface JPPFNodeAdminMBean
Throws:
Exception - if any error occurs.
See Also:
JPPFNodeAdminMBean.shutdown()

resetTaskCounter

public void resetTaskCounter()
                      throws Exception
Reset the node's executed tasks counter to zero.

Specified by:
resetTaskCounter in interface JPPFNodeAdminMBean
Throws:
Exception - if any error occurs.
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 any error occurs.
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 any error occurs.
See Also:
JPPFNodeAdminMBean.updateThreadsPriority(java.lang.Integer)

updateConfiguration

public void updateConfiguration(Map<Object,Object> 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 any error occurs.
See Also:
JPPFNodeAdminMBean.updateConfiguration(java.util.Map, java.lang.Boolean)

eventOccurred

public void eventOccurred(JPPFTaskEvent event)
Receive a notification that an event occurred within a task.

Specified by:
eventOccurred in interface JPPFTaskListener
Parameters:
event - the event that occurred.
See Also:
JPPFTaskListener.eventOccurred(org.jppf.server.protocol.JPPFTaskEvent)

eventOccurred

public void eventOccurred(NodeEvent event)
Called to notify a listener that a node event has occurred.

Specified by:
eventOccurred in interface NodeListener
Parameters:
event - the event that triggered the notification.
See Also:
NodeListener.eventOccurred(org.jppf.node.event.NodeEvent)

taskStarted

public void taskStarted(String id)
Notification that a task witht the specified id has started.

Parameters:
id - the id of the task.

taskEnded

public void taskEnded(String id)
Notification that a task witht the specified id has ended.

Parameters:
id - the id of the task.

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.