Interface ICache
- All Superinterfaces:
IComponent
,IInitializable
- All Known Subinterfaces:
IAliasCache
,IClassCache
,IDBCache
,IDependentCache
,IThingCache
,ITimedCache
Title:
Description:
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:-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionCreates an empty key.createKey
(int primaryKey) Specify the primary key directly.creates a standary key from the 4 sub keys.void
Remove entries that match primary key.void
flushAll
(boolean flushRemote) flushes all entries from the cachevoid
Flushes only entries which store values of specified classesgets the manager for this cacheGets the entry from the cache.int
maximum number of items in the cachelong
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 implgetName()
name of cachegetReport
(int detailLevel, boolean sendtoLog) Generates a text report on the status of the cache.int
getSize()
Number of items in cacheGets just the value from the entry.boolean
true iff you want events sent/received to all machines in the cluster should be part of the basic cache metadatavoid
Put an entry into the cache.void
refreshes all cache entries..intended for in-memory caches.void
Inform the cache that the object specified by key has changed.Methods inherited from interface com.webmethods.portal.system.IComponent
getComponentData, getComponentName, getComponentProvider, getURI, isInitialized, setComponentData, setComponentProvider
Methods inherited from interface com.webmethods.portal.system.init.IInitializable
init, shutdown
-
Field Details
-
ISCLUSTERED
- See Also:
-
MAX_SIZE
- See Also:
-
ID
- See Also:
-
-
Method Details
-
put
Put an entry into the cache. If the entry doesn't exist this will create one.- Parameters:
key
- cache keymaxAge
- maximum age of entry, 0 means no maximum agedata
- the data to cache
-
getEntry
Gets the entry from the cache. Note that this entry is writable and changes may persist locally. However any changes will probably not affect any other boxes in the cluster. It's not recommended to write to the entry.- Parameters:
key
- cache key- Returns:
- the entry, null if the entry doesn't exist, is invalid, or has expired
-
getValue
Gets just the value from the entry.- Parameters:
key
- cache key- Returns:
- Object in cache or null if not cached, invalid or expired
-
getModified
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- Parameters:
key
- cache key- Returns:
- modified date or 0 if not found
-
flush
Remove entries that match primary key.- Parameters:
key
- cache key
-
refresh
refreshes all cache entries..intended for in-memory caches.- Parameters:
key
- primary of the entryrefreshLocal
- true if you want to refresh local cache
-
update
Inform the cache that the object specified by key has changed.- Parameters:
key
- primary of the entry
-
isClustered
boolean isClustered()true iff you want events sent/received to all machines in the cluster should be part of the basic cache metadata- Returns:
-
getName
String getName()name of cache -
getSize
int getSize()Number of items in cache -
getMaxSize
int getMaxSize()maximum number of items in the cache -
getReport
Generates a text report on the status of the cache. Contents of the report are dependent on implementation.- Parameters:
detailLevel
- optional number defined by implementationsendtoLog
- if true, send result to the log
-
createKey
creates a standary key from the 4 sub keys. The primary key is generated by creating a hashcode of A,B, and Name. The secondary key is used to support entries with the same primary key but with different objects that need to be cached (pages etc)- Parameters:
keyA
- Key AkeyB
- Key BkeyName
- Key NamesecondKey
- Secondary Key- Returns:
- cache key
-
createKey
Specify the primary key directly. Should be similar to a hashcode.- Parameters:
primaryKey
- Primary Key
-
createKey
ICacheKey createKey()Creates an empty key. Call the set methods to initialize it. -
flushAll
flushes all entries from the cache- Throws:
CacheException
-
flushAll
Flushes only entries which store values of specified classes- Parameters:
valueClassNames
-flushRemote
-- Throws:
CacheException
-
getCacheManager
ICacheManager getCacheManager()gets the manager for this cache- Returns:
-