|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface CacheConfiguration
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 | |
---|---|
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 |
setExpiry(CacheConfiguration.ExpiryType type,
CacheConfiguration.Duration duration)
Sets how long cache entries should live. |
void |
setReadThrough(boolean readThrough)
Sets whether the cache is a read-through cache. |
void |
setStatisticsEnabled(boolean enableStatistics)
Sets whether statistics gathering is enabled on this cache. |
void |
setWriteThrough(boolean writeThrough)
Whether the cache is a write-through cache. |
Method Detail |
---|
boolean isReadThrough()
void setReadThrough(boolean readThrough)
readThrough
- the value for readThrough
IllegalStateException
- if the configuration can no longer be changedboolean isWriteThrough()
void setWriteThrough(boolean writeThrough)
writeThrough
- set to true for a write-through cacheboolean isStoreByValue()
boolean isStatisticsEnabled()
void setStatisticsEnabled(boolean enableStatistics)
enableStatistics
- true to enable statistics, false to disableboolean isTransactionEnabled()
IsolationLevel getTransactionIsolationLevel()
Mode getTransactionMode()
void setExpiry(CacheConfiguration.ExpiryType type, CacheConfiguration.Duration duration)
Cache.containsKey(Object)
will return false
type
- the type of the expiryduration
- how long, in the specified duration, the cache entries should live.
NullPointerException
- is type or duration is nullCacheConfiguration.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 |