国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

spring啟動(dòng)流程 (1) 流程概覽

這篇具有很好參考價(jià)值的文章主要介紹了spring啟動(dòng)流程 (1) 流程概覽。希望對(duì)大家有所幫助。如果存在錯(cuò)誤或未考慮完全的地方,請(qǐng)大家不吝賜教,您也可以點(diǎn)擊"舉報(bào)違法"按鈕提交疑問。

本文將通過閱讀AnnotationConfigApplicationContext源碼,分析Spring啟動(dòng)流程。

創(chuàng)建AnnotationConfigApplicationContext

AnnotationConfigApplicationContext applicationContext = new AnnotationConfigApplicationContext();
applicationContext.register(XxConfig.class);
applicationContext.register(YyConfig.class);
applicationContext.refresh();

XxService xxService = applicationContext.getBean(XxService.class);

核心的啟動(dòng)邏輯都在refresh方法中。

構(gòu)造方法

public AnnotationConfigApplicationContext() {
	this.reader = new AnnotatedBeanDefinitionReader(this);
	this.scanner = new ClassPathBeanDefinitionScanner(this);
}

AnnotatedBeanDefinitionReader類

定義了多個(gè)register方法,用于向Spring容器注冊(cè)BeanDefinition。

在創(chuàng)建AnnotatedBeanDefinitionReader時(shí),會(huì)向容器注冊(cè)幾個(gè)注解驅(qū)動(dòng)處理器:

  • org.springframework.context.annotation.internalConfigurationAnnotationProcessor: ConfigurationClassPostProcessor
    • BeanFactoryPostProcessor實(shí)現(xiàn),用于解析@Configuration類。
    • 按優(yōu)先級(jí)排序,因?yàn)樵贎Configuration類中聲明的任何@Bean方法都必須在任何其他BeanFactoryPostProcessor執(zhí)行之前注冊(cè)其對(duì)應(yīng)的BeanDefinition。
  • org.springframework.context.annotation.internalAutowiredAnnotationProcessor: AutowiredAnnotationBeanPostProcessor
    • BeanPostProcessor實(shí)現(xiàn)類。
    • @Autowired支持處理器。
  • org.springframework.context.annotation.internalCommonAnnotationProcessor: CommonAnnotationBeanPostProcessor
    • BeanPostProcessor實(shí)現(xiàn)類。
    • 支持Resource、PostConstruct、PreDestroy等注解。
  • org.springframework.context.event.internalEventListenerProcessor: EventListenerMethodProcessor
  • org.springframework.context.event.internalEventListenerFactory: DefaultEventListenerFactory

ClassPathBeanDefinitionScanner類

BeanDefinition掃描器,在類路徑上檢測(cè)Bean,并將其注冊(cè)到Spring容器中。掃描的類是通過類型過濾器檢測(cè)到的。

refresh方法

public void refresh() throws BeansException, IllegalStateException {
	synchronized (this.startupShutdownMonitor) {
		// Prepare this context for refreshing.
		prepareRefresh();

		// Tell the subclass to refresh the internal bean factory.
		ConfigurableListableBeanFactory beanFactory = obtainFreshBeanFactory();

		// Prepare the bean factory for use in this context.
		prepareBeanFactory(beanFactory);

		try {
			// Allows post-processing of the bean factory in context subclasses.
			postProcessBeanFactory(beanFactory);

			// Invoke factory processors registered as beans in the context.
			invokeBeanFactoryPostProcessors(beanFactory);

			// Register bean processors that intercept bean creation.
			registerBeanPostProcessors(beanFactory);

			// Initialize message source for this context.
			initMessageSource();

			// Initialize event multicaster for this context.
			initApplicationEventMulticaster();

			// Initialize other special beans in specific context subclasses.
			onRefresh();

			// Check for listener beans and register them.
			registerListeners();

			// Instantiate all remaining (non-lazy-init) singletons.
			finishBeanFactoryInitialization(beanFactory);

			// Last step: publish corresponding event.
			finishRefresh();
		} catch (BeansException ex) {

			// Destroy already created singletons to avoid dangling resources.
			destroyBeans();

			// Reset 'active' flag.
			cancelRefresh(ex);

			// Propagate exception to caller.
			throw ex;
		} finally {
			// Reset common introspection caches in Spring's core, since we
			// might not ever need metadata for singleton beans anymore...
			resetCommonCaches();
		}
	}
}

prepareRefresh方法

