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.ResourceLoaderAware
The@Import
candidate is an instance ofImportSelector
orImportBeanDefinitionRegistrar
and not a regular Spring bean, which only invokesBeanClassLoaderAware
,BeanFactoryAware
,EnvironmentAware
, andResourceLoaderAware
contracts in order if they are implemented, thus it will not bepopulated
andinitialized
.The current abstract implementation is a template class supports the population and initialization, the sub-class must implement the interface
ImportSelector
orImportBeanDefinitionRegistrar
, 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.ConfigurableListableBeanFactory
beanFactory
protected java.lang.ClassLoader
classLoader
protected org.springframework.core.env.ConfigurableEnvironment
environment
protected org.slf4j.Logger
logger
protected org.springframework.core.io.ResourceLoader
resourceLoader
-
Constructor Summary
Constructors Constructor Description BeanCapableImportCandidate()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.springframework.beans.factory.config.ConfigurableListableBeanFactory
getBeanFactory()
TheConfigurableListableBeanFactory
instancejava.lang.ClassLoader
getClassLoader()
Get theClassLoader
instanceorg.springframework.core.env.ConfigurableEnvironment
getEnvironment()
TheConfigurableEnvironment
instanceorg.springframework.core.io.ResourceLoader
getResourceLoader()
TheResourceLoader
instancevoid
setBeanClassLoader(java.lang.ClassLoader classLoader)
void
setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)
void
setEnvironment(org.springframework.core.env.Environment environment)
void
setResourceLoader(org.springframework.core.io.ResourceLoader resourceLoader)
-
-
-
Field Detail
-
logger
protected final org.slf4j.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:
setBeanClassLoader
in interfaceorg.springframework.beans.factory.BeanClassLoaderAware
-
setBeanFactory
public final void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory) throws org.springframework.beans.BeansException
- Specified by:
setBeanFactory
in interfaceorg.springframework.beans.factory.BeanFactoryAware
- Throws:
org.springframework.beans.BeansException
-
setEnvironment
public final void setEnvironment(org.springframework.core.env.Environment environment)
- Specified by:
setEnvironment
in interfaceorg.springframework.context.EnvironmentAware
-
setResourceLoader
public final void setResourceLoader(org.springframework.core.io.ResourceLoader resourceLoader)
- Specified by:
setResourceLoader
in interfaceorg.springframework.context.ResourceLoaderAware
-
getClassLoader
@NonNull public final java.lang.ClassLoader getClassLoader()
Get theClassLoader
instance- Returns:
- non-null
-
getBeanFactory
@NonNull public final org.springframework.beans.factory.config.ConfigurableListableBeanFactory getBeanFactory()
TheConfigurableListableBeanFactory
instance- Returns:
- non-null
-
getEnvironment
@NonNull public final org.springframework.core.env.ConfigurableEnvironment getEnvironment()
TheConfigurableEnvironment
instance- Returns:
- non-null
-
getResourceLoader
@NonNull public final org.springframework.core.io.ResourceLoader getResourceLoader()
TheResourceLoader
instance- Returns:
- non-null
-
-