In the sample code, I'm using a Spring ApplicationContext that ensures this is the case, because it automatically pre-instantiates all singleton beans.
在示例代码中,我用Spring的ApplicationContext确保了这种情况,因为它会自动地预先实例化所有单体bean。
Applications can avoid this by utilizing the normal lifecycle notices they receive from the WebSphere container to explicitly call close on the ApplicationContext.
应用程序可以避免这一点,方法是利用从WebSphere容器接收的常规生命周期通知来显式调用ApplicationContext上的关闭。
A Spring object (ApplicationContext or BeanFactory) can use this configuration file to create the beans, inject the dependencies and many other things not shown here.
Spring对象(ApplicationContext或BeanFactory)可以使用此配置文件来创建Bean,注入依赖项,以及执行许多其他此处未显示的操作。
As you can see, the code for the Spring-based implementation, basically USES ApplicationContext to initialize the Spring components and retrieve the beans to be used.
正如您所看到的,基于Spring的实现的代码主要使用ApplicationContext来初始化spring组件和检索要使用的bean。