@Test(expected = IllegalStateException.class) public final void assertThatCallingStartTwiceInARowFails() { final HazelcastService objectUnderTest = newObjectUnderTest(); objectUnderTest.start(); objectUnderTest.start(); }
@Override public void start() { checkState(this.hazelcastInstance == null, "{} has already been started", this); this.log.info("Starting {} using ...", this.configuration); final long start = System.currentTimeMillis(); this.hazelcastInstance = FactoryImpl .newHazelcastInstanceProxy(this.configuration); final long startupDuration = System.currentTimeMillis() - start; this.metricsRegistry.newGauge(getClass(), STARTUP_DURATION_GAUGE, new Gauge<Long>() { @Override public Long value() { return startupDuration; } }); this.log.info("{} started in [{}] ms", this, startupDuration); }
HazelcastService implements SmartLifecycle { @Override public void start() { checkState(this.hazelcastInstance == null, "{} has already been started", this); this.log.info("Starting {} using ...", this.configuration); final long start = System.currentTimeMillis(); this.hazelcastInstance = FactoryImpl .newHazelcastInstanceProxy(this.configuration); final long startupDuration = System.currentTimeMillis() - start; this.metricsRegistry.newGauge(getClass(), STARTUP_DURATION_GAUGE, new Gauge<Long>() { @Override public Long value() { return startupDuration; } }); this.log.info("{} started in [{}] ms", this, startupDuration); } }
HazelcastService implements SmartLifecycle { @Override public void start() { checkState(this.hazelcastInstance == null, "{} has already been started", this); this.log.info("Starting {} using ...", this.configuration); final long start = System.currentTimeMillis(); this.hazelcastInstance = FactoryImpl .newHazelcastInstanceProxy(this.configuration); final long startupDuration = System.currentTimeMillis() - start; this.metricsRegistry.newGauge(getClass(), STARTUP_DURATION_GAUGE, new Gauge<Long>() { @Override public Long value() { return startupDuration; } }); this.log.info("{} started in [{}] ms", this, startupDuration); } HazelcastService(final Config configuration,
	        final MetricsRegistry metricsRegistry); }
HazelcastService implements SmartLifecycle { @Override public void start() { checkState(this.hazelcastInstance == null, "{} has already been started", this); this.log.info("Starting {} using ...", this.configuration); final long start = System.currentTimeMillis(); this.hazelcastInstance = FactoryImpl .newHazelcastInstanceProxy(this.configuration); final long startupDuration = System.currentTimeMillis() - start; this.metricsRegistry.newGauge(getClass(), STARTUP_DURATION_GAUGE, new Gauge<Long>() { @Override public Long value() { return startupDuration; } }); this.log.info("{} started in [{}] ms", this, startupDuration); } HazelcastService(final Config configuration,
	        final MetricsRegistry metricsRegistry); @Override void start(); @Override void stop(); @Override boolean isRunning(); @Override int getPhase(); @Override boolean isAutoStartup(); @Override void stop(final Runnable callback); @Override String toString(); }
HazelcastService implements SmartLifecycle { @Override public void start() { checkState(this.hazelcastInstance == null, "{} has already been started", this); this.log.info("Starting {} using ...", this.configuration); final long start = System.currentTimeMillis(); this.hazelcastInstance = FactoryImpl .newHazelcastInstanceProxy(this.configuration); final long startupDuration = System.currentTimeMillis() - start; this.metricsRegistry.newGauge(getClass(), STARTUP_DURATION_GAUGE, new Gauge<Long>() { @Override public Long value() { return startupDuration; } }); this.log.info("{} started in [{}] ms", this, startupDuration); } HazelcastService(final Config configuration,
	        final MetricsRegistry metricsRegistry); @Override void start(); @Override void stop(); @Override boolean isRunning(); @Override int getPhase(); @Override boolean isAutoStartup(); @Override void stop(final Runnable callback); @Override String toString();  }