Package com.metamx.common.lifecycle

Examples of com.metamx.common.lifecycle.Lifecycle.stop()


      if (leading) {
        leading = false;
        mayBeStopped.signalAll();
        final Lifecycle leaderLifecycle = leaderLifecycleRef.getAndSet(null);
        if (leaderLifecycle != null) {
          leaderLifecycle.stop();
        }
      }
    }
    finally {
      giant.unlock();
View Full Code Here


      try {
        Lifecycle lifecycle = initLifecycle(injector);

        injector.getInstance(ExecutorLifecycle.class).join();
        lifecycle.stop();
      }
      catch (Throwable t) {
        log.error(t, "Error when starting up.  Failing.");
        System.exit(1);
      }
View Full Code Here

    injector.getInstance(TestInterface.class).run()// It's a singleton
    Assert.assertEquals(2, instance.getStarted());
    Assert.assertEquals(0, instance.getStopped());
    Assert.assertEquals(2, instance.getRan());

    lifecycle.stop();
    Assert.assertEquals(2, instance.getStarted());
    Assert.assertEquals(2, instance.getStopped());
    Assert.assertEquals(2, instance.getRan());
  }
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.