org.jppf.classloader
Class JPPFClassLoader

java.lang.Object
  extended by java.lang.ClassLoader
      extended by java.security.SecureClassLoader
          extended by java.net.URLClassLoader
              extended by org.jppf.classloader.AbstractJPPFClassLoaderLifeCycle
                  extended by org.jppf.classloader.AbstractJPPFClassLoader
                      extended by org.jppf.classloader.JPPFClassLoader

public class JPPFClassLoader
extends AbstractJPPFClassLoader

This class is a custom class loader serving the purpose of dynamically loading the JPPF classes and the client application classes, to avoid costly redeployment system-wide.

Author:
Laurent Cohen

Nested Class Summary
protected  class JPPFClassLoader.ResourceRequest
          Encapsulates a remote resource request submitted asynchronously via the single-thread executor.
 
Nested classes/interfaces inherited from class org.jppf.classloader.AbstractJPPFClassLoaderLifeCycle
AbstractJPPFClassLoaderLifeCycle.AbstractResourceRequest
 
Field Summary
 
Fields inherited from class org.jppf.classloader.AbstractJPPFClassLoaderLifeCycle
cache, dynamic, executor, INITIALIZING, LOCK, requestUuid, serializer, uuidPath
 
Constructor Summary
JPPFClassLoader(ClassLoader parent)
          Initialize this class loader with a parent class loader.
JPPFClassLoader(ClassLoader parent, List<String> uuidPath)
          Initialize this class loader with a parent class loader.
 
Method Summary
 void close()
          Terminate this classloader and clean the resources it uses.
protected  void init()
          Initialize the underlying socket connection.
protected  JPPFResourceWrapper loadRemoteData(Map<String,Object> map, boolean asResource)
          Load the specified class from a socket connection.
 void reset()
          Reset and reinitialize the connection ot the server.
 
Methods inherited from class org.jppf.classloader.AbstractJPPFClassLoader
computeRemoteData, findClass, findMultipleResources, findResource, findResources, getMultipleResources, getResourceAsStream, loadJPPFClass
 
Methods inherited from class org.jppf.classloader.AbstractJPPFClassLoaderLifeCycle
addURL, getSerializer, loadResourceData, loadResourceData0, setRequestUuid
 
Methods inherited from class java.net.URLClassLoader
definePackage, getPermissions, getURLs, newInstance, newInstance
 
Methods inherited from class java.security.SecureClassLoader
defineClass, defineClass
 
Methods inherited from class java.lang.ClassLoader
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findLibrary, findLoadedClass, findSystemClass, getPackage, getPackages, getParent, getResource, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, loadClass, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JPPFClassLoader

public JPPFClassLoader(ClassLoader parent)
Initialize this class loader with a parent class loader.

Parameters:
parent - a ClassLoader instance.

JPPFClassLoader

public JPPFClassLoader(ClassLoader parent,
                       List<String> uuidPath)
Initialize this class loader with a parent class loader.

Parameters:
parent - a ClassLoader instance.
uuidPath - unique identifier for the submitting application.
Method Detail

init

protected void init()
Initialize the underlying socket connection.

Specified by:
init in class AbstractJPPFClassLoaderLifeCycle

reset

public void reset()
Reset and reinitialize the connection ot the server.

Specified by:
reset in class AbstractJPPFClassLoaderLifeCycle

close

public void close()
Terminate this classloader and clean the resources it uses.

Specified by:
close in class AbstractJPPFClassLoaderLifeCycle
See Also:
AbstractJPPFClassLoaderLifeCycle.close()

loadRemoteData

protected JPPFResourceWrapper loadRemoteData(Map<String,Object> map,
                                             boolean asResource)
                                      throws Exception
Load the specified class from a socket connection.

Specified by:
loadRemoteData in class AbstractJPPFClassLoaderLifeCycle
Parameters:
map - contains the necessary resource request data.
asResource - true if the resource is loaded using getResource(), false otherwise.
Returns:
a JPPFResourceWrapper containing the resource content.
Throws:
Exception - if the connection was lost and could not be reestablished.


Copyright © 2005-2010 JPPF Team.