Skip to content

Conversation

@alaneuler
Copy link
Contributor

fix: #667

application.setAppName(appName);

Map<String, SofaRuntimeManager> sofaRuntimeManagers = applicationContext
.getBeansOfType(SofaRuntimeManager.class);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

为何不使用org.springframework.beans.factory.BeanFactory#getBean(java.lang.Class), 该方法抛出的异常包含了各类场景

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这一块主要是新增的逻辑。。。不知道有什么异常情况,尽量不影响之前的启动逻辑

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

在这个类中SofaRuntimeManager获取有问题肯定是有异常原因导致的,应该直接抛出spring的异常阻止应用启动,而不是打印error日志

*
* @author khotyn Created on 2020/10/26
*/
public class SpringComponent extends AbstractComponent {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

叫SpringContextComponent是否好一点,不然以为是spring bean的component

Copy link
Contributor

@HzjNeverStop HzjNeverStop left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@alaneuler alaneuler merged commit 72fc751 into sofastack:master Oct 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Provide a standard way to obtain all application context when using isle

2 participants