GigaSpaces XAP 7.0 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.PropertyPlaceholderConfigurer
              extended by org.openspaces.core.properties.BeanLevelPropertyPlaceholderConfigurer
All Implemented Interfaces:
ClusterInfoAware, BeanLevelPropertiesAware, 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
DEFAULT_PLACEHOLDER_PREFIX, DEFAULT_PLACEHOLDER_SUFFIX, 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
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, setIgnoreUnresolvablePlaceholders, setNullValue, setPlaceholderPrefix, setPlaceholderSuffix, setSearchSystemEnvironment, setSystemPropertiesMode, setSystemPropertiesModeName
 
Methods inherited from class org.springframework.beans.factory.config.PropertyResourceConfigurer
convertProperties, 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 PropertyPlaceholderConfigurer

setBeanFactory

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

processProperties

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

GigaSpaces XAP 7.0 API

Copyright © GigaSpaces.