Class ProxyChannelRingBuffer

    • Field Summary

      Fields 
      Modifier and Type Field Description
      static long EOF  
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      protected abstract long consumerReferenceArrayIndex​(long offset)
      Get the position index of the consumer in the reference array
      protected abstract long producerReferenceArrayIndex​(long offset)
      Get the position index of the producer in the reference array
      protected abstract long readAcquire()
      Acquire an offset to read from
      protected abstract java.lang.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 writeAcquire()
      Acquire an offset to write to.
      protected abstract void writeReference​(long index, java.lang.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
    • Constructor Detail

      • ProxyChannelRingBuffer

        public ProxyChannelRingBuffer()
    • Method Detail

      • 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,
                                               java.lang.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 java.lang.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