类 ConfigCenterPropertyPlaceholderConfigurer
- java.lang.Object
-
- org.springframework.core.io.support.PropertiesLoaderSupport
-
- org.springframework.beans.factory.config.PropertyResourceConfigurer
-
- org.springframework.beans.factory.config.PlaceholderConfigurerSupport
-
- org.springframework.context.support.PropertySourcesPlaceholderConfigurer
-
- com.baidu.brcc.spring.ConfigCenterPropertyPlaceholderConfigurer
-
- 所有已实现的接口:
EventListener,org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanFactoryAware,org.springframework.beans.factory.BeanNameAware,org.springframework.beans.factory.config.BeanFactoryPostProcessor,org.springframework.beans.factory.DisposableBean,org.springframework.context.ApplicationContextAware,org.springframework.context.ApplicationListener,org.springframework.context.EnvironmentAware,org.springframework.core.Ordered,org.springframework.core.PriorityOrdered
public class ConfigCenterPropertyPlaceholderConfigurer extends org.springframework.context.support.PropertySourcesPlaceholderConfigurer implements org.springframework.context.ApplicationContextAware, org.springframework.beans.factory.DisposableBean, org.springframework.context.ApplicationListenerA extend utility class for spring property configuration resolve from configuration center server.
-
-
字段概要
字段 修饰符和类型 字段 说明 protected PropertiescachedPropsprotected PropertiesccLoadedPropslocal cached props load from configuration centerstatic StringRCC_PROPERTIES_PROPERTY_SOURCE_NAMErccPropertiesprotected PropertiesrccProperties-
从类继承的字段 org.springframework.context.support.PropertySourcesPlaceholderConfigurer
ENVIRONMENT_PROPERTIES_PROPERTY_SOURCE_NAME, LOCAL_PROPERTIES_PROPERTY_SOURCE_NAME
-
从类继承的字段 org.springframework.beans.factory.config.PlaceholderConfigurerSupport
DEFAULT_PLACEHOLDER_PREFIX, DEFAULT_PLACEHOLDER_SUFFIX, DEFAULT_VALUE_SEPARATOR, ignoreUnresolvablePlaceholders, nullValue, placeholderPrefix, placeholderSuffix, trimValues, valueSeparator
-
-
构造器概要
构造器 构造器 说明 ConfigCenterPropertyPlaceholderConfigurer()
-
方法概要
所有方法 静态方法 实例方法 具体方法 修饰符和类型 方法 说明 voiddestroy()StopConfigLoaderlistener and destroy proxy bean on spring container closing.protected voiddoLogLoadedProperties(Properties props)log out loaded properties.
For safety consider all value will print out only include partial string. example a result "key=jdbcpassword" will finally print out as "key=jdbcpa..."protected voiddoProcessProperties(org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactoryToProcess, org.springframework.util.StringValueResolver valueResolver)static <T> TgetFieldValue(Object target, String fieldName, Class<T> returnType)Map<String,String>getProperties()Get all loaded properties.protected voidloadProperties(Properties props)voidonApplicationEvent(org.springframework.context.ApplicationEvent event)listen all spring application eventvoidsetApplicationContext(org.springframework.context.ApplicationContext applicationContext)setApplicationContextinstance after it created in spring container.
this method is call back byApplicationContextAwareinterface.voidsetCallbackInteval(long callbackInteval)set call back listen call back intervalvoidsetCcEnvId(long ccEnvId)set environment idvoidsetCcPassword(String ccPassword)set passwordvoidsetCcServerUrl(String ccServerUrl)set server urlvoidsetCcVersion(long ccVersion)set versionvoidsetCcVersionName(String ccVersionName)set version namevoidsetConnectionTimeout(int connectionTimeout)set connection time out valuevoidsetEnableInterruptService(boolean enableInterruptService)voidsetEnableUpdateCallback(boolean enableUpdateCallback)set enableUpdateCallback valuevoidsetEnvironment(org.springframework.core.env.Environment environment)voidsetEnvName(String envName)set environment namevoidsetLogProperties(boolean logProperties)set logPropertiesvoidsetProjectName(String projectName)set project namevoidsetReadTimeout(int readTimeout)set read time out value-
从类继承的方法 org.springframework.context.support.PropertySourcesPlaceholderConfigurer
getAppliedPropertySources, postProcessBeanFactory, processProperties, processProperties, setPropertySources
-
从类继承的方法 org.springframework.beans.factory.config.PlaceholderConfigurerSupport
setBeanFactory, setBeanName, setIgnoreUnresolvablePlaceholders, setNullValue, setPlaceholderPrefix, setPlaceholderSuffix, setTrimValues, setValueSeparator
-
从类继承的方法 org.springframework.beans.factory.config.PropertyResourceConfigurer
convertProperties, convertProperty, convertPropertyValue, getOrder, setOrder
-
-
-
-
字段详细资料
-
RCC_PROPERTIES_PROPERTY_SOURCE_NAME
public static final String RCC_PROPERTIES_PROPERTY_SOURCE_NAME
rccProperties- 另请参阅:
- 常量字段值
-
ccLoadedProps
protected Properties ccLoadedProps
local cached props load from configuration center
-
cachedProps
protected Properties cachedProps
-
rccProperties
protected Properties rccProperties
-
-
方法详细资料
-
setProjectName
public void setProjectName(String projectName)
set project name- 参数:
projectName- the projectName to set
-
setEnvName
public void setEnvName(String envName)
set environment name- 参数:
envName- the envName to set
-
setEnvironment
public void setEnvironment(org.springframework.core.env.Environment environment)
- 指定者:
setEnvironment在接口中org.springframework.context.EnvironmentAware- 覆盖:
setEnvironment在类中org.springframework.context.support.PropertySourcesPlaceholderConfigurer
-
setLogProperties
public void setLogProperties(boolean logProperties)
set logProperties- 参数:
logProperties- the logProperties to set
-
setCallbackInteval
public void setCallbackInteval(long callbackInteval)
set call back listen call back interval- 参数:
callbackInteval- the callbackInteval to set
-
setEnableInterruptService
public void setEnableInterruptService(boolean enableInterruptService)
-
setCcServerUrl
public void setCcServerUrl(String ccServerUrl)
set server url- 参数:
ccServerUrl- the ccServerUrl to set
-
setCcPassword
public void setCcPassword(String ccPassword)
set password- 参数:
ccPassword- the ccPassword to set
-
setCcVersion
public void setCcVersion(long ccVersion)
set version- 参数:
ccVersion- the ccVersion to set
-
setCcVersionName
public void setCcVersionName(String ccVersionName)
set version name- 参数:
ccVersionName- the ccVersionName to set
-
setCcEnvId
public void setCcEnvId(long ccEnvId)
set environment id- 参数:
ccEnvId- the ccEnvId to set
-
setReadTimeout
public void setReadTimeout(int readTimeout)
set read time out value- 参数:
readTimeout- the readTimeout to set
-
setConnectionTimeout
public void setConnectionTimeout(int connectionTimeout)
set connection time out value- 参数:
connectionTimeout- the connectionTimeout to set
-
setEnableUpdateCallback
public void setEnableUpdateCallback(boolean enableUpdateCallback)
set enableUpdateCallback value- 参数:
enableUpdateCallback- value
-
doProcessProperties
protected void doProcessProperties(org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactoryToProcess, org.springframework.util.StringValueResolver valueResolver)- 覆盖:
doProcessProperties在类中org.springframework.beans.factory.config.PlaceholderConfigurerSupport
-
doLogLoadedProperties
protected void doLogLoadedProperties(Properties props)
log out loaded properties.
For safety consider all value will print out only include partial string. example a result "key=jdbcpassword" will finally print out as "key=jdbcpa..."- 参数:
props- properties to log out
-
loadProperties
protected void loadProperties(Properties props) throws IOException
- 覆盖:
loadProperties在类中org.springframework.core.io.support.PropertiesLoaderSupport- 抛出:
IOException
-
setApplicationContext
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansExceptionsetApplicationContextinstance after it created in spring container.
this method is call back byApplicationContextAwareinterface.- 指定者:
setApplicationContext在接口中org.springframework.context.ApplicationContextAware- 参数:
applicationContext- spring application context instance- 抛出:
org.springframework.beans.BeansException- bean create exception
-
destroy
public void destroy() throws ExceptionStopConfigLoaderlistener and destroy proxy bean on spring container closing.- 指定者:
destroy在接口中org.springframework.beans.factory.DisposableBean- 抛出:
Exception- throws any exception.
-
onApplicationEvent
public void onApplicationEvent(org.springframework.context.ApplicationEvent event)
listen all spring application event- 指定者:
onApplicationEvent在接口中org.springframework.context.ApplicationListener- 参数:
event- spring application event
-
getProperties
public Map<String,String> getProperties()
Get all loaded properties.- 返回:
- loaded properties
-
getFieldValue
public static <T> T getFieldValue(Object target, String fieldName, Class<T> returnType) throws IllegalAccessException
-
-