Package de.mid.innovator.net
Class InoTelegramCache<T extends InoTelegram>
java.lang.Object
de.mid.innovator.net.InoTelegramCache<T>
- Type Parameters:
T- telegram class
- Direct Known Subclasses:
SrvDataTelegramCache
A cache that manages entries based on the policy specified at creation time.
The initial size of the cache can be configured through the
"de.mid.innovator.api.cache.size" system property. The default size is 2048
entries.
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
InoTelegramCache
public InoTelegramCache()Creates a cache with specific policy
-
-
Method Details
-
put
Adds an entry to the cache. The entry is not updated. exists. -
get
Queries the cache for the specific host. If found, the CacheEntry is returned, otherwise null. -
disable
public void disable() -
setPolicy
Change the cache policy and use this policy for the future use of the cache. Hence the new policy is valid for old and new cache entry. Hence, e.g. setting the policy to DISABLE will clear the cache.- Parameters:
policy- New policy to use for cache.
-
getAccessCnt
public int getAccessCnt() -
getHitCnt
public int getHitCnt() -
resetStatistics
public void resetStatistics() -
clear
public void clear() -
toString
-
stats
-
size
public int size()
-