Package org.cache2k.config
Interface CacheBuildContext<K,V>
-
public interface CacheBuildContext<K,V>
Access to configuration and cache manager properties during the construction of the cache object.- Author:
- Jens Wilke
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <T> T
createCustomization(CustomizationSupplier<T> supplier)
CacheManager
getCacheManager()
Assigned cache manager.Cache2kConfig<K,V>
getConfig()
The effective cache configuration.Executor
getExecutor()
Executor to use for this cache instance.String
getName()
The cache name.TimeReference
getTimeReference()
Time reference to use for this cache instance.
-
-
-
Method Detail
-
getCacheManager
CacheManager getCacheManager()
Assigned cache manager. This can be useful to retrieve resources via the propertiesCacheManager.getProperties()
-
getName
String getName()
The cache name. Always identical toCache2kConfig.getName()
-
getTimeReference
TimeReference getTimeReference()
Time reference to use for this cache instance.- Throws:
IllegalStateException
- if this method is called within the supplier of the time reference or executor.
-
getExecutor
Executor getExecutor()
Executor to use for this cache instance.- Throws:
IllegalStateException
- if this method is called within the supplier of the time reference or executor.
-
getConfig
Cache2kConfig<K,V> getConfig()
The effective cache configuration. The data is only valid within the call. Customizations must copy the relevant configuration parameters and not hold a reference to the configuration object.
-
createCustomization
<T> T createCustomization(CustomizationSupplier<T> supplier)
-
-