MCPcopy Create free account
hub / github.com/antlr/codebuff / notifyStarted

Method notifyStarted

output/java_guava/1.4.17/AbstractService.java:341–364  ·  view source on GitHub ↗

Implementing classes should invoke this method once their service has started. It will cause the service to transition from State#STARTING to State#RUNNING. @throws IllegalStateException if the service is not State#STARTING.

()

Source from the content-addressed store, hash-verified

339
340
341 protected final void notifyStarted() {
342 monitor.enter();
343 try {
344 // We have to examine the internal state of the snapshot here to properly handle the stop
345 // while starting case.
346 if (snapshot.state != STARTING) {
347 IllegalStateException failure = new IllegalStateException("Cannot notifyStarted() when the service is " + snapshot.state);
348 notifyFailed(failure);
349 throw failure;
350 }
351 if (snapshot.shutdownWhenStartupFinishes) {
352 snapshot = new StateSnapshot(STOPPING);
353 // We don't call listeners here because we already did that when we set the
354 // shutdownWhenStartupFinishes flag.
355 doStop();
356 } else {
357 snapshot = new StateSnapshot(RUNNING);
358 running();
359 }
360 } finally {
361 monitor.leave();
362 executeListeners();
363 }
364 }
365
366 /**
367 * Implementing classes should invoke this method once their service has stopped. It will cause

Callers 4

runMethod · 0.45
runMethod · 0.45
runMethod · 0.45
doStartMethod · 0.45

Calls 6

notifyFailedMethod · 0.95
doStopMethod · 0.95
runningMethod · 0.95
executeListenersMethod · 0.95
enterMethod · 0.45
leaveMethod · 0.45

Tested by

no test coverage detected