public final class CustomizationSupplierByClassName<T> extends Object implements CustomizationSupplier<T>, ValidatingConfigurationBean
| Constructor and Description |
|---|
CustomizationSupplierByClassName()
Default constructor for beans.
|
CustomizationSupplierByClassName(String className)
Construct a customization factory based on the class name.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object other) |
String |
getClassName() |
int |
hashCode() |
void |
setClassName(String v) |
T |
supply(CacheManager manager)
Create or return an existing customization instance.
|
void |
validate()
Check whether the configuration is valid, especially whether mandatory fields
are set.
|
public CustomizationSupplierByClassName()
public CustomizationSupplierByClassName(String className)
className - Fully qualified class name, used to create the class instance
via a ClassLoader.loadClass(String). The class must have
a default constructor. Not null.public String getClassName()
public void setClassName(String v)
public void validate()
ValidatingConfigurationBeanvalidate in interface ValidatingConfigurationBeanpublic T supply(CacheManager manager) throws Exception
CustomizationSupplierDeveloper 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
supply in interface CustomizationSupplier<T>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.