|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.lang.ClassLoader
com.googlecode.mobilityrpc.session.impl.SessionClassLoader
public class SessionClassLoader
| Constructor Summary | |
|---|---|
SessionClassLoader(MobilityControllerInternal mobilityController,
UUID sessionId)
|
|
| Method Summary | |
|---|---|
protected Class<?> |
findClass(String name)
Tries to find classes by requesting bytecode from remote machines. |
protected URL |
findResource(String name)
Tries to find resources by requesting requesting from remote machines. |
protected Enumeration<URL> |
findResources(String name)
Finds resources with the given name which are loadable by this session class loader. |
void |
processResourceResponse(ResourceResponse resourceResponse)
Called by the thread processing an incoming ResourceResponse object. |
void |
setThreadLocalConnectionId(ConnectionId connectionId)
Called by threads processing an execution request from a remote machine, to indicate to this class loader that should those threads require classes to be loaded that the class loader can request those classes from the remote machine indicated. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SessionClassLoader(MobilityControllerInternal mobilityController,
UUID sessionId)
| Method Detail |
|---|
public void setThreadLocalConnectionId(ConnectionId connectionId)
null for the
connection id.
connectionId - Indicates the current connection in use by a thread processing an execution requestpublic void processResourceResponse(ResourceResponse resourceResponse)
ResourceResponse object.
This method will look up and unblock the relevant thread which is waiting for the resource to arrive.
resourceResponse - Contains class bytecode or other resource which this class loader previously requested
from a remote machine on behalf of a thread on this machine which tried to access a class/resource which was not
loaded.
protected Class<?> findClass(String name)
throws ClassNotFoundException
ClassLoader.loadClass(java.lang.String) when the parent class loader cannot locate the required class according
to the parent delegation model of class loading.
findClass in class ClassLoadername - The binary name of the class required
ClassNotFoundException - If the requested class cannot be located on remote machinesprotected URL findResource(String name)
ClassLoader.getResource(String) when the parent class loader cannot locate the required
resource according to the parent delegation model of class loading.
This method caches all resources loaded from client machines, and will serve from this cache whenever possible.
The URL.openStream() method of the URL returned, will provide the resource data.
The toString representation of the URL will resemble the following:mobility-rpc://[192.168.56.1:52671:0]/5f088ec8-4f71-4fae-a89b-56a0b408dcbe/test-resource.txt
(when referencing a remote machine)mobility-rpc://[local-cache:0:0]/5f088ec8-4f71-4fae-a89b-56a0b408dcbe/test-resource.txt
(when subsequently cached locally)
findResource in class ClassLoadername - The name of the resource required
URL.openStream() method provides content for the given resource. Returns
null if the resource could not be foundprotected Enumeration<URL> findResources(String name)
findResource(String).
findResources in class ClassLoadername - The name of the resource
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||