org.xmlecho.palomar.cache
Class Holder

java.lang.Object
  extended byorg.xmlecho.palomar.cache.Holder
Direct Known Subclasses:
ObjectHolder

public abstract class Holder
extends java.lang.Object

Abstract class for all ObjectHolders. Holders 1) participate in linked list, 2) provide access to a cached object, 3) provide access to the set of cache properties for the object, and 4) provide access to the key by which we store the object


Field Summary
protected  long _cachedAtTime
          represents the time at which the object is cached.
protected  java.lang.Object _cachedObject
          the original object that has to be cached.
protected  Cache _myCache
           
protected  Holder _next
           
protected  java.lang.String _objectKey
           
protected  Policy[] _objectPolicies
          The policies that are attached to the object held.
protected  Holder _prev
           
 
Constructor Summary
Holder()
           
 
Method Summary
abstract  void clean()
          remove the object from the IrisHolder, performing any necessary cleanup
 Cache getCache()
           
 long getCachedAtTime()
          Method for getting the time at which a particular Holder is instantiated
 Holder getNext()
          gets next in linked list of IrisHolders
 java.lang.Object getObject()
          Method for getting the original object.
 java.lang.String getObjectKey()
          getter for object key
 Policy[] getPolicies()
          Method for getting the policies attached to an Object
 Holder getPrev()
          gets previous in linked list of IrisHolders
 void setCache(Cache theCache)
          Inform the ObjectHolder which cache owns him
 void setCachedAtTime(long cachedTime)
          sets the time at which the underlying object is cached.
 void setNext(Holder next)
          sets next in linked list of IrisHolders
 java.lang.Object setObject(java.lang.Object subject)
          Method for setting the object to be cached.
 void setObjectKey(java.lang.String objectKey)
          setter for object key
 void setPolicies(Policy[] objectPolicies)
          Method for setting policies on an Object.
 void setPrev(Holder prev)
          sets previous in linked list of IrisHolders
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_cachedObject

protected java.lang.Object _cachedObject
the original object that has to be cached.


_prev

protected Holder _prev

_next

protected Holder _next

_myCache

protected Cache _myCache

_objectKey

protected java.lang.String _objectKey

_objectPolicies

protected Policy[] _objectPolicies
The policies that are attached to the object held.


_cachedAtTime

protected long _cachedAtTime
represents the time at which the object is cached.

Constructor Detail

Holder

public Holder()
Method Detail

setCache

public void setCache(Cache theCache)
Inform the ObjectHolder which cache owns him


getCache

public Cache getCache()
Returns:
the Cache to which we belong

getObject

public java.lang.Object getObject()
Method for getting the original object.

Returns:
Object the object that is cached.

setObject

public java.lang.Object setObject(java.lang.Object subject)
Method for setting the object to be cached.

Parameters:
subject - object to be cached
Returns:
the original object, or possibly something that will act just like it

setPolicies

public void setPolicies(Policy[] objectPolicies)
Method for setting policies on an Object.

Parameters:
objectPolicies - list of policies to be attached

getPolicies

public Policy[] getPolicies()
Method for getting the policies attached to an Object

Returns:
IrisPolicy the list of policies

getCachedAtTime

public long getCachedAtTime()
Method for getting the time at which a particular Holder is instantiated


setCachedAtTime

public void setCachedAtTime(long cachedTime)
sets the time at which the underlying object is cached.

Parameters:
cachedTime - time in milliseconds

setObjectKey

public void setObjectKey(java.lang.String objectKey)
setter for object key


clean

public abstract void clean()
remove the object from the IrisHolder, performing any necessary cleanup


setPrev

public void setPrev(Holder prev)
sets previous in linked list of IrisHolders


getPrev

public Holder getPrev()
gets previous in linked list of IrisHolders


setNext

public void setNext(Holder next)
sets next in linked list of IrisHolders


getNext

public Holder getNext()
gets next in linked list of IrisHolders


getObjectKey

public java.lang.String getObjectKey()
getter for object key