Spring源码深度解析
2019-12-11 11:19:57 10 举报
AI智能生成
Spring源码深度解析
作者其他创作
大纲/内容
Spring深度解析
GenericApplicationContext
new DefaultListableBeanFactory()
AnnotationConfigApplicationContext
new AnnotatedBeanDefinitionReader
this
registerAnnotationConfigProcessors
unwrapDefaultListableBeanFactory
ContextAnnotationAutowireCandidateResolver
registry.containsBeanDefinition
registerPostProcessor
setRole
registerBeanDefinition
validate()
prepareMethodOverrides
ConfigurationClassPostProcessor.class
beanDefinitionMap.get
BeanDefinitionHolder
new ClassPathBeanDefinitionScanner
registerDefaultFilters
register()
registerBean
doRegisterBean
AnnotatedGenericBeanDefinition
shouldSkip
processCommonDefinitionAnnotations
applyScopedProxyMode
refresh()
prepareRefresh()
initPropertySources()
validateRequiredProperties()
obtainFreshBeanFactory()
refreshBeanFactory()
compareAndSet
prepareBeanFactory()
setBeanClassLoader
setBeanExpressionResolver
addBeanPostProcessor
ignoreDependencyInterface
registerResolvableDependency
registerSingleton
postProcessBeanFactory()
invokeBeanFactoryPostProcessors()
invokeBeanFactoryPostProcessors
BeanDefinitionRegistry
regularPostProcessors
currentRegistryProcessors
implement PriorityOrdered
currentRegistryProcessors.add(beanFactory.getBean)
sortPostProcessors
Ordered
invokeBeanDefinitionRegistryPostProcessors
postProcessBeanDefinitionRegistry
System.identityHashCode
processConfigBeanDefinitions
getBeanDefinitionNames
configCandidates
new ConfigurationClassParser
candidates
alreadyParsed
parser.parse
parse
getBeanDefinition()
instanceof AnnotatedBeanDefinition
processConfigurationClass
doProcessConfigurationClass
isAnnotated
attributesForRepeatable
getAnnotationAttributes
!componentScans.isEmpty()
ClassPathBeanDefinitionScanner
scopedProxyMode
ScopeMetadataResolver
setResourcePattern
typeFilter
lazyInit
addExcludeFilter
doScan
basePackages
findCandidateComponents
scanCandidateComponents
packageSearchPath
getResourcePatternResolver().getResources
Resource resource : resources
resource.isReadable()
getMetadataReader
new ScannedGenericBeanDefinition(metadataReader)
return candidates
processImports
retrieveBeanMethodMetadata
processInterfaces
validate
loadBeanDefinitions
loadBeanDefinitionsForConfigurationClass
loadBeanDefinitionsFromImportedResources
loadBeanDefinitionsFromRegistrars
registerBeanDefinitions
beandefinitionregistrypostprocessor
registerBeanPostProcessors()
registerBeanPostProcessors
getBeanNamesForType
BeanPostProcessorChecker
beanFactory.getBean
initMessageSource()
initApplicationEventMulticaster()
onRefresh()
registerListeners()
finishBeanFactoryInitialization()
preInstantiateSingletons
getBean
doGetBean
transformedBeanName
getSingleton
getObjectForBeanInstance
getParentBeanFactory()
getDependsOn()
mbd.isSingleton()
beforeSingletonCreation
singletonFactory.getObject()
createBean
resolveBeforeInstantiation
doCreateBean
createBeanInstance
determineConstructorsFromBeanPostProcessors
applyMergedBeanDefinitionPostProcessors
addSingletonFactory
populateBean
ibp.postProcessAfterInstantiation
mbd.getResolvedAutowireMode()
ibp.postProcessProperties
findAutowiringMetadata
inject
elementsToIterate
(Field) this.member
resolveDependency
doResolveDependency
getDependencyType()
findAutowireCandidates
resolveCandidate
field.set()
applyPropertyValues();
initializeBean
invokeAwareMethods
applyBeanPostProcessorsBeforeInitialization
invokeInitMethods
applyBeanPostProcessorsAfterInitialization
registerDisposableBeanIfNecessary
afterSingletonCreation
addSingleton
finishRefresh()
clearResourceCaches
initLifecycleProcessor
getLifecycleProcessor().onRefresh()
publishEvent
registerApplicationContext
destroyBeans()
getBeanFactory().destroySingletons();
destroySingleton
removeSingleton
disposableBeans.remove(beanName);
destroyBean
clearSingletonCache
cancelRefresh
resetCommonCaches
ReflectionUtils.clearCache()
AnnotationUtils.clearCache()
ResolvableType.clearCache()
cache.clear()
SerializableTypeWrapper.cache.clear()
CachedIntrospectionResults.clearClassLoader(getClassLoader())
AutowiredAnnotationBeanPostProcessor
determineCandidateConstructors
findAutowiredAnnotation
CommonAnnotationBeanPostProcessor
postProcessMergedBeanDefinition
resetBeanDefinition
postProcessAfterInstantiation
postProcessProperties
postProcessBeforeInstantiation
ConfigurationClassPostProcessor
ApplicationContextAwareProcessor
BeanPostProcessor
InstantiationAwareBeanPostProcessor
SmartInstantiationAwareBeanPostProcessor
InstantiationAwareBeanPostProcessorAdapter
ImportAwareBeanPostProcessor
PersistenceAnnotationBeanPostProcessor
MergedBeanDefinitionPostProcessor
InitDestroyAnnotationBeanPostProcessor
DestructionAwareBeanPostProcessor
0 条评论
回复 删除
下一页