ehcache

net.sf.ehcache.store.compound
Interface IdentityElementSubstituteFactory

All Known Implementing Classes:
CapacityLimitedInMemoryFactory, InMemoryFactory

public interface IdentityElementSubstituteFactory

IdentityElementProxyFactory is implemented by all non-proxying factories.

Non-proxying factories are used to implement direct in-heap storage of Elements. Their encode methods will typically (but not necessarily) return the same element as was passed to them. They may however choose to perform eviction operations either synchronously within their methods, or trigger asynchronous evictions from them.

Author:
Chris Dennis

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 Element or ElementSubstitute.
 Element retrieve(Object key, T object)
          Retrieves the supplied Element or ElementSubstitute.
 void unbind(CompoundStore store)
          Unbinds a store instance from this factory
 

Method Detail

bind

void bind(CompoundStore store)
Bind a store instance to this factory.

Parameters:
store - store to bind

unbind

void unbind(CompoundStore store)
Unbinds a store instance from this factory

Parameters:
store - store to unbind

create

T create(Object key,
         Element element)
Creates a substitute for the supplied 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.

Parameters:
key - key to which this element is mapped
element - Element to encode
Returns:
The potentially substitute Element

retrieve

Element retrieve(Object key,
                 T object)
Retrieves the supplied Element or ElementSubstitute.

Parameters:
key - key to which this element is mapped
object - Element or ElementSubstitute to retrieve
Returns:
a decoded Element

free

void free(Lock exclusion,
          T object)
Free any manually managed resources used by this Element or ElementSubstitute.

Parameters:
object - Element or ElementSubstitute being free'd.

created

boolean created(Object object)
Returns true if this factory created the given object.

Parameters:
object - object to check
Returns:
true if object created by this factory

ehcache

true