当前位置: 首页>>代码示例>>Java>>正文


Java ApplicationPidFileWriter类代码示例

本文整理汇总了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());
  }
}
 
开发者ID:dewey-its,项目名称:apollo-custom,代码行数:40,代码来源:ApolloApplication.java

示例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());
  }
}
 
开发者ID:dewey-its,项目名称:apollo-custom,代码行数:39,代码来源:LocalApolloApplication.java

示例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);

}
 
开发者ID:DeemOpen,项目名称:excord,代码行数:8,代码来源:Main.java

示例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);
}
 
开发者ID:Abdull,项目名称:sipgate-io-spring-boot,代码行数:8,代码来源:Application.java

示例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);
}
 
开发者ID:jocax,项目名称:spring-cloud-showcase,代码行数:8,代码来源:Application.java

示例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]");
}
 
开发者ID:ewerk,项目名称:sample_spring-boot-camel-mongo-jdk8,代码行数:15,代码来源:PrototypeApplication.java

示例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());
}
 
开发者ID:dewey-its,项目名称:apollo-custom,代码行数:6,代码来源:PortalApplication.java

示例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());
}
 
开发者ID:dewey-its,项目名称:apollo-custom,代码行数:7,代码来源:AdminServiceApplication.java

示例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());
}
 
开发者ID:dewey-its,项目名称:apollo-custom,代码行数:7,代码来源:ConfigServiceApplication.java

示例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);
}
 
开发者ID:larmic,项目名称:SpringBootAndSwaggerUI,代码行数:6,代码来源:DemoApplication.java

示例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);
    }
 
开发者ID:box,项目名称:mojito,代码行数:7,代码来源:Application.java

示例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);
}
 
开发者ID:Manfred73,项目名称:graphite-monitor-example,代码行数:6,代码来源:Application.java

示例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);
}
 
开发者ID:jandy-team,项目名称:jandy,代码行数:7,代码来源:JandyApplicationServer.java

示例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);
}
 
开发者ID:jocax,项目名称:spring-cloud-showcase,代码行数:7,代码来源:Application.java

示例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);
}
 
开发者ID:HSLdevcom,项目名称:parkandrideAPI,代码行数:6,代码来源:Application.java


注:本文中的org.springframework.boot.actuate.system.ApplicationPidFileWriter类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。