net.sf.ashkay
Class CacheEntry

java.lang.Object
  extended bynet.sf.ashkay.CacheEntry
Direct Known Subclasses:
SoftReferenceCacheEntry

public class CacheEntry
extends java.lang.Object

CacheEntry represents a single entry in the object cache. A cache entry contains the cached object and properties associated with the entry. These properties may be used by the CachingStrategy to detirmine if an entry passes validation.

Author:
Dave Brown

Constructor Summary
protected CacheEntry()
          Empty constructor for subclasses only
  CacheEntry(java.lang.Object entryKey, java.lang.Object entryObject)
          Creates a default CacheEntry
  CacheEntry(java.lang.Object entryKey, java.lang.Object entryObject, java.util.Map entryProperties)
          Creates a CacheEntry with properties pre-specified
  CacheEntry(java.lang.Object entryKey, java.lang.Object entryObject, java.util.Map entryProperties, ObjectCache theCache)
           
 
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.
 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

CacheEntry

protected CacheEntry()
Empty constructor for subclasses only


CacheEntry

public CacheEntry(java.lang.Object entryKey,
                  java.lang.Object entryObject)
Creates a default CacheEntry

Parameters:
entryObject - - the object this entry represents

CacheEntry

public CacheEntry(java.lang.Object entryKey,
                  java.lang.Object entryObject,
                  java.util.Map entryProperties)
Creates a CacheEntry with properties pre-specified

Parameters:
entryObject - - the object this entry represents
entryProperties - - the properties of this entry

CacheEntry

public CacheEntry(java.lang.Object entryKey,
                  java.lang.Object entryObject,
                  java.util.Map entryProperties,
                  ObjectCache theCache)
Method Detail

getEntryKey

public java.lang.Object getEntryKey()

setEntryKey

public void setEntryKey(java.lang.Object key)

getEntryObject

public java.lang.Object getEntryObject()
Returns the object this entry represents.

Returns:
the entries object

setEntryObject

public void setEntryObject(java.lang.Object entryObject)
Sets the object this entry represents

Parameters:
entryObject - - the new object to represent

addProperty

public void addProperty(java.lang.Object key,
                        java.lang.Object value)
Adds a property to this entry.

Parameters:
key - - the key to this property
value - - the value to hold in the property

getProperty

public java.lang.Object getProperty(java.lang.Object key)
Looks up a property of this entry

Parameters:
key - - the key of the property to lookup
Returns:
the value of the property or null if not set

addProperties

public void addProperties(java.util.Map propertiesToAdd)
Adds a group of properties to this entry, en masse

Parameters:
propertiesToAdd - - map of properties to add

getProperties

public java.util.Map getProperties()
Returns the entire Map of this entry's properties

Returns:
the properties

getCache

public ObjectCache getCache()

setCache

public void setCache(ObjectCache myCache)


Copyright © 2004 . All Rights Reserved.