1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 package net.brabenetz.app.springstompserver;
21
22 import org.slf4j.Logger;
23 import org.slf4j.LoggerFactory;
24 import org.springframework.beans.factory.InitializingBean;
25 import org.springframework.boot.Banner.Mode;
26 import org.springframework.boot.WebApplicationType;
27 import org.springframework.boot.autoconfigure.SpringBootApplication;
28 import org.springframework.boot.builder.SpringApplicationBuilder;
29 import org.springframework.boot.context.properties.EnableConfigurationProperties;
30
31
32
33
34 @SpringBootApplication
35 @EnableConfigurationProperties
36 @SuppressWarnings("PMD.UseUtilityClass")
37 public class SpringStompServerApplication {
38
39
40
41
42
43
44 @SuppressWarnings("resource")
45 public static void main(final String[] args) {
46 if (System.getProperty("spring.config.name") == null) {
47 System.setProperty("spring.config.name", "spring-stomp-server");
48 }
49
50 new SpringApplicationBuilder(SpringStompServerApplication.class)
51 .bannerMode(Mode.OFF)
52 .parent(new SpringApplicationBuilder(AppPrepare.class)
53 .banner(new SpringStompServerBanner())
54 .web(WebApplicationType.NONE)
55 .run(args))
56 .run(args);
57 }
58
59
60
61
62 public static class AppPrepare implements InitializingBean {
63 private static final Logger LOG = LoggerFactory.getLogger(AppPrepare.class);
64
65 @Override
66 public void afterPropertiesSet() throws Exception {
67 LOG.info("Current Java-Version: {}; OS: {}; Timezone: {}; Lang: {}",
68 System.getProperty("java.version"),
69 System.getProperty("os.name"),
70 System.getProperty("user.timezone"),
71 System.getProperty("user.language"));
72 }
73 }
74
75 }