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

Method notifyStopped

output/java_guava/1.4.16/AbstractService.java:375–392  ·  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

373
374
375 protected final void notifyStopped() {
376 monitor.enter();
377 try {
378 // We check the internal state of the snapshot instead of state() directly so we don't allow
379 // notifyStopped() to be called while STARTING, even if stop() has already been called.
380 State previous = snapshot.state;
381 if (previous != STOPPING && previous != RUNNING) {
382 IllegalStateException failure = new IllegalStateException("Cannot notifyStopped() when the service is " + previous);
383 notifyFailed(failure);
384 throw failure;
385 }
386 snapshot = new StateSnapshot(TERMINATED);
387 terminated(previous);
388 } finally {
389 monitor.leave();
390 executeListeners();
391 }
392 }
393
394 /**
395 * 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