|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.ashkay.CacheEntry net.sf.ashkay.strategies.SoftReferenceCacheEntry
SoftReferenceCacheEntry represents a cache entry that is wrapped in which
the entry object is wrapped in a SoftReference in order to allow the
garbage collector to still collect the object if all other hard references
are destroyed.
Often, this strategy will be used in memory sensative caches.
SoftReference
Constructor Summary | |
SoftReferenceCacheEntry(CacheEntry originalEntry,
java.lang.ref.ReferenceQueue queue)
|
Method Summary | |
void |
addProperties(java.util.Map propertiesToAdd)
Adds a group of properties to this entry, en masse |
void |
addProperty(java.lang.Object key,
java.lang.Object value)
Adds a property to this entry. |
ObjectCache |
getCache()
|
java.lang.Object |
getEntryKey()
|
java.lang.Object |
getEntryObject()
Returns the object this entry represents. |
(package private) java.lang.ref.SoftReference |
getEntryReference()
|
java.util.Map |
getProperties()
Returns the entire Map of this entry's properties |
java.lang.Object |
getProperty(java.lang.Object key)
Looks up a property of this entry |
void |
setCache(ObjectCache myCache)
|
void |
setEntryKey(java.lang.Object key)
|
void |
setEntryObject(java.lang.Object entryObject)
Sets the object this entry represents |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SoftReferenceCacheEntry(CacheEntry originalEntry, java.lang.ref.ReferenceQueue queue)
Method Detail |
java.lang.ref.SoftReference getEntryReference()
public java.lang.Object getEntryObject()
CacheEntry
getEntryObject
in class CacheEntry
public void addProperties(java.util.Map propertiesToAdd)
CacheEntry
addProperties
in class CacheEntry
propertiesToAdd
- - map of properties to addpublic void addProperty(java.lang.Object key, java.lang.Object value)
CacheEntry
addProperty
in class CacheEntry
key
- - the key to this propertyvalue
- - the value to hold in the propertypublic java.lang.Object getProperty(java.lang.Object key)
CacheEntry
getProperty
in class CacheEntry
key
- - the key of the property to lookup
public void setEntryObject(java.lang.Object entryObject)
CacheEntry
setEntryObject
in class CacheEntry
entryObject
- - the new object to representpublic java.lang.Object getEntryKey()
getEntryKey
in class CacheEntry
public void setEntryKey(java.lang.Object key)
setEntryKey
in class CacheEntry
public java.util.Map getProperties()
CacheEntry
getProperties
in class CacheEntry
public ObjectCache getCache()
getCache
in class CacheEntry
public void setCache(ObjectCache myCache)
setCache
in class CacheEntry
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |