Class UnsafeBufferStatusIndicator


public class UnsafeBufferStatusIndicator extends StatusIndicator
StatusIndicator which wraps an AtomicBuffer with a given counter id.
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final long
     
    private final byte[]
     
    private final ByteBuffer
     
    private final int
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    UnsafeBufferStatusIndicator(AtomicBuffer buffer, int counterId)
    Map a status indicator over a buffer.
  • Method Summary

    Modifier and Type
    Method
    Description
    long
    Get the current status indication of a component with acquire semantics.
    long
    Get the current status indication of a component with opaque semantics.
    long
    Get the current status indication of a component with volatile semantics.
    int
    id()
    Identifier for this status indicator.
    void
    setOpaque(long value)
    Sets the current status indication of the component with opaque memory semantics.
    void
    setOrdered(long value)
    Sets the current status indication of the component with ordered memory semantics.
    void
    setRelease(long value)
    Sets the current status indication of the component with release memory semantics.
    void
    setVolatile(long value)
    Sets the current status indication of the component with volatile memory semantics.

    Methods inherited from class java.lang.Object

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

    • counterId

      private final int counterId
    • addressOffset

      private final long addressOffset
    • byteArray

      private final byte[] byteArray
    • byteBuffer

      private final ByteBuffer byteBuffer
  • Constructor Details

    • UnsafeBufferStatusIndicator

      public UnsafeBufferStatusIndicator(AtomicBuffer buffer, int counterId)
      Map a status indicator over a buffer.
      Parameters:
      buffer - containing the indicator.
      counterId - identifier of the indicator.
  • Method Details

    • id

      public int id()
      Identifier for this status indicator.
      Specified by:
      id in class StatusIndicatorReader
      Returns:
      the identifier for this status indicator.
    • setVolatile

      public void setVolatile(long value)
      Sets the current status indication of the component with volatile memory semantics.
      Specified by:
      setVolatile in class StatusIndicator
      Parameters:
      value - the current status indication of the component.
    • setOrdered

      public void setOrdered(long value)
      Sets the current status indication of the component with ordered memory semantics.

      This method is identical to StatusIndicator.setRelease(long) and that method should be used instead.

      Specified by:
      setOrdered in class StatusIndicator
      Parameters:
      value - the current status indication of the component.
    • setRelease

      public void setRelease(long value)
      Sets the current status indication of the component with release memory semantics.
      Specified by:
      setRelease in class StatusIndicator
      Parameters:
      value - the current status indication of the component.
    • setOpaque

      public void setOpaque(long value)
      Sets the current status indication of the component with opaque memory semantics.
      Specified by:
      setOpaque in class StatusIndicator
      Parameters:
      value - the current status indication of the component.
    • getVolatile

      public long getVolatile()
      Get the current status indication of a component with volatile semantics.
      Specified by:
      getVolatile in class StatusIndicatorReader
      Returns:
      the current status indication of a component.
    • getAcquire

      public long getAcquire()
      Get the current status indication of a component with acquire semantics.
      Specified by:
      getAcquire in class StatusIndicatorReader
      Returns:
      the current status indication of a component.
    • getOpaque

      public long getOpaque()
      Get the current status indication of a component with opaque semantics.
      Specified by:
      getOpaque in class StatusIndicatorReader
      Returns:
      the current status indication of a component.
    • toString

      public String toString()
      Overrides:
      toString in class Object