GigaSpaces XAP 9.7.2 API

org.openspaces.core.cluster
Class ClusterInfoPropertyPlaceholderConfigurer

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.cluster.ClusterInfoPropertyPlaceholderConfigurer
All Implemented Interfaces:
ClusterInfoAware, Aware, BeanFactoryAware, BeanNameAware, BeanFactoryPostProcessor, Ordered, PriorityOrdered

public class ClusterInfoPropertyPlaceholderConfigurer
extends PropertyPlaceholderConfigurer
implements BeanNameAware, BeanFactoryAware, ClusterInfoAware

Provides the ClusterInfo parameters as injected properties that can be used within Spring application context. The following is a list of the properties:

If the cluster info parameter is not set (has null value) an empty string will be used.

Author:
kimchy

Field Summary
static String BACKUP_ID_PROP
           
static String INSTANCE_ID_PROP
           
static String NAME_PROP
           
static String NUMBER_OF_BACKUPS_PROP
           
static String NUMBER_OF_INSTANCES_PROP
           
static String RUNNING_NUMBER_OFFEST_1_PROP
           
static String RUNNING_NUMBER_PROP
           
static String SCHEMA_PROP
           
static String SUFFIX_PROP
           
 
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
ClusterInfoPropertyPlaceholderConfigurer()
           
ClusterInfoPropertyPlaceholderConfigurer(ClusterInfo clusterInfo)
           
 
Method Summary
static Properties createProperties(ClusterInfo clusterInfo)
           
protected  void processProperties(ConfigurableListableBeanFactory beanFactoryToProcess, Properties props)
           
 void setBeanFactory(BeanFactory beanFactory)
           
 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
 

Field Detail

NUMBER_OF_INSTANCES_PROP

public static final String NUMBER_OF_INSTANCES_PROP
See Also:
Constant Field Values

NUMBER_OF_BACKUPS_PROP

public static final String NUMBER_OF_BACKUPS_PROP
See Also:
Constant Field Values

INSTANCE_ID_PROP

public static final String INSTANCE_ID_PROP
See Also:
Constant Field Values

BACKUP_ID_PROP

public static final String BACKUP_ID_PROP
See Also:
Constant Field Values

SCHEMA_PROP

public static final String SCHEMA_PROP
See Also:
Constant Field Values

RUNNING_NUMBER_PROP

public static final String RUNNING_NUMBER_PROP
See Also:
Constant Field Values

RUNNING_NUMBER_OFFEST_1_PROP

public static final String RUNNING_NUMBER_OFFEST_1_PROP
See Also:
Constant Field Values

SUFFIX_PROP

public static final String SUFFIX_PROP
See Also:
Constant Field Values

NAME_PROP

public static final String NAME_PROP
See Also:
Constant Field Values
Constructor Detail

ClusterInfoPropertyPlaceholderConfigurer

public ClusterInfoPropertyPlaceholderConfigurer()

ClusterInfoPropertyPlaceholderConfigurer

public ClusterInfoPropertyPlaceholderConfigurer(ClusterInfo clusterInfo)
Method Detail

createProperties

public static Properties createProperties(ClusterInfo clusterInfo)

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.