GigaSpaces XAP 9.7.2 API

org.openspaces.core.properties
Class BeanLevelPropertyPlaceholderConfigurer

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.PlaceholderConfigurerSupport
              extended by org.springframework.beans.factory.config.PropertyPlaceholderConfigurer
                  extended by org.openspaces.core.properties.BeanLevelPropertyPlaceholderConfigurer
All Implemented Interfaces:
ClusterInfoAware, BeanLevelPropertiesAware, Aware, BeanFactoryAware, BeanNameAware, BeanFactoryPostProcessor, Ordered, PriorityOrdered

public class BeanLevelPropertyPlaceholderConfigurer
extends PropertyPlaceholderConfigurer
implements BeanNameAware, BeanFactoryAware, BeanLevelPropertiesAware, ClusterInfoAware

An extension on top of Spring PropertyPlaceholderConfigurer that works with BeanLevelProperties in order to inject bean level properties.

${..} notations are used to lookup bean level properties with the properties obtained based on the bean name using BeanLevelProperties.getMergedBeanProperties(String).

Author:
kimchy

Field Summary
 
Fields inherited from class org.springframework.beans.factory.config.PropertyPlaceholderConfigurer
SYSTEM_PROPERTIES_MODE_FALLBACK, SYSTEM_PROPERTIES_MODE_NEVER, SYSTEM_PROPERTIES_MODE_OVERRIDE
 
Fields inherited from class org.springframework.beans.factory.config.PlaceholderConfigurerSupport
DEFAULT_PLACEHOLDER_PREFIX, DEFAULT_PLACEHOLDER_SUFFIX, DEFAULT_VALUE_SEPARATOR, ignoreUnresolvablePlaceholders, nullValue, placeholderPrefix, placeholderSuffix, valueSeparator
 
Fields inherited from class org.springframework.core.io.support.PropertiesLoaderSupport
localOverride, localProperties, logger, XML_FILE_EXTENSION
 
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
 
Constructor Summary
BeanLevelPropertyPlaceholderConfigurer(BeanLevelProperties beanLevelProperties)
           
BeanLevelPropertyPlaceholderConfigurer(BeanLevelProperties beanLevelProperties, ClusterInfo clusterInfo)
           
 
Method Summary
protected  void processProperties(ConfigurableListableBeanFactory beanFactoryToProcess, Properties props)
           
 void setBeanFactory(BeanFactory beanFactory)
           
 void setBeanLevelProperties(BeanLevelProperties beanLevelProperties)
          Sets the BeanLevelProperties.
 void setBeanName(String beanName)
           
 void setClusterInfo(ClusterInfo clusterInfo)
          Sets the cluster information.
 
Methods inherited from class org.springframework.beans.factory.config.PropertyPlaceholderConfigurer
parseStringValue, resolvePlaceholder, resolvePlaceholder, resolveSystemProperty, setSearchSystemEnvironment, setSystemPropertiesMode, setSystemPropertiesModeName
 
Methods inherited from class org.springframework.beans.factory.config.PlaceholderConfigurerSupport
doProcessProperties, setIgnoreUnresolvablePlaceholders, setNullValue, setPlaceholderPrefix, setPlaceholderSuffix, setValueSeparator
 
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

BeanLevelPropertyPlaceholderConfigurer

public BeanLevelPropertyPlaceholderConfigurer(BeanLevelProperties beanLevelProperties)

BeanLevelPropertyPlaceholderConfigurer

public BeanLevelPropertyPlaceholderConfigurer(BeanLevelProperties beanLevelProperties,
                                              ClusterInfo clusterInfo)
Method Detail

setBeanLevelProperties

public void setBeanLevelProperties(BeanLevelProperties beanLevelProperties)
Description copied from interface: BeanLevelPropertiesAware
Sets the BeanLevelProperties.

Specified by:
setBeanLevelProperties in interface BeanLevelPropertiesAware

setClusterInfo

public void setClusterInfo(ClusterInfo clusterInfo)
Description copied from interface: ClusterInfoAware
Sets the cluster information.

Note, the cluster information is obtained externally from the application context which means that this feature need to be supported by specific containers (and is not supported by plain Spring application context). This means that beans that implement ClusterInfoAware should take into account the fact that the cluster info provided might be null.

Specified by:
setClusterInfo in interface ClusterInfoAware
Parameters:
clusterInfo - The cluster information to be injected

setBeanName

public void setBeanName(String beanName)
Specified by:
setBeanName in interface BeanNameAware
Overrides:
setBeanName in class PlaceholderConfigurerSupport

setBeanFactory

public void setBeanFactory(BeanFactory beanFactory)
Specified by:
setBeanFactory in interface BeanFactoryAware
Overrides:
setBeanFactory in class PlaceholderConfigurerSupport

processProperties

protected void processProperties(ConfigurableListableBeanFactory beanFactoryToProcess,
                                 Properties props)
                          throws BeansException
Overrides:
processProperties in class PropertyPlaceholderConfigurer
Throws:
BeansException

GigaSpaces XAP 9.7.2 API

Copyright © GigaSpaces.