|
IMC Epclient 5.0.3 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectat.spardat.enterprise.cache.ICacheDescriptor
at.spardat.enterprise.cache.TransparentCacheDescriptor
Describes a transparent cache. That is a cache, which is able to load objects on its own. Actually this is done by calling the load-method in this descriptor, which must be overwritten by an application specific subclass.
In order to create a transparent cache, first create a subclass-instance of TransparentCacheDescripor and register this object with the CacheManager.
| Field Summary |
| Fields inherited from class at.spardat.enterprise.cache.ICacheDescriptor |
MILLIS_PER_HOUR, MILLIS_PER_MINUTE, MILLIS_PER_SECOND |
| Constructor Summary | |
TransparentCacheDescriptor(java.lang.String name,
int maxSize,
int maxAgeMillis)
Defines the properties of a transparent cache. |
|
| Method Summary | |
long |
getMaxAgeMillis()
Returns the maximum time in milliseconds a cache entry should be accessible in the chache. |
int |
getMaxAgeSpreadPct()
If the value provided by this method is not zero, the time a cache entry resides in the cache before it is beeing evicted is spread to a percentage around getMaxAgeMillis(). |
int |
getMaxSize()
Returns the maximum number of cached entries in the described cache. |
java.lang.String |
getName()
Returns the name of the described cache. |
boolean |
isTransparent()
Returns true if the described cache is a transparent cache, which can load objects by the load method of this descriptor |
abstract java.lang.Object |
load(java.lang.Object key)
This is the load method of a transparent cache. |
void |
setMaxAgeSpreadPct(int pct)
Sets the spread of cache entry duration. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public TransparentCacheDescriptor(java.lang.String name,
int maxSize,
int maxAgeMillis)
name - the name of the cachemaxSize - maximum number of entries in the cache. If less equal zero,
the cache has unlimited size.maxAgeMillis - the time in milliseconds denoting how long a entry may
reside in the cache before beeing evicted. If less equal zero,
there is no age limitation. If greater than zero, this value
must not be less than 1000.
java.lang.IllegalArgumentException - if maxAgeMillis greater than zero and less than 1000.| Method Detail |
public java.lang.String getName()
ICacheDescriptor
getName in class ICacheDescriptorICacheDescriptor.getName()public boolean isTransparent()
ICacheDescriptor
isTransparent in class ICacheDescriptorICacheDescriptor.isTransparent()public abstract java.lang.Object load(java.lang.Object key)
ICacheDescriptorThis method may be called in parallel from many threads. You must not access instance variables in this method.
load in class ICacheDescriptorkey - the key for which a value should be loaded.
ICacheDescriptor.load(Object)public long getMaxAgeMillis()
ICacheDescriptor
getMaxAgeMillis in class ICacheDescriptorICacheDescriptor.getMaxAgeMillis()public int getMaxSize()
ICacheDescriptor
getMaxSize in class ICacheDescriptorICacheDescriptor.getMaxSize()public int getMaxAgeSpreadPct()
ICacheDescriptorThe default implementation of this method is no spread at all.
getMaxAgeSpreadPct in class ICacheDescriptorICacheDescriptor.getMaxAgeSpreadPct()public void setMaxAgeSpreadPct(int pct)
ICacheDescriptor.getMaxAgeSpreadPct()
|
IMC Epclient 5.0.3 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||