spring 面试题

1.springboot自动装配

从 这个META-INF/spring-autoconfigure-metadata.properties加载文件

2.springbean 的生命周期

3.spring 如何解绝循环依赖

java 复制代码
private final Map<String, Object> earlySingletonObjects = new ConcurrentHashMap<>(16);
private final Map<String, Object> singletonObjects = new ConcurrentHashMap<>(256);
private final Map<String, ObjectFactory<?>> singletonFactories = new HashMap<>(16);

synchronized (this.singletonObjects) {
			Object singletonObject = this.singletonObjects.get(beanName);
			if (singletonObject == null) {
				beforeSingletonCreation(beanName);
				try {
					singletonObject = singletonFactory.getObject();
					newSingleton = true;
				}
				catch (IllegalStateException ex) {
					singletonObject = this.singletonObjects.get(beanName);

				}
				finally {
					afterSingletonCreation(beanName);
				}
				if (newSingleton) {
					addSingleton(beanName, singletonObject);
				}
			}
			return singletonObject;
		}
  1. spring cloud zuul 的类型

forward SendForwardFilter,SimpleHostRoutingFilter

pre PreDecorationFilter,FormBodyWrapperFilter,DebugFilter

post LocationRewriteFilter,SendErrorFilter,SendResponseFilter

5.spring cloud 的 eureka 的负载保护

相关推荐
Coder_Boy_3 分钟前
基于SpringAI企业级智能教学考试平台核心模块协同总结与最佳实践方案
java·大数据·人工智能
崎岖Qiu4 分钟前
【设计模式笔记23】:长文解析-深刻理解「装饰器模式」
java·笔记·设计模式·装饰器模式
bigHead-4 分钟前
前端双屏显示与通信
开发语言·前端·javascript
richxu202510019 分钟前
Java是当今最优雅的开发语言
java·开发语言
2501_918126919 分钟前
用Python开发一个三进制程序开发工具
开发语言·汇编·python·个人开发
顾安r10 分钟前
1.1 脚本网页 战推棋
java·前端·游戏·html·virtualenv
yuuki23323313 分钟前
【C++】揭秘STL:stack与queue的底层实现
java·c++·windows
weixin_4250230025 分钟前
Java开发高频实用技巧汇总(List操作/多线程/反射/监控等)
java·windows·list
zh_xuan25 分钟前
kotlin的常见空检查
android·开发语言·kotlin