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

Method stopAsync

output/java_guava/1.4.19/AbstractService.java:223–259  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

221 }
222
223 @CanIgnoreReturnValue
224 @Override
225 public final Service stopAsync() {
226 if (monitor.enterIf(isStoppable)) {
227 try {
228 State previous = state();
229 switch (previous) {
230 case NEW:
231 snapshot = new StateSnapshot(TERMINATED);
232 terminated(NEW);
233 break;
234 case STARTING:
235 snapshot = new StateSnapshot(STARTING, true, null);
236 stopping(STARTING);
237 break;
238 case RUNNING:
239 snapshot = new StateSnapshot(STOPPING);
240 stopping(RUNNING);
241 doStop();
242 break;
243 case STOPPING:
244 case TERMINATED:
245 case FAILED:
246 // These cases are impossible due to the if statement above.
247 throw new AssertionError("isStoppable is incorrectly implemented, saw: " + previous);
248 default:
249 throw new AssertionError("Unexpected state: " + previous);
250 }
251 } catch (Throwable shutdownFailure) {
252 notifyFailed(shutdownFailure);
253 } finally {
254 monitor.leave();
255 executeListeners();
256 }
257 }
258 return this;
259 }
260
261 @Override
262 public final void awaitRunning() {

Callers

nothing calls this directly

Calls 8

stateMethod · 0.95
terminatedMethod · 0.95
stoppingMethod · 0.95
doStopMethod · 0.95
notifyFailedMethod · 0.95
executeListenersMethod · 0.95
enterIfMethod · 0.45
leaveMethod · 0.45

Tested by

no test coverage detected