org.jppf.server.node
Class AbstractClassLoaderManager

java.lang.Object
  extended by org.jppf.server.node.AbstractClassLoaderManager
Direct Known Subclasses:
RemoteClassLoaderManager

public abstract class AbstractClassLoaderManager
extends Object

Instances of this class manage the node's class loader and associated operations.

Author:
Laurent Cohen

Field Summary
protected  AbstractJPPFClassLoader classLoader
          Class loader used for dynamic loading and updating of client classes.
protected  LinkedList<JPPFContainer> containerList
          A list retaining the container in chronological order of their creation.
protected  Map<String,JPPFContainer> containerMap
          Mapping of containers to their corresponding application uuid.
 
Constructor Summary
AbstractClassLoaderManager()
           
 
Method Summary
protected abstract  AbstractJPPFClassLoader createClassLoader()
          Create the class loader for this node.
 AbstractJPPFClassLoader getClassLoader()
          Get the main classloader for the node.
 JPPFContainer getContainer(List<String> uuidPath)
          Get a reference to the JPPF container associated with an application uuid.
protected abstract  Callable<AbstractJPPFClassLoader> newClassLoaderCreator(List<String> uuidPath)
          Instantiate the callback used to create the class loader in each JPPFContainer.
protected abstract  JPPFContainer newJPPFContainer(List<String> uuidPath, AbstractJPPFClassLoader cl)
          Create a new container based on the uuid path and class loader.
 void setClassLoader(JPPFClassLoader cl)
          Set the main classloader for the node.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

classLoader

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


containerMap

protected Map<String,JPPFContainer> containerMap
Mapping of containers to their corresponding application uuid.


containerList

protected LinkedList<JPPFContainer> containerList
A list retaining the container in chronological order of their creation.

Constructor Detail

AbstractClassLoaderManager

public AbstractClassLoaderManager()
Method Detail

getClassLoader

public AbstractJPPFClassLoader getClassLoader()
Get the main classloader for the node. This method performs a lazy initialization of the classloader.

Returns:
a ClassLoader used for loading the classes of the framework.

createClassLoader

protected abstract AbstractJPPFClassLoader createClassLoader()
Create the class loader for this node.

Returns:
a JPPFClassLoader instance.

setClassLoader

public void setClassLoader(JPPFClassLoader cl)
Set the main classloader for the node.

Parameters:
cl - the class loader to set.

getContainer

public JPPFContainer getContainer(List<String> uuidPath)
                           throws Exception
Get a reference to the JPPF container associated with an application uuid.

Parameters:
uuidPath - the uuid path containing the key to the container.
Returns:
a JPPFContainer instance.
Throws:
Exception - if an error occcurs while getting the container.

newJPPFContainer

protected abstract JPPFContainer newJPPFContainer(List<String> uuidPath,
                                                  AbstractJPPFClassLoader cl)
                                           throws Exception
Create a new container based on the uuid path and class loader.

Parameters:
uuidPath - uuid path for the corresponding client.
cl - the class loader to use.
Returns:
a JPPFContainer instance.
Throws:
Exception - if any error occurs

newClassLoaderCreator

protected abstract Callable<AbstractJPPFClassLoader> newClassLoaderCreator(List<String> uuidPath)
Instantiate the callback used to create the class loader in each JPPFContainer.

Parameters:
uuidPath - the uuid path containing the key to the container.
Returns:
a Callable instance.


Copyright © 2005-2010 JPPF Team.