|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
K - the type of keys maintained the cacheV - the type of cached valuespublic interface Configuration<K,V>
The basic representation of a configuration for a Cache.
CacheManagers to configure Caches.
Implementations of this interface must always override #hashCode() and
#equals(Object) as Configurations are often compared
at runtime.
| Nested Class Summary | |
|---|---|
static class |
Configuration.Duration
A time duration. |
| Method Summary | |
|---|---|
Iterable<CacheEntryListenerRegistration<? super K,? super V>> |
getCacheEntryListenerRegistrations()
Obtains the CacheEntryListenerRegistrations for CacheEntryListeners
to be configured on a Cache. |
CacheLoader<K,? extends V> |
getCacheLoader()
Gets the registered CacheLoader, if any. |
CacheWriter<? super K,? super V> |
getCacheWriter()
Gets the registered CacheWriter, if any. |
ExpiryPolicy<? super K,? super V> |
getExpiryPolicy()
Gets the ExpiryPolicy to be used for caches. |
IsolationLevel |
getTransactionIsolationLevel()
Gets the transaction isolation level. |
Mode |
getTransactionMode()
Gets the transaction mode. |
boolean |
isReadThrough()
Determines if a Cache should operate in "read-through" mode. |
boolean |
isStatisticsEnabled()
Checks whether statistics collection is enabled in this cache. |
boolean |
isStoreByValue()
Whether storeByValue (true) or storeByReference (false). |
boolean |
isTransactionsEnabled()
Checks whether transactions are enabled for this cache. |
boolean |
isWriteThrough()
Determines if a Cache should operate in "write-through" mode. |
void |
setStatisticsEnabled(boolean enableStatistics)
Sets whether statistics gathering is enabled on this cache. |
| Method Detail |
|---|
boolean isReadThrough()
Cache should operate in "read-through" mode.
When in "read-through" mode, cache misses that occur due to cache entries
not existing as a result of performing a "get" call via one of Cache.get(Object),
Cache.getAll(java.util.Set), Cache.getAndRemove(Object) and/or
Cache.getAndReplace(Object, Object) will appropriately cause
the configured CacheLoader to be invoked.
The default value is false.
true when a Cache is in "read-through" mode.getCacheLoader()boolean isWriteThrough()
Cache should operate in "write-through" mode.
When in "write-through" mode, cache updates that occur as a result of performing
"put" operations called via one of Cache.put(Object, Object), Cache.getAndRemove(Object),
Cache.removeAll(), Cache.getAndPut(Object, Object)
Cache.getAndRemove(Object), Cache.getAndReplace(Object, Object),
Cache.invokeEntryProcessor(Object, javax.cache.Cache.EntryProcessor)
will appropriately cause the configured CacheWriter to be invoked.
The default value is false.
true when a Cache is in "write-through" mode.getCacheWriter()boolean isStoreByValue()
true.
boolean isStatisticsEnabled()
false.
void setStatisticsEnabled(boolean enableStatistics)
enableStatistics - true to enable statistics, false to disable.boolean isTransactionsEnabled()
false.
IsolationLevel getTransactionIsolationLevel()
IsolationLevel.NONE.
Mode getTransactionMode()
Mode.NONE.
Iterable<CacheEntryListenerRegistration<? super K,? super V>> getCacheEntryListenerRegistrations()
CacheEntryListenerRegistrations for CacheEntryListeners
to be configured on a Cache.
Iterable over the CacheEntryListenerRegistrationsCacheLoader<K,? extends V> getCacheLoader()
CacheLoader, if any.
A CacheLoader should be configured for "Read Through" caches
to load values when a cache miss occurs using either the
Cache.get(Object) and/or Cache#getAll(java.util.Set methods.
The default value is null.
CacheLoader or null if none has been set.CacheWriter<? super K,? super V> getCacheWriter()
CacheWriter, if any.
The default value is null.
CacheWriter or null if none has been set.ExpiryPolicy<? super K,? super V> getExpiryPolicy()
ExpiryPolicy to be used for caches.
The default value is ExpiryPolicy#DEFAULT.
ExpiryPolicy (must not be null)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||