public final class TimedBuffer extends CriticalComponentImpl
Modifier and Type | Field and Description |
---|---|
protected static int |
CRITICAL_PATH_ADD_BYTES |
protected static int |
CRITICAL_PATH_CHECK_SIZE |
protected static int |
CRITICAL_PATH_FLUSH |
protected static int |
CRITICAL_PATH_SET_OBSERVER |
protected static int |
CRITICAL_PATH_START |
protected static int |
CRITICAL_PATH_STOP |
protected static int |
CRITICAL_PATHS |
Constructor and Description |
---|
TimedBuffer(CriticalAnalyzer analyzer,
int size,
int timeout,
boolean logRates) |
Modifier and Type | Method and Description |
---|---|
void |
addBytes(ActiveMQBuffer bytes,
boolean sync,
IOCallback callback) |
void |
addBytes(EncodingSupport bytes,
boolean sync,
IOCallback callback) |
boolean |
checkSize(int sizeChecked)
Verify if the size fits the buffer
|
void |
flush() |
boolean |
flushBatch()
Attempts to flush if
!delayFlush and buffer is filled by any data. |
void |
setObserver(TimedBufferObserver observer) |
protected void |
sleep(long sleepNanos)
Sub classes (tests basically) can use this to override how the sleep is being done
|
void |
start() |
protected void |
startSpin()
Sub classes (tests basically) can use this to override disabling spinning
|
void |
stop() |
protected void |
stopSpin()
Sub classes (tests basically) can use this to override disabling spinning
|
enterCritical, getCriticalAnalyzer, isExpired, leaveCritical
protected static final int CRITICAL_PATHS
protected static final int CRITICAL_PATH_FLUSH
protected static final int CRITICAL_PATH_STOP
protected static final int CRITICAL_PATH_START
protected static final int CRITICAL_PATH_CHECK_SIZE
protected static final int CRITICAL_PATH_ADD_BYTES
protected static final int CRITICAL_PATH_SET_OBSERVER
public TimedBuffer(CriticalAnalyzer analyzer, int size, int timeout, boolean logRates)
public void start()
public void stop()
public void setObserver(TimedBufferObserver observer)
public boolean checkSize(int sizeChecked)
sizeChecked
- public void addBytes(ActiveMQBuffer bytes, boolean sync, IOCallback callback)
public void addBytes(EncodingSupport bytes, boolean sync, IOCallback callback)
public void flush()
public boolean flushBatch()
!delayFlush
and buffer
is filled by any data.true
when are flushed any bytes, false
otherwiseprotected void sleep(long sleepNanos)
sleepNanos
- InterruptedException
protected void stopSpin()
protected void startSpin()
Copyright © 2019 JBoss by Red Hat. All rights reserved.