|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.clazzes.util.lifecycle.impl.AbstractObjectFactoryImpl<T>
org.clazzes.util.lifecycle.impl.AbstractCacheImpl<T>
public abstract class AbstractCacheImpl<T>
Abstract base class for Cache
interface.
Concrete implementations must merely implement AbstractObjectFactoryImpl.createNew(Object)
appropriately.
AbstractObjectFactoryImpl
Field Summary | |
---|---|
protected java.util.Hashtable<T,java.lang.ref.WeakReference<Cacheable<T>>> |
cache
|
Constructor Summary | |
---|---|
AbstractCacheImpl()
|
Method Summary | |
---|---|
void |
addShareable(Cacheable<T> object)
Adds a Cacheable object to the Cache . |
Cacheable<T> |
get(T key)
Deliver an object for the passed key. |
Methods inherited from class org.clazzes.util.lifecycle.impl.AbstractObjectFactoryImpl |
---|
createNew, internalCreateNew |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected transient java.util.Hashtable<T,java.lang.ref.WeakReference<Cacheable<T>>> cache
Constructor Detail |
---|
public AbstractCacheImpl()
Method Detail |
---|
public Cacheable<T> get(T key)
ObjectFactory
get
in interface ObjectFactory<T>
get
in class AbstractObjectFactoryImpl<T>
key
- The key used to identify the object.
public void addShareable(Cacheable<T> object)
Cache
Cacheable
object to the Cache
. References to this object can be retrieved with
ObjectFactory.get(Object)
. If an object with the same id is already present in the cache, the given instance will be
merged with the resident using the object's Cacheable.merge(Cacheable)
method.
addShareable
in interface Cache<T>
object
- the object to be added to the cache.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |