Created
April 27, 2017 19:11
-
-
Save sidneydemoraes/8f47ba2d11360b76dbe3516b02ea90dd to your computer and use it in GitHub Desktop.
TechTalk - Gradle + Spring Boot + Groovy - Application.groovy (Command Line Application)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.slf4j.Logger | |
import org.slf4j.LoggerFactory | |
import org.springframework.boot.CommandLineRunner | |
import org.springframework.boot.SpringApplication | |
import org.springframework.boot.autoconfigure.SpringBootApplication | |
import org.springframework.boot.system.ApplicationPidFileWriter | |
/** | |
* Classe de entrada da aplicaçao SpringBoot. | |
*/ | |
@SpringBootApplication | |
class Application implements CommandLineRunner { | |
private static final Logger log = LoggerFactory.getLogger(Application.class) | |
public static void main(String[] args) throws Exception { | |
SpringApplication application = new SpringApplication(Application.class) | |
application.addListeners(new ApplicationPidFileWriter("pid/monitor-servicos.pid")) | |
application.run(args); | |
} | |
@Override | |
void run(String... args) throws Exception { | |
log.info("Monitor de Servico: Iniciado.") | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment