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
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceOffers additional introspection features forbuffer providers.static interfaceOffers additional notification features forbuffer providers. -
Method Summary
Modifier and TypeMethodDescriptionshortReturns the capacity, in bytes, of buffers returned byprovideBuffer().Provides a buffer and transfers its current ownership to the caller.voidretainBuffer(IBuffer buffer) Accepts a buffer whose caller has relinquished ownership.
-
Method Details
-
getBufferCapacity
short getBufferCapacity()Returns the capacity, in bytes, of buffers returned byprovideBuffer(). -
provideBuffer
IBuffer provideBuffer()Provides a buffer and transfers its current ownership to the caller. -
retainBuffer
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.
-