Package org.jppf.classloader
Class AbstractClassLoaderConnection<C>
java.lang.Object
org.jppf.node.AbstractNodeConnection<C>
org.jppf.classloader.AbstractClassLoaderConnection<C>
- Type Parameters:
C- the type of communication channel used by this connection.
- All Implemented Interfaces:
ClassLoaderConnection<C>,NodeConnection<C>
- Direct Known Subclasses:
AsyncLocalClassLoaderConnection,RemoteClassLoaderConnection
public abstract class AbstractClassLoaderConnection<C>
extends AbstractNodeConnection<C>
implements ClassLoaderConnection<C>
Abstract implementation of
ClassLoaderConnection.- Author:
- Laurent Cohen
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ClassLoaderRequestHandlerThe object which sends the class laoding requests and receives the responses.protected final StringThis node's uuid.Fields inherited from class org.jppf.node.AbstractNodeConnection
channel, initializing, lock -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet the object which sends the class laoding requests and receives the responses.org.jppf.classloader.JPPFResourceWrapperloadResource(Map<org.jppf.classloader.ResourceIdentifier, Object> map, boolean dynamic, String requestUuid, List<String> uuidPath) Load the specified class from a driver connection.protected voidperformCommonHandshake(org.jppf.classloader.ResourceRequestRunner requestRunner) Perform the part of the handshake common to remote and local nodes.voidreset()Reset this connection.protected voidsendCloseChannelCommand(org.jppf.classloader.ResourceRequestRunner requestRunner) Send a command to close the channel to the server.toString()Methods inherited from class org.jppf.node.AbstractNodeConnection
getChannelMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.jppf.node.NodeConnection
close, getChannel, init
-
Field Details
-
requestHandler
The object which sends the class laoding requests and receives the responses. -
uuid
This node's uuid.
-
-
Constructor Details
-
AbstractClassLoaderConnection
- Parameters:
uuid- this node's uuid.
-
-
Method Details
-
performCommonHandshake
protected void performCommonHandshake(org.jppf.classloader.ResourceRequestRunner requestRunner) Perform the part of the handshake common to remote and local nodes. This consists in:- sending an initial message to the server
- receiving an initial response from the server
- Parameters:
requestRunner- the object wrapping the driver connection and handling the class loading requests.
-
sendCloseChannelCommand
protected void sendCloseChannelCommand(org.jppf.classloader.ResourceRequestRunner requestRunner) Send a command to close the channel to the server.- Parameters:
requestRunner- the object wrapping the driver connection and handling the class loading requests.
-
loadResource
public org.jppf.classloader.JPPFResourceWrapper loadResource(Map<org.jppf.classloader.ResourceIdentifier, Object> map, boolean dynamic, String requestUuid, List<String> uuidPath) throws ExceptionDescription copied from interface:ClassLoaderConnectionLoad the specified class from a driver connection.- Specified by:
loadResourcein interfaceClassLoaderConnection<C>- Parameters:
map- contains the necessary resource request data.dynamic- true for a client class loader, false otherwise.requestUuid- identifies for which job the request is made.uuidPath- identifies the path to the driver or client that wil lookup and send back the requested resource.- Returns:
- a
JPPFResourceWrappercontaining the resource content. - Throws:
Exception- if the connection was lost and could not be reestablished.
-
getRequestHandler
Get the object which sends the class laoding requests and receives the responses.- Returns:
- a
ClassLoaderRequestHandlerinstance.
-
reset
Description copied from interface:NodeConnectionReset this connection.- Specified by:
resetin interfaceNodeConnection<C>- Overrides:
resetin classAbstractNodeConnection<C>- Throws:
Exception- if any error occurs.
-
toString
-