|
ehcache | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.ehcache.pool.impl.AbstractPoolAccessor<T>
T
- accessing store typepublic abstract class AbstractPoolAccessor<T>
Abstract PoolAccessor implementation providing pool to store binding functionality.
Field Summary | |
---|---|
protected SizeOfEngine |
sizeOfEngine
SizeOfEngine used by the accessor. |
Constructor Summary | |
---|---|
AbstractPoolAccessor(Pool<T> pool,
T store,
SizeOfEngine sizeOfEngine)
Creates an accessor for the specified store to access the specified pool. |
Method Summary | |
---|---|
protected abstract long |
add(long sizeOf,
boolean force)
Add a specific number of bytes to the pool. |
long |
add(Object key,
Object value,
Object container,
boolean force)
Add an element to the pool. |
protected abstract boolean |
canAddWithoutEvicting(long sizeOf)
Check if there is enough room in the pool to add a specific number of bytes without provoking any eviction |
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 |
protected void |
checkLinked()
Throws IllegalStateException if this accessor is not linked to it's pool. |
void |
clear()
Free resources used by this accessor. |
protected abstract void |
doClear()
Free resources used by this accessor. |
protected Pool<T> |
getPool()
Return the pool this accessor is associated with. |
T |
getStore()
Return the store that uses this accessor |
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface net.sf.ehcache.pool.PoolAccessor |
---|
delete, getSize |
Field Detail |
---|
protected final SizeOfEngine sizeOfEngine
SizeOfEngine
used by the accessor.
Constructor Detail |
---|
public AbstractPoolAccessor(Pool<T> pool, T store, SizeOfEngine sizeOfEngine)
pool
- pool to be accessedstore
- accessing storeMethod Detail |
---|
public final long add(Object key, Object value, Object container, boolean force)
add
in interface PoolAccessor<T>
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
public final boolean canAddWithoutEvicting(Object key, Object value, Object container)
canAddWithoutEvicting
in interface PoolAccessor<T>
key
- the key of the elementvalue
- the value of the elementcontainer
- the element-container object
protected abstract long add(long sizeOf, boolean force)
sizeOf
- number of bytes to addforce
- true if the pool should accept adding the element, even if it's out of resources
protected abstract boolean canAddWithoutEvicting(long sizeOf)
sizeOf
- number of bytes to test against
public final long replace(long currentSize, Object key, Object value, Object container, boolean force)
replace
in interface PoolAccessor<T>
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
public final void clear()
clear
in interface PoolAccessor<T>
protected abstract void doClear()
clear()
.
public final void unlink()
unlink
in interface PoolAccessor<T>
public final T getStore()
getStore
in interface PoolAccessor<T>
public void setMaxSize(long newValue)
setMaxSize
in interface PoolAccessor<T>
newValue
- the value in bytesprotected final void checkLinked() throws IllegalStateException
IllegalStateException
if this accessor is not linked to it's pool.
IllegalStateException
- if not linkedprotected final Pool<T> getPool()
public boolean hasAbortedSizeOf()
hasAbortedSizeOf
in interface PoolAccessor<T>
|
ehcache | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |