本文整理汇总了Java中org.springframework.boot.system.ApplicationPidFileWriter类的典型用法代码示例。如果您正苦于以下问题:Java ApplicationPidFileWriter类的具体用法?Java ApplicationPidFileWriter怎么用?Java ApplicationPidFileWriter使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ApplicationPidFileWriter类属于org.springframework.boot.system包,在下文中一共展示了ApplicationPidFileWriter类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: main
import org.springframework.boot.system.ApplicationPidFileWriter; //导入依赖的package包/类
public static void main(String[] args) {
final SpringApplication app = new SpringApplication(Application.class);
// save the pid into a file...
app.addListeners(new ApplicationPidFileWriter("smarti.pid"));
final ConfigurableApplicationContext context = app.run(args);
final ConfigurableEnvironment env = context.getEnvironment();
try {
//http://localhost:8080/admin/index.html
final URI uri = new URI(
(env.getProperty("server.ssl.enabled", Boolean.class, false) ? "https" : "http"),
null,
(env.getProperty("server.address", "localhost")),
(env.getProperty("server.port", Integer.class, 8080)),
(env.getProperty("server.context-path", "/")).replaceAll("//+", "/"),
null, null);
log.info("{} started: {}",
env.getProperty("server.display-name", context.getDisplayName()),
uri);
} catch (URISyntaxException e) {
log.warn("Could not build launch-url: {}", e.getMessage());
}
}
示例2: main
import org.springframework.boot.system.ApplicationPidFileWriter; //导入依赖的package包/类
/**
* @param args The command line arguments.
*/
@SuppressFBWarnings(value="DM_DEFAULT_ENCODING", justification="DEV-NULL encoding is irrelevant")
public static void main(String[] args) {
try (PrintStream devNull = new PrintStream(ByteStreams.nullOutputStream()))
{
System.setErr(devNull);
ctx = new SpringApplicationBuilder(
ScheduleConfiguration.class,
RunNowConfiguration.class,
SmokeTestConfiguration.class,
RunConfigConfiguration.class)
.bannerMode(Mode.OFF)
.listeners(new ApplicationPidFileWriter())
.web(false)
.run(args);
ctx.start();
} catch (Throwable t) {
errHandler.handle(t);
}
}
示例3: main
import org.springframework.boot.system.ApplicationPidFileWriter; //导入依赖的package包/类
public static void main(String[] args) {
SpringApplication springApplication = new SpringApplication(Application.class);
springApplication.addListeners(new ApplicationPidFileWriter());
ApplicationContext ctx = springApplication.run(args);
Assert.notNull(ctx, "May not be null!");
}
示例4: main
import org.springframework.boot.system.ApplicationPidFileWriter; //导入依赖的package包/类
/**
* 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);
}
示例5: main
import org.springframework.boot.system.ApplicationPidFileWriter; //导入依赖的package包/类
public static void main(String[] args) {
SpringApplication springApplication = new SpringApplication(ApplicationStart.class);
springApplication.addListeners(new ApplicationPidFileWriter("thrush.pid"), new ThrushApplicationListener());
springApplication.run(args);
}
示例6: main
import org.springframework.boot.system.ApplicationPidFileWriter; //导入依赖的package包/类
public static void main(String[] args) {
SpringApplication springApplication = new SpringApplication(ConsoleApplicationStart.class);
springApplication.addListeners(new ApplicationPidFileWriter("console.pid"));
springApplication.run(args);
}
示例7: main
import org.springframework.boot.system.ApplicationPidFileWriter; //导入依赖的package包/类
public static void main(String[] args) {
SpringApplication springApplication = new SpringApplication(TaskApplicationStart.class);
springApplication.addListeners(new ApplicationPidFileWriter("task.pid"));
springApplication.run(args);
}
示例8: applicationPidFileWriter
import org.springframework.boot.system.ApplicationPidFileWriter; //导入依赖的package包/类
public static ApplicationListener<?> applicationPidFileWriter() {
return new ApplicationPidFileWriter("app.pid");
}
示例9: main
import org.springframework.boot.system.ApplicationPidFileWriter; //导入依赖的package包/类
public static void main(String[] args) {
SpringApplication springApplication = new SpringApplication(RagnarApplication.class);
springApplication.addListeners(new ApplicationPidFileWriter());
springApplication.run(args);
}
示例10: main
import org.springframework.boot.system.ApplicationPidFileWriter; //导入依赖的package包/类
public static void main(String[] args) {
SpringApplication springApplication = new SpringApplication(ApplicationStart.class);
springApplication.addListeners(new ApplicationPidFileWriter("qiuqiu.pid"));
springApplication.run(args);
}
示例11: main
import org.springframework.boot.system.ApplicationPidFileWriter; //导入依赖的package包/类
public static void main(String[] args) throws SQLException, ClassNotFoundException {
final SpringApplication application = new SpringApplication(ServicesInOneApplication.class);
application.addListeners(new ApplicationPidFileWriter());
application.run(args);
}
示例12: main
import org.springframework.boot.system.ApplicationPidFileWriter; //导入依赖的package包/类
public static void main(String[] args) {
SpringApplication springApplication = new SpringApplication( DispatcherApplication.class);
ApplicationPidFileWriter applicationPidFileWriter = new ApplicationPidFileWriter();
springApplication.addListeners( applicationPidFileWriter );
springApplication.run(args);
}
示例13: main
import org.springframework.boot.system.ApplicationPidFileWriter; //导入依赖的package包/类
public static void main(String[] args) {
SpringApplication springApplication = new SpringApplication( SamplesAgentApplication.class);
ApplicationPidFileWriter applicationPidFileWriter = new ApplicationPidFileWriter();
springApplication.addListeners( applicationPidFileWriter );
springApplication.run(args);
}
示例14: main
import org.springframework.boot.system.ApplicationPidFileWriter; //导入依赖的package包/类
public static void main(String[] args) {
SpringApplication springApplication = new SpringApplication( ProgressMonitorApp.class);
ApplicationPidFileWriter applicationPidFileWriter = new ApplicationPidFileWriter();
springApplication.addListeners( applicationPidFileWriter );
springApplication.run(args);
}
示例15: main
import org.springframework.boot.system.ApplicationPidFileWriter; //导入依赖的package包/类
public static void main(String[] args) {
SpringApplication springApplication = new SpringApplication( ApiApplication.class);
ApplicationPidFileWriter applicationPidFileWriter = new ApplicationPidFileWriter();
springApplication.addListeners( applicationPidFileWriter );
springApplication.run(args);
}