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 Details

    • requestHandler

      protected ClassLoaderRequestHandler requestHandler
      The object which sends the class laoding requests and receives the responses.
    • uuid

      protected final String uuid
      This node's uuid.
  • Constructor Details

    • AbstractClassLoaderConnection

      protected AbstractClassLoaderConnection(String uuid)
      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:
      1. sending an initial message to the server
      2. 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 Exception
      Description copied from interface: ClassLoaderConnection
      Load the specified class from a driver connection.
      Specified by:
      loadResource in interface ClassLoaderConnection<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 JPPFResourceWrapper containing the resource content.
      Throws:
      Exception - if the connection was lost and could not be reestablished.
    • getRequestHandler

      public ClassLoaderRequestHandler getRequestHandler()
      Get the object which sends the class laoding requests and receives the responses.
      Returns:
      a ClassLoaderRequestHandler instance.
    • reset

      public void reset() throws Exception
      Description copied from interface: NodeConnection
      Reset this connection.
      Specified by:
      reset in interface NodeConnection<C>
      Overrides:
      reset in class AbstractNodeConnection<C>
      Throws:
      Exception - if any error occurs.
    • toString

      public String toString()
      Overrides:
      toString in class Object