Class TimedBuffer

java.lang.Object
org.apache.activemq.artemis.utils.critical.CriticalComponentImpl
org.apache.activemq.artemis.core.io.buffer.TimedBuffer
All Implemented Interfaces:
org.apache.activemq.artemis.utils.critical.CriticalComponent

public final class TimedBuffer extends org.apache.activemq.artemis.utils.critical.CriticalComponentImpl
  • Field Details

  • Constructor Details

    • TimedBuffer

      public TimedBuffer(org.apache.activemq.artemis.utils.critical.CriticalAnalyzer analyzer, int size, int timeout, boolean logRates)
  • Method Details

    • start

      public void start()
    • stop

      public void stop()
    • setObserver

      public void setObserver(TimedBufferObserver observer)
    • checkSize

      public boolean checkSize(int sizeChecked)
      Verify if the size fits the buffer
    • addBytes

      public void addBytes(ActiveMQBuffer bytes, boolean sync, IOCallback callback)
    • addBytes

      public void addBytes(EncodingSupport bytes, boolean sync, IOCallback callback)
    • flush

      public void flush()
    • flushBatch

      public boolean flushBatch()
      Attempts to flush if !delayFlush and buffer is filled by any data.
      Returns:
      true when are flushed any bytes, false otherwise
    • sleep

      protected void sleep(long sleepNanos)
      Sub classes (tests basically) can use this to override how the sleep is being done
    • stopSpin

      protected void stopSpin()
      Sub classes (tests basically) can use this to override disabling spinning
    • startSpin

      protected void startSpin()
      Sub classes (tests basically) can use this to override disabling spinning