Package org.jppf.nio

Class AbstractNioObject

java.lang.Object
org.jppf.nio.AbstractNioObject
All Implemented Interfaces:
NioObject
Direct Known Subclasses:
PlainNioObject, SSLNioObject

public abstract class AbstractNioObject extends Object implements NioObject
Abstract implementation of the NioObject interface, providing the means to keep stateful information across multiple calls to the read() or write() methods.
Author:
Laurent Cohen
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected long
    Actual bytes sent to or received from the underlying channel (in encrypted form for secure channels).
    protected int
    What has currently been read from or written to the message.
    protected final DataLocation
    Location of the data to read or write.
    protected final int
    The size of the data ot send or receive.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    AbstractNioObject(DataLocation location, int size)
    Initialize this NioObject with the specified data location and size.
  • Method Summary

    Modifier and Type
    Method
    Description
    long
    Get the actual bytes sent to or received from the underlying channel.
    Location of the data to read or write.
    int
    Get the size of the data ot send or receive.
    Reset this object.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.jppf.nio.NioObject

    read, write
  • Field Details

    • size

      protected final int size
      The size of the data ot send or receive.
    • count

      protected int count
      What has currently been read from or written to the message.
    • location

      protected final DataLocation location
      Location of the data to read or write.
    • channelCount

      protected long channelCount
      Actual bytes sent to or received from the underlying channel (in encrypted form for secure channels).
  • Constructor Details

    • AbstractNioObject

      protected AbstractNioObject(DataLocation location, int size)
      Initialize this NioObject with the specified data location and size.
      Parameters:
      location - the object which holds the data to read or write.
      size - the size of the data.
  • Method Details

    • getData

      public DataLocation getData()
      Description copied from interface: NioObject
      Location of the data to read or write.
      Specified by:
      getData in interface NioObject
      Returns:
      a DataLocation instance.
    • getSize

      public int getSize()
      Description copied from interface: NioObject
      Get the size of the data ot send or receive.
      Specified by:
      getSize in interface NioObject
      Returns:
      the size as an int.
    • getChannelCount

      public long getChannelCount()
      Description copied from interface: NioObject
      Get the actual bytes sent to or received from the underlying channel.
      Specified by:
      getChannelCount in interface NioObject
      Returns:
      the number of bytes as a long value.
    • reset

      public NioObject reset()
      Description copied from interface: NioObject
      Reset this object.
      Specified by:
      reset in interface NioObject
      Returns:
      an Object of the same class.