org.jppf.server
Class JPPFDriver

java.lang.Object
  extended by org.jppf.server.JPPFDriver

public class JPPFDriver
extends Object

This class serves as an initializer for the entire JPPF server. It follows the singleton pattern and provides access, accross the JVM, to the tasks execution queue.

It also holds a server for incoming client connections, a server for incoming node connections, along with a class server to handle requests to and from remote class loaders.

Author:
Laurent Cohen

Field Summary
static boolean JPPF_DEBUG
          Flag indicating whether collection of debug information is available via JMX.
 
Constructor Summary
protected JPPFDriver()
          Initialize this JPPFDriver.
 
Method Summary
 ClassNioServer getClassServer()
          Get the JPPF class server.
 DriverInitializer getInitializer()
          Get this driver's initializer.
static JPPFDriver getInstance()
          Get the singleton instance of the JPPFDriver.
 JPPFJobManager getJobManager()
          Get the object that manages and monitors the jobs thoughout their processing within this driver.
 NodeInformationHandler getNodeHandler()
          Get the object that manages information about the nodes.
 NodeNioServer getNodeNioServer()
          Get the JPPF nodes server.
static JPPFQueue getQueue()
          Get the queue that handles the tasks to execute.
 JPPFDriverStatsManager getStatsManager()
          Get a reference to the object that generates the statistics events of which all related listeners are notified.
 JPPFDriverStatsUpdater getStatsUpdater()
          Get the listener that gathers the statistics published through the management interface.
 String getUuid()
          Get this driver's unique identifier.
 void initiateShutdownRestart(long shutdownDelay, boolean restart, long restartDelay)
          Initialize this task with the specified parameters.
 boolean isShuttingDown()
          Determines whether this server has initiated a shutdown, in which case it does not accept connections anymore.
static void main(String... args)
          Start the JPPF server.
 void run()
          Initialize and start this driver.
 void shutdown()
          Shutdown this server and all its components.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

JPPF_DEBUG

public static final boolean JPPF_DEBUG
Flag indicating whether collection of debug information is available via JMX.

Constructor Detail

JPPFDriver

protected JPPFDriver()
Initialize this JPPFDriver.

Method Detail

run

public void run()
         throws Exception
Initialize and start this driver.

Throws:
Exception - if the initialization fails.

getInstance

public static JPPFDriver getInstance()
Get the singleton instance of the JPPFDriver.

Returns:
a JPPFDriver instance.

getQueue

public static JPPFQueue getQueue()
Get the queue that handles the tasks to execute.

Returns:
a JPPFQueue instance.

getClassServer

public ClassNioServer getClassServer()
Get the JPPF class server.

Returns:
a ClassNioServer instance.

getNodeNioServer

public NodeNioServer getNodeNioServer()
Get the JPPF nodes server.

Returns:
a NodeNioServer instance.

isShuttingDown

public boolean isShuttingDown()
Determines whether this server has initiated a shutdown, in which case it does not accept connections anymore.

Returns:
true if a shutdown is initiated, false otherwise.

getUuid

public String getUuid()
Get this driver's unique identifier.

Returns:
the uuid as a string.

initiateShutdownRestart

public void initiateShutdownRestart(long shutdownDelay,
                                    boolean restart,
                                    long restartDelay)
Initialize this task with the specified parameters.
The shutdown is initiated after the specified shutdown delay has expired.
If the restart parameter is set to false then the JVM exits after the shutdown is complete.

Parameters:
shutdownDelay - delay, in milliseconds, after which the server shutdown is initiated. A value of 0 or less means an immediate shutdown.
restart - determines whether the server should restart after shutdown is complete. If set to false, then the JVM will exit.
restartDelay - delay, starting from shutdown completion, after which the server is restarted. A value of 0 or less means the server is restarted immediately after the shutdown is complete.

shutdown

public void shutdown()
Shutdown this server and all its components.


getStatsUpdater

public JPPFDriverStatsUpdater getStatsUpdater()
Get the listener that gathers the statistics published through the management interface.

Returns:
a JPPFStatsUpdater instance.

getStatsManager

public JPPFDriverStatsManager getStatsManager()
Get a reference to the object that generates the statistics events of which all related listeners are notified.

Returns:
a JPPFDriverStatsManager instance.

getJobManager

public JPPFJobManager getJobManager()
Get the object that manages and monitors the jobs thoughout their processing within this driver.

Returns:
an instance of JPPFJobManager.

getInitializer

public DriverInitializer getInitializer()
Get this driver's initializer.

Returns:
a DriverInitializer instance.

getNodeHandler

public NodeInformationHandler getNodeHandler()
Get the object that manages information about the nodes.

Returns:
a NodeInformationHandler instance.

main

public static void main(String... args)
Start the JPPF server.

Parameters:
args - not used.


Copyright © 2005-2010 JPPF Team.