public CamelPropertyPlaceholderDefinition getCamelPropertyPlaceholder() { return camelPropertyPlaceholder; }
public void setCamelPropertyPlaceholder(CamelPropertyPlaceholderDefinition camelPropertyPlaceholder) { this.camelPropertyPlaceholder = camelPropertyPlaceholder; }
public void init() { // register restContext parser registerParser("restContext", new RestContextDefinitionParser()); // register routeContext parser registerParser("routeContext", new RouteContextDefinitionParser()); // register endpoint parser registerParser("endpoint", endpointParser); addBeanDefinitionParser("keyStoreParameters", KeyStoreParametersFactoryBean.class, true, true); addBeanDefinitionParser("secureRandomParameters", SecureRandomParametersFactoryBean.class, true, true); registerBeanDefinitionParser("sslContextParameters", new SSLContextParametersFactoryBeanBeanDefinitionParser()); addBeanDefinitionParser("proxy", CamelProxyFactoryBean.class, true, false); addBeanDefinitionParser("template", CamelProducerTemplateFactoryBean.class, true, false); addBeanDefinitionParser("consumerTemplate", CamelConsumerTemplateFactoryBean.class, true, false); addBeanDefinitionParser("export", CamelServiceExporter.class, true, false); addBeanDefinitionParser("threadPool", CamelThreadPoolFactoryBean.class, true, true); addBeanDefinitionParser("redeliveryPolicyProfile", CamelRedeliveryPolicyFactoryBean.class, true, true); // jmx agent, stream caching, hystrix, service call configurations and property placeholder cannot be used outside of the camel context addBeanDefinitionParser("jmxAgent", CamelJMXAgentDefinition.class, false, false); addBeanDefinitionParser("streamCaching", CamelStreamCachingStrategyDefinition.class, false, false); addBeanDefinitionParser("propertyPlaceholder", CamelPropertyPlaceholderDefinition.class, false, false); addBeanDefinitionParser("hystrixConfiguration", HystrixConfigurationDefinition.class, false, false); addBeanDefinitionParser("consulConfiguration", ConsulConfigurationDefinition.class, false, false); addBeanDefinitionParser("dnsConfiguration", DnsConfigurationDefinition.class, false, false); addBeanDefinitionParser("etcdConfiguration", EtcdConfigurationDefinition.class, false, false); addBeanDefinitionParser("kubernetesConfiguration", KubernetesConfigurationDefinition.class, false, false); addBeanDefinitionParser("ribbonConfiguration", RibbonConfigurationDefinition.class, false, false); // errorhandler could be the sub element of camelContext or defined outside camelContext BeanDefinitionParser errorHandlerParser = new ErrorHandlerDefinitionParser(); registerParser("errorHandler", errorHandlerParser); parserMap.put("errorHandler", errorHandlerParser); // camel context boolean osgi = false; Class<?> cl = CamelContextFactoryBean.class; // These code will try to detected if we are in the OSGi environment. // If so, camel will use the OSGi version of CamelContextFactoryBean to create the CamelContext. try { // Try to load the BundleActivator first Class.forName("org.osgi.framework.BundleActivator"); Class<?> c = Class.forName("org.apache.camel.osgi.Activator"); Method mth = c.getDeclaredMethod("getBundle"); Object bundle = mth.invoke(null); if (bundle != null) { cl = Class.forName("org.apache.camel.osgi.CamelContextFactoryBean"); osgi = true; } } catch (Throwable t) { // not running with camel-core-osgi so we fallback to the regular factory bean LOG.trace("Cannot find class so assuming not running in OSGi container: " + t.getMessage()); } if (osgi) { LOG.info("OSGi environment detected."); } LOG.debug("Using {} as CamelContextBeanDefinitionParser", cl.getCanonicalName()); registerParser("camelContext", new CamelContextBeanDefinitionParser(cl)); }
@Override public CamelPropertyPlaceholderDefinition getCamelPropertyPlaceholder() { return _factoryBean.getCamelPropertyPlaceholder(); }