Class JPPFContainer

java.lang.Object
org.jppf.server.node.JPPFContainer

public abstract class JPPFContainer extends Object
Instances of this class represent dynamic class loading, and serialization/deserialization, capabilities, associated with a specific client application.
The application is identified through a unique uuid. This class effectively acts as a container for the classes of a client application, a provides the methods to enable the transport, serialization and deserialization of these classes.
Author:
Laurent Cohen
  • Field Details

    • helper

      protected org.jppf.serialization.SerializationHelper helper
      Utility for deserialization and serialization.
    • serializer

      protected org.jppf.serialization.ObjectSerializer serializer
      Utility for deserialization and serialization.
    • classLoader

      protected AbstractJPPFClassLoader classLoader
      Class loader used for dynamic loading and updating of client classes.
    • uuidPath

      protected List<String> uuidPath
      The unique identifier for the submitting application.
  • Constructor Details

    • JPPFContainer

      public JPPFContainer(AbstractCommonNode node, List<String> uuidPath, AbstractJPPFClassLoader classLoader, boolean clientAccess) throws Exception
      Initialize this container with a specified application uuid.
      Parameters:
      node - the node holding this container.
      uuidPath - the unique identifier of a submitting application.
      classLoader - the class loader for this container.
      clientAccess - whether the node has access to the client that submitted the job.
      Throws:
      Exception - if an error occurs while initializing.
  • Method Details

    • init

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

      public abstract int deserializeObjects(Object[] list, int count, ExecutorService executor) throws Throwable
      Deserialize a number of objects from the I/O channel.
      Parameters:
      list - a list holding the resulting deserialized objects.
      count - the number of objects to deserialize.
      executor - the number of objects to deserialize.
      Returns:
      the new position in the source data after deserialization.
      Throws:
      Throwable - if an error occurs while deserializing.
    • getClassLoader

      public AbstractJPPFClassLoader getClassLoader()
      Get the main class loader for this container.
      Returns:
      a ClassLoader used for loading the classes of the framework.
    • setClassLoader

      public void setClassLoader(AbstractJPPFClassLoader classLoader)
      Get the main class loader for this container.
      Parameters:
      classLoader - a ClassLoader used for loading the classes of the framework.
    • initHelper

      protected 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.
    • getAppUuid

      public String getAppUuid()
      Get the unique identifier for the submitting application.
      Returns:
      the application uuid as a string.
    • setUuidPath

      public void setUuidPath(List<String> uuidPath)
      Set the unique identifier for the submitting application.
      Parameters:
      uuidPath - the application uuid as a string.
    • getSerializer

      public org.jppf.serialization.ObjectSerializer getSerializer()
      Return the utility object for serialization and deserialization.
      Returns:
      an ObjectSerializer instance.
    • getLock

      public Lock getLock()
      Returns:
      the lock for sequential deserialization.
    • isSequentialDeserialization

      public boolean isSequentialDeserialization()
      Returns:
      true if sequential serialization/serialization is enabled, false otherwise.