[ 成为架构师系列 ] 5. Spring Bean 的生命周期 (the standard bean lifecycle)

[ 成为架构师系列 ] 5. Spring Bean 的生命周期

[ 成为架构师系列 ] 5. Spring Bean 的生命周期 (the standard bean lifecycle)_第1张图片

AbstractXmlApplicationContext

/*
 * Copyright 2002-2017 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.springframework.context.support;

import java.io.IOException;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
import org.springframework.beans.factory.xml.ResourceEntityResolver;
import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
import org.springframework.context.ApplicationContext;
import org.springframework.core.io.Resource;
import org.springframework.lang.Nullable;

/**
 * Convenient base class for {@link org.springframework.context.ApplicationContext}
 * implementations, drawing configuration from XML documents containing bean definitions
 * understood by an {@link org.springframework.beans.factory.xml.XmlBeanDefinitionReader}.
 *
 * 

Subclasses just have to implement the {@link #getConfigResources} and/or * the {@link #getConfigLocations} method. Furthermore, they might override * the {@link #getResourceByPath} hook to interpret relative paths in an * environment-specific fashion, and/or {@link #getResourcePatternResolver} * for extended pattern resolution. * * @author Rod Johnson * @author Juergen Hoeller * @see #getConfigResources * @see #getConfigLocations * @see org.springframework.beans.factory.xml.XmlBeanDefinitionReader */ public abstract class AbstractXmlApplicationContext extends AbstractRefreshableConfigApplicationContext { private boolean validating = true; /** * Create a new AbstractXmlApplicationContext with no parent. */ public AbstractXmlApplicationContext() { } /** * Create a new AbstractXmlApplicationContext with the given parent context. * @param parent the parent context */ public AbstractXmlApplicationContext(@Nullable ApplicationContext parent) { super(parent); } /** * Set whether to use XML validation. Default is {@code true}. */ public void setValidating(boolean validating) { this.validating = validating; } /** * Loads the bean definitions via an XmlBeanDefinitionReader. * @see org.springframework.beans.factory.xml.XmlBeanDefinitionReader * @see #initBeanDefinitionReader * @see #loadBeanDefinitions */ @Override protected void loadBeanDefinitions(DefaultListableBeanFactory beanFactory) throws BeansException, IOException { // Create a new XmlBeanDefinitionReader for the given BeanFactory. XmlBeanDefinitionReader beanDefinitionReader = new XmlBeanDefinitionReader(beanFactory); // Configure the bean definition reader with this context's // resource loading environment. beanDefinitionReader.setEnvironment(this.getEnvironment()); beanDefinitionReader.setResourceLoader(this); beanDefinitionReader.setEntityResolver(new ResourceEntityResolver(this)); // Allow a subclass to provide custom initialization of the reader, // then proceed with actually loading the bean definitions. initBeanDefinitionReader(beanDefinitionReader); loadBeanDefinitions(beanDefinitionReader); } /** * Initialize the bean definition reader used for loading the bean * definitions of this context. Default implementation is empty. *

Can be overridden in subclasses, e.g. for turning off XML validation * or using a different XmlBeanDefinitionParser implementation. * @param reader the bean definition reader used by this context * @see org.springframework.beans.factory.xml.XmlBeanDefinitionReader#setDocumentReaderClass */ protected void initBeanDefinitionReader(XmlBeanDefinitionReader reader) { reader.setValidating(this.validating); } /** * Load the bean definitions with the given XmlBeanDefinitionReader. *

The lifecycle of the bean factory is handled by the {@link #refreshBeanFactory} * method; hence this method is just supposed to load and/or register bean definitions. * @param reader the XmlBeanDefinitionReader to use * @throws BeansException in case of bean registration errors * @throws IOException if the required XML document isn't found * @see #refreshBeanFactory * @see #getConfigLocations * @see #getResources * @see #getResourcePatternResolver */ protected void loadBeanDefinitions(XmlBeanDefinitionReader reader) throws BeansException, IOException { Resource[] configResources = getConfigResources(); if (configResources != null) { reader.loadBeanDefinitions(configResources); } String[] configLocations = getConfigLocations(); if (configLocations != null) { reader.loadBeanDefinitions(configLocations); } } /** * Return an array of Resource objects, referring to the XML bean definition * files that this context should be built with. *

The default implementation returns {@code null}. Subclasses can override * this to provide pre-built Resource objects rather than location Strings. * @return an array of Resource objects, or {@code null} if none * @see #getConfigLocations() */ @Nullable protected Resource[] getConfigResources() { return null; } }

[ 成为架构师系列 ] 5. Spring Bean 的生命周期 (the standard bean lifecycle)_第2张图片
[ 成为架构师系列 ] 5. Spring Bean 的生命周期 (the standard bean lifecycle)_第3张图片

IDEA 自动生成类图 UML:

[ 成为架构师系列 ] 5. Spring Bean 的生命周期 (the standard bean lifecycle)_第4张图片

Alt + Shift + Command + U

[ 成为架构师系列 ] 5. Spring Bean 的生命周期 (the standard bean lifecycle)_第5张图片

Bean factory implementations should support the standard bean lifecycle interfaces as far as possible. The full set of initialization methods and their standard order is:

[ 成为架构师系列 ] 5. Spring Bean 的生命周期 (the standard bean lifecycle)_第6张图片

示例代码

    private static void withSpringApplicationContext() {
        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("beans.xml");
        HelloService helloService = (HelloService) applicationContext.getBean("helloService");

        System.out.println(applicationContext);
        System.out.println(helloService);

        String s1 = helloService.service1("Jack");
        String s2 = helloService.service2("Jobs");
        System.out.println(s1);
        System.out.println(s2);
    }

其中, HelloServiceImpl 代码如下:

package com.light.sword.service;

import com.alibaba.fastjson.JSON;
import com.light.sword.dao.HelloDao;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.*;
import org.springframework.context.*;
import org.springframework.core.env.Environment;
import org.springframework.core.io.ResourceLoader;
import org.springframework.core.io.support.ResourcePatternResolver;
import org.springframework.core.io.support.ResourcePatternUtils;
import org.springframework.util.StringValueResolver;

/**
 * @author: Jack
 * 2019-11-25 23:09
 */
public class HelloServiceImpl implements HelloService,
    BeanNameAware,
    BeanClassLoaderAware,
    BeanFactoryAware,
    EnvironmentAware,
    EmbeddedValueResolverAware,
    ResourceLoaderAware,
    ApplicationEventPublisherAware,
    MessageSourceAware,
    ApplicationContextAware {
    // 依赖注入的思想,就是把这句代码放到容器中单独管理,而不是写死在代码里.
    // private HelloDao helloDao = new HelloDaoImpl();
    private HelloDao helloDao;

    public HelloDao getHelloDao() {
        return helloDao;
    }

    public void setHelloDao(HelloDao helloDao) {
        this.helloDao = helloDao;
    }

    @Override
    public String service1(String name) {
        return helloDao.say(name);
    }

    @Override
    public String service2(String name) {
        return helloDao.say("$" + name);
    }

    /**
     * Callback that supplies the bean {@link ClassLoader class loader} to
     * a bean instance.
     * 

Invoked after the population of normal bean properties but * before an initialization callback such as * {@link InitializingBean InitializingBean's} * {@link InitializingBean#afterPropertiesSet()} * method or a custom init-method. * * @param classLoader the owning class loader */ @Override public void setBeanClassLoader(ClassLoader classLoader) { print("setBeanClassLoader"); printlnJson(classLoader); } /** * Callback that supplies the owning factory to a bean instance. *

Invoked after the population of normal bean properties * but before an initialization callback such as * {@link InitializingBean#afterPropertiesSet()} or a custom init-method. * * @param beanFactory owning BeanFactory (never {@code null}). * The bean can immediately call methods on the factory. * @throws BeansException in case of initialization errors * @see BeanInitializationException */ @Override public void setBeanFactory(BeanFactory beanFactory) throws BeansException { print("setBeanFactory:"); printlnJson(beanFactory); } /** * Set the name of the bean in the bean factory that created this bean. *

Invoked after population of normal bean properties but before an * init callback such as {@link InitializingBean#afterPropertiesSet()} * or a custom init-method. * * @param name the name of the bean in the factory. * Note that this name is the actual bean name used in the factory, which may * differ from the originally specified name: in particular for inner bean * names, the actual bean name might have been made unique through appending * "#..." suffixes. Use the {@link BeanFactoryUtils#originalBeanName(String)} * method to extract the original bean name (without suffix), if desired. */ @Override public void setBeanName(String name) { print("setBeanName:"); printlnJson(name); } /** * Set the ApplicationContext that this object runs in. * Normally this call will be used to initialize the object. *

Invoked after population of normal bean properties but before an init callback such * as {@link InitializingBean#afterPropertiesSet()} * or a custom init-method. Invoked after {@link ResourceLoaderAware#setResourceLoader}, * {@link ApplicationEventPublisherAware#setApplicationEventPublisher} and * {@link MessageSourceAware}, if applicable. * * @param applicationContext the ApplicationContext object to be used by this object * @throws ApplicationContextException in case of context initialization errors * @throws BeansException if thrown by application context methods * @see BeanInitializationException */ @Override public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { print("setApplicationContext:"); printlnJson(applicationContext); } /** * Set the ApplicationEventPublisher that this object runs in. *

Invoked after population of normal bean properties but before an init * callback like InitializingBean's afterPropertiesSet or a custom init-method. * Invoked before ApplicationContextAware's setApplicationContext. * * @param applicationEventPublisher event publisher to be used by this object */ @Override public void setApplicationEventPublisher(ApplicationEventPublisher applicationEventPublisher) { print("setApplicationEventPublisher:"); printlnJson(applicationEventPublisher); } /** * Set the StringValueResolver to use for resolving embedded definition values. * * @param resolver */ @Override public void setEmbeddedValueResolver(StringValueResolver resolver) { print("setEmbeddedValueResolver:"); printlnJson(resolver); } /** * Set the {@code Environment} that this component runs in. * * @param environment */ @Override public void setEnvironment(Environment environment) { print("setEnvironment:"); printlnJson(environment); } /** * Set the MessageSource that this object runs in. *

Invoked after population of normal bean properties but before an init * callback like InitializingBean's afterPropertiesSet or a custom init-method. * Invoked before ApplicationContextAware's setApplicationContext. * * @param messageSource message source to be used by this object */ @Override public void setMessageSource(MessageSource messageSource) { print("setMessageSource:"); printlnJson(messageSource); } /** * Set the ResourceLoader that this object runs in. *

This might be a ResourcePatternResolver, which can be checked * through {@code instanceof ResourcePatternResolver}. See also the * {@code ResourcePatternUtils.getResourcePatternResolver} method. *

Invoked after population of normal bean properties but before an init callback * like InitializingBean's {@code afterPropertiesSet} or a custom init-method. * Invoked before ApplicationContextAware's {@code setApplicationContext}. * * @param resourceLoader the ResourceLoader object to be used by this object * @see ResourcePatternResolver * @see ResourcePatternUtils#getResourcePatternResolver */ @Override public void setResourceLoader(ResourceLoader resourceLoader) { print("setResourceLoader:"); printlnJson(resourceLoader); } void print(Object obj) { System.out.print(obj); } void printlnJson(Object obj) { System.out.println(JSON.toJSONString(obj)); } }

运行日志:

setBeanName:"helloService"
setBeanClassLoader{"uRLs":["file:/Library/Java/JavaVirtualMachines/jdk1.8.0_40/Contents/Home/jre/lib/charsets.jar","file:/Library/Java/JavaVirtualMachines/jdk1.8.0_40/Contents/Home/jre/lib/deploy.jar","file:/Library/Java/JavaVirtualMachines/jdk1.8.0_40/Contents/Home/jre/lib/ext/cldrdata.jar","file:/Library/Java/JavaVirtualMachines/jdk1.8.0_40/Contents/Home/jre/lib/ext/dnsns.jar","file:/Library/Java/JavaVirtualMachines/jdk1.8.0_40/Contents/Home/jre/lib/ext/jfxrt.jar","file:/Library/Java/JavaVirtualMachines/jdk1.8.0_40/Contents/Home/jre/lib/ext/localedata.jar","file:/Library/Java/JavaVirtualMachines/jdk1.8.0_40/Contents/Home/jre/lib/ext/nashorn.jar","file:/Library/Java/JavaVirtualMachines/jdk1.8.0_40/Contents/Home/jre/lib/ext/sunec.jar","file:/Library/Java/JavaVirtualMachines/jdk1.8.0_40/Contents/Home/jre/lib/ext/sunjce_provider.jar","file:/Library/Java/JavaVirtualMachines/jdk1.8.0_40/Contents/Home/jre/lib/ext/sunpkcs11.jar","file:/Library/Java/JavaVirtualMachines/jdk1.8.0_40/Contents/Home/jre/lib/ext/zipfs.jar","file:/Library/Java/JavaVirtualMachines/jdk1.8.0_40/Contents/Home/jre/lib/javaws.jar","file:/Library/Java/JavaVirtualMachines/jdk1.8.0_40/Contents/Home/jre/lib/jce.jar","file:/Library/Java/JavaVirtualMachines/jdk1.8.0_40/Contents/Home/jre/lib/jfr.jar","file:/Library/Java/JavaVirtualMachines/jdk1.8.0_40/Contents/Home/jre/lib/jfxswt.jar","file:/Library/Java/JavaVirtualMachines/jdk1.8.0_40/Contents/Home/jre/lib/jsse.jar","file:/Library/Java/JavaVirtualMachines/jdk1.8.0_40/Contents/Home/jre/lib/management-agent.jar","file:/Library/Java/JavaVirtualMachines/jdk1.8.0_40/Contents/Home/jre/lib/plugin.jar","file:/Library/Java/JavaVirtualMachines/jdk1.8.0_40/Contents/Home/jre/lib/resources.jar","file:/Library/Java/JavaVirtualMachines/jdk1.8.0_40/Contents/Home/jre/lib/rt.jar","file:/Library/Java/JavaVirtualMachines/jdk1.8.0_40/Contents/Home/lib/ant-javafx.jar","file:/Library/Java/JavaVirtualMachines/jdk1.8.0_40/Contents/Home/lib/dt.jar","file:/Library/Java/JavaVirtualMachines/jdk1.8.0_40/Contents/Home/lib/javafx-mx.jar","file:/Library/Java/JavaVirtualMachines/jdk1.8.0_40/Contents/Home/lib/jconsole.jar","file:/Library/Java/JavaVirtualMachines/jdk1.8.0_40/Contents/Home/lib/packager.jar","file:/Library/Java/JavaVirtualMachines/jdk1.8.0_40/Contents/Home/lib/sa-jdi.jar","file:/Library/Java/JavaVirtualMachines/jdk1.8.0_40/Contents/Home/lib/tools.jar","file:/Users/jack/architect/springdemo/target/classes/","file:/Users/jack/.m2/repository/org/springframework/spring-core/5.2.1.RELEASE/spring-core-5.2.1.RELEASE.jar","file:/Users/jack/.m2/repository/org/springframework/spring-jcl/5.2.1.RELEASE/spring-jcl-5.2.1.RELEASE.jar","file:/Users/jack/.m2/repository/org/springframework/spring-beans/5.2.1.RELEASE/spring-beans-5.2.1.RELEASE.jar","file:/Users/jack/.m2/repository/org/springframework/spring-context/5.2.1.RELEASE/spring-context-5.2.1.RELEASE.jar","file:/Users/jack/.m2/repository/org/springframework/spring-aop/5.2.1.RELEASE/spring-aop-5.2.1.RELEASE.jar","file:/Users/jack/.m2/repository/org/springframework/spring-expression/5.2.1.RELEASE/spring-expression-5.2.1.RELEASE.jar","file:/Users/jack/.m2/repository/com/alibaba/fastjson/1.2.60/fastjson-1.2.60.jar","file:/Applications/IntelliJ%20IDEA.app/Contents/lib/idea_rt.jar"]}
setBeanFactory:{"accessControlContext":{},"allowBeanDefinitionOverriding":true,"allowEagerClassLoading":true,"autowireCandidateResolver":{},"beanDefinitionCount":2,"beanDefinitionNames":["helloDao","helloService"],"beanExpressionResolver":{},"beanNamesIterator":["helloDao","helloService","environment","systemProperties","systemEnvironment","messageSource","applicationEventMulticaster"],"beanPostProcessorCount":3,"beanPostProcessors":[{},{},{}],"cacheBeanMetadata":true,"configurationFrozen":true,"customEditors":{},"propertyEditorRegistrars":[{}],"registeredScopeNames":[],"serializationId":"org.springframework.context.support.ClassPathXmlApplicationContext@2e0fa5d3","singletonCount":7,"singletonMutex":{"systemEnvironment":{"IRBRC":"/Users/jack/.rvm/rubies/ruby-2.3.0/.irbrc","PATH":"...,"propertyNames":["IRBRC","PATH","SDKMAN_VERSION","GREP_OPTIONS","GRAILS_HOME","ANDROID_HOME","rvm_loaded_flag","JAVA9_HOME","MAVEN_HOME","JAVA_MAIN_CLASS_24435","SDKMAN_DIR","LOGNAME","rvm_version","PWD","SPRINGBOOT_HOME","Python","rvm_user_install_flag","SHELL","SPRING_BOOT_HOME","MY_RUBY_HOME","GEM_HOME","VERSIONER_PYTHON_PREFER_32_BIT","TMPDIR","rvm_path","XPC_FLAGS","RUBY_VERSION","_system_name","__CF_USER_TEXT_ENCODING","Apple_PubSub_Socket_Render","LC_CTYPE","SDKMAN_CURRENT_API","_system_arch","rvm_bin_path","GRAPHIZ_HOME","KOTLIN_HOME","JAVA_HOME","TERM","rvm_prefix","GRADLE_HOME","ANT_HOME","GROOVY_HOME","VERSIONER_PYTHON_VERSION","XPC_SERVICE_NAME","NODE_PATH","SCALA_HOME","SDKMAN_CANDIDATES_DIR","SDKMAN_LEGACY_API","RUBY_HOME","LSCOLORS","_system_type","_system_version","SDKMAN_PLATFORM","CLICOLOR","USER","CLASSPATH","rvm_stored_umask","SSH_AUTH_SOCK","GEM_PATH","HOME"],"source":{"$ref":"$.autowireCapableBeanFactory.singletonMutex.systemEnvironment"}}],"systemEnvironment":{"$ref":"$.autowireCapableBeanFactory.singletonMutex.systemEnvironment"},"systemProperties":{"$ref":"$.autowireCapableBeanFactory.singletonMutex.environment.null.source"}},"systemProperties":{"$ref":"$.autowireCapableBeanFactory.singletonMutex.environment.null.source"},"helloDao":{},"messageSource":{}},"singletonNames":["environment","systemProperties","systemEnvironment","messageSource","applicationEventMulticaster","helloDao","helloService"],"typeConverter":{}},"beanDefinitionCount":2,"beanDefinitionNames":["helloDao","helloService"],"beanFactory":{"$ref":"$.autowireCapableBeanFactory"},"beanFactoryPostProcessors":[],"displayName":"org.springframework.context.support.ClassPathXmlApplicationContext@2e0fa5d3","environment":{"$ref":"$.autowireCapableBeanFactory.singletonMutex.environment"},"id":"org.springframework.context.support.ClassPathXmlApplicationContext@2e0fa5d3","protocolResolvers":[],"running":false,"startupDate":1574817896085}
setApplicationEventPublisher:{"active":true,"applicationListeners":[],"applicationName":"","autowireCapableBeanFactory":{"accessControlContext":{},"allowBeanDefinitionOverriding":true,"allowEagerClassLoading":true,"autowireCandidateResolver":{},"beanDefinitionCount":2,"beanDefinitionNames":["helloDao","helloService"],"beanExpressionResolver":{},"beanNamesIterator":["helloDao","helloService","environment","systemProperties","systemEnvironment","messageSource","applicationEventMulticaster"],"beanPostProcessorCount":3,"beanPostProcessors":[{},{},{}],"cacheBeanMetadata":true,"configurationFrozen":true,"customEditors":{},"propertyEditorRegistrars":[{}],"registeredScopeNames":[],"serializationId":"org.springframework.context.support.ClassPathXmlApplicationContext@2e0fa5d3","singletonCount":7,"singletonMutex":{"systemEnvironment":{"IRBRC":"/Users/jack/.rvm/rubies/ruby-2.3.0/.irbrc","PATH":"/opt/local/bin:/opt/local/sbin:/Library/Frameworks/Python.framework/Versions/3.6/bin:/Users/jack/.cargo/bin:/Library/Frameworks/Python.framework/Versions/3.6/bin:/Users/jack/.yarn/bin:/Users/jack/.config/yarn/global/node_modules/.bin:/Users/jack/.rvm/gems/ruby-2.3.0/bin:/Users/jack/.rvm/gems/ruby-2.3.0@global/bin:/Users/jack/.rvm/rubies/ruby-2.3.0/bin:/Users/jack/.sdkman/candidates/springboot/current/bin:/Users/jack/.sdkman/candidates/groovy/current/bin:.:.:/Library/Java/JavaVirtualMachines/jdk1.8.0_40.jdk/Contents/Home/bin:/usr/bin:/usr/sbin:/bin:/sbin:/usr/X11R6/bin:/usr/X11/bin:/usr/local/bin:/Library/Java/JavaVirtualMachines/jdk1.8.0_40/Contents/Home/bin:/Library/Java/JavaVirtualMachines/jdk-9.jdk/Contents/Home/bin:/Users/jack/soft/apache-maven-3.3.9/bin:/Users/jack/soft/scala-2.12.2/bin:/bin:/Users/jack/soft/gradle-4.10.2/bin:/Users/jack/Library/Android/sdk/bin:/Users/jack/Library/Android/sdk/tools:/Users/jack/Library/Android/sdk/platform-tools:/Users/jack/study/clojure/:/Users/jack/.rvm/rubies/ruby-2.3.0/bin:/Users/jack/soft/mytools:/Users/jack/.rvm/bin:/Users/jack/Downloads/phantomjs-2.1.1-macosx/bin:/Users/jack/soft/mongodb-osx-x86_64-3.4.2/bin:/Users/jack/soft/spring-1.5.2.RELEASE/bin:/Users/jack/soft/grails-3.2.8/bin:/Library/Frameworks/Python.framework/Versions/3.6/bin:/Users/jack/soft/kotlinc/bin:/Users/jack/soft/apache-ant-1.10.5/bin:/Users/jack/soft/spring-2.0.0.BUILD-SNAPSHOT/bin:/Users/jack/soft/apache-ant-1.10.5/bin:/Users/jack/soft:/usr/local/Cellar/graphviz/2.42.2/bin:/Users/jack/.nowa-gui/installation/node_modules/.bin:/Applications/NowaGUI.app/Contents/Resources/app/nodes:/Applications/NowaGUI.app/Contents/Resources/app/node_modules/.bin","SDKMAN_VERSION":"5.5.9+231","GREP_OPTIONS":"--color=auto","GRAILS_HOME":"/Users/jack/soft/grails-3.2.8","ANDROID_HOME":"/Users/jack/Library/Android/sdk","rvm_loaded_flag":"1","JAVA9_HOME":"/Library/Java/JavaVirtualMachines/jdk-9.jdk/Contents/Home","MAVEN_HOME":"/Users/jack/soft/apache-maven-3.3.9","JAVA_MAIN_CLASS_24435":"com.light.sword.App","SDKMAN_DIR":"/Users/jack/.sdkman","LOGNAME":"jack","rvm_version":"1.27.0 (latest)","PWD":"/Users/jack/architect/springdemo","SPRINGBOOT_HOME":"/Users/jack/.sdkman/candidates/springboot/current","Python":"/Library/Frameworks/Python.framework/Versions/3.6","rvm_user_install_flag":"1","SHELL":"/bin/bash","SPRING_BOOT_HOME":"/Users/jack/soft/spring-2.0.0.BUILD-SNAPSHOT","MY_RUBY_HOME":"/Users/jack/.rvm/rubies/ruby-2.3.0","GEM_HOME":"/Users/jack/.rvm/gems/ruby-2.3.0","VERSIONER_PYTHON_PREFER_32_BIT":"no","TMPDIR":"/var/folders/q5/kvt7_nsd6ngdw5qry4d99xv00000gn/T/","rvm_path":"/Users/jack/.rvm","XPC_FLAGS":"0x0","RUBY_VERSION":"ruby-2.3.0","_system_name":"OSX","__CF_USER_TEXT_ENCODING":"0x1F5:0x19:0x34","Apple_PubSub_Socket_Render":"/private/tmp/com.apple.launchd.HGU9K7UaLt/Render","LC_CTYPE":"zh_CN.UTF-8","SDKMAN_CURRENT_API":"https://api.sdkman.io/2","_system_arch":"x86_64","rvm_bin_path":"/Users/jack/.rvm/bin","GRAPHIZ_HOME":"/usr/local/Cellar/graphviz/2.42.2","KOTLIN_HOME":"/Users/jack/soft/kotlinc","JAVA_HOME":"/Library/Java/JavaVirtualMachines/jdk1.8.0_40/Contents/Home","TERM":"xterm-color","rvm_prefix":"/Users/jack","GRADLE_HOME":"/Users/jack/soft/gradle-4.10.2","ANT_HOME":"/Users/jack/soft/apache-ant-1.10.5","GROOVY_HOME":"/Users/jack/.sdkman/candidates/groovy/current","VERSIONER_PYTHON_VERSION":"2.7","XPC_SERVICE_NAME":"0","NODE_PATH":"/usr/local/lib/node_modules","SCALA_HOME":"/Users/jack/soft/scala-2.12.2","SDKMAN_CANDIDATES_DIR":"/Users/jack/.sdkman/candidates","SDKMAN_LEGACY_API":"https://api.sdkman.io/1","RUBY_HOME":"/Users/jack/.rvm/rubies/ruby-2.3.0","LSCOLORS":"GxFxCxDxBxegedabagaced","_system_type":"Darwin","_system_version":"10.14","SDKMAN_PLATFORM":"Darwin","CLICOLOR":"0","USER":"jack","CLASSPATH":".:/Library/Java/JavaVirtualMachines/jdk1.8.0_40/Contents/Home/lib/dt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_40/Contents/Home/lib/tools.jar","rvm_stored_umask":"0022","SSH_AUTH_SOCK":"/private/tmp/com.apple.launchd.sYjE96iqUz/Listeners","GEM_PATH":"/Users/jack/.rvm/gems/ruby-2.3.0:/Users/jack/.rvm/gems/ruby-2.3.0@global","HOME":"/Users/jack"},"applicationEventMulticaster":{},"environment":{"activeProfiles":[],"conversionService":{},"defaultProfiles":["default"],"propertySources":[{"name":"systemProperties","propertyNames":["java.runtime.name","sun.boot.library.path","java.vm.version","gopherProxySet","java.vm.vendor","java.vendor.url","path.separator","java.vm.name","file.encoding.pkg","user.country","sun.java.launcher","sun.os.patch.level","java.vm.specification.name","user.dir","java.runtime.version","java.awt.graphicsenv","java.endorsed.dirs","os.arch","java.io.tmpdir","line.separator","java.vm.specification.vendor","os.name","sun.jnu.encoding","java.library.path","java.specification.name","java.class.version","sun.management.compiler","os.version","user.home","user.timezone","java.awt.printerjob","file.encoding","java.specification.version","java.class.path","user.name","java.vm.specification.version","sun.java.command","java.home","sun.arch.data.model","user.language","java.specification.vendor","awt.toolkit","java.vm.info","java.version","java.ext.dirs","sun.boot.class.path","java.vendor","file.separator","java.vendor.url.bug","sun.io.unicode.encoding","sun.cpu.endian","sun.cpu.isalist"],"source":{"java.runtime.name":"Java(TM) SE Runtime Environment","sun.boot.library.path":"/Library/Java/JavaVirtualMachines/jdk1.8.0_40/Contents/Home/jre/lib","java.vm.version":"25.40-b25","gopherProxySet":"false","java.vm.vendor":"Oracle Corporation","java.vendor.url":"http://java.oracle.com/","path.separator":":","java.vm.name":"Java HotSpot(TM) 64-Bit Server VM","file.encoding.pkg":"sun.io","user.country":"CN","sun.java.launcher":"SUN_STANDARD","sun.os.patch.level":"unknown","java.vm.specification.name":"Java Virtual Machine Specification","user.dir":"/Users/jack/architect/springdemo","java.runtime.version":"1.8.0_40-b27","java.awt.graphicsenv":"sun.awt.CGraphicsEnvironment","java.endorsed.dirs":"/Library/Java/JavaVirtualMachines/jdk1.8.0_40/Contents/Home/jre/lib/endorsed","os.arch":"x86_64","java.io.tmpdir":"/var/folders/q5/kvt7_nsd6ngdw5qry4d99xv00000gn/T/","line.separator":"\n","java.vm.specification.vendor":"Oracle Corporation","os.name":"Mac OS X","sun.jnu.encoding":"UTF-8","java.library.path":"/Users/jack/Library/Java/Extensions:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:.","java.specification.name":"Java Platform API Specification","java.class.version":"52.0","sun.management.compiler":"HotSpot 64-Bit Tiered Compilers","os.version":"10.14.5","user.home":"/Users/jack","user.timezone":"Asia/Shanghai","java.awt.printerjob":"sun.lwawt.macosx.CPrinterJob","file.encoding":"UTF-8","java.specification.version":"1.8","java.class.path":"...,"propertyNames":["IRBRC","PATH","SDKMAN_VERSION","GREP_OPTIONS","GRAILS_HOME","ANDROID_HOME","rvm_loaded_flag","JAVA9_HOME","MAVEN_HOME","JAVA_MAIN_CLASS_24435","SDKMAN_DIR","LOGNAME","rvm_version","PWD","SPRINGBOOT_HOME","Python","rvm_user_install_flag","SHELL","SPRING_BOOT_HOME","MY_RUBY_HOME","GEM_HOME","VERSIONER_PYTHON_PREFER_32_BIT","TMPDIR","rvm_path","XPC_FLAGS","RUBY_VERSION","_system_name","__CF_USER_TEXT_ENCODING","Apple_PubSub_Socket_Render","LC_CTYPE","SDKMAN_CURRENT_API","_system_arch","rvm_bin_path","GRAPHIZ_HOME","KOTLIN_HOME","JAVA_HOME","TERM","rvm_prefix","GRADLE_HOME","ANT_HOME","GROOVY_HOME","VERSIONER_PYTHON_VERSION","XPC_SERVICE_NAME","NODE_PATH","SCALA_HOME","SDKMAN_CANDIDATES_DIR","SDKMAN_LEGACY_API","RUBY_HOME","LSCOLORS","_system_type","_system_version","SDKMAN_PLATFORM","CLICOLOR","USER","CLASSPATH","rvm_stored_umask","SSH_AUTH_SOCK","GEM_PATH","HOME"],"source":{"$ref":"$.autowireCapableBeanFactory.singletonMutex.systemEnvironment"}}],"systemEnvironment":{"$ref":"$.autowireCapableBeanFactory.singletonMutex.systemEnvironment"},"systemProperties":{"$ref":"$.autowireCapableBeanFactory.singletonMutex.environment.null.source"}},"systemProperties":{"$ref":"$.autowireCapableBeanFactory.singletonMutex.environment.null.source"},"helloDao":{},"messageSource":{}},"singletonNames":["environment","systemProperties","systemEnvironment","messageSource","applicationEventMulticaster","helloDao","helloService"],"typeConverter":{}},"beanDefinitionCount":2,"beanDefinitionNames":["helloDao","helloService"],"beanFactory":{"$ref":"$.autowireCapableBeanFactory"},"beanFactoryPostProcessors":[],"displayName":"org.springframework.context.support.ClassPathXmlApplicationContext@2e0fa5d3","environment":{"$ref":"$.autowireCapableBeanFactory.singletonMutex.environment"},"id":"org.springframework.context.support.ClassPathXmlApplicationContext@2e0fa5d3","protocolResolvers":[],"running":false,"startupDate":1574817896085}
setMessageSource:{"active":true,"applicationListeners":[],"applicationName":"","autowireCapableBeanFactory":{"accessControlContext":{},"allowBeanDefinitionOverriding":true,"allowEagerClassLoading":true,"autowireCandidateResolver":{},"beanDefinitionCount":2,"beanDefinitionNames":["helloDao","helloService"],"beanExpressionResolver":{},"beanNamesIterator":["helloDao","helloService","environment","systemProperties","systemEnvironment","messageSource","applicationEventMulticaster"],"beanPostProcessorCount":3,"beanPostProcessors":[{},{},{}],"cacheBeanMetadata":true,"configurationFrozen":true,"customEditors":{},"propertyEditorRegistrars":[{}],"registeredScopeNames":[],"serializationId":"org.springframework.context.support.ClassPathXmlApplicationContext@2e0fa5d3","singletonCount":7,"singletonMutex":{"systemEnvironment":{"IRBRC":"/Users/jack/.rvm/rubies/ruby-2.3.0/.irbrc","PATH":"/opt/local/bin:/opt/local/sbin:/Library/Frameworks/Python.framework/Versions/3.6/bin:/Users/jack/.cargo/bin:/Library/Frameworks/Python.framework/Versions/3.6/bin:/Users/jack/.yarn/bin:/Users/jack/.config/yarn/global/node_modules/.bin:/Users/jack/.rvm/gems/ruby-2.3.0/bin:/Users/jack/.rvm/gems/ruby-2.3.0@global/bin:/Users/jack/.rvm/rubies/ruby-2.3.0/bin:/Users/jack/.sdkman/candidates/springboot/current/bin:/Users/jack/.sdkman/candidates/groovy/current/bin:.:.:/Library/Java/JavaVirtualMachines/jdk1.8.0_40.jdk/Contents/Home/bin:/usr/bin:/usr/sbin:/bin:/sbin:/usr/X11R6/bin:/usr/X11/bin:/usr/local/bin:/Library/Java/JavaVirtualMachines/jdk1.8.0_40/Contents/Home/bin:/Library/Java/JavaVirtualMachines/jdk-9.jdk/Contents/Home/bin:/Users/jack/soft/apache-maven-3.3.9/bin:/Users/jack/soft/scala-2.12.2/bin:/bin:/Users/jack/soft/gradle-4.10.2/bin:/Users/jack/Library/Android/sdk/bin:/Users/jack/Library/Android/sdk/tools:/Users/jack/Library/Android/sdk/platform-tools:/Users/jack/study/clojure/:/Users/jack/.rvm/rubies/ruby-2.3.0/bin:/Users/jack/soft/mytools:/Users/jack/.rvm/bin:/Users/jack/Downloads/phantomjs-2.1.1-macosx/bin:/Users/jack/soft/mongodb-osx-x86_64-3.4.2/bin:/Users/jack/soft/spring-1.5.2.RELEASE/bin:/Users/jack/soft/grails-3.2.8/bin:/Library/Frameworks/Python.framework/Versions/3.6/bin:/Users/jack/soft/kotlinc/bin:/Users/jack/soft/apache-ant-1.10.5/bin:/Users/jack/soft/spring-2.0.0.BUILD-SNAPSHOT/bin:/Users/jack/soft/apache-ant-1.10.5/bin:/Users/jack/soft:/usr/local/Cellar/graphviz/2.42.2/bin:/Users/jack/.nowa-gui/installation/node_modules/.bin:/Applications/NowaGUI.app/Contents/Resources/app/nodes:/Applications/NowaGUI.app/Contents/Resources/app/node_modules/.bin","SDKMAN_VERSION":"5.5.9+231","GREP_OPTIONS":"--color=auto","GRAILS_HOME":"/Users/jack/soft/grails-3.2.8","ANDROID_HOME":"/Users/jack/Library/Android/sdk","rvm_loaded_flag":"1","JAVA9_HOME":"/Library/Java/JavaVirtualMachines/jdk-9.jdk/Contents/Home","MAVEN_HOME":"/Users/jack/soft/apache-maven-3.3.9","JAVA_MAIN_CLASS_24435":"com.light.sword.App","SDKMAN_DIR":"/Users/jack/.sdkman","LOGNAME":"jack","rvm_version":"1.27.0 (latest)","PWD":"/Users/jack/architect/springdemo","SPRINGBOOT_HOME":"/Users/jack/.sdkman/candidates/springboot/current","Python":"/Library/Frameworks/Python.framework/Versions/3.6","rvm_user_install_flag":"1","SHELL":"/bin/bash","SPRING_BOOT_HOME":"/Users/jack/soft/spring-2.0.0.BUILD-SNAPSHOT","MY_RUBY_HOME":"/Users/jack/.rvm/rubies/ruby-2.3.0","GEM_HOME":"/Users/jack/.rvm/gems/ruby-2.3.0","VERSIONER_PYTHON_PREFER_32_BIT":"no","TMPDIR":"/var/folders/q5/kvt7_nsd6ngdw5qry4d99xv00000gn/T/","rvm_path":"/Users/jack/.rvm","XPC_FLAGS":"0x0","RUBY_VERSION":"ruby-2.3.0","_system_name":"OSX","__CF_USER_TEXT_ENCODING":"0x1F5:0x19:0x34","Apple_PubSub_Socket_Render":"/private/tmp/com.apple.launchd.HGU9K7UaLt/Render","LC_CTYPE":"zh_CN.UTF-8","SDKMAN_CURRENT_API":"https://api.sdkman.io/2","_system_arch":"x86_64","rvm_bin_path":"/Users/jack/.rvm/bin","GRAPHIZ_HOME":"/usr/local/Cellar/graphviz/2.42.2","KOTLIN_HOME":"/Users/jack/soft/kotlinc","JAVA_HOME":"/Library/Java/JavaVirtualMachines/jdk1.8.0_40/Contents/Home","TERM":"xterm-color","rvm_prefix":"/Users/jack","GRADLE_HOME":"/Users/jack/soft/gradle-4.10.2","ANT_HOME":"/Users/jack/soft/apache-ant-1.10.5","GROOVY_HOME":"/Users/jack/.sdkman/candidates/groovy/current","VERSIONER_PYTHON_VERSION":"2.7","XPC_SERVICE_NAME":"0","NODE_PATH":"/usr/local/lib/node_modules","SCALA_HOME":"/Users/jack/soft/scala-2.12.2","SDKMAN_CANDIDATES_DIR":"/Users/jack/.sdkman/candidates","SDKMAN_LEGACY_API":"https://api.sdkman.io/1","RUBY_HOME":"/Users/jack/.rvm/rubies/ruby-2.3.0","LSCOLORS":"GxFxCxDxBxegedabagaced","_system_type":"Darwin","_system_version":"10.14","SDKMAN_PLATFORM":"Darwin","CLICOLOR":"0","USER":"jack","CLASSPATH":".:/Library/Java/JavaVirtualMachines/jdk1.8.0_40/Contents/Home/lib/dt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_40/Contents/Home/lib/tools.jar","rvm_stored_umask":"0022","SSH_AUTH_SOCK":"/private/tmp/com.apple.launchd.sYjE96iqUz/Listeners","GEM_PATH":"/Users/jack/.rvm/gems/ruby-2.3.0:/Users/jack/.rvm/gems/ruby-2.3.0@global","HOME":"/Users/jack"},"applicationEventMulticaster":{},"environment":{"activeProfiles":[],"conversionService":{},"defaultProfiles":["default"],"propertySources":[{"name":"systemProperties","propertyNames":["java.runtime.name","sun.boot.library.path","java.vm.version","gopherProxySet","java.vm.vendor","java.vendor.url","path.separator","java.vm.name","file.encoding.pkg","user.country","sun.java.launcher","sun.os.patch.level","java.vm.specification.name","user.dir","java.runtime.version","java.awt.graphicsenv","java.endorsed.dirs","os.arch","java.io.tmpdir","line.separator","java.vm.specification.vendor","os.name","sun.jnu.encoding","java.library.path","java.specification.name","java.class.version","sun.management.compiler","os.version","user.home","user.timezone","java.awt.printerjob","file.encoding","java.specification.version","java.class.path","user.name","java.vm.specification.version","sun.java.command","java.home","sun.arch.data.model","user.language","java.specification.vendor","awt.toolkit","java.vm.info","java.version","java.ext.dirs","sun.boot.class.path","java.vendor","file.separator","java.vendor.url.bug","sun.io.unicode.encoding","sun.cpu.endian","sun.cpu.isalist"],"source":{"java.runtime.name":"Java(TM) SE Runtime Environment","sun.boot.library.path":"/Library/Java/JavaVirtualMachines/jdk1.8.0_40/Contents/Home/jre/lib","java.vm.version":"25.40-b25","gopherProxySet":"false","java.vm.vendor":"Oracle Corporation","java.vendor.url":"http://java.oracle.com/","path.separator":":","java.vm.name":"Java HotSpot(TM) 64-Bit Server VM","file.encoding.pkg":"sun.io","user.country":"CN","sun.java.launcher":"SUN_STANDARD","sun.os.patch.level":"unknown","java.vm.specification.name":"Java Virtual Machine Specification","user.dir":"/Users/jack/architect/springdemo","java.runtime.version":"1.8.0_40-b27","java.awt.graphicsenv":"sun.awt.CGraphicsEnvironment","java.endorsed.dirs":"/Library/Java/JavaVirtualMachines/jdk1.8.0_40/Contents/Home/jre/lib/endorsed","os.arch":"x86_64","java.io.tmpdir":"/var/folders/q5/kvt7_nsd6ngdw5qry4d99xv00000gn/T/","line.separator":"\n","java.vm.specification.vendor":"Oracle Corporation","os.name":"Mac OS X","sun.jnu.encoding":"UTF-8","java.library.path":"/Users/jack/Library/Java/Extensions:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:.","java.specification.name":"Java Platform API Specification","java.class.version":"52.0","sun.management.compiler":"HotSpot 64-Bit Tiered Compilers","os.version":"10.14.5","user.home":"/Users/jack","user.timezone":"Asia/Shanghai","java.awt.printerjob":"sun.lwawt.macosx.CPrinterJob","file.encoding":"UTF-8","java.specification.version":"1.8","java.class.path":"...","java.vendor":"Oracle Corporation","file.separator":"/","java.vendor.url.bug":"http://bugreport.sun.com/bugreport/","sun.io.unicode.encoding":"UnicodeBig","sun.cpu.endian":"little","sun.cpu.isalist":""}},{"name":"systemEnvironment","propertyNames":["IRBRC","PATH","SDKMAN_VERSION","GREP_OPTIONS","GRAILS_HOME","ANDROID_HOME","rvm_loaded_flag","JAVA9_HOME","MAVEN_HOME","JAVA_MAIN_CLASS_24435","SDKMAN_DIR","LOGNAME","rvm_version","PWD","SPRINGBOOT_HOME","Python","rvm_user_install_flag","SHELL","SPRING_BOOT_HOME","MY_RUBY_HOME","GEM_HOME","VERSIONER_PYTHON_PREFER_32_BIT","TMPDIR","rvm_path","XPC_FLAGS","RUBY_VERSION","_system_name","__CF_USER_TEXT_ENCODING","Apple_PubSub_Socket_Render","LC_CTYPE","SDKMAN_CURRENT_API","_system_arch","rvm_bin_path","GRAPHIZ_HOME","KOTLIN_HOME","JAVA_HOME","TERM","rvm_prefix","GRADLE_HOME","ANT_HOME","GROOVY_HOME","VERSIONER_PYTHON_VERSION","XPC_SERVICE_NAME","NODE_PATH","SCALA_HOME","SDKMAN_CANDIDATES_DIR","SDKMAN_LEGACY_API","RUBY_HOME","LSCOLORS","_system_type","_system_version","SDKMAN_PLATFORM","CLICOLOR","USER","CLASSPATH","rvm_stored_umask","SSH_AUTH_SOCK","GEM_PATH","HOME"],"source":{"$ref":"$.autowireCapableBeanFactory.singletonMutex.systemEnvironment"}}],"systemEnvironment":{"$ref":"$.autowireCapableBeanFactory.singletonMutex.systemEnvironment"},"systemProperties":{"$ref":"$.autowireCapableBeanFactory.singletonMutex.environment.null.source"}},"systemProperties":{"$ref":"$.autowireCapableBeanFactory.singletonMutex.environment.null.source"},"helloDao":{},"messageSource":{}},"singletonNames":["environment","systemProperties","systemEnvironment","messageSource","applicationEventMulticaster","helloDao","helloService"],"typeConverter":{}},"beanDefinitionCount":2,"beanDefinitionNames":["helloDao","helloService"],"beanFactory":{"$ref":"$.autowireCapableBeanFactory"},"beanFactoryPostProcessors":[],"displayName":"org.springframework.context.support.ClassPathXmlApplicationContext@2e0fa5d3","environment":{"$ref":"$.autowireCapableBeanFactory.singletonMutex.environment"},"id":"org.springframework.context.support.ClassPathXmlApplicationContext@2e0fa5d3","protocolResolvers":[],"running":false,"startupDate":1574817896085}
setApplicationContext:{"active":true,"applicationListeners":[],"applicationName":"","autowireCapableBeanFactory":{"accessControlContext":{},"allowBeanDefinitionOverriding":true,"allowEagerClassLoading":true,"autowireCandidateResolver":{},"beanDefinitionCount":2,"beanDefinitionNames":["helloDao","helloService"],"beanExpressionResolver":{},"beanNamesIterator":["helloDao","helloService","environment","systemProperties","systemEnvironment","messageSource","applicationEventMulticaster"],"beanPostProcessorCount":3,"beanPostProcessors":[{},{},{}],"cacheBeanMetadata":true,"configurationFrozen":true,"customEditors":{},"propertyEditorRegistrars":[{}],"registeredScopeNames":[],"serializationId":"org.springframework.context.support.ClassPathXmlApplicationContext@2e0fa5d3","singletonCount":7,"singletonMutex":{"systemEnvironment":{"IRBRC":"/Users/jack/.rvm/rubies/ruby-2.3.0/.irbrc","PATH":"...,"HOME":"/Users/jack"},"applicationEventMulticaster":{},"environment":{"activeProfiles":[],"conversionService":{},"defaultProfiles":["default"],"propertySources":[{"name":"systemProperties","propertyNames":["java.runtime.name","sun.boot.library.path","java.vm.version","gopherProxySet","java.vm.vendor","java.vendor.url","path.separator","java.vm.name","file.encoding.pkg","user.country","sun.java.launcher","sun.os.patch.level","java.vm.specification.name","user.dir","java.runtime.version","java.awt.graphicsenv","java.endorsed.dirs","os.arch","java.io.tmpdir","line.separator","java.vm.specification.vendor","os.name","sun.jnu.encoding","java.library.path","java.specification.name","java.class.version","sun.management.compiler","os.version","user.home","user.timezone","java.awt.printerjob","file.encoding",...Corporation","file.separator":"/","java.vendor.url.bug":"http://bugreport.sun.com/bugreport/","sun.io.unicode.encoding":"UnicodeBig","sun.cpu.endian":"little","sun.cpu.isalist":""}},{"name":"systemEnvironment","propertyNames":["IRBRC","PATH","SDKMAN_VERSION","GREP_OPTIONS","GRAILS_HOME","ANDROID_HOME","rvm_loaded_flag","JAVA9_HOME","MAVEN_HOME","JAVA_MAIN_CLASS_24435","SDKMAN_DIR","LOGNAME","rvm_version","PWD","SPRINGBOOT_HOME","Python","rvm_user_install_flag","SHELL","SPRING_BOOT_HOME","MY_RUBY_HOME","GEM_HOME","VERSIONER_PYTHON_PREFER_32_BIT","TMPDIR","rvm_path","XPC_FLAGS","RUBY_VERSION","_system_name","__CF_USER_TEXT_ENCODING","Apple_PubSub_Socket_Render","LC_CTYPE","SDKMAN_CURRENT_API","_system_arch","rvm_bin_path","GRAPHIZ_HOME","KOTLIN_HOME","JAVA_HOME","TERM","rvm_prefix","GRADLE_HOME","ANT_HOME","GROOVY_HOME","VERSIONER_PYTHON_VERSION","XPC_SERVICE_NAME","NODE_PATH","SCALA_HOME","SDKMAN_CANDIDATES_DIR","SDKMAN_LEGACY_API","RUBY_HOME","LSCOLORS","_system_type","_system_version","SDKMAN_PLATFORM","CLICOLOR","USER","CLASSPATH","rvm_stored_umask","SSH_AUTH_SOCK","GEM_PATH","HOME"],"source":{"$ref":"$.autowireCapableBeanFactory.singletonMutex.systemEnvironment"}}],"systemEnvironment":{"$ref":"$.autowireCapableBeanFactory.singletonMutex.systemEnvironment"},"systemProperties":{"$ref":"$.autowireCapableBeanFactory.singletonMutex.environment.null.source"}},"systemProperties":{"$ref":"$.autowireCapableBeanFactory.singletonMutex.environment.null.source"},"helloDao":{},"messageSource":{}},"singletonNames":["environment","systemProperties","systemEnvironment","messageSource","applicationEventMulticaster","helloDao","helloService"],"typeConverter":{}},"beanDefinitionCount":2,"beanDefinitionNames":["helloDao","helloService"],"beanFactory":{"$ref":"$.autowireCapableBeanFactory"},"beanFactoryPostProcessors":[],"displayName":"org.springframework.context.support.ClassPathXmlApplicationContext@2e0fa5d3","environment":{"$ref":"$.autowireCapableBeanFactory.singletonMutex.environment"},"id":"org.springframework.context.support.ClassPathXmlApplicationContext@2e0fa5d3","protocolResolvers":[],"running":false,"startupDate":1574817896085}
org.springframework.context.support.ClassPathXmlApplicationContext@2e0fa5d3, started on Wed Nov 27 09:24:56 CST 2019
com.light.sword.service.HelloServiceImpl@38364841
Hello,Jack, now is:Wed Nov 27 09:24:56 CST 2019
Hello,$Jobs, now is:Wed Nov 27 09:24:56 CST 2019

从上面日志中各个对象的数据结构,我们可以看到关于 Spring 框架的所有秘密:

setBeanName

    /**
     * Set the name of the bean in the bean factory that created this bean.
     * 

Invoked after population of normal bean properties but before an * init callback such as {@link InitializingBean#afterPropertiesSet()} * or a custom init-method. * * @param name the name of the bean in the factory. * Note that this name is the actual bean name used in the factory, which may * differ from the originally specified name: in particular for inner bean * names, the actual bean name might have been made unique through appending * "#..." suffixes. Use the {@link BeanFactoryUtils#originalBeanName(String)} * method to extract the original bean name (without suffix), if desired. */ @Override public void setBeanName(String name) { print("setBeanName:"); printlnJson(name); }

setBeanClassLoader

    /**
     * Callback that supplies the bean {@link ClassLoader class loader} to
     * a bean instance.
     * 

Invoked after the population of normal bean properties but * before an initialization callback such as * {@link InitializingBean InitializingBean's} * {@link InitializingBean#afterPropertiesSet()} * method or a custom init-method. * * @param classLoader the owning class loader */ @Override public void setBeanClassLoader(ClassLoader classLoader) { print("setBeanClassLoader:"); printlnJson(classLoader); }

{
    "uRLs":[
        "file:/Library/Java/JavaVirtualMachines/jdk1.8.0_40/Contents/Home/jre/lib/charsets.jar",
        "file:/Library/Java/JavaVirtualMachines/jdk1.8.0_40/Contents/Home/jre/lib/deploy.jar",
        "file:/Library/Java/JavaVirtualMachines/jdk1.8.0_40/Contents/Home/jre/lib/ext/cldrdata.jar",
        "file:/Library/Java/JavaVirtualMachines/jdk1.8.0_40/Contents/Home/jre/lib/ext/dnsns.jar",
        "file:/Library/Java/JavaVirtualMachines/jdk1.8.0_40/Contents/Home/jre/lib/ext/jfxrt.jar",
        "file:/Library/Java/JavaVirtualMachines/jdk1.8.0_40/Contents/Home/jre/lib/ext/localedata.jar",
        "file:/Library/Java/JavaVirtualMachines/jdk1.8.0_40/Contents/Home/jre/lib/ext/nashorn.jar",
        "file:/Library/Java/JavaVirtualMachines/jdk1.8.0_40/Contents/Home/jre/lib/ext/sunec.jar",
        "file:/Library/Java/JavaVirtualMachines/jdk1.8.0_40/Contents/Home/jre/lib/ext/sunjce_provider.jar",
        "file:/Library/Java/JavaVirtualMachines/jdk1.8.0_40/Contents/Home/jre/lib/ext/sunpkcs11.jar",
        "file:/Library/Java/JavaVirtualMachines/jdk1.8.0_40/Contents/Home/jre/lib/ext/zipfs.jar",
        "file:/Library/Java/JavaVirtualMachines/jdk1.8.0_40/Contents/Home/jre/lib/javaws.jar",
        "file:/Library/Java/JavaVirtualMachines/jdk1.8.0_40/Contents/Home/jre/lib/jce.jar",
        "file:/Library/Java/JavaVirtualMachines/jdk1.8.0_40/Contents/Home/jre/lib/jfr.jar",
        "file:/Library/Java/JavaVirtualMachines/jdk1.8.0_40/Contents/Home/jre/lib/jfxswt.jar",
        "file:/Library/Java/JavaVirtualMachines/jdk1.8.0_40/Contents/Home/jre/lib/jsse.jar",
        "file:/Library/Java/JavaVirtualMachines/jdk1.8.0_40/Contents/Home/jre/lib/management-agent.jar",
        "file:/Library/Java/JavaVirtualMachines/jdk1.8.0_40/Contents/Home/jre/lib/plugin.jar",
        "file:/Library/Java/JavaVirtualMachines/jdk1.8.0_40/Contents/Home/jre/lib/resources.jar",
        "file:/Library/Java/JavaVirtualMachines/jdk1.8.0_40/Contents/Home/jre/lib/rt.jar",
        "file:/Library/Java/JavaVirtualMachines/jdk1.8.0_40/Contents/Home/lib/ant-javafx.jar",
        "file:/Library/Java/JavaVirtualMachines/jdk1.8.0_40/Contents/Home/lib/dt.jar",
        "file:/Library/Java/JavaVirtualMachines/jdk1.8.0_40/Contents/Home/lib/javafx-mx.jar",
        "file:/Library/Java/JavaVirtualMachines/jdk1.8.0_40/Contents/Home/lib/jconsole.jar",
        "file:/Library/Java/JavaVirtualMachines/jdk1.8.0_40/Contents/Home/lib/packager.jar",
        "file:/Library/Java/JavaVirtualMachines/jdk1.8.0_40/Contents/Home/lib/sa-jdi.jar",
        "file:/Library/Java/JavaVirtualMachines/jdk1.8.0_40/Contents/Home/lib/tools.jar",
        "file:/Users/jack/architect/springdemo/target/classes/",
        "file:/Users/jack/.m2/repository/org/springframework/spring-core/5.2.1.RELEASE/spring-core-5.2.1.RELEASE.jar",
        "file:/Users/jack/.m2/repository/org/springframework/spring-jcl/5.2.1.RELEASE/spring-jcl-5.2.1.RELEASE.jar",
        "file:/Users/jack/.m2/repository/org/springframework/spring-beans/5.2.1.RELEASE/spring-beans-5.2.1.RELEASE.jar",
        "file:/Users/jack/.m2/repository/org/springframework/spring-context/5.2.1.RELEASE/spring-context-5.2.1.RELEASE.jar",
        "file:/Users/jack/.m2/repository/org/springframework/spring-aop/5.2.1.RELEASE/spring-aop-5.2.1.RELEASE.jar",
        "file:/Users/jack/.m2/repository/org/springframework/spring-expression/5.2.1.RELEASE/spring-expression-5.2.1.RELEASE.jar",
        "file:/Users/jack/.m2/repository/com/alibaba/fastjson/1.2.60/fastjson-1.2.60.jar",
        "file:/Applications/IntelliJ%20IDEA.app/Contents/lib/idea_rt.jar"
    ]
}

setBeanFactory

    /**
     * Callback that supplies the owning factory to a bean instance.
     * 

Invoked after the population of normal bean properties * but before an initialization callback such as * {@link InitializingBean#afterPropertiesSet()} or a custom init-method. * * @param beanFactory owning BeanFactory (never {@code null}). * The bean can immediately call methods on the factory. * @throws BeansException in case of initialization errors * @see BeanInitializationException */ @Override public void setBeanFactory(BeanFactory beanFactory) throws BeansException { print("setBeanFactory:"); printlnJson(beanFactory); }

{
    "accessControlContext":{

    },
    "allowBeanDefinitionOverriding":true,
    "allowEagerClassLoading":true,
    "autowireCandidateResolver":{

    },
    "beanDefinitionCount":2,
    "beanDefinitionNames":[
        "helloDao",
        "helloService"
    ],
    "beanExpressionResolver":{

    },
    "beanNamesIterator":[
        "helloDao",
        "helloService",
        "environment",
        "systemProperties",
        "systemEnvironment",
        "messageSource",
        "applicationEventMulticaster"
    ],
    "beanPostProcessorCount":3,
    "beanPostProcessors":[
        {

        },
        {

        },
        {

        }
    ],
    "cacheBeanMetadata":true,
    "configurationFrozen":true,
    "customEditors":{

    },
    "propertyEditorRegistrars":[
        {

        }
    ],
    "registeredScopeNames":[

    ],
    "serializationId":"org.springframework.context.support.ClassPathXmlApplicationContext@2e0fa5d3",
    "singletonCount":7,
    "singletonMutex":{
        "systemEnvironment":{
            "IRBRC":"/Users/jack/.rvm/rubies/ruby-2.3.0/.irbrc",
            "PATH":"/opt/local/bin:/opt/local/sbin:/Library/Frameworks/Python.framework/Versions/3.6/bin:/Users/jack/.cargo/bin:/Library/Frameworks/Python.framework/Versions/3.6/bin:/Users/jack/.yarn/bin:/Users/jack/.config/yarn/global/node_modules/.bin:/Users/jack/.rvm/gems/ruby-2.3.0/bin:/Users/jack/.rvm/gems/ruby-2.3.0@global/bin:/Users/jack/.rvm/rubies/ruby-2.3.0/bin:/Users/jack/.sdkman/candidates/springboot/current/bin:/Users/jack/.sdkman/candidates/groovy/current/bin:.:.:/Library/Java/JavaVirtualMachines/jdk1.8.0_40.jdk/Contents/Home/bin:/usr/bin:/usr/sbin:/bin:/sbin:/usr/X11R6/bin:/usr/X11/bin:/usr/local/bin:/Library/Java/JavaVirtualMachines/jdk1.8.0_40/Contents/Home/bin:/Library/Java/JavaVirtualMachines/jdk-9.jdk/Contents/Home/bin:/Users/jack/soft/apache-maven-3.3.9/bin:/Users/jack/soft/scala-2.12.2/bin:/bin:/Users/jack/soft/gradle-4.10.2/bin:/Users/jack/Library/Android/sdk/bin:/Users/jack/Library/Android/sdk/tools:/Users/jack/Library/Android/sdk/platform-tools:/Users/jack/study/clojure/:/Users/jack/.rvm/rubies/ruby-2.3.0/bin:/Users/jack/soft/mytools:/Users/jack/.rvm/bin:/Users/jack/Downloads/phantomjs-2.1.1-macosx/bin:/Users/jack/soft/mongodb-osx-x86_64-3.4.2/bin:/Users/jack/soft/spring-1.5.2.RELEASE/bin:/Users/jack/soft/grails-3.2.8/bin:/Library/Frameworks/Python.framework/Versions/3.6/bin:/Users/jack/soft/kotlinc/bin:/Users/jack/soft/apache-ant-1.10.5/bin:/Users/jack/soft/spring-2.0.0.BUILD-SNAPSHOT/bin:/Users/jack/soft/apache-ant-1.10.5/bin:/Users/jack/soft:/usr/local/Cellar/graphviz/2.42.2/bin:/Users/jack/.nowa-gui/installation/node_modules/.bin:/Applications/NowaGUI.app/Contents/Resources/app/nodes:/Applications/NowaGUI.app/Contents/Resources/app/node_modules/.bin",
            "SDKMAN_VERSION":"5.5.9+231",
            "GREP_OPTIONS":"--color=auto",
            "GRAILS_HOME":"/Users/jack/soft/grails-3.2.8",
            "ANDROID_HOME":"/Users/jack/Library/Android/sdk",
            "rvm_loaded_flag":"1",
            "JAVA9_HOME":"/Library/Java/JavaVirtualMachines/jdk-9.jdk/Contents/Home",
            "MAVEN_HOME":"/Users/jack/soft/apache-maven-3.3.9",
            "JAVA_MAIN_CLASS_24435":"com.light.sword.App",
            "SDKMAN_DIR":"/Users/jack/.sdkman",
            "LOGNAME":"jack",
            "rvm_version":"1.27.0 (latest)",
            "PWD":"/Users/jack/architect/springdemo",
            "SPRINGBOOT_HOME":"/Users/jack/.sdkman/candidates/springboot/current",
            "Python":"/Library/Frameworks/Python.framework/Versions/3.6",
            "rvm_user_install_flag":"1",
            "SHELL":"/bin/bash",
            "SPRING_BOOT_HOME":"/Users/jack/soft/spring-2.0.0.BUILD-SNAPSHOT",
            "MY_RUBY_HOME":"/Users/jack/.rvm/rubies/ruby-2.3.0",
            "GEM_HOME":"/Users/jack/.rvm/gems/ruby-2.3.0",
            "VERSIONER_PYTHON_PREFER_32_BIT":"no",
            "TMPDIR":"/var/folders/q5/kvt7_nsd6ngdw5qry4d99xv00000gn/T/",
            "rvm_path":"/Users/jack/.rvm",
            "XPC_FLAGS":"0x0",
            "RUBY_VERSION":"ruby-2.3.0",
            "_system_name":"OSX",
            "__CF_USER_TEXT_ENCODING":"0x1F5:0x19:0x34",
            "Apple_PubSub_Socket_Render":"/private/tmp/com.apple.launchd.HGU9K7UaLt/Render",
            "LC_CTYPE":"zh_CN.UTF-8",
            "SDKMAN_CURRENT_API":"[https://api.sdkman.io/2](https://api.sdkman.io/2)",
            "_system_arch":"x86_64",
            "rvm_bin_path":"/Users/jack/.rvm/bin",
            "GRAPHIZ_HOME":"/usr/local/Cellar/graphviz/2.42.2",
            "KOTLIN_HOME":"/Users/jack/soft/kotlinc",
            "JAVA_HOME":"/Library/Java/JavaVirtualMachines/jdk1.8.0_40/Contents/Home",
            "TERM":"xterm-color",
            "rvm_prefix":"/Users/jack",
            "GRADLE_HOME":"/Users/jack/soft/gradle-4.10.2",
            "ANT_HOME":"/Users/jack/soft/apache-ant-1.10.5",
            "GROOVY_HOME":"/Users/jack/.sdkman/candidates/groovy/current",
            "VERSIONER_PYTHON_VERSION":"2.7",
            "XPC_SERVICE_NAME":"0",
            "NODE_PATH":"/usr/local/lib/node_modules",
            "SCALA_HOME":"/Users/jack/soft/scala-2.12.2",
            "SDKMAN_CANDIDATES_DIR":"/Users/jack/.sdkman/candidates",
            "SDKMAN_LEGACY_API":"[https://api.sdkman.io/1](https://api.sdkman.io/1)",
            "RUBY_HOME":"/Users/jack/.rvm/rubies/ruby-2.3.0",
            "LSCOLORS":"GxFxCxDxBxegedabagaced",
            "_system_type":"Darwin",
            "_system_version":"10.14",
            "SDKMAN_PLATFORM":"Darwin",
            "CLICOLOR":"0",
            "USER":"jack",
            "CLASSPATH":".:/Library/Java/JavaVirtualMachines/jdk1.8.0_40/Contents/Home/lib/dt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_40/Contents/Home/lib/tools.jar",
            "rvm_stored_umask":"0022",
            "SSH_AUTH_SOCK":"/private/tmp/com.apple.launchd.sYjE96iqUz/Listeners",
            "GEM_PATH":"/Users/jack/.rvm/gems/ruby-2.3.0:/Users/jack/.rvm/gems/ruby-2.3.0@global",
            "HOME":"/Users/jack"
        },
        "applicationEventMulticaster":{

        },
        "environment":{
            "activeProfiles":[

            ],
            "conversionService":{

            },
            "defaultProfiles":[
                "default"
            ],
            "propertySources":[
                {
                    "name":"systemProperties",
                    "propertyNames":[
                        "java.runtime.name",
                        "sun.boot.library.path",
                        "java.vm.version",
                        "gopherProxySet",
                        "java.vm.vendor",
                        "java.vendor.url",
                        "path.separator",
                        "java.vm.name",
                        "file.encoding.pkg",
                        "user.country",
                        "sun.java.launcher",
                        "sun.os.patch.level",
                        "java.vm.specification.name",
                        "user.dir",
                        "java.runtime.version",
                        "java.awt.graphicsenv",
                        "java.endorsed.dirs",
                        "os.arch",
                        "java.io.tmpdir",
                        "line.separator",
                        "java.vm.specification.vendor",
                        "os.name",
                        "sun.jnu.encoding",
                        "java.library.path",
                        "java.specification.name",
                        "java.class.version",
                        "sun.management.compiler",
                        "os.version",
                        "user.home",
                        "user.timezone",
                        "java.awt.printerjob",
                        "file.encoding",
                        "java.specification.version",
                        "java.class.path",
                        "user.name",
                        "java.vm.specification.version",
                        "sun.java.command",
                        "java.home",
                        "sun.arch.data.model",
                        "user.language",
                        "java.specification.vendor",
                        "awt.toolkit",
                        "java.vm.info",
                        "java.version",
                        "java.ext.dirs",
                        "sun.boot.class.path",
                        "java.vendor",
                        "file.separator",
                        "java.vendor.url.bug",
                        "sun.io.unicode.encoding",
                        "sun.cpu.endian",
                        "sun.cpu.isalist"
                    ],
                    "source":{
                        "java.runtime.name":"Java(TM) SE Runtime Environment",
                        "sun.boot.library.path":"/Library/Java/JavaVirtualMachines/jdk1.8.0_40/Contents/Home/jre/lib",
                        "java.vm.version":"25.40-b25",
                        "gopherProxySet":"false",
                        "java.vm.vendor":"Oracle Corporation",
                        "java.vendor.url":"[http://java.oracle.com/](http://java.oracle.com/)",
                        "path.separator":":",
                        "java.vm.name":"Java HotSpot(TM) 64-Bit Server VM",
                        "file.encoding.pkg":"sun.io",
                        "user.country":"CN",
                        "sun.java.launcher":"SUN_STANDARD",
                        "sun.os.patch.level":"unknown",
                        "java.vm.specification.name":"Java Virtual Machine Specification",
                        "user.dir":"/Users/jack/architect/springdemo",
                        "java.runtime.version":"1.8.0_40-b27",
                        "java.awt.graphicsenv":"sun.awt.CGraphicsEnvironment",
                        "java.endorsed.dirs":"/Library/Java/JavaVirtualMachines/jdk1.8.0_40/Contents/Home/jre/lib/endorsed",
                        "os.arch":"x86_64",
                        "java.io.tmpdir":"/var/folders/q5/kvt7_nsd6ngdw5qry4d99xv00000gn/T/",
                        "line.separator":" ",
                        "java.vm.specification.vendor":"Oracle Corporation",
                        "os.name":"Mac OS X",
                        "sun.jnu.encoding":"UTF-8",
                        "java.library.path":"/Users/jack/Library/Java/Extensions:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:.",
                        "java.specification.name":"Java Platform API Specification",
                        "java.class.version":"52.0",
                        "sun.management.compiler":"HotSpot 64-Bit Tiered Compilers",
                        "os.version":"10.14.5",
                        "user.home":"/Users/jack",
                        "user.timezone":"Asia/Shanghai",
                        "java.awt.printerjob":"sun.lwawt.macosx.CPrinterJob",
                        "file.encoding":"UTF-8",
                        "java.specification.version":"1.8",
                        "java.class.path":"/Library/Java/JavaVirtualMachines/jdk1.8.0_40/Contents/Home/jre/lib/charsets.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_40/Contents/Home/jre/lib/deploy.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_40/Contents/Home/jre/lib/ext/cldrdata.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_40/Contents/Home/jre/lib/ext/dnsns.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_40/Contents/Home/jre/lib/ext/jfxrt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_40/Contents/Home/jre/lib/ext/localedata.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_40/Contents/Home/jre/lib/ext/nashorn.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_40/Contents/Home/jre/lib/ext/sunec.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_40/Contents/Home/jre/lib/ext/sunjce_provider.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_40/Contents/Home/jre/lib/ext/sunpkcs11.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_40/Contents/Home/jre/lib/ext/zipfs.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_40/Contents/Home/jre/lib/javaws.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_40/Contents/Home/jre/lib/jce.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_40/Contents/Home/jre/lib/jfr.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_40/Contents/Home/jre/lib/jfxswt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_40/Contents/Home/jre/lib/jsse.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_40/Contents/Home/jre/lib/management-agent.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_40/Contents/Home/jre/lib/plugin.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_40/Contents/Home/jre/lib/resources.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_40/Contents/Home/jre/lib/rt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_40/Contents/Home/lib/ant-javafx.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_40/Contents/Home/lib/dt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_40/Contents/Home/lib/javafx-mx.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_40/Contents/Home/lib/jconsole.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_40/Contents/Home/lib/packager.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_40/Contents/Home/lib/sa-jdi.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_40/Contents/Home/lib/tools.jar:/Users/jack/architect/springdemo/target/classes:/Users/jack/.m2/repository/org/springframework/spring-core/5.2.1.RELEASE/spring-core-5.2.1.RELEASE.jar:/Users/jack/.m2/repository/org/springframework/spring-jcl/5.2.1.RELEASE/spring-jcl-5.2.1.RELEASE.jar:/Users/jack/.m2/repository/org/springframework/spring-beans/5.2.1.RELEASE/spring-beans-5.2.1.RELEASE.jar:/Users/jack/.m2/repository/org/springframework/spring-context/5.2.1.RELEASE/spring-context-5.2.1.RELEASE.jar:/Users/jack/.m2/repository/org/springframework/spring-aop/5.2.1.RELEASE/spring-aop-5.2.1.RELEASE.jar:/Users/jack/.m2/repository/org/springframework/spring-expression/5.2.1.RELEASE/spring-expression-5.2.1.RELEASE.jar:/Users/jack/.m2/repository/com/alibaba/fastjson/1.2.60/fastjson-1.2.60.jar:/Applications/IntelliJ IDEA.app/Contents/lib/idea_rt.jar",
                        "user.name":"jack",
                        "java.vm.specification.version":"1.8",
                        "sun.java.command":"com.light.sword.App",
                        "java.home":"/Library/Java/JavaVirtualMachines/jdk1.8.0_40/Contents/Home/jre",
                        "sun.arch.data.model":"64",
                        "user.language":"zh",
                        "java.specification.vendor":"Oracle Corporation",
                        "awt.toolkit":"sun.lwawt.macosx.LWCToolkit",
                        "java.vm.info":"mixed mode",
                        "java.version":"1.8.0_40",
                        "java.ext.dirs":"/Users/jack/Library/Java/Extensions:/Library/Java/JavaVirtualMachines/jdk1.8.0_40/Contents/Home/jre/lib/ext:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java",
                        "sun.boot.class.path":"/Library/Java/JavaVirtualMachines/jdk1.8.0_40/Contents/Home/jre/lib/resources.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_40/Contents/Home/jre/lib/rt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_40/Contents/Home/jre/lib/sunrsasign.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_40/Contents/Home/jre/lib/jsse.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_40/Contents/Home/jre/lib/jce.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_40/Contents/Home/jre/lib/charsets.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_40/Contents/Home/jre/lib/jfr.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_40/Contents/Home/jre/classes",
                        "java.vendor":"Oracle Corporation",
                        "file.separator":"/",
                        "java.vendor.url.bug":"[http://bugreport.sun.com/bugreport/](http://bugreport.sun.com/bugreport/)",
                        "sun.io.unicode.encoding":"UnicodeBig",
                        "sun.cpu.endian":"little",
                        "sun.cpu.isalist":""
                    }
                },
                {
                    "name":"systemEnvironment",
                    "propertyNames":[
                        "IRBRC",
                        "PATH",
                        "SDKMAN_VERSION",
                        "GREP_OPTIONS",
                        "GRAILS_HOME",
                        "ANDROID_HOME",
                        "rvm_loaded_flag",
                        "JAVA9_HOME",
                        "MAVEN_HOME",
                        "JAVA_MAIN_CLASS_24435",
                        "SDKMAN_DIR",
                        "LOGNAME",
                        "rvm_version",
                        "PWD",
                        "SPRINGBOOT_HOME",
                        "Python",
                        "rvm_user_install_flag",
                        "SHELL",
                        "SPRING_BOOT_HOME",
                        "MY_RUBY_HOME",
                        "GEM_HOME",
                        "VERSIONER_PYTHON_PREFER_32_BIT",
                        "TMPDIR",
                        "rvm_path",
                        "XPC_FLAGS",
                        "RUBY_VERSION",
                        "_system_name",
                        "__CF_USER_TEXT_ENCODING",
                        "Apple_PubSub_Socket_Render",
                        "LC_CTYPE",
                        "SDKMAN_CURRENT_API",
                        "_system_arch",
                        "rvm_bin_path",
                        "GRAPHIZ_HOME",
                        "KOTLIN_HOME",
                        "JAVA_HOME",
                        "TERM",
                        "rvm_prefix",
                        "GRADLE_HOME",
                        "ANT_HOME",
                        "GROOVY_HOME",
                        "VERSIONER_PYTHON_VERSION",
                        "XPC_SERVICE_NAME",
                        "NODE_PATH",
                        "SCALA_HOME",
                        "SDKMAN_CANDIDATES_DIR",
                        "SDKMAN_LEGACY_API",
                        "RUBY_HOME",
                        "LSCOLORS",
                        "_system_type",
                        "_system_version",
                        "SDKMAN_PLATFORM",
                        "CLICOLOR",
                        "USER",
                        "CLASSPATH",
                        "rvm_stored_umask",
                        "SSH_AUTH_SOCK",
                        "GEM_PATH",
                        "HOME"
                    ],
                    "source":{
                        "$ref":"$.singletonMutex.systemEnvironment"
                    }
                }
            ],
            "systemEnvironment":{
                "$ref":"$.singletonMutex.systemEnvironment"
            },
            "systemProperties":{
                "$ref":"$.singletonMutex.environment.null.source"
            }
        },
        "systemProperties":{
            "$ref":"$.singletonMutex.environment.null.source"
        },
        "helloDao":{

        },
        "messageSource":{

        }
    },
    "singletonNames":[
        "environment",
        "systemProperties",
        "systemEnvironment",
        "messageSource",
        "applicationEventMulticaster",
        "helloDao",
        "helloService"
    ],
    "typeConverter":{

    }
}

另外注意
DefaultListableBeanFactory cannot be cast to org.springframework.context.support.ClassPathXmlApplicationContext

    public void setBeanFactory(BeanFactory beanFactory) throws BeansException {
        print("setBeanFactory:");
        printlnJson(beanFactory);
        String[] beanDefinitionNames = ((DefaultListableBeanFactory) beanFactory).getBeanDefinitionNames();
        // DefaultListableBeanFactory cannot be cast to org.springframework.context.support.ClassPathXmlApplicationContext
        // String[] beanDefinitionNames2 = ((ClassPathXmlApplicationContext) beanFactory).getBeanDefinitionNames();
        printlnJson(beanDefinitionNames);
    }

你可能感兴趣的:([ 成为架构师系列 ] 5. Spring Bean 的生命周期 (the standard bean lifecycle))