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_NAMEFields inherited from class io.microsphere.spring.context.annotation.BeanCapableImportCandidate
beanFactory, classLoader, environment, resourceLoader -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidprotected voidconfigureResourcePropertySourcesRefresher(PropertySourceExtensionAttributes<ResourcePropertySource> extensionAttributes, List<PropertySourceExtensionLoader.PropertySourceResource> propertySourceResources, org.springframework.core.env.CompositePropertySource propertySource, PropertySourceExtensionLoader.ResourcePropertySourcesRefresher refresher) Configure thePropertySourceExtensionLoader.ResourcePropertySourcesRefresherofPropertySourceResourceswhenPropertySourceExtension.autoRefreshed()istruevoiddestroy()booleanisResourcePattern(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.PropertySourceResourcearray.Methods inherited from class io.microsphere.spring.config.context.annotation.PropertySourceExtensionLoader
addPropertySource, buildExtensionAttributes, createInstance, createPropertySourceFactory, createResourceComparator, createResourcePropertySource, createResourcePropertySourceName, getExtensionAttributesType, loadPropertySource, loadPropertySource, resolveExtensionAttributesType, resolvePropertySourceResources, setApplicationContextMethods inherited from class io.microsphere.spring.config.context.annotation.AnnotatedPropertySourceLoader
buildDefaultPropertySourceName, buildPropertySourceName, getAnnotationType, getPropertySourceName, resolveAnnotationType, resolvePropertySourceName, selectImportsMethods inherited from class io.microsphere.spring.context.annotation.BeanCapableImportCandidate
getBeanFactory, getClassLoader, getEnvironment, getResourceLoader, setBeanClassLoader, setBeanFactory, setEnvironment, setResourceLoaderMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.beans.factory.BeanClassLoaderAware
setBeanClassLoaderMethods inherited from interface org.springframework.context.annotation.ImportSelector
getExclusionFilterMethods inherited from interface org.springframework.context.ResourceLoaderAware
setResourceLoader
-
Constructor Details
-
ResourcePropertySourceLoader
public ResourcePropertySourceLoader()
-
-
Method Details
-
afterPropertiesSet
- Specified by:
afterPropertiesSetin 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:PropertySourceExtensionLoaderResolve the given resource value(s) to bePropertySourceExtensionLoader.PropertySourceResourcearray.- Specified by:
resolveResourcesin classPropertySourceExtensionLoader<ResourcePropertySource,PropertySourceExtensionAttributes<ResourcePropertySource>> - Parameters:
extensionAttributes-PropertySourceExtensionLoaderpropertySourceName-PropertySourceExtension.name()resourceValue- the resource value to resolve- Returns:
- nullable
- Throws:
Throwable
-
isResourcePattern
Description copied from class:PropertySourceExtensionLoaderTest the resource value is pattern or not- Specified by:
isResourcePatternin classPropertySourceExtensionLoader<ResourcePropertySource,PropertySourceExtensionAttributes<ResourcePropertySource>> - Parameters:
resourceValue- theStringvalue presenting resource- Returns:
trueifresourceValueis 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:PropertySourceExtensionLoaderConfigure thePropertySourceExtensionLoader.ResourcePropertySourcesRefresherofPropertySourceResourceswhenPropertySourceExtension.autoRefreshed()istrue- Overrides:
configureResourcePropertySourcesRefresherin classPropertySourceExtensionLoader<ResourcePropertySource,PropertySourceExtensionAttributes<ResourcePropertySource>> - Parameters:
extensionAttributes- theannotation attributesofPropertySourceExtensionpropertySourceResources- The sorted list of the resolvedresourcespropertySource- Theproperty sourceof current loader to be added into the Spring'sproperty sourcesrefresher- The Refresher ofPropertySources'Resource- Throws:
Throwable- any error
-
destroy
- Specified by:
destroyin interfaceorg.springframework.beans.factory.DisposableBean- Throws:
Exception
-