@Slf4j
@SpringBootApplication
public class CellApplication {
...
public static void main(String[] args) throws IOException {
SpringApplicationBuilder builder = new SpringApplicationBuilder(CellApplication.class);
builder.web(WebApplicationType.NONE).build().addListeners(new ApplicationPidFileWriter());
builder.run(args);
}
@EventListener
public void applicationStartedEvent(ApplicationStartedEvent applicationStartedEvent) {
...
}
@PostConstruct
public void onStart() {
...
}
@PreDestroy
public void onExit() {
...
}
}