Package org.jppf.nio

Class AbstractNioMessageBase

java.lang.Object
org.jppf.nio.AbstractNioMessageBase
All Implemented Interfaces:
NioMessage
Direct Known Subclasses:
AbstractNioMessage, SimpleNioMessage

public abstract class AbstractNioMessageBase extends Object implements NioMessage
Common abstract superclass representing a message sent or received by a channel. A message is the transformation of a sequence of objects into a more easily transportable format.
Author:
Laurent Cohen
  • Field Details

    • count

      protected int count
      The current count of bytes sent or received.
    • currentDataLocation

      protected DataLocation currentDataLocation
      Temporary holder used as a local performance optimization for write operations.
    • currentLength

      protected int currentLength
      The length of the location at the current position.
    • currentLengthObject

      protected NioObject currentLengthObject
      Object storing the length of the object currently being read or written.
    • resetCurrentLength

      protected boolean resetCurrentLength
    • currentObject

      protected NioObject currentObject
      Object storing the object currently being read or written.
    • ssl

      protected final boolean ssl
      true is data is read from or written an SSL connection, false otherwise.
    • sslHandler

      protected final SSLHandler sslHandler
      Wraps a channel associated with an SSLEngine.
    • channelReadCount

      protected long channelReadCount
      Actual bytes sent to or received from the underlying channel.
    • channelWriteCount

      protected long channelWriteCount
      Actual bytes sent to or received from the underlying channel.
    • channel

      protected final NioContext channel
      The channel to read from or write to.
    • lengthBuf

      protected final MultipleBuffersLocation lengthBuf
      Reusable buffer for reading/writing serialized object lengths.
    • sslHandlerReadCount

      protected long sslHandlerReadCount
    • sslHandlerWriteCount

      protected long sslHandlerWriteCount
  • Constructor Details

    • AbstractNioMessageBase

      protected AbstractNioMessageBase(NioContext channel)
      Initialize this nio message.
      Parameters:
      channel - the channel to read from or write to.
  • Method Details

    • isSSL

      public boolean isSSL()
      Description copied from interface: NioMessage
      Determines whether this message read from / writes to an SSL connection.
      Specified by:
      isSSL in interface NioMessage
      Returns:
      true is data is read from or written an SSL connection, false otherwise.
    • getChannelReadCount

      public long getChannelReadCount()
      Description copied from interface: NioMessage
      Get the actual bytes received from the underlying channel.
      Specified by:
      getChannelReadCount in interface NioMessage
      Returns:
      the number of bytes as a long value.
    • getChannelWriteCount

      public long getChannelWriteCount()
      Description copied from interface: NioMessage
      Get the actual bytes sent to the underlying channel.
      Specified by:
      getChannelWriteCount in interface NioMessage
      Returns:
      the number of bytes as a long value.
    • getCurrentDataLocation

      public DataLocation getCurrentDataLocation()
      Get the data location objects abstracting the data to send or receive.
      Returns:
      a DataLocation object.
    • updateCounts

      protected void updateCounts(long update, int op)
      Parameters:
      update - the update value.
      op - the type of operation, and therefore which counter to upddate.