Prepare this context for refreshing, setting its startup date and active flag as well as performing any initialization of property sources.

protected void prepareRefresh() {
	// Switch to active.
	this.startupDate = System.currentTimeMillis();
	this.closed.set(false);
	this.active.set(true);

	// Initialize any placeholder property sources in the context environment.
	// Replace any stub property sources with actual instances.
	// web相關(guān)的ApplicationContext有實(shí)現(xiàn)
	initPropertySources();

	// Validate that all properties marked as required are resolvable:
	// see ConfigurablePropertyResolver#setRequiredProperties
	getEnvironment().validateRequiredProperties();

	// Store pre-refresh ApplicationListeners...
	if (this.earlyApplicationListeners == null) {
		this.earlyApplicationListeners = new LinkedHashSet<>(this.applicationListeners);
	} else {
		// Reset local application listeners to pre-refresh state.
		this.applicationListeners.clear();
		this.applicationListeners.addAll(this.earlyApplicationListeners);
	}

	// Allow for the collection of early ApplicationEvents,
	// to be published once the multicaster is available...
	this.earlyApplicationEvents = new LinkedHashSet<>();
}

obtainFreshBeanFactory方法

Tell the subclass to refresh the internal bean factory.

protected ConfigurableListableBeanFactory obtainFreshBeanFactory() {
	refreshBeanFactory();
	return getBeanFactory();
}

由于AnnotationConfigApplicationContext繼承了GenericApplicationContext類,所以此處獲取到的是DefaultListableBeanFactory對(duì)象。

prepareBeanFactory方法

配置BeanFactory的標(biāo)準(zhǔn)上下文,例如上下文的ClassLoader和后置處理器。

protected void prepareBeanFactory(ConfigurableListableBeanFactory beanFactory) {
	// Tell the internal bean factory to use the context's class loader etc.
	beanFactory.setBeanClassLoader(getClassLoader());

	// Standard implementation of the BeanExpressionResolver interface,
	// parsing and evaluating Spring EL using Spring's expression module.
	beanFactory.setBeanExpressionResolver(
        new StandardBeanExpressionResolver(beanFactory.getBeanClassLoader()));
	beanFactory.addPropertyEditorRegistrar(new ResourceEditorRegistrar(this, getEnvironment()));

	// Configure the bean factory with context callbacks.
	// 支持EnvironmentAware, MessageSourceAware, ApplicationContextAware等
	beanFactory.addBeanPostProcessor(new ApplicationContextAwareProcessor(this));
	beanFactory.ignoreDependencyInterface(EnvironmentAware.class);
	beanFactory.ignoreDependencyInterface(EmbeddedValueResolverAware.class);
	beanFactory.ignoreDependencyInterface(ResourceLoaderAware.class);
	beanFactory.ignoreDependencyInterface(ApplicationEventPublisherAware.class);
	beanFactory.ignoreDependencyInterface(MessageSourceAware.class);
	beanFactory.ignoreDependencyInterface(ApplicationContextAware.class);

	// BeanFactory interface not registered as resolvable type in a plain factory.
	// MessageSource registered (and found for autowiring) as a bean.
	beanFactory.registerResolvableDependency(BeanFactory.class, beanFactory);
	beanFactory.registerResolvableDependency(ResourceLoader.class, this);
	beanFactory.registerResolvableDependency(ApplicationEventPublisher.class, this);
	beanFactory.registerResolvableDependency(ApplicationContext.class, this);

	// ApplicationListenerDetector處理器自動(dòng)將ApplicationListener類型Bean添加容器
	beanFactory.addBeanPostProcessor(new ApplicationListenerDetector(this));

	// Detect a LoadTimeWeaver and prepare for weaving, if found.
	if (beanFactory.containsBean(LOAD_TIME_WEAVER_BEAN_NAME)) {
		beanFactory.addBeanPostProcessor(new LoadTimeWeaverAwareProcessor(beanFactory));
		// Set a temporary ClassLoader for type matching.
		beanFactory.setTempClassLoader(new ContextTypeMatchClassLoader(beanFactory.getBeanClassLoader()));
	}

	// 注冊(cè)env bean
	if (!beanFactory.containsLocalBean(ENVIRONMENT_BEAN_NAME)) {
		beanFactory.registerSingleton(ENVIRONMENT_BEAN_NAME, getEnvironment());
	}
	if (!beanFactory.containsLocalBean(SYSTEM_PROPERTIES_BEAN_NAME)) {
		beanFactory.registerSingleton(SYSTEM_PROPERTIES_BEAN_NAME, getEnvironment().getSystemProperties());
	}
	if (!beanFactory.containsLocalBean(SYSTEM_ENVIRONMENT_BEAN_NAME)) {
		beanFactory
            .registerSingleton(SYSTEM_ENVIRONMENT_BEAN_NAME, getEnvironment().getSystemEnvironment());
	}
}

