Examples of TerminationEvent


Examples of com.netflix.governator.guice.runner.TerminationEvent

   
    @Test(enabled=false)
    public void shouldCreateSingletonAndExitAfter1Second() throws Exception {
        Stopwatch sw = new Stopwatch().start();
       
        final TerminationEvent event = new SelfDestructingTerminationEvent(1, TimeUnit.SECONDS);
        LifecycleInjector.builder()
            // Example of a singleton that will be created
            .withAdditionalModules(new AbstractModule() {
                @Override
                protected void configure() {
                    bind(SomeSingleton.class).asEagerSingleton();
                }
            })
            .withAdditionalBootstrapModules(
                StandaloneRunnerModule.builder()
                    .withTerminateEvent(event)
                    .build())
            .build()
            .createInjector();
       
        event.await();
        long elapsed = sw.elapsed(TimeUnit.MILLISECONDS);
        LOG.info("Elapsed: " + elapsed);
        Assert.assertTrue(initCalled.get());
        Assert.assertTrue(shutdownCalled.get());
        Assert.assertTrue(elapsed > 1000);
View Full Code Here

Examples of com.netflix.governator.guice.runner.TerminationEvent

        LOG.info("Exit main");

    }
   
    public static void main(String args[]) {
        final TerminationEvent event = new SelfDestructingTerminationEvent(1, TimeUnit.SECONDS);
        LifecycleInjector.builder()
            // Example of a singleton that will be created
            .withAdditionalModules(new AbstractModule() {
                @Override
                protected void configure() {
View Full Code Here

Examples of eu.stratosphere.pact.runtime.iterative.event.TerminationEvent

          log.info(formatLogString("signaling that all workers are to terminate in iteration ["
            + currentIteration + "]"));
        }

        requestTermination();
        sendToAllWorkers(new TerminationEvent());
//        notifyMonitor(IterationMonitoring.Event.SYNC_FINISHED, currentIteration);
      } else {
        if (log.isInfoEnabled()) {
          log.info(formatLogString("signaling that all workers are done in iteration [" + currentIteration
            + "]"));
View Full Code Here

Examples of eu.stratosphere.pact.runtime.iterative.event.TerminationEvent

  }

  @Test
  public void syncTermination() throws InterruptedException {
    for (int n = 0; n < 20; n++) {
      sync(new TerminationEvent());
    }
  }
View Full Code Here

Examples of org.apache.flink.runtime.iterative.event.TerminationEvent

  }

  @Test
  public void syncTermination() throws InterruptedException {
    for (int n = 0; n < 20; n++) {
      sync(new TerminationEvent());
    }
  }
View Full Code Here

Examples of org.apache.flink.runtime.iterative.event.TerminationEvent

          log.info(formatLogString("signaling that all workers are to terminate in iteration ["
            + currentIteration + "]"));
        }

        requestTermination();
        sendToAllWorkers(new TerminationEvent());
//        notifyMonitor(IterationMonitoring.Event.SYNC_FINISHED, currentIteration);
      } else {
        if (log.isInfoEnabled()) {
          log.info(formatLogString("signaling that all workers are done in iteration [" + currentIteration
            + "]"));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.