@Override protected ChannelHandler newConnectionLifecycleHandler(ChannelPipeline pipeline) { return new ConnectionLifecycleHandler<I, O>(connectionHandler, connectionFactory, errorHandler, eventsSubject); } }
@Override public void userEventTriggered(ChannelHandlerContext ctx, Object evt) throws Exception { super.userEventTriggered(ctx, evt); if (evt instanceof SslHandshakeCompletionEvent) { final long startTimeMillis = Clock.newStartTimeMillis(); connection = connectionFactory.newConnection(ctx.channel()); handleConnection(startTimeMillis); } }
@Override public void userEventTriggered(ChannelHandlerContext ctx, Object evt) throws Exception { super.userEventTriggered(ctx, evt); if (evt instanceof SslHandshakeCompletionEvent) { final long startTimeMillis = Clock.newStartTimeMillis(); connection = connectionFactory.newConnection(ctx.channel()); handleConnection(startTimeMillis); } }
@Override public void channelActive(ChannelHandlerContext ctx) throws Exception { if(null == ctx.channel().pipeline().get(SslHandler.class)) { final long startTimeMillis = Clock.newStartTimeMillis(); connection = connectionFactory.newConnection(ctx.channel()); eventsSubject.onEvent(ServerMetricsEvent.NEW_CLIENT_CONNECTED); super.channelActive(ctx); // Called before connection handler call to finish the pipeline before the connection // is handled. handleConnection(startTimeMillis); } else { super.channelActive(ctx); } }
@Override protected ChannelHandler newConnectionLifecycleHandler(ChannelPipeline pipeline) { return new ConnectionLifecycleHandler<I, O>(connectionHandler, connectionFactory, errorHandler, eventsSubject); } }
@Override public void channelActive(ChannelHandlerContext ctx) throws Exception { if(null == ctx.channel().pipeline().get(SslHandler.class)) { final long startTimeMillis = Clock.newStartTimeMillis(); connection = connectionFactory.newConnection(ctx.channel()); eventsSubject.onEvent(ServerMetricsEvent.NEW_CLIENT_CONNECTED); super.channelActive(ctx); // Called before connection handler call to finish the pipeline before the connection // is handled. handleConnection(startTimeMillis); } else { super.channelActive(ctx); } }