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

Method notifyFailed

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

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