|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface SharedCache
Extends Cache to support double hashing by adding a set of access methods with an additional domain key. The domain key is automatically mapped to a domain specific cache. If the domain is not given, the default domain cache is used.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface java.util.Map |
|---|
Map.Entry<K,V> |
| Method Summary | |
|---|---|
void |
clear(String domain)
Clears the specified domain map. |
void |
clearDomains()
Clears all domain caches. |
boolean |
containsDomain(String domain)
Checks whether a domain has a cache. |
boolean |
containsKey(String domain,
Object key)
Checks a key from the specified domain map. |
boolean |
containsValue(String domain,
Object obj)
Checks a value from the specified domain map. |
Set |
domainSet()
Returns a set of defined domains. |
Set |
entrySet(String domain)
Gets an entry set from the specified domain map. |
Object |
expire(String domain,
Object key)
Expires and removes a value from the specified domain map. |
void |
expireAll(String domain)
Expires all values from the specified domain map. |
void |
expireAllDomains()
Expires all values from all domain caches. |
void |
expireFraction(String domain,
float fraction)
Expires a fraction of entries. |
Object |
get(String domain,
Object key)
Gets a value from the specified domain map. |
Object |
get(String domain,
Object key,
int freq)
Gets a value from the the specified domain map and refreshes it with a specified expiration frequency. |
int |
getDefaultExpirationTime(String domain)
Gets the default expiration time of the domain in seconds. |
CachedMap |
getDomainCache(String domain)
Gets the cache of the specified domain. |
CachedMap |
getDomainCache(String domain,
boolean create)
Gets and optionally creates the cache of the specified domain. |
int |
getExpirationLimit(String domain)
Gets the expiration limit in the domain. |
int |
getExpirationSleepInterval(String domain)
Gets the expiration sleep interval of the domain in seconds. |
float |
getExpirationThreshold(String domain)
Gets the expiration threshold in the domain. |
int |
getMaxExpirationTime(String domain)
Gets the maximum expiration time of the domain in seconds. |
boolean |
isAllowExpired(String domain)
Gets the allow expired option of the domain. |
boolean |
isDiscardOverloaded(String domain)
Gets the discard overloaded option of the domain. |
boolean |
isEmpty(String domain)
Checks if the specified domain map is empty. |
Set |
keySet(String domain)
Gets a key set from the specified domain map. |
Object |
put(String domain,
Object key,
Object obj)
Puts a value to the specified domain map. |
Object |
put(String domain,
Object key,
Object obj,
int freq)
Puts a value to the specified domain map with a value specific expiration frequency. |
void |
putAll(String domain,
Map map)
Puts a map to the specified domain map. |
boolean |
refresh(String domain,
Object key)
Refreshes a value in the specified domain map. |
boolean |
refresh(String domain,
Object key,
int freq)
Refreshes a value in the specified domain map with a new frequency. |
Object |
remove(String domain,
Object key)
Removes a value from the specified domain map. |
void |
removeDomain(String domain)
Removes the specified domain. |
void |
setAllowExpired(String domain,
boolean flag)
Sets the allow expired option of the domain allowing gets of entries already expired but not yet removed by the expiration handler. |
void |
setDefaultExpirationTime(String domain,
int t)
Sets the default expiration time of the domain in seconds. |
void |
setDiscardOverloaded(String domain,
boolean flag)
Sets the discard overloaded option of the domain. |
void |
setExpirationLimit(String domain,
int c)
Sets the expiration limit in the domain. |
void |
setExpirationSleepInterval(String domain,
int t)
Sets the expiration sleep interval of the domain in seconds. |
void |
setExpirationThreshold(String domain,
float h)
Gets the expiration threshold in the domain. |
void |
setMaxExpirationTime(String domain,
int t)
Sets the maximum expiration time of the domain in seconds. |
int |
size(String domain)
Gets the size of the specified domain map. |
Collection |
values(String domain)
Gets a collection of values from the specified domain map. |
| Methods inherited from interface org.norther.tammi.acorn.cache.CachedMap |
|---|
add, add, expire, expireAll, expireFraction, get, getDefaultExpirationTime, getExpirationLimit, getExpirationSleepInterval, getExpirationThreshold, getMaxExpirationTime, isAllowExpired, isAutoRefreshDeclined, isDiscardOverloaded, put, putIfAbsent, refresh, refresh, setAllowExpired, setAutoRefreshDeclined, setDefaultExpirationTime, setDiscardOverloaded, setExpirationLimit, setExpirationSleepInterval, setExpirationThreshold, setMaxExpirationTime |
| Methods inherited from interface java.util.concurrent.ConcurrentMap |
|---|
putIfAbsent, remove, replace, replace |
| Methods inherited from interface java.util.Map |
|---|
clear, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, size, values |
| Method Detail |
|---|
boolean isAllowExpired(String domain)
domain - the domain.
void setAllowExpired(String domain,
boolean flag)
domain - the domain.flag - the allow expired option.boolean isDiscardOverloaded(String domain)
domain - the domain.
void setDiscardOverloaded(String domain,
boolean flag)
domain - the domain.flag - true if new puts are discarded if overloaded, false
otherwise.int getMaxExpirationTime(String domain)
domain - the domain.
void setMaxExpirationTime(String domain,
int t)
domain - the domain.t - the secs.int getDefaultExpirationTime(String domain)
domain - the domain.
void setDefaultExpirationTime(String domain,
int t)
domain - the domain.t - the secs.int getExpirationSleepInterval(String domain)
domain - the domain.
void setExpirationSleepInterval(String domain,
int t)
domain - the domain.t - the secsint getExpirationLimit(String domain)
domain - the domain.
void setExpirationLimit(String domain,
int c)
domain - the domain.c - the limit.float getExpirationThreshold(String domain)
domain - the domain.
void setExpirationThreshold(String domain,
float h)
domain - the domain.h - the threshold.void clear(String domain)
domain - the domain.
boolean containsValue(String domain,
Object obj)
domain - the domain.obj - the value to check.
boolean containsKey(String domain,
Object key)
domain - the domain.key - the key to check.
Set entrySet(String domain)
domain - the domain.
Set keySet(String domain)
domain - the domain.
Collection values(String domain)
domain - the domain.
Object get(String domain,
Object key)
domain - the domain.key - the key.
Object put(String domain,
Object key,
Object obj)
domain - the domain.key - the key.obj - the value.
void putAll(String domain,
Map map)
domain - the domain.map - the map.
Object remove(String domain,
Object key)
domain - the domain.key - the key.
int size(String domain)
domain - the domain.
boolean isEmpty(String domain)
domain - the domain.
Object get(String domain,
Object key,
int freq)
domain - the domain.key - the key.freq - the expiration frequency.
Object put(String domain,
Object key,
Object obj,
int freq)
domain - the domain.key - the key.obj - the value.freq - the expiration frequency.
boolean refresh(String domain,
Object key)
domain - the domain.key - the key.
boolean refresh(String domain,
Object key,
int freq)
domain - the domain.key - the key.freq - the expiration frequency.
Object expire(String domain,
Object key)
domain - the domain.key - the key.
void expireAll(String domain)
domain - the domain.
void expireFraction(String domain,
float fraction)
domain - the domain.fraction - the fraction to expire (0.0..1.0).
IllegalArgumentException - for an invalid fragment.CachedMap getDomainCache(String domain)
domain - the domain.
CachedMap getDomainCache(String domain,
boolean create)
domain - the domain.create - true to create a missing cache.
boolean containsDomain(String domain)
domain - the domain.
void removeDomain(String domain)
domain - the domain.Set domainSet()
void clearDomains()
void expireAllDomains()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||