postProcessBeanFactory方法

Modify the application context's internal bean factory after its standard initialization. All bean definitions will have been loaded, but no beans will have been instantiated yet. This allows for registering special BeanPostProcessors etc in certain ApplicationContext implementations.

在標(biāo)準(zhǔn)初始化之后修改ApplicationContext的內(nèi)部bean工廠。所有的BeanDefinition都將被加載,但還沒有任何Bean被實(shí)例化。這允許在某些ApplicationContext實(shí)現(xiàn)中注冊(cè)特殊的BeanPostProcessors等。

invokeBeanFactoryPostProcessors方法

實(shí)例化并調(diào)用注冊(cè)的所有BeanFactoryPostProcessor,如果指定順序則按照順序調(diào)用,必須在單例實(shí)例化之前調(diào)用。

protected void invokeBeanFactoryPostProcessors(ConfigurableListableBeanFactory beanFactory) {
	// 調(diào)用BeanFactoryPostProcessors
	PostProcessorRegistrationDelegate
        .invokeBeanFactoryPostProcessors(beanFactory, getBeanFactoryPostProcessors());

	// Detect a LoadTimeWeaver and prepare for weaving, if found in the meantime
	// (e.g. through an @Bean method registered by ConfigurationClassPostProcessor)
	if (beanFactory.getTempClassLoader() == null && beanFactory.containsBean(LOAD_TIME_WEAVER_BEAN_NAME)) {
		beanFactory.addBeanPostProcessor(new LoadTimeWeaverAwareProcessor(beanFactory));
		beanFactory.setTempClassLoader(new ContextTypeMatchClassLoader(beanFactory.getBeanClassLoader()));
	}
}

調(diào)用BeanFactoryPostProcessor和BeanDefinitionRegistryPostProcessor。

registerBeanPostProcessors方法

實(shí)例化并注冊(cè)所有BeanPostProcessor,如果指定順序則按照順序注冊(cè),必須在應(yīng)用Bean實(shí)例化之前調(diào)用。

protected void registerBeanPostProcessors(ConfigurableListableBeanFactory beanFactory) {
	PostProcessorRegistrationDelegate.registerBeanPostProcessors(beanFactory, this);
}

把BeanPostProcessor實(shí)例添加到beanPostProcessors中:

  1. 從容器獲取所有的BeanPostProcessor Bean
  2. 按照以下順序注冊(cè):實(shí)現(xiàn)了PriorityOrdered接口、實(shí)現(xiàn)了Ordered接口、普通BeanPostProcessor、實(shí)現(xiàn)MergedBeanDefinitionPostProcessor接口
private static void registerBeanPostProcessors(
		ConfigurableListableBeanFactory beanFactory, List<BeanPostProcessor> postProcessors) {

	for (BeanPostProcessor postProcessor : postProcessors) {
		beanFactory.addBeanPostProcessor(postProcessor);
	}
}

initMessageSource方法

國(guó)際化。

protected void initMessageSource() {
	ConfigurableListableBeanFactory beanFactory = getBeanFactory();
	if (beanFactory.containsLocalBean(MESSAGE_SOURCE_BEAN_NAME)) {
		this.messageSource = beanFactory.getBean(MESSAGE_SOURCE_BEAN_NAME, MessageSource.class);
		// Make MessageSource aware of parent MessageSource.
		if (this.parent != null && this.messageSource instanceof HierarchicalMessageSource) {
			HierarchicalMessageSource hms = (HierarchicalMessageSource) this.messageSource;
			if (hms.getParentMessageSource() == null) {
				// Only set parent context as parent MessageSource if no parent MessageSource
				// registered already.
				hms.setParentMessageSource(getInternalParentMessageSource());
			}
		}
	} else {
		// Use empty MessageSource to be able to accept getMessage calls.
		DelegatingMessageSource dms = new DelegatingMessageSource();
		dms.setParentMessageSource(getInternalParentMessageSource());
		this.messageSource = dms;
		beanFactory.registerSingleton(MESSAGE_SOURCE_BEAN_NAME, this.messageSource);
	}
}

