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

Method notifyFailed

output/java_guava/1.4.17/AbstractService.java:401–426  ·  view source on GitHub ↗

Invoke this method to transition the service to the State#FAILED. The service will not be stopped if it is running. Invoke this method when a service has failed critically or otherwise cannot be started nor stopped.

(Throwable cause)

Source from the content-addressed store, hash-verified

399
400
401 protected final void notifyFailed(Throwable cause) {
402 checkNotNull(cause);
403 monitor.enter();
404 try {
405 State previous = state();
406 switch (previous) {
407 case NEW:
408 case TERMINATED:
409 throw new IllegalStateException("Failed while in state:" + previous, cause);
410 case RUNNING:
411 case STARTING:
412 case STOPPING:
413 snapshot = new StateSnapshot(FAILED, false, cause);
414 failed(previous, cause);
415 break;
416 case FAILED:
417 // Do nothing
418 break;
419 default:
420 throw new AssertionError("Unexpected state: " + previous);
421 }
422 } finally {
423 monitor.leave();
424 executeListeners();
425 }
426 }
427
428 @Override
429 public final boolean isRunning() {

Callers 9

startAsyncMethod · 0.95
stopAsyncMethod · 0.95
notifyStartedMethod · 0.95
notifyStoppedMethod · 0.95
runMethod · 0.45
runMethod · 0.45
runMethod · 0.45
rescheduleMethod · 0.45
runMethod · 0.45

Calls 6

stateMethod · 0.95
failedMethod · 0.95
executeListenersMethod · 0.95
checkNotNullMethod · 0.45
enterMethod · 0.45
leaveMethod · 0.45

Tested by

no test coverage detected