org.jppf.management
Class JMXDriverConnectionWrapper

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

public class JMXDriverConnectionWrapper
extends JMXConnectionWrapper
implements JPPFDriverAdminMBean

Node-specific connection wrapper, implementing a user-friendly interface for the monitoring and management of the node. Note that this class implements all the methods in the interface DriverJobManagementMBean, without implementing the interface itself.

Author:
Laurent Cohen
See Also:
Serialized Form

Field Summary
static String[] MBEAN_SIGNATURE
          Signature of the method invoked on the MBean.
 
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
JMXDriverConnectionWrapper()
          Initialize a local connection to the MBean server.
JMXDriverConnectionWrapper(String host, int port)
          Initialize the connection to the remote MBean server.
 
Method Summary
 void cancelJob(String jobId)
          Cancel the job with the specified id.
 String changeLoadBalancerSettings(String algorithm, Map parameters)
          Change the bundle size tuning settings.
 String[] getAllJobIds()
          Get the set of ids for all the jobs currently queued or executing.
 JobInformation getJobInformation(String jobId)
          Get an object describing the job with the specified id.
 NodeJobInformation[] getNodeInformation(String jobId)
          Get a list of objects describing the nodes to which the whole or part of a job was dispatched.
 LoadBalancingInformation loadBalancerInformation()
          Obtain the current load-balancing settings.
 Collection<JPPFManagementInfo> nodesInformation()
          Request the JMX connection information for all the nodes attached to the server.
 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.
 JPPFStats statistics()
          Get the latest statistics snapshot from the JPPF driver.
 void suspendJob(String jobId, Boolean requeue)
          Suspend the job with the specified id.
 void updateMaxNodes(String jobId, Integer maxNodes)
          Update the maximum number of nodes a node can run on.
 
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
 

Field Detail

MBEAN_SIGNATURE

public static final String[] MBEAN_SIGNATURE
Signature of the method invoked on the MBean.

Constructor Detail

JMXDriverConnectionWrapper

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


JMXDriverConnectionWrapper

public JMXDriverConnectionWrapper(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

nodesInformation

public Collection<JPPFManagementInfo> nodesInformation()
                                                throws Exception
Request the JMX connection information for all the nodes attached to the server.

Specified by:
nodesInformation in interface JPPFDriverAdminMBean
Returns:
a collection of NodeManagementInfo instances.
Throws:
Exception - if any error occurs.
See Also:
JPPFDriverAdminMBean.nodesInformation()

statistics

public JPPFStats statistics()
                     throws Exception
Get the latest statistics snapshot from the JPPF driver.

Specified by:
statistics in interface JPPFDriverAdminMBean
Returns:
a JPPFStats instance.
Throws:
Exception - if any error occurs.
See Also:
JPPFDriverAdminMBean.statistics()

restartShutdown

public String restartShutdown(Long shutdownDelay,
                              Long restartDelay)
                       throws Exception
Perform a shutdown or restart of the server.

Specified by:
restartShutdown in interface JPPFDriverAdminMBean
Parameters:
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.
Returns:
an acknowledgement message.
Throws:
Exception - if any error occurs.
See Also:
JPPFDriverAdminMBean.restartShutdown(java.lang.Long, java.lang.Long)

changeLoadBalancerSettings

public String changeLoadBalancerSettings(String algorithm,
                                         Map parameters)
                                  throws Exception
Change the bundle size tuning settings.

Specified by:
changeLoadBalancerSettings in interface JPPFDriverAdminMBean
Parameters:
algorithm - the name opf the load-balancing algorithm to set.
parameters - the algorithm's parameters.
Returns:
an acknowledgement or error message.
Throws:
Exception - if an error occurred while updating the settings.
See Also:
JPPFDriverAdminMBean.changeLoadBalancerSettings(java.lang.String, java.util.Map)

loadBalancerInformation

public LoadBalancingInformation loadBalancerInformation()
                                                 throws Exception
Obtain the current load-balancing settings.

Specified by:
loadBalancerInformation in interface JPPFDriverAdminMBean
Returns:
an instance of LoadBalancingInformation.
Throws:
Exception - if any error occurs.
See Also:
JPPFDriverAdminMBean.loadBalancerInformation()

cancelJob

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

Parameters:
jobId - the id of the job to cancel.
Throws:
Exception - if any error occurs.
See Also:
DriverJobManagementMBean.cancelJob(java.lang.String)

suspendJob

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

Parameters:
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.
Throws:
Exception - if any error occurs.
See Also:
DriverJobManagementMBean.suspendJob(java.lang.String,java.lang.Boolean)

resumeJob

public void resumeJob(String jobId)
               throws Exception
Resume the job with the specified id.

Parameters:
jobId - the id of the job to resume.
Throws:
Exception - if any error occurs.
See Also:
DriverJobManagementMBean.resumeJob(java.lang.String)

updateMaxNodes

public void updateMaxNodes(String jobId,
                           Integer maxNodes)
                    throws Exception
Update the maximum number of nodes a node can run on.

Parameters:
jobId - the id of the job to update.
maxNodes - the new maximum number of nodes for the job.
Throws:
Exception - if any error occurs.
See Also:
DriverJobManagementMBean.updateMaxNodes(java.lang.String, java.lang.Integer)

getAllJobIds

public String[] getAllJobIds()
                      throws Exception
Get the set of ids for all the jobs currently queued or executing.

Returns:
an array of ids as strings.
Throws:
Exception - if any error occurs.
See Also:
DriverJobManagementMBean.getAllJobIds()

getJobInformation

public JobInformation getJobInformation(String jobId)
                                 throws Exception
Get an object describing the job with the specified id.

Parameters:
jobId - the id of the job to get information about.
Returns:
an instance of JobInformation.
Throws:
Exception - if any error occurs.
See Also:
DriverJobManagementMBean.getJobInformation(java.lang.String)

getNodeInformation

public NodeJobInformation[] getNodeInformation(String jobId)
                                        throws Exception
Get a list of objects describing the nodes to which the whole or part of a job was dispatched.

Parameters:
jobId - the id of the job for which to find node information.
Returns:
an array of NodeManagementInfo, JobInformation instances.
Throws:
Exception - if any error occurs.
See Also:
DriverJobManagementMBean.getNodeInformation(java.lang.String)

resetStatistics

public void resetStatistics()
                     throws Exception
Reset this server's statistics. This method triggers a reset() event via the JPPFDriverStatsManager instance.

Specified by:
resetStatistics in interface JPPFDriverAdminMBean
Throws:
Exception - if any error occurs.


Copyright © 2005-2010 JPPF Team.