|
Oracle® Coherence Java API Reference Release 12.1.2.0.3 E26043-02 |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
com.tangosol.util.Base
com.tangosol.io.nio.AbstractBufferManager
public abstract class AbstractBufferManager
Provides a basic implementation of ByteBufferManager.
Constructor Summary | |
---|---|
protected |
AbstractBufferManager(int cbInitial, int cbMaximum) Construct a AbstractBufferManager that supports a buffer of a certain initial and maximum size. |
Method Summary | |
---|---|
protected abstract void |
allocateBuffer() Allocate a new buffer, copying old data if there is any. |
protected void |
calibrate() Determine the grow and shrink thresholds based on the current capacity. |
java.nio.ByteBuffer |
getBuffer() Get the current ByteBuffer reference. |
int |
getCapacity() Get the capacity of the current ByteBuffer. |
int |
getGrowthThreshold() Determine the level (what number of bytes used) above which the current ByteBuffer will need to be "resized" upwards. |
int |
getMaxCapacity() Determine the maximum size that the managed buffer can reach. |
protected int |
getMaxIncrement() |
int |
getMinCapacity() Determine the minimum size that the managed buffer can reach. |
int |
getShrinkageThreshold() Determine the level (what number of bytes used) below which the current ByteBuffer will need to be "resized" downwards. |
void |
grow(int cbRequired) Request that the buffer be grown based on the number of bytes currently required. |
protected void |
setBuffer(java.nio.ByteBuffer buffer) Set the current ByteBuffer reference. |
protected void |
setCapacity(int cb) Set the capacity of the current ByteBuffer. |
protected void |
setGrowthThreshold(int cb) Specify the level (what number of bytes used) above which the current ByteBuffer will need to be "resized" upwards. |
protected void |
setMaxCapacity(int cb) Specify the maximum size that the managed buffer can reach. |
protected void |
setMinCapacity(int cb) Specify the minimum size that the managed buffer can reach. |
protected void |
setShrinkageThreshold(int cb) Specify the level (what number of bytes used) below which the current ByteBuffer will need to be "resized" downwards. |
void |
shrink(int cbRequired) Request that the buffer be shrunk based on the number of bytes currently required. |
Constructor Detail |
---|
protected AbstractBufferManager(int cbInitial, int cbMaximum)
cbInitial
- the initial sizecbMaximum
- the maximum sizeMethod Detail |
---|
public java.nio.ByteBuffer getBuffer()
getBuffer
in interface ByteBufferManager
protected void setBuffer(java.nio.ByteBuffer buffer)
buffer
- the current ByteBufferpublic int getCapacity()
getBuffer().capacity()
.getCapacity
in interface ByteBufferManager
protected void setCapacity(int cb)
cb
- the capacity of the managed ByteBufferpublic int getGrowthThreshold()
getGrowthThreshold
in interface ByteBufferManager
protected void setGrowthThreshold(int cb)
cb
- the number of bytes that, when the number of used bytes exceeds it, the ByteBuffer will need to growpublic int getShrinkageThreshold()
getShrinkageThreshold
in interface ByteBufferManager
protected void setShrinkageThreshold(int cb)
cb
- the number of bytes that, when the number of used bytes drops below it, the ByteBuffer will need to shrinkpublic int getMinCapacity()
getCapacity
.getMinCapacity
in interface ByteBufferManager
protected void setMinCapacity(int cb)
cb
- minimum size for the managed bufferpublic int getMaxCapacity()
getCapacity
.getMaxCapacity
in interface ByteBufferManager
protected void setMaxCapacity(int cb)
cb
- maximum size for the managed bufferprotected int getMaxIncrement()
public void grow(int cbRequired)
grow
in interface ByteBufferManager
cbRequired
- the number of bytes that are needed by the requesting operationpublic void shrink(int cbRequired)
shrink
in interface ByteBufferManager
cbRequired
- the number of contiguous bytes in the buffer, starting from offset 0, that are actually in useprotected void calibrate()
protected abstract void allocateBuffer()
|
Oracle® Coherence Java API Reference Release 12.1.2.0.3 E26043-02 |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |