|
ehcache | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.ehcache.store.compound.factories.CapacityLimitedInMemoryFactory
public class CapacityLimitedInMemoryFactory
An implementation of a capacity limited in-memory factory.
Constructor Summary | |
---|---|
CapacityLimitedInMemoryFactory(DiskOverflowStorageFactory secondary,
int capacity,
Policy policy,
RegisteredEventListeners eventService)
Constructs a factory with the given secondary (null if none), capacity, and eviction policy. |
Method Summary | |
---|---|
void |
bind(CompoundStore store)
Bind a store instance to this factory. |
Element |
create(Object key,
Element element)
Creates a substitute for the supplied Element |
boolean |
created(Object object)
Returns true if this factory created the given object. |
void |
expireElements()
Remove elements created by this factory if they have expired. |
void |
free(Lock exclusion,
Element object)
Free any manually managed resources used by this Element or
ElementSubstitute . |
Policy |
getEvictionPolicy()
Return the eviction policy used by this factory. |
int |
getSize()
Get the count of elements created by this factory |
long |
getSizeInBytes()
Get the total serialized size of all elements created by this factory |
Element |
retrieve(Object key,
Element object)
Retrieves the supplied Element or ElementSubstitute . |
void |
setCapacity(int capacity)
Set the maximum capacity of this factory. |
void |
setEvictionPolicy(Policy policy)
Set the eviction policy used by this factory. |
void |
unbind(CompoundStore store)
Unbinds a store instance from this factory |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CapacityLimitedInMemoryFactory(DiskOverflowStorageFactory secondary, int capacity, Policy policy, RegisteredEventListeners eventService)
secondary
- factory to evict throughcapacity
- maximum capacitypolicy
- policy to use on evictionMethod Detail |
---|
public void bind(CompoundStore store)
store
- store to bindpublic void unbind(CompoundStore store)
store
- store to unbindpublic Element create(Object key, Element element)
Element
In the case that this element is no longer mapped to a key - if for example the element is being decoded following a removal - then the supplied key will be null.
key
- key to which this element is mappedelement
- Element to encode
public Element retrieve(Object key, Element object)
Element
or ElementSubstitute
.
key
- key to which this element is mappedobject
- Element or ElementSubstitute to retrieve
public void free(Lock exclusion, Element object)
Element
or
ElementSubstitute
.
object
- Element or ElementSubstitute being free'd.public int getSize()
public long getSizeInBytes()
public Policy getEvictionPolicy()
public void setEvictionPolicy(Policy policy)
public void setCapacity(int capacity)
public boolean created(Object object)
true
if this factory created the given object.
object
- object to check
true
if object created by this factorypublic void expireElements()
|
ehcache | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |