|
ehcache | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
T
- Type representing this "other" side of this accessor (i.e. a store), so the evictor can interact with itpublic interface PoolAccessor<T extends PoolParticipant>
PoolAccessors are used by stores to tell the pools about their resource consumption
Method Summary | |
---|---|
long |
add(Object key,
Object value,
Object container,
boolean force)
Add an element to the pool. |
boolean |
canAddWithoutEvicting(Object key,
Object value,
Object container)
Check if there is enough room in the pool to add an element without provoking any eviction |
void |
clear()
Free resources used by this accessor. |
long |
delete(long size)
Delete a fixed number of bytes from the pool. |
T |
getParticipant()
Return the store that uses this accessor |
long |
getPoolOccupancy()
Returns the occupied size for this pool. |
long |
getPoolSize()
Returns the size of this pool. |
long |
getSize()
Return how many bytes this accessor consumes from the pool. |
boolean |
hasAbortedSizeOf()
Check if the store may contain elements which the SizeOf engine could not fully size. |
long |
replace(long currentSize,
Object key,
Object value,
Object container,
boolean force)
Delete a fixed number of bytes from the pool with the given objects. |
void |
setMaxSize(long newValue)
Sets the max size for this pool |
void |
unlink()
unlink this PoolAccessor from its pool. |
Method Detail |
---|
long add(Object key, Object value, Object container, boolean force)
key
- the key of the elementvalue
- the value of the elementcontainer
- the element-container objectforce
- true if the pool should accept adding the element, even if it's out of resources
boolean canAddWithoutEvicting(Object key, Object value, Object container)
key
- the key of the elementvalue
- the value of the elementcontainer
- the element-container object
long delete(long size) throws IllegalArgumentException
size
- number of bytes
IllegalArgumentException
- when sizeOf is negativelong replace(long currentSize, Object key, Object value, Object container, boolean force)
currentSize
- the size of the object(s) being replacedkey
- the key of the elementvalue
- the value of the elementcontainer
- the element-container objectforce
- true if the pool should accept replacing the element, even if it's out of resources
Long.MIN_VALUE
if replace failed.long getSize()
void unlink()
void clear()
T getParticipant()
void setMaxSize(long newValue)
newValue
- the value in byteslong getPoolOccupancy()
long getPoolSize()
boolean hasAbortedSizeOf()
|
ehcache | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |