org.xmlecho.palomar.cache
Interface Cache

All Superinterfaces:
org.xmlecho.palomar.cron.Job, org.xmlecho.palomar.cron.Refreshable
All Known Implementing Classes:
AbstractCache

public interface Cache
extends org.xmlecho.palomar.cron.Refreshable

Interface class for Cache implementations.


Method Summary
 void clear()
          removes all objects from the cache
 java.lang.Object get(java.lang.String objectKey)
          find a cached object
 java.lang.String getCacheDir()
          returns the cache specific directory should be overridden by the specific cache implementation
 int getMaxCacheSize()
          returns the maximum holding capacity of this cache instance
 java.util.Properties getProperties()
          Return the characteristics of a specific implementation of IrisCache
 java.lang.String getType()
          returns the identifier for this cache
 void invalidate(java.lang.String key)
          recieve notification from an outside party (another server) that the object with the given key has been updated
 void put(java.lang.String objectKey, java.lang.Object cacheObject)
          store or replace an object in the cache
 java.lang.Object putMutable(java.lang.String objectKey, java.lang.Object mutableObject)
          Cache an object which we're going to write some output to
 void remove(java.lang.String objectKey)
          remove an object from the cache.
 void setMaxCacheSize(int maxCacheSize)
          setter for maximum capacity this cache can hold
 void setProperties(java.lang.String type, java.util.Properties cacheProperties)
          Set properties so that a specific cache can build its characteristics on its own.
 void setRefreshFreq(long refreshFrequency)
          The default refresh period
 
Methods inherited from interface org.xmlecho.palomar.cron.Refreshable
getNextRefreshTime, getRefreshInterval, getRunnable, isTimeToRefresh, refresh, willWantRefresh
 
Methods inherited from interface org.xmlecho.palomar.cron.Job
getCronExpr, getJobGroupName, getJobName, runJob
 

Method Detail

get

public java.lang.Object get(java.lang.String objectKey)
find a cached object

Parameters:
objectKey - the identifier used for lookup
Returns:
the cached Object, or null if not found

put

public void put(java.lang.String objectKey,
                java.lang.Object cacheObject)
         throws java.lang.Exception
store or replace an object in the cache

Parameters:
cacheObject - the object we want to cache
objectKey - the identifier we may use for lookup, later
Throws:
java.lang.Exception

putMutable

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

Throws:
java.lang.Exception

remove

public void remove(java.lang.String objectKey)
            throws java.lang.Exception
remove an object from the cache. Does nothing if the object isn't found

Parameters:
objectKey - the identifier we used when storing the object
Throws:
java.lang.Exception

invalidate

public void invalidate(java.lang.String key)
recieve notification from an outside party (another server) that the object with the given key has been updated


clear

public void clear()
removes all objects from the cache


setProperties

public void setProperties(java.lang.String type,
                          java.util.Properties cacheProperties)
Set properties so that a specific cache can build its characteristics on its own.

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

getProperties

public java.util.Properties getProperties()
Return the characteristics of a specific implementation of IrisCache

Returns:
Properties

setRefreshFreq

public void setRefreshFreq(long refreshFrequency)
The default refresh period


getType

public java.lang.String getType()
returns the identifier for this cache


getCacheDir

public java.lang.String getCacheDir()
returns the cache specific directory should be overridden by the specific cache implementation


setMaxCacheSize

public void setMaxCacheSize(int maxCacheSize)
setter for maximum capacity this cache can hold


getMaxCacheSize

public int getMaxCacheSize()
returns the maximum holding capacity of this cache instance