Search in sources :

Example 1 with CustomStoreConfiguration

use of org.infinispan.configuration.cache.CustomStoreConfiguration in project infinispan by infinispan.

the class PersistenceUtil method getClassBasedOnConfigurationAnnotation.

private static Class<?> getClassBasedOnConfigurationAnnotation(StoreConfiguration cfg) {
    ConfigurationFor annotation = cfg.getClass().getAnnotation(ConfigurationFor.class);
    Class<?> classAnnotation = null;
    if (annotation == null) {
        if (cfg instanceof CustomStoreConfiguration) {
            classAnnotation = ((CustomStoreConfiguration) cfg).customStoreClass();
        }
    } else {
        classAnnotation = annotation.value();
    }
    if (classAnnotation == null) {
        throw CONFIG.loaderConfigurationDoesNotSpecifyLoaderClass(cfg.getClass().getName());
    }
    return classAnnotation;
}
Also used : ConfigurationFor(org.infinispan.commons.configuration.ConfigurationFor) CustomStoreConfiguration(org.infinispan.configuration.cache.CustomStoreConfiguration)

Aggregations

ConfigurationFor (org.infinispan.commons.configuration.ConfigurationFor)1 CustomStoreConfiguration (org.infinispan.configuration.cache.CustomStoreConfiguration)1