Example usage for io.netty.channel EventLoopGroup isShuttingDown

List of usage examples for io.netty.channel EventLoopGroup isShuttingDown

Introduction

In this page you can find the example usage for io.netty.channel EventLoopGroup isShuttingDown.

Prototype

boolean isShuttingDown();

Source Link

Document

Returns true if and only if all EventExecutor s managed by this EventExecutorGroup are being #shutdownGracefully() shut down gracefully or was #isShutdown() shut down .

Usage

From source file:com.streamsets.pipeline.lib.network.BaseNettyServer.java

License:Apache License

public void destroy() {
    LOG.info("Destroying server on address(es) {}", addresses);
    for (ChannelFuture channelFuture : channelFutures) {
        if (channelFuture != null && channelFuture.isCancellable()) {
            channelFuture.cancel(true);//  w w  w .  ja  v  a2s. c o m
        }
    }
    try {
        for (EventLoopGroup group : groups) {
            if (group != null && !group.isShutdown() && !group.isShuttingDown()) {
                try {
                    group.shutdownGracefully().get();
                } catch (InterruptedException ex) {
                    LOG.error("InterruptedException thrown while shutting down: " + ex, ex);
                    Thread.currentThread().interrupt();
                } catch (Exception ex) {
                    LOG.error("Unexpected error shutting down: " + ex, ex);
                }
            }
        }
    } finally {
        channelFutures.clear();
    }
}

From source file:org.apache.tajo.rpc.NettyUtils.java

License:Apache License

protected static boolean isEventLoopGroupShuttingDown(EventLoopGroup eventLoopGroup) {
    return ((eventLoopGroup == null) || eventLoopGroup.isShuttingDown());
}