Java 类org.springframework.boot.devtools.restart.Restarter 实例源码

项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:FileWatchingFailureHandler.java   
@Override
public Outcome handle(Throwable failure) {
    CountDownLatch latch = new CountDownLatch(1);
    FileSystemWatcher watcher = this.fileSystemWatcherFactory.getFileSystemWatcher();
    watcher.addSourceFolders(
            new ClassPathFolders(Restarter.getInstance().getInitialUrls()));
    watcher.addListener(new Listener(latch));
    watcher.start();
    try {
        latch.await();
    }
    catch (InterruptedException ex) {
        Thread.currentThread().interrupt();
    }
    return Outcome.RETRY;
}
项目:spring-boot-concourse    文件:FileWatchingFailureHandler.java   
@Override
public Outcome handle(Throwable failure) {
    CountDownLatch latch = new CountDownLatch(1);
    FileSystemWatcher watcher = this.fileSystemWatcherFactory.getFileSystemWatcher();
    watcher.addSourceFolders(
            new ClassPathFolders(Restarter.getInstance().getInitialUrls()));
    watcher.addListener(new Listener(latch));
    watcher.start();
    try {
        latch.await();
    }
    catch (InterruptedException ex) {
        // Ignore
    }
    return Outcome.RETRY;
}
项目:contestparser    文件:FileWatchingFailureHandler.java   
@Override
public Outcome handle(Throwable failure) {
    failure.printStackTrace();
    CountDownLatch latch = new CountDownLatch(1);
    FileSystemWatcher watcher = this.fileSystemWatcherFactory.getFileSystemWatcher();
    watcher.addSourceFolders(
            new ClassPathFolders(Restarter.getInstance().getInitialUrls()));
    watcher.addListener(new Listener(latch));
    watcher.start();
    try {
        latch.await();
    }
    catch (InterruptedException ex) {
        // Ignore
    }
    return Outcome.RETRY;
}
项目:ReBoot    文件:YarnRunner.java   
@Override
public void run(String... args) throws Exception {
  if (!environment.acceptsProfiles("production") && !environment.acceptsProfiles("test")) {
    AtomicBoolean registered = (AtomicBoolean) Restarter.getInstance().getOrAddAttribute("yarnStarted", AtomicBoolean::new);
    boolean alreadyRun = registered.getAndSet(true);
    if (!alreadyRun) {
      startFrontend();
    }
  }
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:RestartServer.java   
/**
 * Called to restart the application.
 * @param urls the updated URLs
 * @param files the updated files
 */
protected void restart(Set<URL> urls, ClassLoaderFiles files) {
    Restarter restarter = Restarter.getInstance();
    restarter.addUrls(urls);
    restarter.addClassLoaderFiles(files);
    restarter.restart();
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:RemoteSpringApplication.java   
private void run(String[] args) {
    Restarter.initialize(args, RestartInitializer.NONE);
    SpringApplication application = new SpringApplication(
            RemoteClientConfiguration.class);
    application.setWebEnvironment(false);
    application.setBanner(getBanner());
    application.setInitializers(getInitializers());
    application.setListeners(getListeners());
    application.run(args);
    waitIndefinitely();
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:LocalDevToolsAutoConfiguration.java   
@Bean
@RestartScope
@ConditionalOnMissingBean
public LiveReloadServer liveReloadServer() {
    return new LiveReloadServer(this.properties.getLivereload().getPort(),
            Restarter.getInstance().getThreadFactory());
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:LocalDevToolsAutoConfiguration.java   
@EventListener
public void onClassPathChanged(ClassPathChangedEvent event) {
    if (event.isRestartRequired()) {
        Restarter.getInstance().restart(
                new FileWatchingFailureHandler(fileSystemWatcherFactory()));
    }
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:LocalDevToolsAutoConfiguration.java   
@Bean
@ConditionalOnMissingBean
public ClassPathFileSystemWatcher classPathFileSystemWatcher() {
    URL[] urls = Restarter.getInstance().getInitialUrls();
    ClassPathFileSystemWatcher watcher = new ClassPathFileSystemWatcher(
            fileSystemWatcherFactory(), classPathRestartStrategy(), urls);
    watcher.setStopWatcherOnRestart(true);
    return watcher;
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:RemoteClientConfiguration.java   
@Bean
@RestartScope
@ConditionalOnMissingBean
public LiveReloadServer liveReloadServer() {
    return new LiveReloadServer(this.properties.getLivereload().getPort(),
            Restarter.getInstance().getThreadFactory());
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:LocalDevToolsAutoConfigurationTests.java   
private ConfigurableApplicationContext initializeAndRun(Class<?> config,
        Map<String, Object> properties, String... args) {
    Restarter.initialize(new String[0], false, new MockRestartInitializer(), false);
    SpringApplication application = new SpringApplication(config);
    application.setDefaultProperties(getDefaultProperties(properties));
    application.setWebEnvironment(false);
    ConfigurableApplicationContext context = application.run(args);
    return context;
}
项目:spring-boot-concourse    文件:RestartServer.java   
/**
 * Called to restart the application.
 * @param urls the updated URLs
 * @param files the updated files
 */
protected void restart(Set<URL> urls, ClassLoaderFiles files) {
    Restarter restarter = Restarter.getInstance();
    restarter.addUrls(urls);
    restarter.addClassLoaderFiles(files);
    restarter.restart();
}
项目:spring-boot-concourse    文件:RemoteSpringApplication.java   
private void run(String[] args) {
    Restarter.initialize(args, RestartInitializer.NONE);
    SpringApplication application = new SpringApplication(
            RemoteClientConfiguration.class);
    application.setWebEnvironment(false);
    application.setBanner(getBanner());
    application.setInitializers(getInitializers());
    application.setListeners(getListeners());
    application.run(args);
    waitIndefinitely();
}
项目:spring-boot-concourse    文件:LocalDevToolsAutoConfiguration.java   
@Bean
@RestartScope
@ConditionalOnMissingBean
public LiveReloadServer liveReloadServer() {
    return new LiveReloadServer(this.properties.getLivereload().getPort(),
            Restarter.getInstance().getThreadFactory());
}
项目:spring-boot-concourse    文件:LocalDevToolsAutoConfiguration.java   
@EventListener
public void onClassPathChanged(ClassPathChangedEvent event) {
    if (event.isRestartRequired()) {
        Restarter.getInstance().restart(
                new FileWatchingFailureHandler(fileSystemWatcherFactory()));
    }
}
项目:spring-boot-concourse    文件:LocalDevToolsAutoConfiguration.java   
@Bean
@ConditionalOnMissingBean
public ClassPathFileSystemWatcher classPathFileSystemWatcher() {
    URL[] urls = Restarter.getInstance().getInitialUrls();
    ClassPathFileSystemWatcher watcher = new ClassPathFileSystemWatcher(
            fileSystemWatcherFactory(), classPathRestartStrategy(), urls);
    watcher.setStopWatcherOnRestart(true);
    return watcher;
}
项目:spring-boot-concourse    文件:RemoteClientConfiguration.java   
@Bean
@RestartScope
@ConditionalOnMissingBean
public LiveReloadServer liveReloadServer() {
    return new LiveReloadServer(this.properties.getLivereload().getPort(),
            Restarter.getInstance().getThreadFactory());
}
项目:spring-boot-concourse    文件:LocalDevToolsAutoConfigurationTests.java   
private ConfigurableApplicationContext initializeAndRun(Class<?> config,
        Map<String, Object> properties, String... args) {
    Restarter.initialize(new String[0], false, new MockRestartInitializer(), false);
    SpringApplication application = new SpringApplication(config);
    application.setDefaultProperties(getDefaultProperties(properties));
    application.setWebEnvironment(false);
    ConfigurableApplicationContext context = application.run(args);
    return context;
}
项目:contestparser    文件:RestartServer.java   
/**
 * Called to restart the application.
 * @param urls the updated URLs
 * @param files the updated files
 */
protected void restart(Set<URL> urls, ClassLoaderFiles files) {
    Restarter restarter = Restarter.getInstance();
    restarter.addUrls(urls);
    restarter.addClassLoaderFiles(files);
    restarter.restart();
}
项目:contestparser    文件:RemoteSpringApplication.java   
private void run(String[] args) {
    Restarter.initialize(args, RestartInitializer.NONE);
    SpringApplication application = new SpringApplication(
            RemoteClientConfiguration.class);
    application.setWebEnvironment(false);
    application.setBanner(getBanner());
    application.setInitializers(getInitializers());
    application.setListeners(getListeners());
    application.run(args);
    waitIndefinitely();
}
项目:contestparser    文件:LocalDevToolsAutoConfiguration.java   
@Bean
@RestartScope
@ConditionalOnMissingBean
public LiveReloadServer liveReloadServer() {
    return new LiveReloadServer(this.properties.getLivereload().getPort(),
            Restarter.getInstance().getThreadFactory());
}
项目:contestparser    文件:LocalDevToolsAutoConfiguration.java   
@EventListener
public void onClassPathChanged(ClassPathChangedEvent event) {
    if (event.isRestartRequired()) {
        Restarter.getInstance().restart(
                new FileWatchingFailureHandler(fileSystemWatcherFactory()));
    }
}
项目:contestparser    文件:LocalDevToolsAutoConfiguration.java   
@Bean
@ConditionalOnMissingBean
public ClassPathFileSystemWatcher classPathFileSystemWatcher() {
    URL[] urls = Restarter.getInstance().getInitialUrls();
    ClassPathFileSystemWatcher watcher = new ClassPathFileSystemWatcher(
            fileSystemWatcherFactory(), classPathRestartStrategy(), urls);
    watcher.setStopWatcherOnRestart(true);
    return watcher;
}
项目:contestparser    文件:RemoteClientConfiguration.java   
@Bean
@RestartScope
@ConditionalOnMissingBean
public LiveReloadServer liveReloadServer() {
    return new LiveReloadServer(this.properties.getLivereload().getPort(),
            Restarter.getInstance().getThreadFactory());
}
项目:contestparser    文件:LocalDevToolsAutoConfigurationTests.java   
private ConfigurableApplicationContext initializeAndRun(Class<?> config,
        Map<String, Object> properties, String... args) {
    Restarter.initialize(new String[0], false, new MockRestartInitializer(), false);
    SpringApplication application = new SpringApplication(config);
    application.setDefaultProperties(getDefaultProperties(properties));
    application.setWebEnvironment(false);
    ConfigurableApplicationContext context = application.run(args);
    return context;
}
项目:wicket-spring-boot    文件:WicketDevToolsPropertyDefaultsPostProcessor.java   
private boolean isRestarterInitialized() {

    try {
        Restarter restarter = Restarter.getInstance();
        return (restarter != null && restarter.getInitialUrls() != null);
    }
    catch (NoClassDefFoundError | Exception ex) {
        return false;
    }
}