|
ehcache | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
T
- type of the created and retrievable element substitutes.public interface ElementSubstituteFactory<T extends ElementSubstitute>
ElementSubstituteFactory is implemented by all true substituting factories.
A true substituting factory returns an ElementSubstitute instance instead of an Element on calls to encode. ElementSubstitute instances may simply be wrapping Elements with additional functionality (e.g. a soft/weak reference) or be indirectly referencing an Element (e.g. a pointer to a secondary storage location).
Method Summary | |
---|---|
void |
bind(CompoundStore store)
Bind a store instance to this factory. |
T |
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 |
free(Lock exclusion,
T object)
Free any manually managed resources used by this ElementSubstitute . |
Element |
retrieve(Object key,
T object)
Decodes the supplied ElementSubstitute . |
void |
unbind(CompoundStore store)
Unbinds a store instance from this factory |
Method Detail |
---|
T create(Object key, Element element) throws IllegalArgumentException
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
IllegalArgumentException
- if element cannot be substitutedElement retrieve(Object key, T object)
ElementSubstitute
.
object
- ElementSubstitute to decodekey
- key to which this element is mapped
void free(Lock exclusion, T object)
ElementSubstitute
.
object
- ElementSubstitute being free'd.void bind(CompoundStore store)
store
- store to bindvoid unbind(CompoundStore store)
store
- store to unbindboolean created(Object object)
true
if this factory created the given object.
object
- object to check
true
if object created by this factory
|
ehcache | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |