public interface CustomizationSupplier<T>
ExpiryPolicy or CacheLoader.
An implementation must implement proper a hashCode and equals method.
Implementations of this class that should be usable within the XML configuration
need to implement Serializable. This is not done so in this interface since
there may be suppliers which are used within the program that are intentionally not
serializable, such as CustomizationReferenceSupplier.
| Modifier and Type | Method and Description |
|---|---|
T |
supply(CacheManager manager)
Create or return an existing customization instance.
|
T supply(CacheManager manager) throws Exception
Developer note: The interface lacks context where the customization is used, e.g. the cache name. With the cache name, different customizations could share data or expose themselves
manager - The manager can be used to retrieve the class loader or
additional properties needed to configure the customization.Exception - the method may throw arbitrary exceptions. The exception
is wrapped into a CacheException and
rethrown. When the creation of a customization fails, the
cache will not be usable.cache2k API documentation. Copyright © 2000–2019 headissue GmbH, Munich.