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

Method notifyStopped

output/java_guava/1.4.19/AbstractService.java:377–394  ·  view source on GitHub ↗

Implementing classes should invoke this method once their service has stopped. It will cause the service to transition from State#STOPPING to State#TERMINATED. @throws IllegalStateException if the service is neither State#STOPPING nor State#RUNNING.

()

Source from the content-addressed store, hash-verified

375
376
377 protected final void notifyStopped() {
378 monitor.enter();
379 try {
380 // We check the internal state of the snapshot instead of state() directly so we don't allow
381 // notifyStopped() to be called while STARTING, even if stop() has already been called.
382 State previous = snapshot.state;
383 if (previous != STOPPING && previous != RUNNING) {
384 IllegalStateException failure = new IllegalStateException("Cannot notifyStopped() when the service is " + previous);
385 notifyFailed(failure);
386 throw failure;
387 }
388 snapshot = new StateSnapshot(TERMINATED);
389 terminated(previous);
390 } finally {
391 monitor.leave();
392 executeListeners();
393 }
394 }
395
396 /**
397 * Invoke this method to transition the service to the {@link State#FAILED}. The service will

Callers 4

runMethod · 0.45
runMethod · 0.45
runMethod · 0.45
doStopMethod · 0.45

Calls 5

notifyFailedMethod · 0.95
terminatedMethod · 0.95
executeListenersMethod · 0.95
enterMethod · 0.45
leaveMethod · 0.45

Tested by

no test coverage detected