public class Cache2kConfiguration<K,V> extends Object implements ConfigurationBean, ConfigurationWithSections
To create a cache, the Cache2kBuilder
is used. All configuration properties
are present on the builder and are documented in this place. Consequently all properties
refer to the corresponding builder method.
The configuration bean is designed to be serializable. This is used for example to copy default configurations. The builder allows object references to customizations to be set. If this happens the configuration is not serializable. Such configuration is only used for immediate creation of one cache via the builder.
The configuration may contain additional beans, called configuration sections, that are used to configure extensions or sub modules.
Modifier and Type | Field and Description |
---|---|
static long |
EXPIRY_NOT_ETERNAL |
Constructor and Description |
---|
Cache2kConfiguration() |
public static final long EXPIRY_NOT_ETERNAL
public Cache2kConfiguration()
public static <K,V> Cache2kConfiguration<K,V> of(Class<K> keyType, Class<V> valueType)
public static <K,V> Cache2kConfiguration<K,V> of(Class<K> keyType, CacheType<V> valueType)
public static <K,V> Cache2kConfiguration<K,V> of(CacheType<K> keyType, Class<V> valueType)
public static <K,V> Cache2kConfiguration<K,V> of(CacheType<K> keyType, CacheType<V> valueType)
public String getName()
Cache2kBuilder.name(String)
public void setName(String name)
Cache2kBuilder.name(String)
public long getEntryCapacity()
Cache2kBuilder.entryCapacity(long)
public void setEntryCapacity(long v)
public boolean isRefreshAhead()
Cache2kBuilder.refreshAhead(boolean)
public void setRefreshAhead(boolean v)
Cache2kBuilder.refreshAhead(boolean)
public boolean isBackgroundRefresh()
isRefreshAhead()
Cache2kBuilder.refreshAhead(boolean)
public void setBackgroundRefresh(boolean v)
setRefreshAhead(boolean)
Cache2kBuilder.refreshAhead(boolean)
public CacheType<K> getKeyType()
public void setKeyType(Class<?> v)
public void setKeyType(CacheType v)
public CacheType<V> getValueType()
public void setValueType(Class<?> v)
public void setValueType(CacheType v)
public boolean isEternal()
public void setEternal(boolean v)
Cache2kBuilder.eternal(boolean)
public void setExpirySeconds(int v)
setExpireAfterWrite(long)
public int getExpirySeconds()
getExpireAfterWrite()
public long getExpireAfterWrite()
public void setExpireAfterWrite(long millis)
public long getRetryInterval()
public void setRetryInterval(long millis)
public long getMaxRetryInterval()
public void setMaxRetryInterval(long millis)
public long getResilienceDuration()
public void setResilienceDuration(long millis)
public boolean isKeepDataAfterExpired()
public void setKeepDataAfterExpired(boolean v)
public boolean isSharpExpiry()
public void setSharpExpiry(boolean v)
Cache2kBuilder.sharpExpiry(boolean)
public boolean isSuppressExceptions()
public void setSuppressExceptions(boolean v)
public boolean isExternalConfigurationPresent()
public void setExternalConfigurationPresent(boolean v)
public ConfigurationSectionContainer getSections()
getSections
in interface ConfigurationWithSections
public CustomizationSupplier<CacheLoader<K,V>> getLoader()
public void setLoader(CustomizationSupplier<CacheLoader<K,V>> v)
public CustomizationSupplier<AdvancedCacheLoader<K,V>> getAdvancedLoader()
public void setAdvancedLoader(CustomizationSupplier<AdvancedCacheLoader<K,V>> v)
public int getLoaderThreadCount()
public void setLoaderThreadCount(int v)
Cache2kBuilder.loaderThreadCount(int)
public CustomizationSupplier<ExpiryPolicy<K,V>> getExpiryPolicy()
public void setExpiryPolicy(CustomizationSupplier<ExpiryPolicy<K,V>> _expiryPolicy)
public CustomizationSupplier<CacheWriter<K,V>> getWriter()
public void setWriter(CustomizationSupplier<CacheWriter<K,V>> v)
Cache2kBuilder.writer(CacheWriter)
public boolean isStoreByReference()
public void setStoreByReference(boolean v)
Cache2kBuilder.storeByReference(boolean)
public CustomizationSupplier<ExceptionPropagator<K>> getExceptionPropagator()
public void setExceptionPropagator(CustomizationSupplier<ExceptionPropagator<K>> v)
public CustomizationCollection<CacheEntryOperationListener<K,V>> getListeners()
A listener can be added by adding it to the collection. Duplicate (in terms of equal objects) listeners will be ignored.
public boolean hasListeners()
public CustomizationCollection<CacheEntryOperationListener<K,V>> getAsyncListeners()
public boolean hasAsyncListeners()
public CustomizationSupplier<ResiliencePolicy<K,V>> getResiliencePolicy()
public void setResiliencePolicy(CustomizationSupplier<ResiliencePolicy<K,V>> _resiliencePolicy)
public boolean isStrictEviction()
public void setStrictEviction(boolean v)
Cache2kBuilder.strictEviction(boolean)
public boolean isPermitNullValues()
public void setPermitNullValues(boolean v)
Cache2kBuilder.permitNullValues(boolean)
public boolean isDisableStatistics()
public void setDisableStatistics(boolean v)
public int getEvictionSegmentCount()
public void setEvictionSegmentCount(int v)
Cache2kBuilder.evictionSegmentCount(int)
public CustomizationSupplier<Executor> getLoaderExecutor()
public void setLoaderExecutor(CustomizationSupplier<Executor> v)
Cache2kBuilder.loaderExecutor(Executor)
public CustomizationSupplier<Executor> getPrefetchExecutor()
public void setPrefetchExecutor(CustomizationSupplier<Executor> v)
cache2k API documentation. Copyright © 2000–2016 headissue GmbH, Munich.