|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
K
- the type of keys maintained by this cacheV
- the type of cached valuespublic interface CacheConfiguration<K,V>
Information on how a cache is configured.
A Cache may be constructed byCacheManager
using a configuration instance.
At runtime it is used by javax.cache to decide how to behave. For example the behaviour of put
will vary depending on whether the cache is write-through.
Finally, a cache makes it's configuration visible via this interface.
Only those configurations which can be changed at runtime (if supported by the underlying implementation)
have setters in this interface. Those that can only be set prior to cache construction have setters in
CacheBuilder
.
Nested Class Summary | |
---|---|
static class |
CacheConfiguration.Duration
A time duration. |
static class |
CacheConfiguration.ExpiryType
Type of Expiry |
Method Summary | |
---|---|
CacheLoader<K,? extends V> |
getCacheLoader()
Gets the registered CacheLoader , if any. |
CacheWriter<? super K,? super V> |
getCacheWriter()
Gets the registered CacheWriter , if any. |
CacheConfiguration.Duration |
getExpiry(CacheConfiguration.ExpiryType type)
Gets the cache's time to live setting,Sets how long cache entries should live. |
IsolationLevel |
getTransactionIsolationLevel()
Gets the transaction isolation level. |
Mode |
getTransactionMode()
Gets the transaction mode. |
boolean |
isReadThrough()
Whether the cache is a read-through cache. |
boolean |
isStatisticsEnabled()
Checks whether statistics collection is enabled in this cache. |
boolean |
isStoreByValue()
Whether storeByValue (true) or storeByReference (false). |
boolean |
isTransactionEnabled()
Checks whether transaction are enabled for this cache. |
boolean |
isWriteThrough()
Whether the cache is a write-through cache. |
void |
setStatisticsEnabled(boolean enableStatistics)
Sets whether statistics gathering is enabled on this cache. |
Method Detail |
---|
boolean isReadThrough()
Cache.get(Object)
and Cache#getAll(java.util.Set
.
Default value is false.
boolean isWriteThrough()
boolean isStoreByValue()
boolean isStatisticsEnabled()
void setStatisticsEnabled(boolean enableStatistics)
enableStatistics
- true to enable statistics, false to disable.boolean isTransactionEnabled()
IsolationLevel getTransactionIsolationLevel()
IsolationLevel.NONE
if this cache is not transactional.Mode getTransactionMode()
Mode.NONE
if this cache is not transactional.CacheLoader<K,? extends V> getCacheLoader()
CacheLoader
, if any.
CacheLoader
or null if none has been set.CacheWriter<? super K,? super V> getCacheWriter()
CacheWriter
, if any.
CacheWriter
or null if none has been set.CacheConfiguration.Duration getExpiry(CacheConfiguration.ExpiryType type)
CacheConfiguration.Duration.ETERNAL
.
type
- the type of the expiration
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |