Class ProxyChannelRingBuffer

java.lang.Object
org.jctools.channels.proxy.ProxyChannelRingBuffer
Direct Known Subclasses:
OffHeapFixedMessageSizeRingBuffer

public abstract class ProxyChannelRingBuffer extends Object
This is the definition of the API required for the byte code generated by the ProxyChannelFactory
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final long
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected abstract long
    Get the position index of the consumer in the reference array
    protected abstract long
    Get the position index of the producer in the reference array
    protected abstract long
    Acquire an offset to read from
    protected abstract Object
    readReference(long index)
    Read a reference from the index of the reference array.
    protected abstract void
    readRelease(long offset)
    Release the offset from reading
    protected abstract long
    Acquire an offset to write to.
    protected abstract void
    writeReference(long index, Object reference)
    Write a reference into the index of the reference array.
    protected abstract void
    writeRelease(long offset, int callTypeId)
    Ordered store of the callTypeId for the message at offset

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • ProxyChannelRingBuffer

      public ProxyChannelRingBuffer()
  • Method Details

    • writeAcquire

      protected abstract long writeAcquire()
      Acquire an offset to write to. If there's no space available a wait strategy may be used.
      Returns:
      the offset that was acquired for writing or EOF
    • writeRelease

      protected abstract void writeRelease(long offset, int callTypeId)
      Ordered store of the callTypeId for the message at offset
      Parameters:
      offset - the offset that was released for writing
      callTypeId - A unique ID for the call
    • readAcquire

      protected abstract long readAcquire()
      Acquire an offset to read from
      Returns:
      the offset that was acquired for reading or EOF
    • readRelease

      protected abstract void readRelease(long offset)
      Release the offset from reading
      Parameters:
      offset - the offset to release for reading
    • consumerReferenceArrayIndex

      protected abstract long consumerReferenceArrayIndex(long offset)
      Get the position index of the consumer in the reference array
      Parameters:
      offset - the current offset of the consumer returned from readAcquire()
      Returns:
      the consumer index
    • producerReferenceArrayIndex

      protected abstract long producerReferenceArrayIndex(long offset)
      Get the position index of the producer in the reference array
      Parameters:
      offset - the current offset of the producer returned from writeAcquire()
      Returns:
      the producer index
    • writeReference

      protected abstract void writeReference(long index, Object reference)
      Write a reference into the index of the reference array.
      Parameters:
      index - the index to write to
      reference - the reference to write
    • readReference

      protected abstract Object readReference(long index)
      Read a reference from the index of the reference array.
      Parameters:
      index - the index to read from
      Returns:
      the reference that was read