Package org.jppf.server.node
Class JPPFContainer
java.lang.Object
org.jppf.server.node.JPPFContainer
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.
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 Summary
FieldsModifier and TypeFieldDescriptionprotected AbstractJPPFClassLoaderClass loader used for dynamic loading and updating of client classes.protected org.jppf.serialization.SerializationHelperUtility for deserialization and serialization.protected org.jppf.serialization.ObjectSerializerUtility for deserialization and serialization.The unique identifier for the submitting application. -
Constructor Summary
ConstructorsConstructorDescriptionJPPFContainer(AbstractCommonNode node, List<String> uuidPath, AbstractJPPFClassLoader classLoader, boolean clientAccess) Initialize this container with a specified application uuid. -
Method Summary
Modifier and TypeMethodDescriptionabstract intdeserializeObjects(Object[] list, int count, ExecutorService executor) Deserialize a number of objects from the I/O channel.Get the unique identifier for the submitting application.Get the main class loader for this container.getLock()org.jppf.serialization.ObjectSerializerReturn the utility object for serialization and deserialization.final voidinit()Initialize this node's resources.protected voidGet the main classloader for the node.booleanvoidsetClassLoader(AbstractJPPFClassLoader classLoader) Get the main class loader for this container.voidsetUuidPath(List<String> uuidPath) Set the unique identifier for the submitting application.
-
Field Details
-
helper
protected org.jppf.serialization.SerializationHelper helperUtility for deserialization and serialization. -
serializer
protected org.jppf.serialization.ObjectSerializer serializerUtility for deserialization and serialization. -
classLoader
Class loader used for dynamic loading and updating of client classes. -
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
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
Get the main class loader for this container.- Returns:
- a
ClassLoaderused for loading the classes of the framework.
-
setClassLoader
Get the main class loader for this container.- Parameters:
classLoader- aClassLoaderused for loading the classes of the framework.
-
initHelper
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
Get the unique identifier for the submitting application.- Returns:
- the application uuid as a string.
-
setUuidPath
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
ObjectSerializerinstance.
-
getLock
- Returns:
- the lock for sequential deserialization.
-
isSequentialDeserialization
public boolean isSequentialDeserialization()- Returns:
trueif sequential serialization/serialization is enabled,falseotherwise.
-