本文共 8490 字,大约阅读时间需要 28 分钟。
package com.spring.study;import org.springframework.context.support.ClassPathXmlApplicationContext;public class StudyClient { public static void main(String[] args){ ClassPathXmlApplicationContext classPathXmlApplicationContext = new ClassPathXmlApplicationContext("classpath:spring.xml"); }}
package com.spring.study;public class StudyService { public StudyService(){ System.out.println("initialize study service"); } private StudyDao studyDao; public void setStudyDao(StudyDao studyDao){ this.studyDao = studyDao; } public void invokeStudyDao(){ studyDao.invoke(); }}
StudyDao
package com.spring.study;public class StudyDao { public StudyDao(){ System.out.println("initialized study dao"); } public void invoke(){ System.out.println("StudyDao was invoked"); }}
14:26:26.139 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating instance of bean ‘studyDao’
initialized study dao 14:26:26.149 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Eagerly caching bean ‘studyDao’ to allow for resolving potential circular references 14:26:26.150 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Finished creating instance of bean ‘studyDao’ 14:26:26.151 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean ‘studyService’ 14:26:26.151 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating instance of bean ‘studyService’ initialize study servicepackage com.spring.study;
public class StudyLazyInit {
public StudyLazyInit(){ System.out.println("is StudyLazyInit init?");}public void init(){ System.out.println("StudyLazyInit is initialize");}
}
[org.springframework.context.support.DelegatingMessageSource@e320068]
14:46:08.108 [main] DEBUG org.springframework.context.support.ClassPathXmlApplicationContext - Unable to locate ApplicationEventMulticaster with name ‘applicationEventMulticaster’: using default [org.springframework.context.event.SimpleApplicationEventMulticaster@34cd072c] 14:46:08.109 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@a67c67e: defining beans [studyService,studyDao,studyLazyInit]; root of factory hierarchy 14:46:08.110 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean ‘studyService’ 14:46:08.110 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating instance of bean ‘studyService’ initialize study service 14:46:08.119 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Eagerly caching bean ‘studyService’ to allow for resolving potential circular references 14:46:08.120 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean ‘studyDao’ 14:46:08.120 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating instance of bean ‘studyDao’ initialized study dao 14:46:08.121 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Eagerly caching bean ‘studyDao’ to allow for resolving potential circular references 14:46:08.121 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Finished creating instance of bean ‘studyDao’ 14:46:08.161 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Finished creating instance of bean ‘studyService’ 14:46:08.161 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Returning cached instance of singleton bean ‘studyDao’ 14:46:08.162 [main] DEBUG org.springframework.context.support.ClassPathXmlApplicationContext - Unable to locate LifecycleProcessor with name ‘lifecycleProcessor’: using default [org.springframework.context.support.DefaultLifecycleProcessor@4d1b0d2a] 14:46:08.162 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Returning cached instance of singleton bean ‘lifecycleProcessor’ 14:46:08.165 [main] DEBUG org.springframework.core.env.PropertySourcesPropertyResolver - Could not find key ‘spring.liveBeansView.mbeanDomain’ in any property sourceProcess finished with exit code 0
14:58:13.816 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@a67c67e: defining beans [studyService,studyDao,studyLazyInit]; root of factory hierarchy
14:58:13.817 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean ‘studyService’ 14:58:13.817 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating instance of bean ‘studyService’ initialize study service 14:58:13.827 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Eagerly caching bean ‘studyService’ to allow for resolving potential circular references 14:58:13.828 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean ‘studyDao’ 14:58:13.828 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating instance of bean ‘studyDao’ initialized study dao 14:58:13.829 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Eagerly caching bean ‘studyDao’ to allow for resolving potential circular references 14:58:13.830 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Finished creating instance of bean ‘studyDao’ 14:58:13.888 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Finished creating instance of bean ‘studyService’ 14:58:13.888 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Returning cached instance of singleton bean ‘studyDao’ 14:58:13.888 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating shared instance of singleton bean ‘studyLazyInit’ 14:58:13.888 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Creating instance of bean ‘studyLazyInit’ is StudyLazyInit init? 14:58:13.888 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Eagerly caching bean ‘studyLazyInit’ to allow for resolving potential circular references 14:58:13.888 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Finished creating instance of bean ‘studyLazyInit’ 14:58:13.889 [main] DEBUG org.springframework.context.support.ClassPathXmlApplicationContext - Unable to locate LifecycleProcessor with name ‘lifecycleProcessor’: using default [org.springframework.context.support.DefaultLifecycleProcessor@4d1b0d2a] 14:58:13.889 [main] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Returning cached instance of singleton bean ‘lifecycleProcessor’ 14:58:13.892 [main] DEBUG org.springframework.core.env.PropertySourcesPropertyResolver - Could not find key ‘spring.liveBeansView.mbeanDomain’ in any property sourceProcess finished with exit code 0
转载地址:http://xusoi.baihongyu.com/