Class JPPFDriver

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

public class JPPFDriver extends Object
This class serves as an initializer for the entire JPPF driver.

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, Lane Schwartz (dynamically allocated server port)
  • Constructor Details

    • JPPFDriver

      public JPPFDriver(org.jppf.utils.TypedProperties configuration)
      Initialize this JPPF driver with the specified configuration.
      Parameters:
      configuration - this driver's configuration.
  • Method Details

    • start

      public JPPFDriver start() throws Exception
      Initialize and start this driver.
      Returns:
      this driver.
      Throws:
      Exception - if the initialization fails.
    • getUuid

      public String getUuid()
      Get this driver's unique identifier.
      Returns:
      the uuid as a string.
    • getJob

      public org.jppf.node.protocol.JPPFDistributedJob getJob(String uuid)
      Get a server-side representation of a job from its uuid.
      Parameters:
      uuid - the uuid of the job to lookup.
      Returns:
      a JPPFDistributedJob instance, or null if there is no job with the specified uuid.
    • 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 driver shutdown is initiated. A value of 0 or less means an immediate shutdown.
      restart - determines whether the driver should restart after shutdown is complete. If set to false, then the JVM will exit.
      restartDelay - delay, starting from shutdown completion, after which the driver is restarted. A value of 0 or less means the driver is restarted immediately after the shutdown is complete.
    • getJobTasksListenerManager

      public org.jppf.job.JobTasksListenerManager getJobTasksListenerManager()
      Get the object which manages the registration and unregistration of job dispatch listeners and notifies these listeners of job dispatch events.
      Returns:
      an instance of JobTasksListenerManager.
    • main

      public static void main(String... args)
      Start the JPPF driver.
      Parameters:
      args - not used.
    • getSystemInformation

      public org.jppf.management.JPPFSystemInformation getSystemInformation()
      Get the system ibnformation for this driver.
      Returns:
      a JPPFSystemInformation instance.
    • getStatistics

      public org.jppf.utils.stats.JPPFStatistics getStatistics()
      Get the object holding the statistics monitors.
      Returns:
      a JPPFStatistics instance.
    • addDriverDiscovery

      public void addDriverDiscovery(org.jppf.discovery.PeerDriverDiscovery discovery)
      Add a custom peer driver discovery mechanism to those already registered, if any.
      Parameters:
      discovery - the driver discovery to add.
    • removeDriverDiscovery

      public void removeDriverDiscovery(org.jppf.discovery.PeerDriverDiscovery discovery)
      Remove a custom peer driver discovery mechanism from those already registered.
      Parameters:
      discovery - the driver discovery to remove.
    • isShuttingDown

      public boolean isShuttingDown()
      Determine whether this driver has initiated a shutdown, in which case it does not accept connections anymore.
      Returns:
      true if a shutdown is initiated, false otherwise.
    • getConfiguration

      public org.jppf.utils.TypedProperties getConfiguration()
      Get this driver's configuration.
      Returns:
      the configuration for this driver as a TypedProperties instance.
    • shutdown

      public void shutdown()
      Shutdown this driver and all its components.
    • getQueue

      public JPPFPriorityQueue getQueue()
      Get the queue that handles the tasks to execute.
      Returns:
      a JPPFQueue instance.
    • getAsyncClientNioServer

      public AsyncClientNioServer getAsyncClientNioServer()
      Get the JPPF client server.
      Returns:
      a AsyncClientNioServer instance.
    • getAsyncClientClassServer

      public AsyncClientClassNioServer getAsyncClientClassServer()
      Get the JPPF class server.
      Returns:
      a ClassNioServer instance.
    • getAsyncNodeClassServer

      public AsyncNodeClassNioServer getAsyncNodeClassServer()
      Get the JPPF class server.
      Returns:
      a ClassNioServer instance.
    • getAsyncNodeNioServer

      public AsyncNodeNioServer getAsyncNodeNioServer()
      Get the JPPF nodes server.
      Returns:
      a NodeNioServer instance.
    • getAcceptorServer

      public org.jppf.nio.acceptor.AcceptorNioServer getAcceptorServer()
      Get the server which handles the initial handshake and peer channel identification.
      Returns:
      a AcceptorNioServer instance.
    • getJobManager

      public JPPFJobManager getJobManager()
      Get the object that manages and monitors the jobs throughout their processing within this driver.
      Returns:
      an instance of JPPFJobManager.
    • getInitializer

      public DriverInitializer getInitializer()
      Get this driver's initializer.
      Returns:
      a DriverInitializer instance.
    • getSerializer

      public org.jppf.serialization.ObjectSerializer getSerializer()
      Returns:
      an object Used for serialization / deserialization.
    • getPeerDriver

      public PeerDriver getPeerDriver()
      Returns:
      the MBean handling changes in number of nodes/processing threads.
    • setPeerDriver

      public void setPeerDriver(PeerDriver peerDriver)
      Parameters:
      peerDriver - the MBean handling changes in number of nodes/processing threads.
    • isJppfDebugEnabled

      public boolean isJppfDebugEnabled()
      Returns:
      whether JPPF debug mode is enabled.
    • getHookFactory

      public org.jppf.utils.hooks.HookFactory getHookFactory()
      Get the factory that creates and invoke hook instances for this node.
      Returns:
      a HookFactory instance.