public interface ICache extends IComponent
Public interface to the cache.
Cache entries can be any java object.
Cache entries are identified by a cache entry primary key, which can be any java object that properly implements the equals() and hashcode() methods.
Copyright: Copyright (c) 2001 Company:Modifier and Type | Field and Description |
---|---|
static String |
ID |
static String |
ISCLUSTERED |
static String |
MAX_SIZE |
Modifier and Type | Method and Description |
---|---|
ICacheKey |
createKey()
Creates an empty key.
|
ICacheKey |
createKey(int primaryKey)
Specify the primary key directly.
|
ICacheKey |
createKey(int keyA,
int keyB,
String keyName,
int secondKey)
creates a standary key from the 4 sub keys.
|
void |
flush(ICacheKey key)
Remove entries that match primary key.
|
void |
flushAll(boolean flushRemote)
flushes all entries from the cache
|
void |
flushAll(String[] valueClassNames,
boolean flushRemote)
Flushes only entries which store values of specified classes
|
ICacheManager |
getCacheManager()
gets the manager for this cache
|
ICacheEntry |
getEntry(ICacheKey key)
Gets the entry from the cache.
|
int |
getMaxSize()
maximum number of items in the cache
|
long |
getModified(ICacheKey key)
this enables the CacheInvalThread to check for invalidated cache entries
without loading the whole entry
The modified date should come from the transient cache impl
|
String |
getName()
name of cache
|
String |
getReport(int detailLevel,
boolean sendtoLog)
Generates a text report on the status of the cache.
|
int |
getSize()
Number of items in cache
|
Object |
getValue(ICacheKey key)
Gets just the value from the entry.
|
boolean |
isClustered()
true iff you want events sent/received to all machines in the cluster
should be part of the basic cache metadata
|
void |
put(ICacheKey key,
long maxAge,
Object data)
Put an entry into the cache.
|
void |
refresh(ICacheKey key,
boolean refreshLocal)
refreshes all cache entries..intended for in-memory caches.
|
void |
update(ICacheKey key)
Inform the cache that the object specified by key
has changed.
|
getComponentData, getComponentName, getComponentProvider, getURI, isInitialized, setComponentData, setComponentProvider
init, shutdown
static final String ISCLUSTERED
static final String MAX_SIZE
static final String ID
void put(ICacheKey key, long maxAge, Object data)
key
- cache keymaxAge
- maximum age of entry, 0 means no maximum agedata
- the data to cacheICacheEntry getEntry(ICacheKey key)
key
- cache keyObject getValue(ICacheKey key)
key
- cache keylong getModified(ICacheKey key)
key
- cache keyvoid flush(ICacheKey key)
key
- cache keyvoid refresh(ICacheKey key, boolean refreshLocal)
key
- primary of the entryrefreshLocal
- true if you want to refresh local cachevoid update(ICacheKey key)
key
- primary of the entryboolean isClustered()
String getName()
int getSize()
int getMaxSize()
String getReport(int detailLevel, boolean sendtoLog)
detailLevel
- optional number defined by implementationsendtoLog
- if true, send result to the logICacheKey createKey(int keyA, int keyB, String keyName, int secondKey)
keyA
- Key AkeyB
- Key BkeyName
- Key NamesecondKey
- Secondary KeyICacheKey createKey(int primaryKey)
primaryKey
- Primary KeyICacheKey createKey()
void flushAll(boolean flushRemote) throws CacheException
CacheException
void flushAll(String[] valueClassNames, boolean flushRemote) throws CacheException
valueClassNames
- flushRemote
- CacheException
ICacheManager getCacheManager()