initApplicationEventMulticaster方法

初始化ApplicationEventMultimaster,如果Context中未定義,則使用SimpleApplicationEventMultimaster。

protected void initApplicationEventMulticaster() {
	ConfigurableListableBeanFactory beanFactory = getBeanFactory();
	if (beanFactory.containsLocalBean(APPLICATION_EVENT_MULTICASTER_BEAN_NAME)) {
		this.applicationEventMulticaster = beanFactory.getBean(
            APPLICATION_EVENT_MULTICASTER_BEAN_NAME, ApplicationEventMulticaster.class);
	} else {
		this.applicationEventMulticaster = new SimpleApplicationEventMulticaster(beanFactory);
		beanFactory.registerSingleton(
            APPLICATION_EVENT_MULTICASTER_BEAN_NAME, this.applicationEventMulticaster);
	}
}

onRefresh方法

可以重寫的模板方法,以添加指定的刷新邏輯。在初始化特殊Bean時(shí)調(diào)用,在實(shí)例化單例之前調(diào)用。

默認(rèn)什么都不做。

SpringBoot中的ServletWebServerApplicationContext實(shí)現(xiàn)類在這個(gè)階段創(chuàng)建WebServer。

registerListeners方法

添加實(shí)現(xiàn)ApplicationListener的Bean作為偵聽器。不會(huì)影響其他偵聽器,這些偵聽器可以在不使用Bean的情況下添加。

finishBeanFactoryInitialization方法

完成Bean工廠的初始化,初始化所有剩余的單例Bean。

protected void finishBeanFactoryInitialization(ConfigurableListableBeanFactory beanFactory) {
	// Initialize conversion service for this context.
	if (beanFactory.containsBean(CONVERSION_SERVICE_BEAN_NAME) &&
			beanFactory.isTypeMatch(CONVERSION_SERVICE_BEAN_NAME, ConversionService.class)) {
		beanFactory.setConversionService(
				beanFactory.getBean(CONVERSION_SERVICE_BEAN_NAME, ConversionService.class));
	}

	// Register a default embedded value resolver if no bean post-processor
	// (such as a PropertyPlaceholderConfigurer bean) registered any before:
	// at this point, primarily for resolution in annotation attribute values.
	if (!beanFactory.hasEmbeddedValueResolver()) {
		beanFactory.addEmbeddedValueResolver(strVal -> getEnvironment().resolvePlaceholders(strVal));
	}

	// Initialize LoadTimeWeaverAware beans early to allow for registering their transformers early.
	String[] weaverAwareNames = beanFactory.getBeanNamesForType(LoadTimeWeaverAware.class, false, false);
	for (String weaverAwareName : weaverAwareNames) {
		getBean(weaverAwareName);
	}

	// Stop using the temporary ClassLoader for type matching.
	beanFactory.setTempClassLoader(null);

	// Allow for caching all bean definition metadata, not expecting further changes.
	beanFactory.freezeConfiguration();

	// Instantiate all remaining (non-lazy-init) singletons.
	beanFactory.preInstantiateSingletons();
}

finishRefresh方法

完成刷新工作,調(diào)用LifecycleProcessor的onRefresh()方法并發(fā)布ContextRefreshedEvent事件。文章來源地址http://www.zghlxwxcb.cn/news/detail-500951.html

protected void finishRefresh() {
	// Clear context-level resource caches (such as ASM metadata from scanning).
	clearResourceCaches();

	// Initialize lifecycle processor for this context.
	initLifecycleProcessor();

	// Propagate refresh to lifecycle processor first.
	getLifecycleProcessor().onRefresh();

	// Publish the final event.
	publishEvent(new ContextRefreshedEvent(this));

	// Participate in LiveBeansView MBean, if active.
	LiveBeansView.registerApplicationContext(this);
}

