org.xmlecho.palomar.cache
Class DumbCache

java.lang.Object
  extended byorg.xmlecho.palomar.cache.AbstractCache
      extended byorg.xmlecho.palomar.cache.DumbCache
All Implemented Interfaces:
Cache, org.xmlecho.palomar.cron.Job, org.xmlecho.palomar.cron.Refreshable

public class DumbCache
extends AbstractCache

A simple cache -- Objects placed here survive for the life of the VM unless explicitly removed


Field Summary
 
Fields inherited from class org.xmlecho.palomar.cache.AbstractCache
_type, lastRefreshTime, refreshFrequency
 
Constructor Summary
DumbCache()
          instantiates a new cache
 
Method Summary
 void clear()
          remover all objects in the cache
 java.lang.Object get(java.lang.String objectKey)
          find a cached object
 java.util.Properties getProperties()
          Return the characteristics of a specific implementation of IrisCache
 java.lang.Runnable getRunnable()
           
 void invalidate(java.lang.String objectKey)
          recieve notification of update event
 boolean isTimeToRefresh()
          always returns false.
 void put(java.lang.String objectKey, java.lang.Object cacheObject)
          inserts or replaces an object in the cache
 java.lang.Object putMutable(java.lang.String objectKey, java.lang.Object mutableObject)
          Cache an object we're going to write some output to
 void refresh()
           
 void remove(java.lang.String objectKey)
          remove a single object from the cache
 void setProperties(java.lang.String type, java.util.Properties myProperties)
          DumbCache doesn't make any use of these properties
 boolean willWantRefresh()
          from Refreshable
 
Methods inherited from class org.xmlecho.palomar.cache.AbstractCache
getCacheDir, getCronExpr, getJobGroupName, getJobName, getKeys, getMaxCacheSize, getNextRefreshTime, getObjects, getRefreshFreq, getRefreshInterval, getType, isEmpty, runJob, setMaxCacheSize, setRefreshFreq, setRefreshTime, setType, shouldNotify, trimProperties
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DumbCache

public DumbCache()
instantiates a new cache

Method Detail

get

public java.lang.Object get(java.lang.String objectKey)
Description copied from interface: Cache
find a cached object

Parameters:
objectKey - the String key
Returns:
the object identified by objectKey or null

put

public void put(java.lang.String objectKey,
                java.lang.Object cacheObject)
inserts or replaces an object in the cache

Parameters:
objectKey - the identifier we'll use to find the object
cacheObject - the object we're want to store

putMutable

public java.lang.Object putMutable(java.lang.String objectKey,
                                   java.lang.Object mutableObject)
Cache an object we're going to write some output to

Returns:
an object for writing to

clear

public void clear()
remover all objects in the cache


invalidate

public void invalidate(java.lang.String objectKey)
recieve notification of update event


remove

public void remove(java.lang.String objectKey)
remove a single object from the cache

Parameters:
objectKey - the identifier we used when storing the object

setProperties

public void setProperties(java.lang.String type,
                          java.util.Properties myProperties)
DumbCache doesn't make any use of these properties

Parameters:
type - the specific type
myProperties - the characteristics of the specific type

getProperties

public java.util.Properties getProperties()
Description copied from interface: Cache
Return the characteristics of a specific implementation of IrisCache

Specified by:
getProperties in interface Cache
Overrides:
getProperties in class AbstractCache

willWantRefresh

public boolean willWantRefresh()
from Refreshable


refresh

public void refresh()
             throws java.lang.Exception
Throws:
java.lang.Exception

isTimeToRefresh

public boolean isTimeToRefresh()
always returns false. NOTE: will be implemented based on requirement.

Specified by:
isTimeToRefresh in interface org.xmlecho.palomar.cron.Refreshable
Overrides:
isTimeToRefresh in class AbstractCache
Returns:
boolean true, if it is time to refresh

getRunnable

public java.lang.Runnable getRunnable()