Class AsyncClientClassContext

java.lang.Object
org.jppf.nio.AbstractNioContext
org.jppf.server.nio.classloader.AbstractAsyncClassContext
org.jppf.server.nio.classloader.client.AsyncClientClassContext
All Implemented Interfaces:
org.jppf.nio.CloseableContext, org.jppf.nio.NioChannelHandler, org.jppf.nio.NioContext

public class AsyncClientClassContext extends AbstractAsyncClassContext
Context or state information associated with a channel that exchanges heartbeat messages between the server and a node or client.
Author:
Laurent Cohen
  • Method Details

    • handleException

      public void handleException(Exception e)
    • handleProviderError

      protected void handleProviderError()
      Handle the scenario where an exception occurs while sending a request to or receiving a response from a provider, and a node channel is waiting for the response.
    • offerMessageToSend

      public void offerMessageToSend(org.jppf.nio.ClassLoaderNioMessage message) throws Exception
      Add the specified message to the send queue.
      Parameters:
      message - the message to add to the queue.
      Throws:
      Exception - if any error occurs.
    • addRequest

      public void addRequest(AsyncResourceRequest request) throws Exception
      Add a new request to send to the client.
      Parameters:
      request - the requets to send.
      Throws:
      Exception - if any error occurs.
    • getNbPendingRequests

      public int getNbPendingRequests()
      Returns:
      the number of pending requests.
    • getRequests

      public List<AsyncResourceRequest> getRequests(org.jppf.classloader.JPPFResourceWrapper resource)
      Retrieve the request matching a specified resource.
      Parameters:
      resource - the key in the request map.
      Returns:
      an AsyncResourceRequest instance, or null if there is no entry with the specified resource.
    • removeRequest

      public AsyncResourceRequest removeRequest(org.jppf.classloader.JPPFResourceWrapper resource)
      Remove the request matching a specified resource.
      Parameters:
      resource - the key in the request map.
      Returns:
      the removed AsyncResourceRequest instance, or null if there is no entry with the specified id.
    • toString

      public String toString()
      Overrides:
      toString in class org.jppf.nio.AbstractNioContext
    • 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.
    • getServer

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