Example usage for io.netty.bootstrap ServerBootstrapConfig childGroup

List of usage examples for io.netty.bootstrap ServerBootstrapConfig childGroup

Introduction

In this page you can find the example usage for io.netty.bootstrap ServerBootstrapConfig childGroup.

Prototype

@SuppressWarnings("deprecation")
public EventLoopGroup childGroup() 

Source Link

Document

Returns the configured EventLoopGroup which will be used for the child channels or null if non is configured yet.

Usage

From source file:io.crate.mqtt.netty.Netty4MqttServerTransport.java

@Override
protected void doStop() {
    for (Channel channel : serverChannels) {
        channel.close().awaitUninterruptibly();
    }//from  w w  w. j a  v  a2s  .  c  om
    serverChannels.clear();
    if (serverBootstrap != null) {
        ServerBootstrapConfig config = serverBootstrap.config();
        config.group().shutdownGracefully(0, 5, TimeUnit.SECONDS).awaitUninterruptibly();
        config.childGroup().shutdownGracefully(0, 5, TimeUnit.SECONDS).awaitUninterruptibly();
        serverBootstrap = null;
    }
}

From source file:io.crate.protocols.postgres.PostgresNetty.java

License:Apache License

@Override
protected void doStop() {
    for (Channel channel : serverChannels) {
        channel.close().awaitUninterruptibly();
    }//from   ww w . ja  va 2 s  .  c  o m
    serverChannels.clear();
    if (bootstrap != null) {
        ServerBootstrapConfig config = bootstrap.config();
        config.group().shutdownGracefully(0, 5, TimeUnit.SECONDS).awaitUninterruptibly();
        config.childGroup().shutdownGracefully(0, 5, TimeUnit.SECONDS).awaitUninterruptibly();
        bootstrap = null;
    }
}