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

Method notifyStarted

output/java_guava/1.4.19/AbstractService.java:343–366  ·  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

341
342
343 protected final void notifyStarted() {
344 monitor.enter();
345 try {
346 // We have to examine the internal state of the snapshot here to properly handle the stop
347 // while starting case.
348 if (snapshot.state != STARTING) {
349 IllegalStateException failure = new IllegalStateException("Cannot notifyStarted() when the service is " + snapshot.state);
350 notifyFailed(failure);
351 throw failure;
352 }
353 if (snapshot.shutdownWhenStartupFinishes) {
354 snapshot = new StateSnapshot(STOPPING);
355 // We don't call listeners here because we already did that when we set the
356 // shutdownWhenStartupFinishes flag.
357 doStop();
358 } else {
359 snapshot = new StateSnapshot(RUNNING);
360 running();
361 }
362 } finally {
363 monitor.leave();
364 executeListeners();
365 }
366 }
367
368 /**
369 * 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