All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.apache.camel.component.ehcache.EhcacheComponentConfigurer Maven / Gradle / Ivy

There is a newer version: 4.8.1
Show newest version
/* Generated by org.apache.camel:apt */
package org.apache.camel.component.ehcache;

import java.util.HashMap;
import java.util.Map;

import org.apache.camel.CamelContext;
import org.apache.camel.spi.GeneratedPropertyConfigurer;
import org.apache.camel.support.component.PropertyConfigurerSupport;

/**
 * Source code generated by org.apache.camel:apt
 */
@SuppressWarnings("unchecked")
public class EhcacheComponentConfigurer extends PropertyConfigurerSupport implements GeneratedPropertyConfigurer {

    @Override
    public boolean configure(CamelContext camelContext, Object component, String name, Object value, boolean ignoreCase) {
        if (ignoreCase) {
            return doConfigureIgnoreCase(camelContext, component, name, value);
        } else {
            return doConfigure(camelContext, component, name, value);
        }
    }

    private static boolean doConfigure(CamelContext camelContext, Object component, String name, Object value) {
        switch (name) {
        case "configuration": ((EhcacheComponent) component).setConfiguration(property(camelContext, org.apache.camel.component.ehcache.EhcacheConfiguration.class, value)); return true;
        case "cacheManager": ((EhcacheComponent) component).setCacheManager(property(camelContext, org.ehcache.CacheManager.class, value)); return true;
        case "cacheManagerConfiguration": ((EhcacheComponent) component).setCacheManagerConfiguration(property(camelContext, org.ehcache.config.Configuration.class, value)); return true;
        case "cacheConfiguration": ((EhcacheComponent) component).setCacheConfiguration(property(camelContext, org.ehcache.config.CacheConfiguration.class, value)); return true;
        case "cachesConfigurations": ((EhcacheComponent) component).setCachesConfigurations(property(camelContext, java.util.Map.class, value)); return true;
        case "cacheConfigurationUri": ((EhcacheComponent) component).setCacheConfigurationUri(property(camelContext, java.lang.String.class, value)); return true;
        case "basicPropertyBinding": ((EhcacheComponent) component).setBasicPropertyBinding(property(camelContext, boolean.class, value)); return true;
            default: return false;
        }
    }

    private static boolean doConfigureIgnoreCase(CamelContext camelContext, Object component, String name, Object value) {
        switch (name.toLowerCase()) {
        case "configuration": ((EhcacheComponent) component).setConfiguration(property(camelContext, org.apache.camel.component.ehcache.EhcacheConfiguration.class, value)); return true;
        case "cachemanager": ((EhcacheComponent) component).setCacheManager(property(camelContext, org.ehcache.CacheManager.class, value)); return true;
        case "cachemanagerconfiguration": ((EhcacheComponent) component).setCacheManagerConfiguration(property(camelContext, org.ehcache.config.Configuration.class, value)); return true;
        case "cacheconfiguration": ((EhcacheComponent) component).setCacheConfiguration(property(camelContext, org.ehcache.config.CacheConfiguration.class, value)); return true;
        case "cachesconfigurations": ((EhcacheComponent) component).setCachesConfigurations(property(camelContext, java.util.Map.class, value)); return true;
        case "cacheconfigurationuri": ((EhcacheComponent) component).setCacheConfigurationUri(property(camelContext, java.lang.String.class, value)); return true;
        case "basicpropertybinding": ((EhcacheComponent) component).setBasicPropertyBinding(property(camelContext, boolean.class, value)); return true;
            default: return false;
        }
    }

}





© 2015 - 2025 Weber Informatics LLC | Privacy Policy