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
ThePropertySourceExtensionLoader
Class forResourcePropertySource
- Since:
- 1.0.0
- Author:
- Mercy
- See Also:
ResourcePropertySource
,PropertySourceExtensionAttributes
-
-
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 Constructor Description ResourcePropertySourceLoader()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
afterPropertiesSet()
protected void
configureResourcePropertySourcesRefresher(PropertySourceExtensionAttributes<ResourcePropertySource> extensionAttributes, java.util.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(java.lang.String resourceValue)
Test the resource value is pattern or notprotected org.springframework.core.io.Resource[]
resolveResources(PropertySourceExtensionAttributes<ResourcePropertySource> extensionAttributes, java.lang.String propertySourceName, java.lang.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
-
-
-
-
Method Detail
-
afterPropertiesSet
public void afterPropertiesSet() throws java.lang.Exception
- Specified by:
afterPropertiesSet
in interfaceorg.springframework.beans.factory.InitializingBean
- Throws:
java.lang.Exception
-
resolveResources
protected org.springframework.core.io.Resource[] resolveResources(PropertySourceExtensionAttributes<ResourcePropertySource> extensionAttributes, java.lang.String propertySourceName, java.lang.String resourceValue) throws java.lang.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:
java.lang.Throwable
-
isResourcePattern
public boolean isResourcePattern(java.lang.String resourceValue)
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, java.util.List<PropertySourceExtensionLoader.PropertySourceResource> propertySourceResources, org.springframework.core.env.CompositePropertySource propertySource, PropertySourceExtensionLoader.ResourcePropertySourcesRefresher refresher) throws java.lang.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:
java.lang.Throwable
- any error
-
destroy
public void destroy() throws java.lang.Exception
- Specified by:
destroy
in interfaceorg.springframework.beans.factory.DisposableBean
- Throws:
java.lang.Exception
-
-