啟動(dòng)流程

  1. 創(chuàng)建AnnotationConfigApplicationContext對(duì)象
    • 創(chuàng)建AnnotatedBeanDefinitionReader和ClassPathBeanDefinitionScanner
    • 向容器注冊(cè)幾個(gè)注解驅(qū)動(dòng)處理器:ConfigurationClassPostProcessor, AutowiredAnnotationBeanPostProcessor, CommonAnnotationBeanPostProcessor等
  2. 調(diào)用applicationContext.register(XxConfig.class)注冊(cè)配置類
  3. 調(diào)用refresh()方法:
    • prepareRefresh方法準(zhǔn)備工作:初始化PropertySources、validateRequiredProperties等
    • Refresh the internal beanFactory
    • 配置BeanFactory的標(biāo)準(zhǔn)上下文,例如上下文的ClassLoader和后置處理器
    • 實(shí)例化并調(diào)用注冊(cè)的所有BeanFactoryPostProcessor,如果指定順序則按照順序調(diào)用,必須在單例實(shí)例化之前調(diào)用
    • 實(shí)例化并注冊(cè)所有BeanPostProcessor,如果指定順序則按照順序注冊(cè),必須在應(yīng)用Bean實(shí)例化之前調(diào)用
    • 初始化MessageSource
    • 初始化ApplicationEventMultimaster,如果Context中未定義,則使用SimpleApplicationEventMultimaster
    • onRefresh方法,SpringBoot中的ServletWebServerApplicationContext實(shí)現(xiàn)類在這個(gè)階段創(chuàng)建WebServer
    • 添加實(shí)現(xiàn)ApplicationListener的Bean作為偵聽器
    • 完成Bean工廠的初始化,初始化所有剩余的單例Bean
    • 完成刷新工作,調(diào)用LifecycleProcessor的onRefresh()方法并發(fā)布ContextRefreshedEvent事件

到了這里,關(guān)于spring啟動(dòng)流程 (1) 流程概覽的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來自互聯(lián)網(wǎng)用戶投稿,該文觀點(diǎn)僅代表作者本人,不代表本站立場(chǎng)。本站僅提供信息存儲(chǔ)空間服務(wù),不擁有所有權(quán),不承擔(dān)相關(guān)法律責(zé)任。如若轉(zhuǎn)載,請(qǐng)注明出處: 如若內(nèi)容造成侵權(quán)/違法違規(guī)/事實(shí)不符,請(qǐng)點(diǎn)擊違法舉報(bào)進(jìn)行投訴反饋,一經(jīng)查實(shí),立即刪除!

領(lǐng)支付寶紅包贊助服務(wù)器費(fèi)用

