public class CacheConfig extends Object
Constructor and Description |
---|
CacheConfig() |
Modifier and Type | Method and Description |
---|---|
Class<?> |
getEntryType() |
long |
getExceptionExpiryMillis() |
long |
getExpiryMillis() |
int |
getExpirySeconds() |
int |
getHeapEntryCapacity() |
Class<?> |
getImplementation() |
Class<?> |
getKeyType() |
int |
getMaxSize() |
int |
getMaxSizeHighBound() |
int |
getMaxSizeLowBound() |
List<Object> |
getModuleConfiguration() |
String |
getName() |
List<StorageConfiguration> |
getStorageModules() |
Class<?> |
getValueType() |
boolean |
isBackgroundRefresh() |
boolean |
isEternal() |
boolean |
isKeepDataAfterExpired() |
boolean |
isSharpExpiry() |
boolean |
isSuppressExceptions() |
void |
setBackgroundRefresh(boolean backgroundRefresh) |
void |
setEntryType(Class<?> entryType) |
void |
setEternal(boolean v)
Set cache entry don't expiry by time.
|
void |
setExceptionExpiryMillis(long v) |
void |
setExpiryMillis(long expiryMillis)
The expiry value of all entries.
|
void |
setExpirySeconds(int v) |
void |
setHeapEntryCapacity(int v)
Maximum number of entries that the cache keeps in the heap.
|
void |
setImplementation(Class<?> cacheImplementation) |
void |
setKeepDataAfterExpired(boolean v)
Expired data is kept in the cache until the entry is evicted by the replacement
algorithm.
|
void |
setKeyType(Class<?> keyType) |
void |
setMaxSize(int maxSize) |
void |
setMaxSizeHighBound(int maxSizeHighBound) |
void |
setMaxSizeLowBound(int maxSizeLowBound) |
void |
setModuleConfiguration(List<Object> moduleConfiguration) |
void |
setName(String name)
Sets the name of a cache.
|
void |
setSharpExpiry(boolean sharpExpiry) |
void |
setSuppressExceptions(boolean suppressExceptions) |
void |
setValueType(Class<?> valueType) |
public CacheConfig()
public void setName(String name)
If a name is specified it must be ensured it is unique within the cache manager. A unique name may consist of a namespace and a counter, e.g. "com.company.application.AssetCache-1".
Allowed characters for a cache name, are URL non-reserved characters, these are: [A-Z], [a-z], [0-9] and [~-_.-], see RFC3986. The reason for restricting the characters in names, is that the names may be used to derive other resource names from it, e.g. for file based storage.
For brevity within log messages and other displays the cache name may be shortened if the manager name is included as prefix.
public int getMaxSize()
public void setMaxSize(int maxSize)
public int getMaxSizeHighBound()
public void setMaxSizeHighBound(int maxSizeHighBound)
public int getMaxSizeLowBound()
public void setMaxSizeLowBound(int maxSizeLowBound)
public boolean isBackgroundRefresh()
public void setBackgroundRefresh(boolean backgroundRefresh)
public Class<?> getKeyType()
public void setKeyType(Class<?> keyType)
public Class<?> getValueType()
public Class<?> getEntryType()
public void setEntryType(Class<?> entryType)
public void setValueType(Class<?> valueType)
public boolean isEternal()
public void setEternal(boolean v)
public void setExpirySeconds(int v)
public int getExpirySeconds()
public long getExpiryMillis()
public void setExpiryMillis(long expiryMillis)
public long getExceptionExpiryMillis()
public void setExceptionExpiryMillis(long v)
public boolean isKeepDataAfterExpired()
public void setKeepDataAfterExpired(boolean v)
CacheSourceWithMetaInfo
public boolean isSharpExpiry()
public void setSharpExpiry(boolean sharpExpiry)
RootAnyBuilder.sharpExpiry(boolean)
public boolean isSuppressExceptions()
public void setSuppressExceptions(boolean suppressExceptions)
public int getHeapEntryCapacity()
public void setHeapEntryCapacity(int v)
public List<Object> getModuleConfiguration()
public void setModuleConfiguration(List<Object> moduleConfiguration)
public Class<?> getImplementation()
public void setImplementation(Class<?> cacheImplementation)
public List<StorageConfiguration> getStorageModules()
cache2k API documentation. Copyright © 2000–2015 headissue GmbH, Munich.