1. spring只管理作用域为simleton的bean,对于作用域为prototype的bean,容器只负责创建,容器不再跟踪其生命周期。
2.容器创建了的时候,simpleton的bean会被创建,并且注入完成之后会调用init-method中指定的方法。生命周期开始。当容器关闭的时候,这些bean会被销毁,生命周期借宿,并且在销毁之前,会调用init-destory指定的方法。
1. spring只管理作用域为simleton的bean,对于作用域为prototype的bean,容器只负责创建,容器不再跟踪其生命周期。
2.容器创建了的时候,simpleton的bean会被创建,并且注入完成之后会调用init-method中指定的方法。生命周期开始。当容器关闭的时候,这些bean会被销毁,生命周期借宿,并且在销毁之前,会调用init-destory指定的方法。