@NoImplement public interface ByteBufferManager
ByteBuffer
instances, so that Mule can keep track
of how much buffer memory is being consumed by the owner of this manager.
Even though the ByteBuffer
API doesn't have the concept of deallocation, for the purposes
of this class every buffer obtained through the allocate(int)
method should eventually be
passed to the deallocate(ByteBuffer)
method once the instance is no longer needed.
Modifier and Type | Method and Description |
---|---|
ByteBuffer |
allocate(int capacity)
Returns a
ByteBuffer of the given capacity . |
void |
deallocate(ByteBuffer byteBuffer)
Indicates that the given
byteBuffer is no longer needed and the runtime
may dispose of it however it sees fit. |
ByteBuffer allocate(int capacity)
ByteBuffer
of the given capacity
.
Invokers MUST call the deallocate(ByteBuffer)
method with the returned
buffer once it's no longer needed.
capacity
- the capacity of the returned bufferByteBuffer
of the given capacity
org.mule.runtime.core.internal.streaming.bytes.MaxStreamingMemoryExceededException
- if no more streaming memory is availablevoid deallocate(ByteBuffer byteBuffer)
byteBuffer
is no longer needed and the runtime
may dispose of it however it sees fit.byteBuffer
- the buffer to be deallocated.Copyright © 2018. All rights reserved.