Class ResourcePropertySourceLoader
java.lang.Object
io.microsphere.spring.context.annotation.BeanCapableImportCandidate
io.microsphere.spring.config.context.annotation.AnnotatedPropertySourceLoader<A>
io.microsphere.spring.config.context.annotation.PropertySourceExtensionLoader<ResourcePropertySource,PropertySourceExtensionAttributes<ResourcePropertySource>>
io.microsphere.spring.config.context.annotation.ResourcePropertySourceLoader
- All Implemented Interfaces:
org.springframework.beans.factory.Aware
,org.springframework.beans.factory.BeanClassLoaderAware
,org.springframework.beans.factory.BeanFactoryAware
,org.springframework.beans.factory.DisposableBean
,org.springframework.beans.factory.InitializingBean
,org.springframework.context.annotation.ImportSelector
,org.springframework.context.ApplicationContextAware
,org.springframework.context.EnvironmentAware
,org.springframework.context.ResourceLoaderAware
public class ResourcePropertySourceLoader
extends PropertySourceExtensionLoader<ResourcePropertySource,PropertySourceExtensionAttributes<ResourcePropertySource>>
implements org.springframework.beans.factory.InitializingBean, org.springframework.context.ResourceLoaderAware, org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.DisposableBean
The
PropertySourceExtensionLoader
Class for ResourcePropertySource
- Since:
- 1.0.0
- Author:
- Mercy
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class io.microsphere.spring.config.context.annotation.PropertySourceExtensionLoader
PropertySourceExtensionLoader.PropertySourceResource, PropertySourceExtensionLoader.ResourcePropertySourcesRefresher
-
Field Summary
Fields inherited from class io.microsphere.spring.config.context.annotation.AnnotatedPropertySourceLoader
logger, NAME_ATTRIBUTE_NAME
Fields inherited from class io.microsphere.spring.context.annotation.BeanCapableImportCandidate
beanFactory, classLoader, environment, resourceLoader
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
protected void
configureResourcePropertySourcesRefresher
(PropertySourceExtensionAttributes<ResourcePropertySource> extensionAttributes, List<PropertySourceExtensionLoader.PropertySourceResource> propertySourceResources, org.springframework.core.env.CompositePropertySource propertySource, PropertySourceExtensionLoader.ResourcePropertySourcesRefresher refresher) Configure thePropertySourceExtensionLoader.ResourcePropertySourcesRefresher
ofPropertySource
Resources
whenPropertySourceExtension.autoRefreshed()
istrue
void
destroy()
boolean
isResourcePattern
(String resourceValue) Test the resource value is pattern or notprotected org.springframework.core.io.Resource[]
resolveResources
(PropertySourceExtensionAttributes<ResourcePropertySource> extensionAttributes, String propertySourceName, String resourceValue) Resolve the given resource value(s) to bePropertySourceExtensionLoader.PropertySourceResource
array.Methods inherited from class io.microsphere.spring.config.context.annotation.PropertySourceExtensionLoader
addPropertySource, buildExtensionAttributes, createInstance, createPropertySourceFactory, createResourceComparator, createResourcePropertySource, createResourcePropertySourceName, getExtensionAttributesType, loadPropertySource, loadPropertySource, resolveExtensionAttributesType, resolvePropertySourceResources, setApplicationContext
Methods inherited from class io.microsphere.spring.config.context.annotation.AnnotatedPropertySourceLoader
buildDefaultPropertySourceName, buildPropertySourceName, getAnnotationType, getPropertySourceName, resolveAnnotationType, resolvePropertySourceName, selectImports
Methods inherited from class io.microsphere.spring.context.annotation.BeanCapableImportCandidate
getBeanFactory, getClassLoader, getEnvironment, getResourceLoader, setBeanClassLoader, setBeanFactory, setEnvironment, setResourceLoader
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.beans.factory.BeanClassLoaderAware
setBeanClassLoader
Methods inherited from interface org.springframework.context.annotation.ImportSelector
getExclusionFilter
Methods inherited from interface org.springframework.context.ResourceLoaderAware
setResourceLoader
-
Constructor Details
-
ResourcePropertySourceLoader
public ResourcePropertySourceLoader()
-
-
Method Details
-
afterPropertiesSet
- Specified by:
afterPropertiesSet
in interfaceorg.springframework.beans.factory.InitializingBean
- Throws:
Exception
-
resolveResources
protected org.springframework.core.io.Resource[] resolveResources(PropertySourceExtensionAttributes<ResourcePropertySource> extensionAttributes, String propertySourceName, String resourceValue) throws Throwable Description copied from class:PropertySourceExtensionLoader
Resolve the given resource value(s) to bePropertySourceExtensionLoader.PropertySourceResource
array.- Specified by:
resolveResources
in classPropertySourceExtensionLoader<ResourcePropertySource,
PropertySourceExtensionAttributes<ResourcePropertySource>> - Parameters:
extensionAttributes
-PropertySourceExtensionLoader
propertySourceName
-PropertySourceExtension.name()
resourceValue
- the resource value to resolve- Returns:
- nullable
- Throws:
Throwable
-
isResourcePattern
Description copied from class:PropertySourceExtensionLoader
Test the resource value is pattern or not- Specified by:
isResourcePattern
in classPropertySourceExtensionLoader<ResourcePropertySource,
PropertySourceExtensionAttributes<ResourcePropertySource>> - Parameters:
resourceValue
- theString
value presenting resource- Returns:
true
ifresourceValue
is a pattern value
-
configureResourcePropertySourcesRefresher
protected void configureResourcePropertySourcesRefresher(PropertySourceExtensionAttributes<ResourcePropertySource> extensionAttributes, List<PropertySourceExtensionLoader.PropertySourceResource> propertySourceResources, org.springframework.core.env.CompositePropertySource propertySource, PropertySourceExtensionLoader.ResourcePropertySourcesRefresher refresher) throws Throwable Description copied from class:PropertySourceExtensionLoader
Configure thePropertySourceExtensionLoader.ResourcePropertySourcesRefresher
ofPropertySource
Resources
whenPropertySourceExtension.autoRefreshed()
istrue
- Overrides:
configureResourcePropertySourcesRefresher
in classPropertySourceExtensionLoader<ResourcePropertySource,
PropertySourceExtensionAttributes<ResourcePropertySource>> - Parameters:
extensionAttributes
- theannotation attributes
ofPropertySourceExtension
propertySourceResources
- The sorted list of the resolvedresources
propertySource
- Theproperty source
of current loader to be added into the Spring'sproperty sources
refresher
- The Refresher ofPropertySources'
Resource
- Throws:
Throwable
- any error
-
destroy
- Specified by:
destroy
in interfaceorg.springframework.beans.factory.DisposableBean
- Throws:
Exception
-