Interface IBufferProvider

All Known Subinterfaces:
IBufferPool, IBufferPool.Introspection, IBufferProvider.Introspection, IBufferProvider.Notification, InternalChannel, InternalChannelMultiplexer, InternalConnector
All Known Implementing Classes:
Channel, ChannelMultiplexer, Connector, MessageConnector, SchedulingConnector

public interface IBufferProvider
Provides IBuffer storage to clients and accepts buffers whose current ownership has been relinquished.

A call to provideBuffer() transfers one buffer to the caller, which must eventually call IBuffer.release(). A provider may then reuse, pool, or dispose of the buffer in retainBuffer(IBuffer). These methods describe a storage ownership cycle; they do not imply that every buffer passed to retainBuffer was originally created by this provider.

Author:
Eike Stepper
  • Method Details

    • getBufferCapacity

      short getBufferCapacity()
      Returns the capacity, in bytes, of buffers returned by provideBuffer().
    • provideBuffer

      IBuffer provideBuffer()
      Provides a buffer and transfers its current ownership to the caller.
    • retainBuffer

      void retainBuffer(IBuffer buffer)
      Accepts a buffer whose caller has relinquished ownership. Implementations may keep it for reuse or release its storage; callers must not use the buffer after handing it over.