Search in sources :

Example 1 with ApplicationPidFileWriter

use of org.springframework.boot.system.ApplicationPidFileWriter in project ontrack by nemerosa.

the class Application method main.

/**
 * Start-up point
 *
 * @param args Arguments passed to the program, they may contain configuration variables.
 */
public static void main(String[] args) {
    // PID file
    File pid = new File("ontrack.pid");
    // Runs the application
    SpringApplication application = new SpringApplication(Application.class);
    application.addListeners(new ApplicationPidFileWriter(pid));
    application.run(args);
}
Also used : SpringApplication(org.springframework.boot.SpringApplication) ApplicationPidFileWriter(org.springframework.boot.system.ApplicationPidFileWriter) File(java.io.File)

Example 2 with ApplicationPidFileWriter

use of org.springframework.boot.system.ApplicationPidFileWriter in project FarmCloud by vratsasg.

the class FarmCloudApplication method main.

public static void main(String[] args) {
    SpringApplication farmCloudApp = new SpringApplication(FarmCloudApplication.class);
    farmCloudApp.addListeners(new ApplicationPidFileWriter());
    farmCloudApp.run(args);
}
Also used : SpringApplication(org.springframework.boot.SpringApplication) ApplicationPidFileWriter(org.springframework.boot.system.ApplicationPidFileWriter)

Example 3 with ApplicationPidFileWriter

use of org.springframework.boot.system.ApplicationPidFileWriter in project tutorials by eugenp.

the class Application method writePID.

private static void writePID() {
    SpringApplicationBuilder app = new SpringApplicationBuilder(Application.class).web(false);
    app.build().addListeners(new ApplicationPidFileWriter("./bin/shutdown.pid"));
    app.run();
}
Also used : SpringApplicationBuilder(org.springframework.boot.builder.SpringApplicationBuilder) ApplicationPidFileWriter(org.springframework.boot.system.ApplicationPidFileWriter) SpringApplication(org.springframework.boot.SpringApplication) SpringBootApplication(org.springframework.boot.autoconfigure.SpringBootApplication)

Aggregations

SpringApplication (org.springframework.boot.SpringApplication)3 ApplicationPidFileWriter (org.springframework.boot.system.ApplicationPidFileWriter)3 File (java.io.File)1 SpringBootApplication (org.springframework.boot.autoconfigure.SpringBootApplication)1 SpringApplicationBuilder (org.springframework.boot.builder.SpringApplicationBuilder)1