|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.dontdrinkandroot.cache.impl.memory.NoopCache<K,V>
public class NoopCache<K,V>
A serializable cache that does not actually perform any caching operation.
| Field Summary |
|---|
| Fields inherited from interface net.dontdrinkandroot.cache.Cache |
|---|
UNLIMITED_IDLE_TIME |
| Constructor Summary | |
|---|---|
NoopCache(String name)
|
|
| Method Summary | ||
|---|---|---|
void |
cleanUp()
Cleanup the cache. |
|
void |
delete(K key)
Manually remove an entry from the cache. |
|
|
get(K key)
Retrieve an entry from the cache if it is available. |
|
long |
getDefaultMaxIdleTime()
Get the default max idle time for cache entries. |
|
long |
getDefaultTtl()
Retrieve the default time to live for cache entries. |
|
MetaData |
getMetaData(K key)
Retrieve the MetaData of a cached entry if it is available. |
|
String |
getName()
Get the name of this cache. |
|
CacheStatistics |
getStatistics()
Get statistics of the cache like hitrate, or size. |
|
|
getWithErrors(K key)
Retrieve an entry from the cache if it is available. |
|
|
put(K key,
T data)
Store an entry in the cache with the default time to live. |
|
|
put(K key,
T data,
long timeToLive)
Store an entry in the cache with a specific time to live. |
|
|
put(K key,
T data,
long timeToLive,
long maxIdleTime)
Store an entry in the cache with a specific time to live and max idle time. |
|
|
putWithErrors(K key,
T data)
Store an entry in the cache with the default time to live. |
|
|
putWithErrors(K key,
T data,
long timeToLive)
Store an entry in the cache with a specific time to live. |
|
|
putWithErrors(K key,
T data,
long timeToLive,
long maxIdleTime)
Store an entry in the cache with a specific time to live and max idle time. |
|
void |
setDefaultTtl(long defaultTTL)
|
|
void |
setName(String name)
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public NoopCache(String name)
| Method Detail |
|---|
public <T extends V> T putWithErrors(K key,
T data)
throws CacheException
Cache
putWithErrors in interface Cache<K,V>key - A unique identifier.data - The data to store. Make sure that you don't alter the data after it has been put
to cache as (depending on the implementation) this might lead to altering the
entry in the cache. Use the returned data instead.
CacheException - Thrown on any errors encountered, supposed to include the stacktrace (if any).
public <T extends V> T getWithErrors(K key)
throws CacheException
Cache
getWithErrors in interface Cache<K,V>key - The unique key under which the entry was stored.
CacheException - Thrown on any errors encountered, supposed to include the stacktrace (if any).
public MetaData getMetaData(K key)
throws CacheException
CacheMetaData of a cached entry if it is available.
getMetaData in interface Cache<K,V>key - The key under which the entry was stored.
MetaData of the entry if found, null otherwise.
CacheException - Thrown on any errors encountered, supposed to include the stacktrace (if any).public void setDefaultTtl(long defaultTTL)
public long getDefaultTtl()
Cache
getDefaultTtl in interface Cache<K,V>
public void delete(K key)
throws CacheException
Cache
delete in interface Cache<K,V>key - The key under which the entry was stored.
CacheException - Thrown on any errors encountered, supposed to include the stacktrace (if any).public void cleanUp()
Cache
cleanUp in interface Cache<K,V>public void setName(String name)
public String getName()
Cache
getName in interface Cache<K,V>
public <T extends V> T putWithErrors(K key,
T data,
long timeToLive)
throws CacheException
CustomTtlCache
putWithErrors in interface CustomTtlCache<K,V>data - The data to store, make sure that you don't alter the data after it has been put
to cache as (depending on the implementation) this might lead to altering the
entry in the cache. Use the returned entry instead.timeToLive - The time (in milliseconds) after which the entry expires.
CacheException - Thrown if the storage fails.public CacheStatistics getStatistics()
Cache
getStatistics in interface Cache<K,V>public long getDefaultMaxIdleTime()
Cache
getDefaultMaxIdleTime in interface Cache<K,V>
public <T extends V> T putWithErrors(K key,
T data,
long timeToLive,
long maxIdleTime)
throws CacheException
CustomTtlCache
putWithErrors in interface CustomTtlCache<K,V>data - The data to store, make sure that you don't alter the data after it has been put
to cache as (depending on the implementation) this might lead to altering the
entry in the cache. Use the returned entry instead.timeToLive - The time (in milliseconds) after which the entry expires.maxIdleTime - The time (in milliseconds) that an entry may idle (not being accessed) before
being expunged.
CacheException - Thrown if the storage fails.
public <T extends V> T put(K key,
T data)
CacheCache.putWithErrors(Object, Object) if you want to handle them.
put in interface Cache<K,V>key - A unique identifier.data - The data to store. Make sure that you don't alter the data after it has been put
to cache as (depending on the implementation) this might lead to altering the
entry in the cache. Use the returned data instead.
public <T extends V> T get(K key)
CacheCache.getWithErrors(Object) if you want to handle them.
get in interface Cache<K,V>key - The unique key under which the entry was stored.
public <T extends V> T put(K key,
T data,
long timeToLive)
CustomTtlCacheCustomTtlCache.put(Object, Object, long) if you want to handle them.
put in interface CustomTtlCache<K,V>data - The data to store, make sure that you don't alter the data after it has been put
to cache as (depending on the implementation) this might lead to altering the
entry in the cache. Use the returned entry instead.timeToLive - The time (in milliseconds) after which the entry expires.
public <T extends V> T put(K key,
T data,
long timeToLive,
long maxIdleTime)
CustomTtlCacheCustomTtlCache.putWithErrors(Object, Object, long) if you want to
handle them.
put in interface CustomTtlCache<K,V>data - The data to store, make sure that you don't alter the data after it has been put
to cache as (depending on the implementation) this might lead to altering the
entry in the cache. Use the returned entry instead.timeToLive - The time (in milliseconds) after which the entry expires.maxIdleTime - The time (in milliseconds) that an entry may idle (not being accessed) before
being expunged.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||