public interface BufferListener
|Modifier and Type||Method and Description|
Notification callback if a buffer is recycled and becomes available in buffer pool.
Notification callback if the buffer provider is destroyed.
boolean notifyBufferAvailable(Buffer buffer)
Note: 1) Responsibility on recycling the given buffer is transferred to this implementation, including any errors that lead to exceptions being thrown! 2) The listener must register itself again if it needs still need more buffers.
BEWARE: since this may be called from outside the thread that relies on
the listener's logic, any exception that occurs with this handler should be forwarded to the
responsible thread for handling and otherwise ignored in the processing of this method. The
buffer pool forwards any
Throwable from here upwards to a potentially unrelated call
buffer- buffer that becomes available in buffer pool.
Copyright © 2014–2021 The Apache Software Foundation. All rights reserved.