|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface ResourceCache
Extends Cache by adding methods supporting caching of resources.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface java.util.Map |
|---|
Map.Entry<K,V> |
| Method Summary | |
|---|---|
long |
getCheckInterval()
Gets the interval of checking validity of cached resources. |
Resource |
getResource(String key)
Gets the cached resource. |
String |
getResourceClassName()
Gets the name of the cached resource class to apply inside this cache. |
int |
getSizeLimit()
Gets the size limit for resources to be kept in the cache. |
Resource |
putResource(String key,
Object obj)
Puts the specified object as a resource into the cache. |
Resource |
putResource(String key,
Object obj,
int freq)
Puts the specified object with an expiration frequency as a resource into the cache. |
Resource |
removeResource(String key)
Removes the cached resource. |
void |
setCheckInterval(long msecs)
Gets the interval of checking validity of cached resources. |
void |
setResource(String key,
Resource res)
Sets the cached resource. |
void |
setResource(String key,
Resource res,
int freq)
Sets the cached resource with an expiration frequency. |
void |
setResourceClassName(String className)
Sets the name of the cached resource class to apply inside this cache. |
void |
setSizeLimit(int limit)
Sets a size limit for resources to be kept in the cache. |
| 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 |
|---|
long getCheckInterval()
void setCheckInterval(long msecs)
msecs - the check interval in milliseconds (-1 = only once).int getSizeLimit()
void setSizeLimit(int limit)
limit - a limit for a resource size in bytes (-1 = unlimited).String getResourceClassName()
void setResourceClassName(String className)
className - the class name of the cached resource.Resource getResource(String key)
key - the key of the cached resource.
void setResource(String key,
Resource res)
Note that the size limit is not applied.
key - the key of the cached resource.res - the cached resource.
void setResource(String key,
Resource res,
int freq)
Note that the size limit is not applied.
key - the key of the cached resource.res - the cached resource.freq - the expiration frequency.
Resource putResource(String key,
Object obj)
throws ConstructionException
key - the key of the cached object.obj - the object to cache.
ConstructionException - if construction fails.
Resource putResource(String key,
Object obj,
int freq)
throws ConstructionException
key - the key of the cached object.obj - the object to cache.freq - the expiration frequency.
ConstructionException - if construction fails.Resource removeResource(String key)
key - the key of the cached resource.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||