相關(guān)文章

  • spring啟動(dòng)流程 (2) Bean實(shí)例化流程

    本文通過閱讀Spring源碼,分析Bean實(shí)例化流程。 上一篇文章已經(jīng)介紹,Bean實(shí)例化入口在AbstractApplicationContext類的finishBeanFactoryInitialization方法: 返回指定beanName的(原始)單例對(duì)象,如果沒有則創(chuàng)建一個(gè)新對(duì)象: 創(chuàng)建Bean實(shí)例、填充屬性、調(diào)用后置處理器等:

    2024年02月11日
    瀏覽(28)
  • Spring Boot 啟動(dòng)流程

    加載配置 Spring Boot在啟動(dòng)時(shí)會(huì)加載應(yīng)用程序的配置文件(例如application.properties或application.yml),并將其轉(zhuǎn)化為內(nèi)部的配置對(duì)象。 創(chuàng)建應(yīng)用程序上下文 Spring Boot會(huì)創(chuàng)建一個(gè)應(yīng)用程序上下文(ApplicationContext),它是Spring框架的核心容器。應(yīng)用程序上下文負(fù)責(zé)管理Bean的生命周期和

    2024年02月06日
    瀏覽(33)
  • Spring Boot的啟動(dòng)流程

    Spring Boot是作為Spring的腳手架框架,其本身并不提供Spring的核心功能,而是來達(dá)到快速構(gòu)建項(xiàng)目、預(yù)置三方配置、開箱即用的目的 。 從本質(zhì)上來說,Spring Boot就是Spring,它做了那些沒有它你自己也會(huì)去做的Spring Bean配置。 Spring Boot使用“習(xí)慣優(yōu)于配置”的理念讓你的項(xiàng)目快速

    2024年02月02日
    瀏覽(23)
  • Spring Boot啟動(dòng)流程簡(jiǎn)析

    文章首發(fā)地址 可以穿件獨(dú)立的Spring應(yīng)用程序,可以創(chuàng)建可執(zhí)行的jars 內(nèi)嵌tomcat或jetty等Servlet容器 提供“入門”依賴項(xiàng),以簡(jiǎn)化構(gòu)建配置。盡可能自動(dòng)配置Spring和第三方庫(kù) 提供可用于生產(chǎn)的功能,例如指標(biāo)、運(yùn)行狀況檢查和外部化配置 了解基本的啟動(dòng)注解 AnnotationUtil.java,該

    2024年02月16日
    瀏覽(48)
  • spring啟動(dòng)流程 (5) Autowired原理

    BeanClass可以在構(gòu)造方法上標(biāo)注@Autowired注解,Spring在創(chuàng)建Bean實(shí)例時(shí)將自動(dòng)為其注入依賴參數(shù) Spring會(huì)優(yōu)先使用標(biāo)注@Autowired注解的構(gòu)造方法 當(dāng)一個(gè)構(gòu)造方法標(biāo)注了@Autowired注解且required=true時(shí),其余構(gòu)造方法不允許再標(biāo)注@Autowired注解 當(dāng)多個(gè)構(gòu)造方法標(biāo)注了@Autowired注解且required=fa

    2024年02月16日
    瀏覽(19)
  • spring啟動(dòng)流程 (4) FactoryBean詳解

    實(shí)現(xiàn)類對(duì)象將被用作創(chuàng)建Bean實(shí)例的工廠,即調(diào)用getObject()方法返回的對(duì)象才是真正要使用的Bean實(shí)例,而不是直接將FactoryBean對(duì)象作為暴露的Bean實(shí)例。 FactoryBeans可以支持singleton和prototype,并且可以根據(jù)需要懶加載或在啟動(dòng)時(shí)立即創(chuàng)建對(duì)象。 這個(gè)接口在編寫掃描接口生成代理對(duì)

    2024年02月13日
    瀏覽(24)
  • spring啟動(dòng)流程 (3) BeanDefinition詳解

    spring啟動(dòng)流程 (3) BeanDefinition詳解

    BeanDefinition在Spring初始化階段保存Bean的元數(shù)據(jù)信息,包括Class名稱、Scope、構(gòu)造方法參數(shù)、屬性值等信息,本文將介紹一下BeanDefinition接口、重要的實(shí)現(xiàn)類,以及在Spring中的使用示例。 用于描述了一個(gè)Bean實(shí)例,該Bean實(shí)例具有屬性、構(gòu)造方法參數(shù)以及由具體實(shí)現(xiàn)提供的其他信息

    2024年02月12日
    瀏覽(16)
  • 【JAVA面試】Spring容器的啟動(dòng)流程

    提示:文章先作為初版,等后續(xù)時(shí)間充足后,補(bǔ)充更深的內(nèi)容 當(dāng)啟動(dòng)Spring容器時(shí),會(huì)按照以下步驟進(jìn)行: 掃描并注冊(cè)Bean定義 :Spring容器會(huì)掃描指定的包或目錄,查找?guī)в?特定注解(如@Component、@Service、@Repository等)的類。它會(huì)創(chuàng)建對(duì)應(yīng)的BeanDefinition對(duì)象 ,包含了Bean的元數(shù)

    2024年02月03日
    瀏覽(19)
  • 三分鐘了解Spring Boot 的啟動(dòng)流程

    三分鐘了解Spring Boot 的啟動(dòng)流程

    ??作者簡(jiǎn)介:大家好,我是冰點(diǎn),從業(yè)11年,目前在物流獨(dú)角獸企業(yè)從事技術(shù)方面工作, ??博主正在努力完成2023計(jì)劃中:以夢(mèng)為馬,揚(yáng)帆起航,2023追夢(mèng)人 ??聯(lián)系方式:iceicepip,加我進(jìn)群,大家一起學(xué)習(xí),一起進(jìn)步?? 背景:最近有位開發(fā)同學(xué)說面試被問到Spring Boot 的啟動(dòng)

    2024年02月08日
    瀏覽(18)
  • 全網(wǎng)最清楚的:Spring Boot 啟動(dòng)流程講解

    Spring Boot 啟動(dòng)流程 簡(jiǎn)介 步驟 加載配置 創(chuàng)建應(yīng)用程序上下文 執(zhí)行自動(dòng)配置 啟動(dòng)應(yīng)用程序 處理請(qǐng)求 源碼層說明 擴(kuò)展 自定義注解以及自定義注解實(shí)現(xiàn)中有bean,與啟動(dòng)流程什么有關(guān) Bean掃描 注解處理 Spring Boot 的啟動(dòng)流程 充分利用了 Spring 框架的強(qiáng)大功能,同時(shí)又為開發(fā)者提供

    2024年02月07日
    瀏覽(19)

覺得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請(qǐng)作者喝杯咖啡吧~博客贊助

支付寶掃一掃領(lǐng)取紅包,優(yōu)惠每天領(lǐng)

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包