Class AsyncClientContext

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

public class AsyncClientContext extends org.jppf.nio.AbstractNioContext
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)
    • serializeBundle

      public ClientMessage serializeBundle(ServerTaskBundleClient bundle) throws Exception
      Serialize specified bundle into a message to send.
      Parameters:
      bundle - the byndle to process.
      Returns:
      the created message.
      Throws:
      Exception - if any error occurs.
    • deserializeBundle

      public ServerTaskBundleClient deserializeBundle(ClientMessage message) throws Exception
      Deserialize a task bundle from a message read from a connection.
      Parameters:
      message - the message to process.
      Returns:
      a ClientContext instance.
      Throws:
      Exception - if an error occurs during the deserialization.
    • newMessage

      public ClientMessage newMessage(ServerTaskBundleClient clientBundle)
      Create a new message.
      Parameters:
      clientBundle - the actual client task bundle from which this message is created.
      Returns:
      an ClientMessage instance.
    • readMessage

      public boolean readMessage() throws Exception
      Throws:
      Exception
    • writeMessage

      public boolean writeMessage() throws Exception
      Throws:
      Exception
    • getJobEntry

      public JobEntry getJobEntry(String jobUuid, long bundleId)
      Retrieve the job entry with the specified id.
      Parameters:
      jobUuid - the uuid of the job whose entry to retrieve.
      bundleId - the id of the client job bundle for the entry.
      Returns:
      a JobEntry instance, or null if there is no entry with the specified id.
    • addEntry

      public void addEntry(ServerTaskBundleClient bundle)
      Add a new job to the job map.
      Parameters:
      bundle - the job to add.
    • removeJobEntry

      public JobEntry removeJobEntry(String jobUuid, long bundleId)
      Remove the job entry with the specified id.
      Parameters:
      jobUuid - the uuid of the job whose entry to retrieve.
      bundleId - the id of the client job bundle for the entry.
      Returns:
      the removed JobEntry instance, or null if there is no entry with the specified id.
    • nextMessageToSend

      protected ClientMessage nextMessageToSend()
      Overrides:
      nextMessageToSend in class org.jppf.nio.AbstractNioContext
    • toString

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

      public static AsyncClientContext.JobEntryDebugStats getEntrystats()
      Returns:
      the job entry stats.
    • getEntryMap

      public Map<String,JobEntry> getEntryMap()
      Returns:
      a map of the client bundles sent over this connection.