11package org .apache .click .examples ;
22
3+ import lombok .extern .slf4j .Slf4j ;
34import lombok .val ;
45import org .apache .click .examples .util .DatabaseInitListener ;
56import org .apache .click .extras .cayenne .DataContextFilter ;
1011import org .springframework .boot .autoconfigure .SpringBootApplication ;
1112import org .springframework .boot .web .servlet .FilterRegistrationBean ;
1213import org .springframework .boot .web .servlet .ServletRegistrationBean ;
14+ import org .springframework .context .Lifecycle ;
1315import org .springframework .context .annotation .Bean ;
1416import org .springframework .context .annotation .ComponentScan ;
1517import org .springframework .web .servlet .config .annotation .EnableWebMvc ;
2426@ SpringBootApplication // (scanBasePackageClasses = { LunaApplication.class, RemoteMvelConsoleController.class })
2527@ EnableWebMvc
2628@ ComponentScan (// == <context:component-scan base-package="org.apache.click.examples" scope-resolver="org.apache.click.extras.spring.PageScopeResolver"/>
27- basePackages = "org.apache.click.examples" ,
28- scopeResolver = PageScopeResolver .class
29+ basePackages = "org.apache.click.examples" ,
30+ scopeResolver = PageScopeResolver .class
2931)
30- public class ExamplesApplication implements WebMvcConfigurer {
31-
32- public static void main (String [] args ) {
32+ @ Slf4j
33+ public class ExamplesApplication implements WebMvcConfigurer , Lifecycle {
34+ public static void main (String [] args ) {
3335 System .out .println (" *** main thread started *** " +Thread .currentThread ());
34- SpringApplication .run (ExamplesApplication .class , args );
35- System .err .println (" *** main thread finishes *** " +Thread .currentThread ());
36+ SpringApplication .run (ExamplesApplication .class , args );
37+ System .err .println (" *** main thread finishes *** " +Thread .currentThread ());
3638 }
37-
3839 private static final String [] CLASSPATH_RESOURCE_LOCATIONS = {
3940 "classpath:/META-INF/resources/" ,// todo classpath*:
40- "classpath:/META-INF/resources/click/" ,
41+ // "classpath:/META-INF/resources/click/",
4142 "classpath:/resources/" ,
42- "classpath:/resources/click/" ,
43+ // "classpath:/resources/click/",
4344 "classpath:/static/" ,
44- "classpath:/static/click/" ,
45+ // "classpath:/static/click/",
4546 "classpath:/public/"
4647 };
4748
@@ -119,4 +120,20 @@ public FilterRegistrationBean<PerformanceFilter> performanceFilter() {
119120 reg .setServletNames (Collections .singletonList ("ClickServlet" ));
120121 return reg ;
121122 }
123+
124+ @ Override
125+ public void start () {
126+ log .warn ("INFO: ✅ start is called" );
127+ }
128+
129+ @ Override
130+ public void stop () {
131+ log .warn ("INFO: ⛔ stop is called" );
132+ }
133+
134+ @ Override
135+ public boolean isRunning () {
136+ log .warn ("INFO: ❔ isRunning is called" );
137+ return false ;
138+ }
122139}
0 commit comments