com.oroad.stxx.cache
Interface Cache

All Known Implementing Classes:
SimpleCacheImpl

public interface Cache

This interface allows for multiple implementations of a cache presumably with different caching algrithms.

Author:
Don Brown

Method Summary
 void addCacheable(Cacheable cacheable)
          Adds an object to the cache
 void clear()
          Clears the cache of all cacheables
 void expire()
          Removes all the expired objects from the cache
 Cacheable getCacheable(java.lang.Object identifier)
          Gets a cached object
 java.lang.String getName()
          Gets the name of the cache
 int getSize()
          Gets the maximum number of objects it can cache
 void removeCacheable(java.lang.Object identifier)
          Removes a cached object
 void setName(java.lang.String name)
          Sets the name of the cache
 void setSize(int size)
          Sets the maximum number of objects it will cache
 

Method Detail

getName

public java.lang.String getName()
Gets the name of the cache

Returns:
The name value

setName

public void setName(java.lang.String name)
Sets the name of the cache

Parameters:
name - The name

getSize

public int getSize()
Gets the maximum number of objects it can cache

Returns:
The size value

setSize

public void setSize(int size)
Sets the maximum number of objects it will cache

Parameters:
size - The size of the cache

getCacheable

public Cacheable getCacheable(java.lang.Object identifier)
Gets a cached object

Parameters:
identifier - The key to find the object
Returns:
The cacheable value

removeCacheable

public void removeCacheable(java.lang.Object identifier)
Removes a cached object

Parameters:
identifier - The key of the object to remove

expire

public void expire()
Removes all the expired objects from the cache


addCacheable

public void addCacheable(Cacheable cacheable)
Adds an object to the cache

Parameters:
cacheable - The object to add

clear

public void clear()
Clears the cache of all cacheables