public interface Cache
In UltraESB there are 6 main types of caches, they are namely;
CacheEntry
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clears out the cache completely, this will cause all the cache keys to be removed from the cache
|
CacheEntry |
delete(Object key)
Deletes the entry with the given key from the cache.
|
Object |
get(Object key)
Gets the value stored with the given key, the key itself has to be serializable if the cache
is distributed, so does the value returned
|
CacheEntry |
getEntry(Object key)
The entry representing the given key in the cache, the returned entry contains the value
associated with the key as well as the meta information about the entry
|
List<Object> |
getKeys()
Gives the unmodifiable list of keys registered in this cache
|
String |
getName()
Gets the name of this cache, it is not expected that the user changes this name, but the name
is exposed as an identifier of the cache.
|
CacheType |
getType()
Gets the type of the cache, it has to be one of the;
LOCAL_TEMP
LOCAL_PERMANENT
LOCAL_PERSISTENT
DISTRIBUTED_TEMP
DISTRIBUTED_PERMANENT
DISTRIBUTED_PERSISTENT
|
boolean |
isDistributed()
Whether this cache is of distributed cache type, if the cache type is one of the following it
is a distributed cache;
DISTRIBUTED_TEMP
DISTRIBUTED_PERMANENT
DISTRIBUTED_PERSISTENT
|
boolean |
isPermanent()
Whether the cache keeps its content permanently (i.e.
|
boolean |
isPersistent()
Whether the cache persists its contents to the disk.
|
void |
put(Object key,
Object value)
Puts an entry into the cache with the given key and value pair.
|
CacheType getType()
Object get(Object key)
key
- of which the cache entry value is requiredvoid put(Object key, Object value)
Serializable
. This method is used
to create a new entry as well as to update an existing entry.key
- the cache key to index the cache entryvalue
- the value associated with the above key in the cacheCacheEntry delete(Object key)
Serializable
even if the resource is persisted, this call will
permanently remove this entry.key
- entry key which needs to be removedCacheEntry getEntry(Object key)
key
- the key of which the entry is requiredList<Object> getKeys()
void clear()
String getName()
boolean isDistributed()
boolean isPermanent()
isPersistent()
should return true for this method too. In concrete terms all of the following types will
belong to the permanent category.;
boolean isPersistent()
Copyright © 2010–2016 AdroitLogic. All rights reserved.