org.jppf.server.node
Class JPPFContainer

java.lang.Object
  extended by org.jppf.server.node.JPPFContainer
Direct Known Subclasses:
JPPFLocalContainer, JPPFRemoteContainer

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

Nested Class Summary
protected  class JPPFContainer.ObjectDeserializationTask
          Instances of this class are used to deserialize objects from an incoming message in parallel.
 
Field Summary
protected  AbstractJPPFClassLoader classLoader
          Class loader used for dynamic loading and updating of client classes.
protected  SerializationHelper helper
          Utility for deserialization and serialization.
protected  List<String> uuidPath
          The unique identifier for the submitting application.
 
Constructor Summary
JPPFContainer(List<String> uuidPath, AbstractJPPFClassLoader classLoader)
          Initialize this container with a specified application uuid.
 
Method Summary
 Object deserializeObject(byte[] data)
          Deserialize an object from a socket client.
abstract  int deserializeObjects(List<Object> list, int count, ExecutorService executor)
          Deserialize a number of objects from the I/O channel.
 String getAppUuid()
          Get the unique identifier for the submitting application.
 AbstractJPPFClassLoader getClassLoader()
          Get the main class loader for this container.
 void init()
          Initialize this node's resources.
protected  void initHelper()
          Get the main classloader for the node.
 void setUuidPath(List<String> uuidPath)
          Set the unique identifier for the submitting application.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

helper

protected SerializationHelper helper
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 Detail

JPPFContainer

public JPPFContainer(List<String> uuidPath,
                     AbstractJPPFClassLoader classLoader)
              throws Exception
Initialize this container with a specified application uuid.

Parameters:
uuidPath - the unique identifier of a submitting application.
classLoader - the class loader for this container.
Throws:
Exception - if an error occurs while initializing.
Method Detail

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(List<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.

deserializeObject

public Object deserializeObject(byte[] data)
                         throws Exception
Deserialize an object from a socket client.

Parameters:
data - the array of bytes to deserialize into an object.
Returns:
the new position in the source data after deserialization.
Throws:
Exception - 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.

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 occcurs 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.


Copyright © 2005-2010 JPPF Team.