|
CoherenceTM v3.3 Copyright© 2000-2007 by Oracle Corporation |
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectcom.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. |
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(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 size| Method Detail |
|---|
public ByteBuffer getBuffer()
getBuffer in interface ByteBufferManagerprotected void setBuffer(ByteBuffer buffer)
buffer - the current ByteBufferpublic int getCapacity()
getBuffer().capacity().
getCapacity in interface ByteBufferManagerprotected void setCapacity(int cb)
cb - the capacity of the managed ByteBufferpublic int getGrowthThreshold()
getGrowthThreshold in interface ByteBufferManagerprotected 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 ByteBufferManagerprotected 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 ByteBufferManagerprotected void setMinCapacity(int cb)
cb - minimum size for the managed bufferpublic int getMaxCapacity()
getCapacity.
getMaxCapacity in interface ByteBufferManagerprotected void setMaxCapacity(int cb)
cb - maximum size for the managed bufferprotected int getMaxIncrement()
public void grow(int cbRequired)
grow in interface ByteBufferManagercbRequired - the number of bytes that are needed by the
requesting operationpublic void shrink(int cbRequired)
shrink in interface ByteBufferManagercbRequired - the number of contiguous bytes in the buffer,
starting from offset 0, that are actually in useprotected void calibrate()
protected abstract void allocateBuffer()
|
CoherenceTM v3.3 Copyright© 2000-2007 by Oracle Corporation |
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||