Package io.microsphere.spring.config
Class ConfigurationPropertyRepository
java.lang.Object
io.microsphere.spring.config.ConfigurationPropertyRepository
- All Implemented Interfaces:
org.springframework.beans.factory.Aware
,org.springframework.beans.factory.DisposableBean
,org.springframework.beans.factory.InitializingBean
,org.springframework.context.EnvironmentAware
public class ConfigurationPropertyRepository
extends Object
implements org.springframework.context.EnvironmentAware, org.springframework.beans.factory.InitializingBean, org.springframework.beans.factory.DisposableBean
ConfigurationProperty
Repository- Since:
- 1.0.0
- Author:
- Mercy
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(ConfigurationProperty configurationProperty) Add aConfigurationProperty
instancevoid
boolean
Determine whether the repository contains the specified namecreateIfAbsent
(String name) Create aConfigurationProperty
instance if absentvoid
destroy()
clear the repositoryGet aConfigurationProperty
instance by namegetAll()
Get allConfigurationProperty
instancesint
Get the max size of the repositoryRemove aConfigurationProperty
instance by namevoid
setEnvironment
(org.springframework.core.env.Environment environment)
-
Field Details
-
BEAN_NAME
- See Also:
-
PROPERTY_NAME_PREFIX
- See Also:
-
MAX_SIZE_PROPERTY_NAME
- See Also:
-
DEFAULT_MAX_SIZE_PROPERTY_VALUE
public static final int DEFAULT_MAX_SIZE_PROPERTY_VALUE- See Also:
-
-
Constructor Details
-
ConfigurationPropertyRepository
public ConfigurationPropertyRepository()
-
-
Method Details
-
add
Add aConfigurationProperty
instance- Parameters:
configurationProperty
- aConfigurationProperty
instance
-
remove
Remove aConfigurationProperty
instance by name- Parameters:
name
-the name of ConfigurationProperty
-
get
Get aConfigurationProperty
instance by name- Parameters:
name
-the name of ConfigurationProperty
- Returns:
null
if not found
-
contains
Determine whether the repository contains the specified name- Parameters:
name
-the name of ConfigurationProperty
- Returns:
true
if contains, otherwisefalse
-
createIfAbsent
Create aConfigurationProperty
instance if absent- Parameters:
name
-the name of ConfigurationProperty
- Returns:
- the
ConfigurationProperty
instance
-
getAll
Get allConfigurationProperty
instances- Returns:
- never
null
-
getMaxSize
public int getMaxSize()Get the max size of the repository- Returns:
- max size
-
setEnvironment
public void setEnvironment(org.springframework.core.env.Environment environment) - Specified by:
setEnvironment
in interfaceorg.springframework.context.EnvironmentAware
-
afterPropertiesSet
- Specified by:
afterPropertiesSet
in interfaceorg.springframework.beans.factory.InitializingBean
- Throws:
Exception
-
destroy
clear the repository- Specified by:
destroy
in interfaceorg.springframework.beans.factory.DisposableBean
- Throws:
Exception
-