MCPcopy Create free account
hub / github.com/grpc/grpc-java / shutdown

Method shutdown

netty/src/main/java/io/grpc/netty/NettyServer.java:363–390  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

361 }
362
363 @Override
364 public void shutdown() {
365 if (terminated) {
366 return;
367 }
368 ChannelGroupFuture groupFuture = channelGroup.close()
369 .addListener(new ChannelGroupFutureListener() {
370 @Override
371 public void operationComplete(ChannelGroupFuture future) throws Exception {
372 if (!future.isSuccess()) {
373 log.log(Level.WARNING, "Error closing server channel group", future.cause());
374 }
375 sharedResourceReferenceCounter.release();
376 protocolNegotiator.close();
377 listenSocketStatsList = Collections.emptyList();
378 synchronized (NettyServer.this) {
379 listener.serverShutdown();
380 terminated = true;
381 }
382 }
383 });
384 try {
385 groupFuture.await();
386 } catch (InterruptedException e) {
387 log.log(Level.FINE, "Interrupted while shutting down", e);
388 Thread.currentThread().interrupt();
389 }
390 }
391
392 @Override
393 public InternalLogId getLogId() {

Callers 5

startStopMethod · 0.95
multiPortStartStopGetMethod · 0.95
multiPortConnectionsMethod · 0.95
channelzListenSocketMethod · 0.95

Calls 4

closeMethod · 0.65
awaitMethod · 0.65
addListenerMethod · 0.45
logMethod · 0.45

Tested by 5

startStopMethod · 0.76
multiPortStartStopGetMethod · 0.76
multiPortConnectionsMethod · 0.76
channelzListenSocketMethod · 0.76