Package org.jppf.server
Class JPPFDriver
java.lang.Object
org.jppf.server.JPPFDriver
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 Summary
ConstructorsConstructorDescriptionJPPFDriver(org.jppf.utils.TypedProperties configuration) Initialize this JPPF driver with the specified configuration. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddDriverDiscovery(org.jppf.discovery.PeerDriverDiscovery discovery) Add a custom peer driver discovery mechanism to those already registered, if any.org.jppf.nio.acceptor.AcceptorNioServerGet the server which handles the initial handshake and peer channel identification.Get the JPPF class server.Get the JPPF client server.Get the JPPF class server.Get the JPPF nodes server.org.jppf.utils.TypedPropertiesGet this driver's configuration.org.jppf.utils.hooks.HookFactoryGet the factory that creates and invoke hook instances for this node.Get this driver's initializer.org.jppf.node.protocol.JPPFDistributedJobGet a server-side representation of a job from its uuid.Get the object that manages and monitors the jobs throughout their processing within this driver.org.jppf.job.JobTasksListenerManagerGet the object which manages the registration and unregistration of job dispatch listeners and notifies these listeners of job dispatch events.getQueue()Get the queue that handles the tasks to execute.org.jppf.serialization.ObjectSerializerorg.jppf.utils.stats.JPPFStatisticsGet the object holding the statistics monitors.org.jppf.management.JPPFSystemInformationGet the system ibnformation for this driver.getUuid()Get this driver's unique identifier.voidinitiateShutdownRestart(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.booleanbooleanDetermine whether this driver has initiated a shutdown, in which case it does not accept connections anymore.static voidStart the JPPF driver.voidremoveDriverDiscovery(org.jppf.discovery.PeerDriverDiscovery discovery) Remove a custom peer driver discovery mechanism from those already registered.voidsetPeerDriver(PeerDriver peerDriver) voidshutdown()Shutdown this driver and all its components.start()Initialize and start this driver.
-
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
Initialize and start this driver.- Returns:
- this driver.
- Throws:
Exception- if the initialization fails.
-
getUuid
Get this driver's unique identifier.- Returns:
- the uuid as a string.
-
getJob
Get a server-side representation of a job from its uuid.- Parameters:
uuid- the uuid of the job to lookup.- Returns:
- a
JPPFDistributedJobinstance, ornullif 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
Start the JPPF driver.- Parameters:
args- not used.
-
getSystemInformation
public org.jppf.management.JPPFSystemInformation getSystemInformation()Get the system ibnformation for this driver.- Returns:
- a
JPPFSystemInformationinstance.
-
getStatistics
public org.jppf.utils.stats.JPPFStatistics getStatistics()Get the object holding the statistics monitors.- Returns:
- a
JPPFStatisticsinstance.
-
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:
trueif a shutdown is initiated,falseotherwise.
-
getConfiguration
public org.jppf.utils.TypedProperties getConfiguration()Get this driver's configuration.- Returns:
- the configuration for this driver as a
TypedPropertiesinstance.
-
shutdown
public void shutdown()Shutdown this driver and all its components. -
getQueue
Get the queue that handles the tasks to execute.- Returns:
- a JPPFQueue instance.
-
getAsyncClientNioServer
Get the JPPF client server.- Returns:
- a
AsyncClientNioServerinstance.
-
getAsyncClientClassServer
Get the JPPF class server.- Returns:
- a
ClassNioServerinstance.
-
getAsyncNodeClassServer
Get the JPPF class server.- Returns:
- a
ClassNioServerinstance.
-
getAsyncNodeNioServer
Get the JPPF nodes server.- Returns:
- a
NodeNioServerinstance.
-
getAcceptorServer
public org.jppf.nio.acceptor.AcceptorNioServer getAcceptorServer()Get the server which handles the initial handshake and peer channel identification.- Returns:
- a
AcceptorNioServerinstance.
-
getJobManager
Get the object that manages and monitors the jobs throughout their processing within this driver.- Returns:
- an instance of
JPPFJobManager.
-
getInitializer
Get this driver's initializer.- Returns:
- a
DriverInitializerinstance.
-
getSerializer
public org.jppf.serialization.ObjectSerializer getSerializer()- Returns:
- an object Used for serialization / deserialization.
-
getPeerDriver
- Returns:
- the MBean handling changes in number of nodes/processing threads.
-
setPeerDriver
- 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
HookFactoryinstance.
-