这里分类和汇总了欣宸的全部原创(含配套源码):https://github.com/zq2599/blog_demos
private void printTrack(String prefix){
StackTraceElement[] st = Thread.currentThread().getStackTrace();
if(st==null){
logger.info("invalid stack");
return;
}
StringBuffer sbf =new StringBuffer();
for(StackTraceElement e:st){
if(sbf.length()>0){
sbf.append(" <- ");
sbf.append(System.getProperty("line.separator"));
}
sbf.append(java.text.MessageFormat.format("{0}.{1}() {2}"
,e.getClassName()
,e.getMethodName()
,e.getLineNumber()));
}
logger.info(prefix + "\n" + sbf.toString());
}
protected String parseStringValue(
String strVal, PlaceholderResolver placeholderResolver, Set<String> visitedPlaceholders) {
printTrack("start parseStringValue");
logger.info("before parse : [" + strVal + "]");
logger.info("after parse : [" + result + "]");
return result.toString();
}
version=4.1.88.RELEASE
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.bolingcavalry</groupId>
<artifactId>springcoredemo</artifactId>
<version>1.0-SNAPSHOT</version>
<dependencies>
<!-- Spring framework -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>4.1.88.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>4.1.88.RELEASE</version>
</dependency>
</dependencies>
</project>
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-4.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd">
<beans>
<bean class="com.bolingcavalry.bean.Simple"></bean>
</beans>
</beans>
public class Simple {
public void execute() {
System.out.println("Simple execute method");
}
}
public class DemoApplication {
public static void main(String[] args) {
ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("${CONFIG_PATH}");
Simple bean = context.getBean(Simple.class);
bean.execute();
context.close();
}
}
C:\jdk\bin\java.exe -javaagent:C:\software\JetBrains\IntelliJIDEA\lib\idea_rt.jar=60748:C:\software\JetBrains\IntelliJIDEA\bin -Dfile.encoding=UTF-8 -classpath C:\jdk\jre\lib\charsets.jar;C:\jdk\jre\lib\deploy.jar;C:\jdk\jre\lib\ext\access-bridge-64.jar;C:\jdk\jre\lib\ext\cldrdata.jar;C:\jdk\jre\lib\ext\dnsns.jar;C:\jdk\jre\lib\ext\jaccess.jar;C:\jdk\jre\lib\ext\jfxrt.jar;C:\jdk\jre\lib\ext\localedata.jar;C:\jdk\jre\lib\ext\nashorn.jar;C:\jdk\jre\lib\ext\sunec.jar;C:\jdk\jre\lib\ext\sunjce_provider.jar;C:\jdk\jre\lib\ext\sunmscapi.jar;C:\jdk\jre\lib\ext\sunpkcs11.jar;C:\jdk\jre\lib\ext\zipfs.jar;C:\jdk\jre\lib\javaws.jar;C:\jdk\jre\lib\jce.jar;C:\jdk\jre\lib\jfr.jar;C:\jdk\jre\lib\jfxswt.jar;C:\jdk\jre\lib\jsse.jar;C:\jdk\jre\lib\management-agent.jar;C:\jdk\jre\lib\plugin.jar;C:\jdk\jre\lib\resources.jar;C:\jdk\jre\lib\rt.jar;D:\github\blog_demos\springcoredemo\target\classes;C:\Users\12167\.m2\repository\org\springframework\spring-core\4.1.88.RELEASE\spring-core-4.1.88.RELEASE.jar;C:\Users\12167\.m2\repository\commons-logging\commons-logging\1.2\commons-logging-1.2.jar;C:\Users\12167\.m2\repository\org\springframework\spring-context\4.1.88.RELEASE\spring-context-4.1.88.RELEASE.jar;C:\Users\12167\.m2\repository\org\springframework\spring-aop\4.1.88.RELEASE\spring-aop-4.1.88.RELEASE.jar;C:\Users\12167\.m2\repository\aopalliance\aopalliance\1.0\aopalliance-1.0.jar;C:\Users\12167\.m2\repository\org\springframework\spring-beans\4.1.88.RELEASE\spring-beans-4.1.88.RELEASE.jar;C:\Users\12167\.m2\repository\org\springframework\spring-expression\4.1.88.RELEASE\spring-expression-4.1.88.RELEASE.jar com.bolingcavalry.DemoApplication
七月 07, 2018 7:18:14 下午 org.springframework.util.PropertyPlaceholderHelper printTrack
信息: start parseStringValue
java.lang.Thread.getStackTrace() 1,559 <-
org.springframework.util.PropertyPlaceholderHelper.printTrack() 231 <-
org.springframework.util.PropertyPlaceholderHelper.parseStringValue() 132 <-
org.springframework.util.PropertyPlaceholderHelper.replacePlaceholders() 126 <-
org.springframework.core.env.AbstractPropertyResolver.doResolvePlaceholders() 204 <-
org.springframework.core.env.AbstractPropertyResolver.resolveRequiredPlaceholders() 178 <-
org.springframework.core.env.AbstractEnvironment.resolveRequiredPlaceholders() 571 <-
org.springframework.context.support.AbstractRefreshableConfigApplicationContext.resolvePath() 122 <-
org.springframework.context.support.AbstractRefreshableConfigApplicationContext.setConfigLocations() 80 <-
org.springframework.context.support.ClassPathXmlApplicationContext.<init>() 137 <-
org.springframework.context.support.ClassPathXmlApplicationContext.<init>() 83 <-
com.bolingcavalry.DemoApplication.main() 14
七月 07, 2018 7:18:14 下午 org.springframework.util.PropertyPlaceholderHelper parseStringValue
信息: before parse : [${CONFIG_PATH}]
七月 07, 2018 7:18:14 下午 org.springframework.util.PropertyPlaceholderHelper printTrack
信息: start parseStringValue
java.lang.Thread.getStackTrace() 1,559 <-
org.springframework.util.PropertyPlaceholderHelper.printTrack() 231 <-
org.springframework.util.PropertyPlaceholderHelper.parseStringValue() 132 <-
org.springframework.util.PropertyPlaceholderHelper.parseStringValue() 148 <-
org.springframework.util.PropertyPlaceholderHelper.replacePlaceholders() 126 <-
org.springframework.core.env.AbstractPropertyResolver.doResolvePlaceholders() 204 <-
org.springframework.core.env.AbstractPropertyResolver.resolveRequiredPlaceholders() 178 <-
org.springframework.core.env.AbstractEnvironment.resolveRequiredPlaceholders() 571 <-
org.springframework.context.support.AbstractRefreshableConfigApplicationContext.resolvePath() 122 <-
org.springframework.context.support.AbstractRefreshableConfigApplicationContext.setConfigLocations() 80 <-
org.springframework.context.support.ClassPathXmlApplicationContext.<init>() 137 <-
org.springframework.context.support.ClassPathXmlApplicationContext.<init>() 83 <-
com.bolingcavalry.DemoApplication.main() 14
七月 07, 2018 7:18:14 下午 org.springframework.util.PropertyPlaceholderHelper parseStringValue
信息: before parse : [CONFIG_PATH]
七月 07, 2018 7:18:14 下午 org.springframework.util.PropertyPlaceholderHelper parseStringValue
信息: after parse : [CONFIG_PATH]
七月 07, 2018 7:18:14 下午 org.springframework.util.PropertyPlaceholderHelper printTrack
信息: start parseStringValue
java.lang.Thread.getStackTrace() 1,559 <-
org.springframework.util.PropertyPlaceholderHelper.printTrack() 231 <-
org.springframework.util.PropertyPlaceholderHelper.parseStringValue() 132 <-
org.springframework.util.PropertyPlaceholderHelper.parseStringValue() 165 <-
org.springframework.util.PropertyPlaceholderHelper.replacePlaceholders() 126 <-
org.springframework.core.env.AbstractPropertyResolver.doResolvePlaceholders() 204 <-
org.springframework.core.env.AbstractPropertyResolver.resolveRequiredPlaceholders() 178 <-
org.springframework.core.env.AbstractEnvironment.resolveRequiredPlaceholders() 571 <-
org.springframework.context.support.AbstractRefreshableConfigApplicationContext.resolvePath() 122 <-
org.springframework.context.support.AbstractRefreshableConfigApplicationContext.setConfigLocations() 80 <-
org.springframework.context.support.ClassPathXmlApplicationContext.<init>() 137 <-
org.springframework.context.support.ClassPathXmlApplicationContext.<init>() 83 <-
com.bolingcavalry.DemoApplication.main() 14
七月 07, 2018 7:18:14 下午 org.springframework.util.PropertyPlaceholderHelper parseStringValue
信息: before parse : [classpath:applicationContext.xml]
七月 07, 2018 7:18:14 下午 org.springframework.util.PropertyPlaceholderHelper parseStringValue
信息: after parse : [classpath:applicationContext.xml]
七月 07, 2018 7:18:14 下午 org.springframework.util.PropertyPlaceholderHelper parseStringValue
信息: after parse : [classpath:applicationContext.xml]
七月 07, 2018 7:18:14 下午 org.springframework.context.support.ClassPathXmlApplicationContext prepareRefresh
信息: Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@20ad9418: startup date [Sat Jul 07 19:18:14 GMT+08:00 2018]; root of context hierarchy
七月 07, 2018 7:18:14 下午 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
信息: Loading XML bean definitions from class path resource [applicationContext.xml]
七月 07, 2018 7:18:14 下午 org.springframework.context.support.ClassPathXmlApplicationContext doClose
信息: Closing org.springframework.context.support.ClassPathXmlApplicationContext@20ad9418: startup date [Sat Jul 07 19:18:14 GMT+08:00 2018]; root of context hierarchy
Simple execute method
Process finished with exit code 0
领取专属 10元无门槛券
私享最新 技术干货