Package de.mid.innovator.net
Class InoTelegramCache<T extends InoTelegram>
- java.lang.Object
- 
- de.mid.innovator.net.InoTelegramCache<T>
 
- 
- Direct Known Subclasses:
- SrvDataTelegramCache
 
 public class InoTelegramCache<T extends InoTelegram> extends java.lang.ObjectA 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 SummaryNested Classes Modifier and Type Class Description static classInoTelegramCache.CachePolicy
 - 
Constructor SummaryConstructors Constructor Description InoTelegramCache()Creates a cache with specific policy
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()voiddisable()Tget(T key)Queries the cache for the specific host.intgetAccessCnt()intgetHitCnt()InoTelegramCache<T>put(T send, T rcv)Adds an entry to the cache.voidresetStatistics()voidsetPolicy(InoTelegramCache.CachePolicy policy)Change the cache policy and use this policy for the future use of the cache.intsize()java.lang.Stringstats()java.lang.StringtoString()
 
- 
- 
- 
Method Detail- 
putpublic InoTelegramCache<T> put(T send, T rcv) Adds an entry to the cache. The entry is not updated. exists.
 - 
getpublic T get(T key) Queries the cache for the specific host. If found, the CacheEntry is returned, otherwise null.
 - 
disablepublic void disable() 
 - 
setPolicypublic void setPolicy(InoTelegramCache.CachePolicy policy) 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.
 
 - 
getAccessCntpublic int getAccessCnt() 
 - 
getHitCntpublic int getHitCnt() 
 - 
resetStatisticspublic void resetStatistics() 
 - 
clearpublic void clear() 
 - 
toStringpublic java.lang.String toString() - Overrides:
- toStringin class- java.lang.Object
 
 - 
statspublic java.lang.String stats() 
 - 
sizepublic int size() 
 
- 
 
-