|
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectjava.lang.ClassLoader
java.security.SecureClassLoader
java.net.URLClassLoader
org.jppf.classloader.AbstractJPPFClassLoaderLifeCycle
public abstract class AbstractJPPFClassLoaderLifeCycle
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.
| Nested Class Summary | |
|---|---|
protected class |
AbstractJPPFClassLoaderLifeCycle.AbstractResourceRequest
Encapsulates a remote resource request submitted asynchronously via the single-thread executor. |
| Field Summary | |
|---|---|
protected org.jppf.classloader.ResourceCache |
cache
The cache handling resources temporarily stored to file. |
protected boolean |
dynamic
Determines whether this class loader should handle dynamic class updating. |
protected static ExecutorService |
executor
The executor that handles asynchronous resource requests. |
protected static AtomicBoolean |
INITIALIZING
Determines whether this class loader should handle dynamic class updating. |
protected static ReentrantLock |
LOCK
Used to synchronize access to the underlying socket from multiple threads. |
protected String |
requestUuid
Uuid of the orignal task bundle that triggered a resource loading request. |
protected ObjectSerializer |
serializer
The object used to serialize and deserialize resources. |
protected List<String> |
uuidPath
The unique identifier for the submitting application. |
| Constructor Summary | |
|---|---|
protected |
AbstractJPPFClassLoaderLifeCycle(ClassLoader parent)
Initialize this class loader with a parent class loader. |
protected |
AbstractJPPFClassLoaderLifeCycle(ClassLoader parent,
List<String> uuidPath)
Initialize this class loader with a parent class loader. |
| Method Summary | |
|---|---|
void |
addURL(URL url)
|
abstract void |
close()
Terminate this classloader and clean the resources it uses. |
protected ObjectSerializer |
getSerializer()
Get the object used to serialize and deserialize resources. |
protected abstract void |
init()
Initialize the underlying socket connection. |
protected abstract JPPFResourceWrapper |
loadRemoteData(Map<String,Object> map,
boolean asResource)
Load the specified class from a socket connection. |
protected JPPFResourceWrapper |
loadResourceData(Map<String,Object> map,
boolean asResource)
Load the specified class from a socket connection. |
protected JPPFResourceWrapper |
loadResourceData0(Map<String,Object> map,
boolean asResource)
Load the specified class from a socket connection. |
abstract void |
reset()
Reset and reinitialize the connection ot the server. |
void |
setRequestUuid(String requestUuid)
Set the uuid for the orignal task bundle that triggered this resource request. |
| Methods inherited from class java.net.URLClassLoader |
|---|
definePackage, findClass, findResource, findResources, getPermissions, getURLs, newInstance, newInstance |
| Methods inherited from class java.security.SecureClassLoader |
|---|
defineClass, defineClass |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final ReentrantLock LOCK
protected static final AtomicBoolean INITIALIZING
protected static ExecutorService executor
protected boolean dynamic
protected List<String> uuidPath
protected String requestUuid
protected org.jppf.classloader.ResourceCache cache
protected ObjectSerializer serializer
| Constructor Detail |
|---|
protected AbstractJPPFClassLoaderLifeCycle(ClassLoader parent)
parent - a ClassLoader instance.
protected AbstractJPPFClassLoaderLifeCycle(ClassLoader parent,
List<String> uuidPath)
parent - a ClassLoader instance.uuidPath - unique identifier for the submitting application.| Method Detail |
|---|
protected abstract void init()
public abstract void reset()
protected JPPFResourceWrapper loadResourceData(Map<String,Object> map,
boolean asResource)
throws ClassNotFoundException
map - contains the necessary resource request data.asResource - true if the resource is loaded using getResource(), false otherwise.
JPPFResourceWrapper containing the resource content.
ClassNotFoundException - if the class could not be loaded from the remote server.
protected JPPFResourceWrapper loadResourceData0(Map<String,Object> map,
boolean asResource)
throws Exception
map - contains the necessary resource request data.asResource - true if the resource is loaded using getResource(), false otherwise.
JPPFResourceWrapper containing the resource content.
Exception - if the connection was lost and could not be reestablished.
protected abstract JPPFResourceWrapper loadRemoteData(Map<String,Object> map,
boolean asResource)
throws Exception
map - contains the necessary resource request data.asResource - true if the resource is loaded using getResource(), false otherwise.
JPPFResourceWrapper containing the resource content.
Exception - if the connection was lost and could not be reestablished.public void setRequestUuid(String requestUuid)
requestUuid - the uuid as a string.public abstract void close()
protected ObjectSerializer getSerializer()
throws Exception
ObjectSerializer instance.
Exception - if any error occurs.public void addURL(URL url)
addURL in class URLClassLoader
|
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||