org.apache.camel.spring.spi
Class BridgePropertyPlaceholderConfigurer

java.lang.Object
  extended by org.springframework.core.io.support.PropertiesLoaderSupport
      extended by org.springframework.beans.factory.config.PropertyResourceConfigurer
          extended by org.springframework.beans.factory.config.PropertyPlaceholderConfigurer
              extended by org.apache.camel.spring.spi.BridgePropertyPlaceholderConfigurer
All Implemented Interfaces:
org.apache.camel.component.properties.AugmentedPropertyNameAwarePropertiesParser, org.apache.camel.component.properties.PropertiesParser, org.apache.camel.component.properties.PropertiesResolver, org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.config.BeanFactoryPostProcessor, org.springframework.core.Ordered, org.springframework.core.PriorityOrdered

public class BridgePropertyPlaceholderConfigurer
extends org.springframework.beans.factory.config.PropertyPlaceholderConfigurer
implements org.apache.camel.component.properties.PropertiesResolver, org.apache.camel.component.properties.AugmentedPropertyNameAwarePropertiesParser

A PropertyPlaceholderConfigurer that bridges Camel's property placeholder with the Spring property placeholder mechanism.


Field Summary
 
Fields inherited from class org.springframework.beans.factory.config.PropertyPlaceholderConfigurer
DEFAULT_PLACEHOLDER_PREFIX, DEFAULT_PLACEHOLDER_SUFFIX, DEFAULT_VALUE_SEPARATOR, SYSTEM_PROPERTIES_MODE_FALLBACK, SYSTEM_PROPERTIES_MODE_NEVER, SYSTEM_PROPERTIES_MODE_OVERRIDE
 
Fields inherited from class org.springframework.core.io.support.PropertiesLoaderSupport
logger, XML_FILE_EXTENSION
 
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
 
Constructor Summary
BridgePropertyPlaceholderConfigurer()
           
 
Method Summary
 String parseProperty(String key, String value, Properties properties)
           
 String parseUri(String text, Properties properties, String prefixToken, String suffixToken)
           
 String parseUri(String text, Properties properties, String prefixToken, String suffixToken, String propertyPrefix, String propertySuffix, boolean fallbackToUnaugmentedProperty)
           
protected  void processProperties(org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactoryToProcess, Properties props)
           
 Properties resolveProperties(org.apache.camel.CamelContext context, boolean ignoreMissingLocation, String... uri)
           
 void setBeanName(String beanName)
           
 void setIgnoreUnresolvablePlaceholders(boolean ignoreUnresolvablePlaceholders)
           
 void setParser(org.apache.camel.component.properties.PropertiesParser parser)
           
 void setPlaceholderPrefix(String placeholderPrefix)
           
 void setPlaceholderSuffix(String placeholderSuffix)
           
 void setResolver(org.apache.camel.component.properties.PropertiesResolver resolver)
           
 void setSystemPropertiesMode(int systemPropertiesMode)
           
 void setSystemPropertiesModeName(String constantName)
           
 void setValueSeparator(String valueSeparator)
           
protected  String springResolvePlaceholders(String text, Properties properties)
          Resolves the placeholders using Spring's property placeholder functionality.
 
Methods inherited from class org.springframework.beans.factory.config.PropertyPlaceholderConfigurer
parseStringValue, resolvePlaceholder, resolvePlaceholder, resolveSystemProperty, setBeanFactory, setNullValue, setSearchSystemEnvironment
 
Methods inherited from class org.springframework.beans.factory.config.PropertyResourceConfigurer
convertProperties, convertProperty, convertPropertyValue, getOrder, postProcessBeanFactory, setOrder
 
Methods inherited from class org.springframework.core.io.support.PropertiesLoaderSupport
loadProperties, mergeProperties, setFileEncoding, setIgnoreResourceNotFound, setLocalOverride, setLocation, setLocations, setProperties, setPropertiesArray, setPropertiesPersister
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BridgePropertyPlaceholderConfigurer

public BridgePropertyPlaceholderConfigurer()
Method Detail

processProperties

protected void processProperties(org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactoryToProcess,
                                 Properties props)
                          throws org.springframework.beans.BeansException
Overrides:
processProperties in class org.springframework.beans.factory.config.PropertyPlaceholderConfigurer
Throws:
org.springframework.beans.BeansException

setBeanName

public void setBeanName(String beanName)
Specified by:
setBeanName in interface org.springframework.beans.factory.BeanNameAware
Overrides:
setBeanName in class org.springframework.beans.factory.config.PropertyPlaceholderConfigurer

setSystemPropertiesModeName

public void setSystemPropertiesModeName(String constantName)
                                 throws IllegalArgumentException
Overrides:
setSystemPropertiesModeName in class org.springframework.beans.factory.config.PropertyPlaceholderConfigurer
Throws:
IllegalArgumentException

setSystemPropertiesMode

public void setSystemPropertiesMode(int systemPropertiesMode)
Overrides:
setSystemPropertiesMode in class org.springframework.beans.factory.config.PropertyPlaceholderConfigurer

setPlaceholderPrefix

public void setPlaceholderPrefix(String placeholderPrefix)
Overrides:
setPlaceholderPrefix in class org.springframework.beans.factory.config.PropertyPlaceholderConfigurer

setPlaceholderSuffix

public void setPlaceholderSuffix(String placeholderSuffix)
Overrides:
setPlaceholderSuffix in class org.springframework.beans.factory.config.PropertyPlaceholderConfigurer

setValueSeparator

public void setValueSeparator(String valueSeparator)
Overrides:
setValueSeparator in class org.springframework.beans.factory.config.PropertyPlaceholderConfigurer

setIgnoreUnresolvablePlaceholders

public void setIgnoreUnresolvablePlaceholders(boolean ignoreUnresolvablePlaceholders)
Overrides:
setIgnoreUnresolvablePlaceholders in class org.springframework.beans.factory.config.PropertyPlaceholderConfigurer

resolveProperties

public Properties resolveProperties(org.apache.camel.CamelContext context,
                                    boolean ignoreMissingLocation,
                                    String... uri)
                             throws Exception
Specified by:
resolveProperties in interface org.apache.camel.component.properties.PropertiesResolver
Throws:
Exception

parseUri

public String parseUri(String text,
                       Properties properties,
                       String prefixToken,
                       String suffixToken,
                       String propertyPrefix,
                       String propertySuffix,
                       boolean fallbackToUnaugmentedProperty)
                throws IllegalArgumentException
Specified by:
parseUri in interface org.apache.camel.component.properties.AugmentedPropertyNameAwarePropertiesParser
Throws:
IllegalArgumentException

parseUri

public String parseUri(String text,
                       Properties properties,
                       String prefixToken,
                       String suffixToken)
                throws IllegalArgumentException
Specified by:
parseUri in interface org.apache.camel.component.properties.PropertiesParser
Throws:
IllegalArgumentException

parseProperty

public String parseProperty(String key,
                            String value,
                            Properties properties)
Specified by:
parseProperty in interface org.apache.camel.component.properties.PropertiesParser

springResolvePlaceholders

protected String springResolvePlaceholders(String text,
                                           Properties properties)
Resolves the placeholders using Spring's property placeholder functionality.

Parameters:
text - the text which may contain spring placeholders
properties - the properties
Returns:
the parsed text with replaced placeholders, or the original text as is

setResolver

public void setResolver(org.apache.camel.component.properties.PropertiesResolver resolver)

setParser

public void setParser(org.apache.camel.component.properties.PropertiesParser parser)


Apache CAMEL