Package org.openspaces.core.cluster
Class ClusterInfoPropertyPlaceholderConfigurer
java.lang.Object
org.springframework.core.io.support.PropertiesLoaderSupport
org.springframework.beans.factory.config.PropertyResourceConfigurer
org.springframework.beans.factory.config.PlaceholderConfigurerSupport
org.springframework.beans.factory.config.PropertyPlaceholderConfigurer
org.openspaces.core.cluster.ClusterInfoPropertyPlaceholderConfigurer
- All Implemented Interfaces:
ClusterInfoAware,org.springframework.beans.factory.Aware,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 ClusterInfoPropertyPlaceholderConfigurer
extends org.springframework.beans.factory.config.PropertyPlaceholderConfigurer
implements org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.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: - ${clusterInfo.numberOfInstances} : Maps to
ClusterInfo.getNumberOfInstances() - ${clusterInfo.numberOfBackups} : Maps to
ClusterInfo.getNumberOfBackups() - ${clusterInfo.instanceId} : Maps to
ClusterInfo.getInstanceId() - ${clusterInfo.backupId} : Maps to
ClusterInfo.getBackupId() - ${clusterInfo.schema} : Maps to
ClusterInfo.getSchema() - ${clusterInfo.runningNumber} : Maps to
ClusterInfo.getRunningNumber() - ${clusterInfo.suffix} : Maps to
ClusterInfo.getSuffix() - ${clusterInfo.name} : Maps to
ClusterInfo.getName()
If the cluster info parameter is not set (has null value) an empty string will be
used.
- Author:
- kimchy
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final StringFields inherited from class org.springframework.beans.factory.config.PropertyPlaceholderConfigurer
SYSTEM_PROPERTIES_MODE_FALLBACK, SYSTEM_PROPERTIES_MODE_NEVER, SYSTEM_PROPERTIES_MODE_OVERRIDEFields inherited from class org.springframework.beans.factory.config.PlaceholderConfigurerSupport
DEFAULT_ESCAPE_CHARACTER, DEFAULT_PLACEHOLDER_PREFIX, DEFAULT_PLACEHOLDER_SUFFIX, DEFAULT_VALUE_SEPARATOR, escapeCharacter, ignoreUnresolvablePlaceholders, nullValue, placeholderPrefix, placeholderSuffix, trimValues, valueSeparatorFields inherited from class org.springframework.core.io.support.PropertiesLoaderSupport
localOverride, localProperties, loggerFields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic PropertiescreateProperties(ClusterInfo clusterInfo) protected voidprocessProperties(org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactoryToProcess, Properties props) voidsetBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory) voidsetBeanName(String beanName) voidsetClusterInfo(ClusterInfo clusterInfo) Sets the cluster information.Methods inherited from class org.springframework.beans.factory.config.PropertyPlaceholderConfigurer
resolvePlaceholder, resolvePlaceholder, resolveSystemProperty, setSearchSystemEnvironment, setSystemPropertiesMode, setSystemPropertiesModeNameMethods inherited from class org.springframework.beans.factory.config.PlaceholderConfigurerSupport
doProcessProperties, setEscapeCharacter, setIgnoreUnresolvablePlaceholders, setNullValue, setPlaceholderPrefix, setPlaceholderSuffix, setTrimValues, setValueSeparatorMethods inherited from class org.springframework.beans.factory.config.PropertyResourceConfigurer
convertProperties, convertProperty, convertPropertyValue, getOrder, postProcessBeanFactory, setOrderMethods inherited from class org.springframework.core.io.support.PropertiesLoaderSupport
loadProperties, mergeProperties, setFileEncoding, setIgnoreResourceNotFound, setLocalOverride, setLocation, setLocations, setProperties, setPropertiesArray, setPropertiesPersister
-
Field Details
-
NUMBER_OF_INSTANCES_PROP
- See Also:
-
NUMBER_OF_BACKUPS_PROP
- See Also:
-
INSTANCE_ID_PROP
- See Also:
-
BACKUP_ID_PROP
- See Also:
-
SCHEMA_PROP
- See Also:
-
RUNNING_NUMBER_PROP
- See Also:
-
RUNNING_NUMBER_OFFEST_1_PROP
- See Also:
-
SUFFIX_PROP
- See Also:
-
NAME_PROP
- See Also:
-
SCALE_PROP
- See Also:
-
-
Constructor Details
-
ClusterInfoPropertyPlaceholderConfigurer
public ClusterInfoPropertyPlaceholderConfigurer() -
ClusterInfoPropertyPlaceholderConfigurer
-
-
Method Details
-
createProperties
-
setClusterInfo
Description copied from interface:ClusterInfoAwareSets 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
ClusterInfoAwareshould take into account the fact that the cluster info provided might be null.- Specified by:
setClusterInfoin interfaceClusterInfoAware- Parameters:
clusterInfo- The cluster information to be injected
-
setBeanName
- Specified by:
setBeanNamein interfaceorg.springframework.beans.factory.BeanNameAware- Overrides:
setBeanNamein classorg.springframework.beans.factory.config.PlaceholderConfigurerSupport
-
setBeanFactory
public void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory) - Specified by:
setBeanFactoryin interfaceorg.springframework.beans.factory.BeanFactoryAware- Overrides:
setBeanFactoryin classorg.springframework.beans.factory.config.PlaceholderConfigurerSupport
-
processProperties
protected void processProperties(org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactoryToProcess, Properties props) throws org.springframework.beans.BeansException - Overrides:
processPropertiesin classorg.springframework.beans.factory.config.PropertyPlaceholderConfigurer- Throws:
org.springframework.beans.BeansException
-