Example usage for io.netty.channel ChannelHandlerContext fireChannelInactive

List of usage examples for io.netty.channel ChannelHandlerContext fireChannelInactive

Introduction

In this page you can find the example usage for io.netty.channel ChannelHandlerContext fireChannelInactive.

Prototype

@Override
    ChannelHandlerContext fireChannelInactive();

Source Link

Usage

From source file:org.rzo.netty.ahessian.heartbeat.HeartbeatHandlerInbound.java

License:Apache License

@Override
public void channelInactive(ChannelHandlerContext ctx) throws Exception {
    _ctx = null;// www  . ja  va  2s  .  c om
    _intervalTimer.stop();
    ctx.fireChannelInactive();
}

From source file:org.rzo.netty.ahessian.io.InputStreamHandler.java

License:Apache License

public void channelInactive(ChannelHandlerContext ctx) throws Exception {
    if (_disconnectListener != null)
        _disconnectListener.run();/*from w  w w . j  av a 2 s .com*/
    ctx.fireChannelInactive();
}

From source file:org.rzo.netty.ahessian.io.OutputStreamHandler.java

License:Apache License

@Override
public void channelInactive(ChannelHandlerContext ctx) throws Exception {
    doChannelInactive();/*from   w  w  w. j  av  a 2  s. c  om*/
    ctx.fireChannelInactive();
}

From source file:org.rzo.netty.ahessian.io.PullInputStreamConsumer.java

License:Apache License

@Override
public void channelInactive(ChannelHandlerContext ctx) throws Exception {
    _lock.lock();/*from   w  w w .  ja v a 2  s  . c o  m*/
    try {
        _consumer.setContext(null);
        _ctx = ctx;
    } finally {
        _lock.unlock();
    }
    ctx.fireChannelInactive();
}

From source file:org.rzo.netty.ahessian.rpc.client.ReconnectHandler.java

License:Apache License

@Override
public void channelInactive(ChannelHandlerContext ctx) {
    ctx.fireChannelInactive();
    scheduleReconnect();
}

From source file:org.rzo.netty.ahessian.rpc.server.HessianRPCServiceHandler.java

License:Apache License

@Override
public void channelInactive(final ChannelHandlerContext ctx) throws Exception {
    ahessianLogger.warn(ctx.channel() + " disconnected");

    _openCounter.decrementAndGet();//from   w  w  w  .j  av a2s.c  o  m
    ctx.fireChannelInactive();

    if (_disconnectListener != null)
        _executor.execute(new Runnable() {

            @Override
            public void run() {
                _disconnectListener.run(ctx.channel());
            }
        });

}

From source file:org.rzo.netty.ahessian.session.ClientSessionFilter.java

License:Apache License

@Override
public void channelInactive(ChannelHandlerContext ctx) {
    _hasSession = false;
    _sessionId = "";
    ctx.fireChannelInactive();
}

From source file:org.rzo.netty.ahessian.session.ServerSessionFilter.java

License:Apache License

@Override
public void channelInactive(final ChannelHandlerContext ctx) throws Exception {

    _hasSession = false;/* w  ww.  j  a v a  2 s.c om*/
    ctx.channel().attr(SESSION).get().close();
    final String sessionId = ctx.channel().attr(SESSION).get().getId();
    Constants.ahessianLogger.info("Session disconnected: " + sessionId);
    _sessionId = "";
    _channel = null;
    // remove the session if the client does not reconnect within timeout
    if (_sessionTimeout > 0) {
        Timeout timeOut = _timer.newTimeout(new TimerTask() {

            public void run(Timeout arg0) throws Exception {
                ctx.channel().attr(SESSION).get().invalidate();
                _factory.removeSession(sessionId);
                _sessionPipelines.remove(sessionId);
                _valid = false;
                Constants.ahessianLogger.warn(ctx.channel() + " session timed out: " + sessionId);
            }

        }, _sessionTimeout, TimeUnit.MILLISECONDS);
        ctx.channel().attr(SESSION).get().setTimeOut(timeOut);
    }
    ctx.fireChannelInactive();
}

From source file:org.sdnplatform.sync.internal.rpc.HandshakeTimeoutHandler.java

License:Apache License

@Override
public void channelInactive(ChannelHandlerContext ctx) throws Exception {
    if (timeout != null) {
        timeout.cancel();//from ww  w .j ava  2 s . c  o  m
        timeout = null;
    }
    ctx.fireChannelInactive();
}

From source file:org.wenxueliu.netty.server.HandshakeTimeoutHandler.java

License:Apache License

@Override
public void channelInactive(ChannelHandlerContext ctx) {
    if (timeout != null) {
        timeout.cancel();/*  w w w  . j  a  v  a 2 s . c  o  m*/
        timeout = null;
    }
    ctx.fireChannelInactive();
}