| java.lang.Object org.riotfamily.cachius.Cache
Cache | final public class Cache implements Serializable(Code) | | The Cachius cache.
author: Felix Gnass |
Constructor Summary | |
public | Cache(File cacheDir, int capacity, boolean enabled) Create the cache. |
Method Summary | |
public boolean | containsKey(String key) Returns whether an item with the given key exists. | public CacheItem | getItem(String key) Returns the CacheItem with the given key or creates a new one, if no
entry with that key exists. | public void | invalidateTaggedItems(String tag) Invalidates all items tagged with the given String. | final protected void | setCacheDir(File cacheDir) Sets the directory where the cache items are stored. | final protected void | setCapacity(int capacity) Sets the cache capacity. | public void | setEnabled(boolean enabled) | public void | shutdown() | public void | tagItem(CacheItem item, Set newTags) Updates the tags of the given CacheItem. |
Cache | public Cache(File cacheDir, int capacity, boolean enabled)(Code) | | Create the cache.
|
containsKey | public boolean containsKey(String key)(Code) | | Returns whether an item with the given key exists.
|
getItem | public CacheItem getItem(String key)(Code) | | Returns the CacheItem with the given key or creates a new one, if no
entry with that key exists.
Parameters: key - The cache key The CacheItem for the given key |
invalidateTaggedItems | public void invalidateTaggedItems(String tag)(Code) | | Invalidates all items tagged with the given String.
|
setCacheDir | final protected void setCacheDir(File cacheDir)(Code) | | Sets the directory where the cache items are stored. If a different
directory is already set, the old directory is emptied.
The method is not thread-safe and therefore protected.
|
setCapacity | final protected void setCapacity(int capacity)(Code) | | Sets the cache capacity.
The method is not thread-safe and therefore protected.
|
setEnabled | public void setEnabled(boolean enabled)(Code) | | |
shutdown | public void shutdown()(Code) | | |
tagItem | public void tagItem(CacheItem item, Set newTags)(Code) | | Updates the tags of the given CacheItem.
|
|
|