Class JPPFNode

java.lang.Object
org.jppf.utils.concurrent.ThreadSynchronization
All Implemented Interfaces:
Runnable, org.jppf.execute.async.ExecutionManagerListener, org.jppf.node.Node, NodeInternal, ClassLoaderProvider

public abstract class JPPFNode extends AbstractCommonNode implements ClassLoaderProvider, org.jppf.execute.async.ExecutionManagerListener
Instances of this class encapsulate execution nodes.
Author:
Laurent Cohen, Domingos Creado
  • Constructor Details

    • JPPFNode

      public JPPFNode(String uuid, org.jppf.utils.TypedProperties configuration, org.jppf.utils.hooks.HookFactory hookFactory)
      Default constructor.
      Parameters:
      uuid - this node's uuid.
      configuration - the configuration of this node.
      hookFactory - used to create and invoke hook instances.
  • Method Details

    • run

      public void run()
      Main processing loop of this node.
      Specified by:
      run in interface Runnable
    • init

      protected void init() throws Exception
      Initialize this node's resources.
      Throws:
      Exception - if an error is raised during initialization.
    • initHelper

      public void initHelper() throws Exception
      Get the main classloader for the node. This method performs a lazy initialization of the classloader.
      Throws:
      Exception - if an error occurs while instantiating the class loader.
    • triggerConfigChanged

      public void triggerConfigChanged()
      Trigger the configuration changed flag.
    • getClassLoader

      public ClassLoader getClassLoader(List<String> uuidPath) throws Exception
      Description copied from interface: ClassLoaderProvider
      Get a reference to the class loader associated with an application uuid.
      Specified by:
      getClassLoader in interface ClassLoaderProvider
      Parameters:
      uuidPath - the uuid path containing the key to the container.
      Returns:
      a ClassLoader used for loading the classes of the framework.
      Throws:
      Exception - if an error occurs while getting the class loader.
    • getSlaveManager

      public SlaveNodeManager getSlaveManager()
      Returns:
      the slave node manager.
    • getNodeConfigNotifier

      public NodeConfigNotifier getNodeConfigNotifier()
      Specified by:
      getNodeConfigNotifier in interface NodeInternal
      Returns:
      the mbean which sends notifications of configuration changes.
    • bundleExecuted

      public void bundleExecuted(org.jppf.node.protocol.TaskBundle bundle, List<org.jppf.node.protocol.Task<?>> tasks, Throwable t)
      Specified by:
      bundleExecuted in interface org.jppf.execute.async.ExecutionManagerListener
    • stopNode

      public void stopNode()
      Description copied from interface: NodeInternal
      Stop this node and release the resources it is using.
      Specified by:
      stopNode in interface NodeInternal
      Overrides:
      stopNode in class AbstractCommonNode
    • getJobWriter

      public org.jppf.utils.concurrent.QueueHandler<org.jppf.node.protocol.BundleWithTasks> getJobWriter()
      Returns:
      the object which asynchronously sends job results and notification bundles.
    • getHandshakeUuidPath

      public List<String> getHandshakeUuidPath()
      Returns:
      the uuid path of the handshake bundle.