本文整理汇总了Java中org.springframework.boot.actuate.system.ApplicationPidFileWriter类的典型用法代码示例。如果您正苦于以下问题:Java ApplicationPidFileWriter类的具体用法?Java ApplicationPidFileWriter怎么用?Java ApplicationPidFileWriter使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ApplicationPidFileWriter类属于org.springframework.boot.actuate.system包,在下文中一共展示了ApplicationPidFileWriter类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: main
import org.springframework.boot.actuate.system.ApplicationPidFileWriter; //导入依赖的package包/类
public static void main(String[] args) throws Exception {
/**
* Common
*/
ConfigurableApplicationContext commonContext =
new SpringApplicationBuilder(ApolloApplication.class).web(false).run(args);
commonContext.addApplicationListener(new ApplicationPidFileWriter());
logger.info(commonContext.getId() + " isActive: " + commonContext.isActive());
/**
* ConfigService
*/
if (commonContext.getEnvironment().containsProperty("configservice")) {
ConfigurableApplicationContext configContext =
new SpringApplicationBuilder(ConfigServiceApplication.class).parent(commonContext)
.sources(RefreshScope.class).run(args);
logger.info(configContext.getId() + " isActive: " + configContext.isActive());
}
/**
* AdminService
*/
if (commonContext.getEnvironment().containsProperty("adminservice")) {
ConfigurableApplicationContext adminContext =
new SpringApplicationBuilder(AdminServiceApplication.class).parent(commonContext)
.sources(RefreshScope.class).run(args);
logger.info(adminContext.getId() + " isActive: " + adminContext.isActive());
}
/**
* Portal
*/
if (commonContext.getEnvironment().containsProperty("portal")) {
ConfigurableApplicationContext portalContext =
new SpringApplicationBuilder(PortalApplication.class).parent(commonContext)
.sources(RefreshScope.class).run(args);
logger.info(portalContext.getId() + " isActive: " + portalContext.isActive());
}
}
示例2: main
import org.springframework.boot.actuate.system.ApplicationPidFileWriter; //导入依赖的package包/类
public static void main(String[] args) throws Exception {
/**
* Common
*/
ConfigurableApplicationContext commonContext =
new SpringApplicationBuilder(ApolloApplication.class).web(false).run(args);
commonContext.addApplicationListener(new ApplicationPidFileWriter());
logger.info(commonContext.getId() + " isActive: " + commonContext.isActive());
/**
* ConfigService
*/
if (commonContext.getEnvironment().containsProperty("configservice")) {
ConfigurableApplicationContext configContext =
new SpringApplicationBuilder(ConfigServiceApplication.class).parent(commonContext)
.sources(RefreshScope.class).run(args);
logger.info(configContext.getId() + " isActive: " + configContext.isActive());
}
/**
* AdminService
*/
if (commonContext.getEnvironment().containsProperty("adminservice")) {
ConfigurableApplicationContext adminContext =
new SpringApplicationBuilder(AdminServiceApplication.class).parent(commonContext)
.sources(RefreshScope.class).run(args);
logger.info(adminContext.getId() + " isActive: " + adminContext.isActive());
}
/**
* Portal
*/
if (commonContext.getEnvironment().containsProperty("portal")) {
ConfigurableApplicationContext portalContext =
new SpringApplicationBuilder(PortalApplication.class).parent(commonContext).run(args);
logger.info(portalContext.getId() + " isActive: " + portalContext.isActive());
}
}
示例3: main
import org.springframework.boot.actuate.system.ApplicationPidFileWriter; //导入依赖的package包/类
public static void main(String[] args) throws Exception {
LOGGER.info("Starting Server!");
SpringApplication app = new SpringApplication(Main.class);
app.addListeners(new ApplicationPidFileWriter());
ApplicationContext ctx = app.run(args);
}
示例4: main
import org.springframework.boot.actuate.system.ApplicationPidFileWriter; //导入依赖的package包/类
public static void main(String[] args) throws Exception {
//SpringApplication.run(Application.class, args);
SpringApplication springApplication = new SpringApplication(Application.class);
springApplication.addListeners( new ApplicationPidFileWriter() );
springApplication.run(args);
}
示例5: main
import org.springframework.boot.actuate.system.ApplicationPidFileWriter; //导入依赖的package包/类
public static void main(String[] args) {
SpringApplication springApplication = new SpringApplication(Application.class);
springApplication.setWebEnvironment(true);
springApplication.addListeners(new ApplicationPidFileWriter("app.pid"));
springApplication.addListeners(new EmbeddedServerPortFileWriter("app.port"));
springApplication.run(args);
}
示例6: main
import org.springframework.boot.actuate.system.ApplicationPidFileWriter; //导入依赖的package包/类
public static void main(final String... args) {
final ApplicationPidFileWriter pidFileWriter = new ApplicationPidFileWriter();
pidFileWriter.setTriggerEventType(ApplicationEnvironmentPreparedEvent.class);
final SpringApplication application = new SpringApplication(PrototypeApplication.class);
application.setHeadless(true);
application.setRegisterShutdownHook(true);
application.setLogStartupInfo(false);
application.setWebEnvironment(true);
application.addListeners(pidFileWriter);
application.run(args);
LOG.info("Prototype launched [OK]");
}
示例7: main
import org.springframework.boot.actuate.system.ApplicationPidFileWriter; //导入依赖的package包/类
public static void main(String[] args) throws Exception {
ConfigurableApplicationContext context = SpringApplication.run(PortalApplication.class, args);
context.addApplicationListener(new ApplicationPidFileWriter());
context.addApplicationListener(new EmbeddedServerPortFileWriter());
}
示例8: main
import org.springframework.boot.actuate.system.ApplicationPidFileWriter; //导入依赖的package包/类
public static void main(String[] args) {
ConfigurableApplicationContext context =
new SpringApplicationBuilder(AdminServiceApplication.class).run(args);
context.addApplicationListener(new ApplicationPidFileWriter());
context.addApplicationListener(new EmbeddedServerPortFileWriter());
}
示例9: main
import org.springframework.boot.actuate.system.ApplicationPidFileWriter; //导入依赖的package包/类
public static void main(String[] args) throws Exception {
ConfigurableApplicationContext context =
new SpringApplicationBuilder(ConfigServiceApplication.class).run(args);
context.addApplicationListener(new ApplicationPidFileWriter());
context.addApplicationListener(new EmbeddedServerPortFileWriter());
}
示例10: main
import org.springframework.boot.actuate.system.ApplicationPidFileWriter; //导入依赖的package包/类
public static void main(String[] args) {
final SpringApplication springApplication = new SpringApplication(DemoApplication.class);
springApplication.addListeners(new ApplicationPidFileWriter("demo.pid"));
springApplication.run(args);
}
示例11: main
import org.springframework.boot.actuate.system.ApplicationPidFileWriter; //导入依赖的package包/类
public static void main(String[] args) throws IOException {
SpringApplication springApplication = new SpringApplication(Application.class);
springApplication.addListeners(new ApplicationPidFileWriter("application.pid"));
springApplication.run(args);
}
示例12: main
import org.springframework.boot.actuate.system.ApplicationPidFileWriter; //导入依赖的package包/类
public static void main(String[] args) {
SpringApplication springApplication = new SpringApplication(Application.class);
springApplication.addListeners(new ApplicationPidFileWriter(APPLICATION_PID));
springApplication.run(args);
}
示例13: main
import org.springframework.boot.actuate.system.ApplicationPidFileWriter; //导入依赖的package包/类
public static void main(String[] args) {
new SpringApplicationBuilder()
.listeners(new ApplicationPidFileWriter())
.sources(JandyApplicationServer.class)
.run(args);
}
示例14: main
import org.springframework.boot.actuate.system.ApplicationPidFileWriter; //导入依赖的package包/类
public static void main(String[] args) {
SpringApplication springApplication = new SpringApplication(Application.class);
springApplication.addListeners(new ApplicationPidFileWriter("app.pid"));
springApplication.addListeners(new EmbeddedServerPortFileWriter("app.port"));
springApplication.run(args);
}
示例15: main
import org.springframework.boot.actuate.system.ApplicationPidFileWriter; //导入依赖的package包/类
public static void main(String[] args) {
SpringApplication app = new SpringApplication(Application.class);
app.addListeners(new ApplicationPidFileWriter());
app.run(args);
}