Class AsyncNodeClassContext

java.lang.Object
org.jppf.nio.AbstractNioContext
org.jppf.server.nio.classloader.AbstractAsyncClassContext
org.jppf.server.nio.classloader.node.AsyncNodeClassContext
All Implemented Interfaces:
org.jppf.classloader.AsyncLocalNodeClassloaderContext, org.jppf.nio.CloseableContext, org.jppf.nio.NioChannelHandler, org.jppf.nio.NioContext

public class AsyncNodeClassContext extends AbstractAsyncClassContext implements org.jppf.classloader.AsyncLocalNodeClassloaderContext
Author:
Laurent Cohen
  • Constructor Details

    • AsyncNodeClassContext

      public AsyncNodeClassContext(AsyncNodeClassNioServer server, SocketChannel socketChannel)
      Parameters:
      server - the server handling this context.
      socketChannel - the underlying socket channel.
  • Method Details

    • handleException

      public void handleException(Exception e)
      Specified by:
      handleException in interface org.jppf.nio.NioContext
    • isProvider

      protected boolean isProvider()
      Description copied from class: AbstractAsyncClassContext
      Determine whether this context relates to a provider or node connection.
      Specified by:
      isProvider in class AbstractAsyncClassContext
      Returns:
      true if this is a provider context, false otherwise.
    • addPendingResponse

      public AsyncResourceRequest addPendingResponse(org.jppf.classloader.JPPFResourceWrapper resource)
      Add a pending response.
      Parameters:
      resource - the resource for which to await a response.
      Returns:
      the new added request.
    • handleProviderResponse

      public void handleProviderResponse(AsyncResourceRequest request) throws Exception
      Process a response ot a provider request.
      Parameters:
      request - the request to handle.
      Throws:
      Exception - if any error occurs.
    • sendResponse

      public void sendResponse(org.jppf.classloader.JPPFResourceWrapper response) throws Exception
      Send a response back to the node
      Parameters:
      response - the response to send.
      Throws:
      Exception - if any error occurs.
    • getNbPendingResponses

      public int getNbPendingResponses()
      Get the number of pending responses.
      Returns:
      the number of pending responses as an int.
    • setLocalRequest

      public void setLocalRequest(org.jppf.classloader.JPPFResourceWrapper localRequest) throws Exception
      Specified by:
      setLocalRequest in interface org.jppf.classloader.AsyncLocalNodeClassloaderContext
      Throws:
      Exception
    • awaitLocalResponse

      public org.jppf.classloader.JPPFResourceWrapper awaitLocalResponse() throws Exception
      Specified by:
      awaitLocalResponse in interface org.jppf.classloader.AsyncLocalNodeClassloaderContext
      Throws:
      Exception
    • setLocalResponse

      public void setLocalResponse(org.jppf.classloader.JPPFResourceWrapper localResponse) throws Exception
      Specified by:
      setLocalResponse in interface org.jppf.classloader.AsyncLocalNodeClassloaderContext
      Throws:
      Exception
    • getServer

      public AsyncNodeClassNioServer getServer()
      Overrides:
      getServer in class AbstractAsyncClassContext
      Returns:
      the Nio server handling this context.
    • toString

      public String toString()
      Overrides:
      toString in class org.jppf.nio.AbstractNioContext