This commit is contained in:
Phillip Webb
2015-02-01 20:00:11 -08:00
parent d64cc082db
commit 555827cad7
14 changed files with 51 additions and 45 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2013 the original author or authors.
* Copyright 2012-2015 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.
@@ -21,7 +21,7 @@ import org.springframework.context.annotation.AnnotationConfigApplicationContext
/**
* Main class to start the embedded server.
*
* @author Phillip Webb
* @author Dave Syer
*/
public final class EmbeddedJarStarter {
@@ -30,4 +30,5 @@ public final class EmbeddedJarStarter {
context.getBean(SpringConfiguration.class).run(args);
context.close();
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2013 the original author or authors.
* Copyright 2012-2015 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.
@@ -27,19 +27,19 @@ import org.springframework.core.io.support.PropertiesLoaderUtils;
/**
* Spring configuration.
*
* @author Phillip Webb
* @author Dave Syer
*/
@Configuration
@ComponentScan
public class SpringConfiguration {
private String message = "Jar";
@PostConstruct
public void init() throws IOException {
String value = PropertiesLoaderUtils.loadAllProperties("application.properties").getProperty("message");
if (value!=null) {
this.message = value;
this.message = value;
}
}
@@ -48,6 +48,4 @@ public class SpringConfiguration {
System.err.println("Hello Embedded " + this.message + "!");
}
}