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.
Within the XML configuraiton of a cache manager different default configuration
values may be specified. To get a configuration bean with the effective defaults of
a specific manager do Cache2kBuilder.forUnknownTypes().manager(...).toConfiguration()
Modifier and Type | Field and Description |
---|---|
static long |
EXPIRY_NOT_ETERNAL |
Constructor and Description |
---|
Cache2kConfiguration() |
public static final long EXPIRY_NOT_ETERNAL
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 void setKeyType(Class<?> v)
public void setKeyType(CacheType v)
public void setValueType(Class<?> v)
public void setValueType(CacheType v)
public boolean isEternal()
public void setEternal(boolean v)
Cache2kBuilder.eternal(boolean)
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()
true
if default values are set via the XML configuration or
if there is a specific section for the cache name.public void setExternalConfigurationPresent(boolean v)
public ConfigurationSectionContainer getSections()
getSections
in interface ConfigurationWithSections
public CustomizationSupplier<? extends FunctionalCacheLoader<K,V>> getLoader()
public void setLoader(CustomizationSupplier<? extends FunctionalCacheLoader<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 CustomizationCollection<CacheClosedListener> getCacheClosedListeners()
public boolean hasCacheClosedListeners()
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 CustomizationSupplier<Executor> getLoaderExecutor()
public boolean isDisableLastModificationTime()
public void setDisableLastModificationTime(boolean v)
public void setLoaderExecutor(CustomizationSupplier<Executor> v)
Cache2kBuilder.loaderExecutor(Executor)
public CustomizationSupplier<Executor> getPrefetchExecutor()
public void setPrefetchExecutor(CustomizationSupplier<Executor> v)
public CustomizationSupplier<Executor> getAsyncListenerExecutor()
public void setAsyncListenerExecutor(CustomizationSupplier<Executor> v)
public CustomizationSupplier<TimeReference> getTimeReference()
public void setTimeReference(CustomizationSupplier<TimeReference> v)
public boolean isBoostConcurrency()
public void setBoostConcurrency(boolean v)
Cache2kBuilder.boostConcurrency(boolean)
cache2k API documentation. Copyright © 2000–2018 headissue GmbH, Munich.