Class BeanCapableImportCandidate
- java.lang.Object
-
- io.microsphere.spring.context.annotation.BeanCapableImportCandidate
-
- All Implemented Interfaces:
org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanClassLoaderAware,org.springframework.beans.factory.BeanFactoryAware,org.springframework.context.EnvironmentAware,org.springframework.context.ResourceLoaderAware
- Direct Known Subclasses:
AnnotatedPropertySourceLoader
public abstract class BeanCapableImportCandidate extends java.lang.Object implements org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.BeanFactoryAware, org.springframework.context.EnvironmentAware, org.springframework.context.ResourceLoaderAwareThe@Importcandidate is an instance ofImportSelectororImportBeanDefinitionRegistrarand not a regular Spring bean, which only invokesBeanClassLoaderAware,BeanFactoryAware,EnvironmentAware, andResourceLoaderAwarecontracts in order if they are implemented, thus it will not bepopulatedandinitialized.The current abstract implementation is a template class supports the population and initialization, the sub-class must implement the interface
ImportSelectororImportBeanDefinitionRegistrar, and can't override those methods:- Since:
- 1.0.0
- Author:
- Mercy
- See Also:
AbstractAutowireCapableBeanFactory.populateBean(String, RootBeanDefinition, BeanWrapper),AbstractAutowireCapableBeanFactory.initializeBean(Object, String),ApplicationContextAwareProcessor
-
-
Field Summary
Fields Modifier and Type Field Description protected org.springframework.beans.factory.config.ConfigurableListableBeanFactorybeanFactoryprotected java.lang.ClassLoaderclassLoaderprotected org.springframework.core.env.ConfigurableEnvironmentenvironmentprotected io.microsphere.logging.Loggerloggerprotected org.springframework.core.io.ResourceLoaderresourceLoader
-
Constructor Summary
Constructors Constructor Description BeanCapableImportCandidate()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.springframework.beans.factory.config.ConfigurableListableBeanFactorygetBeanFactory()TheConfigurableListableBeanFactoryinstancejava.lang.ClassLoadergetClassLoader()Get theClassLoaderinstanceorg.springframework.core.env.ConfigurableEnvironmentgetEnvironment()TheConfigurableEnvironmentinstanceorg.springframework.core.io.ResourceLoadergetResourceLoader()TheResourceLoaderinstancevoidsetBeanClassLoader(java.lang.ClassLoader classLoader)voidsetBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)voidsetEnvironment(org.springframework.core.env.Environment environment)voidsetResourceLoader(org.springframework.core.io.ResourceLoader resourceLoader)
-
-
-
Field Detail
-
logger
protected final io.microsphere.logging.Logger logger
-
classLoader
protected java.lang.ClassLoader classLoader
-
beanFactory
protected org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory
-
environment
protected org.springframework.core.env.ConfigurableEnvironment environment
-
resourceLoader
protected org.springframework.core.io.ResourceLoader resourceLoader
-
-
Method Detail
-
setBeanClassLoader
public final void setBeanClassLoader(java.lang.ClassLoader classLoader)
- Specified by:
setBeanClassLoaderin interfaceorg.springframework.beans.factory.BeanClassLoaderAware
-
setBeanFactory
public final void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory) throws org.springframework.beans.BeansException- Specified by:
setBeanFactoryin interfaceorg.springframework.beans.factory.BeanFactoryAware- Throws:
org.springframework.beans.BeansException
-
setEnvironment
public final void setEnvironment(org.springframework.core.env.Environment environment)
- Specified by:
setEnvironmentin interfaceorg.springframework.context.EnvironmentAware
-
setResourceLoader
public final void setResourceLoader(org.springframework.core.io.ResourceLoader resourceLoader)
- Specified by:
setResourceLoaderin interfaceorg.springframework.context.ResourceLoaderAware
-
getClassLoader
@Nonnull public final java.lang.ClassLoader getClassLoader()
Get theClassLoaderinstance- Returns:
- non-null
-
getBeanFactory
@Nonnull public final org.springframework.beans.factory.config.ConfigurableListableBeanFactory getBeanFactory()
TheConfigurableListableBeanFactoryinstance- Returns:
- non-null
-
getEnvironment
@Nonnull public final org.springframework.core.env.ConfigurableEnvironment getEnvironment()
TheConfigurableEnvironmentinstance- Returns:
- non-null
-
getResourceLoader
@Nonnull public final org.springframework.core.io.ResourceLoader getResourceLoader()
TheResourceLoaderinstance- Returns:
- non-null
-
-