Codota Logo
ChannelHandlerContext.close
Code IndexAdd Codota to your IDE (free)

How to use
close
method
in
io.netty.channel.ChannelHandlerContext

Best Java code snippets using io.netty.channel.ChannelHandlerContext.close (Showing top 20 results out of 4,248)

Refine searchRefine arrow

  • ChannelHandlerContext.channel
  • Common ways to obtain ChannelHandlerContext
private void myMethod () {
ChannelHandlerContext c =
  • Codota IconMockito mockito;mockito.mock(ChannelHandlerContext.class)
  • Smart code suggestions by Codota
}
origin: alibaba/fescar

@Override
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
  ctx.close();
  LOGGER.info("channel error for ClientProxyHandler at :[{}]",ctx.channel());
}
origin: redisson/redisson

  @Override
  public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
    logger.warn("{} Failed to select the application-level protocol:", ctx.channel(), cause);
    ctx.close();
  }
}
origin: redisson/redisson

/**
 * Invoked on failed initial SSL/TLS handshake.
 */
protected void handshakeFailure(ChannelHandlerContext ctx, Throwable cause) throws Exception {
  logger.warn("{} TLS handshake failed:", ctx.channel(), cause);
  ctx.close();
}
origin: neo4j/neo4j

@Override
public void exceptionCaught( ChannelHandlerContext ctx, Throwable cause )
{
  log.error( "Fatal error occurred during protocol handshaking: " + ctx.channel(), cause );
  ctx.close();
}
origin: jamesdbloom/mockserver

@Override
public void channelRead0(ChannelHandlerContext ctx, HttpResponse response) {
  ctx.channel().attr(RESPONSE_FUTURE).get().set(response);
  ctx.close();
}
origin: netty/netty

/**
 * Handle the {@link Throwable} by logging and closing the {@link Channel}. Sub-classes may override this.
 */
@Override
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
  if (logger.isWarnEnabled()) {
    logger.warn("Failed to initialize a channel. Closing: " + ctx.channel(), cause);
  }
  ctx.close();
}
origin: alibaba/fescar

private void closeChannelHandlerContext(ChannelHandlerContext ctx) {
  if (LOGGER.isInfoEnabled()) {
    LOGGER.info("closeChannelHandlerContext channel:" + ctx.channel());
  }
  ctx.disconnect();
  ctx.close();
}
origin: mpusher/mpush

@Override
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
  Connection connection = connectionManager.get(ctx.channel());
  Logs.CONN.error("client caught ex, conn={}", connection);
  LOGGER.error("caught an ex, channel={}, conn={}", ctx.channel(), connection, cause);
  ctx.close();
}
origin: mpusher/mpush

@Override
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
  Connection connection = connectionManager.get(ctx.channel());
  Logs.CONN.error("client caught ex, conn={}", connection);
  LOGGER.error("caught an ex, channel={}, conn={}", ctx.channel(), connection, cause);
  ctx.close();
}
origin: mpusher/mpush

@Override
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
  Connection connection = connectionManager.get(ctx.channel());
  Logs.CONN.error("client caught ex, conn={}", connection);
  LOGGER.error("caught an ex, channel={}, conn={}", ctx.channel(), connection, cause);
  ctx.close();
}
origin: wildfly/wildfly

  @Override
  public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
    logger.warn("{} Failed to select the application-level protocol:", ctx.channel(), cause);
    ctx.close();
  }
}
origin: wildfly/wildfly

/**
 * Invoked on failed initial SSL/TLS handshake.
 */
protected void handshakeFailure(ChannelHandlerContext ctx, Throwable cause) throws Exception {
  logger.warn("{} TLS handshake failed:", ctx.channel(), cause);
  ctx.close();
}
origin: wildfly/wildfly

@Override
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
  if (cause instanceof WebSocketHandshakeException) {
    FullHttpResponse response = new DefaultFullHttpResponse(
        HTTP_1_1, HttpResponseStatus.BAD_REQUEST, Unpooled.wrappedBuffer(cause.getMessage().getBytes()));
    ctx.channel().writeAndFlush(response).addListener(ChannelFutureListener.CLOSE);
  } else {
    ctx.fireExceptionCaught(cause);
    ctx.close();
  }
}
origin: jamesdbloom/mockserver

@Override
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) {
  if (isNotSslException(cause)) {
    cause.printStackTrace();
  }
  ctx.channel().attr(RESPONSE_FUTURE).get().setException(cause);
  ctx.close();
}
origin: line/armeria

  @Override
  public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
    if (handshakeFailed &&
      cause instanceof DecoderException &&
      cause.getCause() instanceof SSLException) {
      // Swallow an SSLException raised after handshake failure.
      return;
    }
    Exceptions.logIfUnexpected(logger, ctx.channel(), cause);
    ctx.close();
  }
});
origin: line/armeria

  @Override
  public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
    Exceptions.logIfUnexpected(logger, ctx.channel(), cause);
    ctx.close();
  }
}
origin: line/armeria

@Override
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
  Exceptions.logIfUnexpected(logger, ctx.channel(), protocol, cause);
  if (ctx.channel().isActive()) {
    ctx.close();
  }
}
origin: redisson/redisson

/**
 * Handle the {@link Throwable} by logging and closing the {@link Channel}. Sub-classes may override this.
 */
@Override
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
  if (logger.isWarnEnabled()) {
    logger.warn("Failed to initialize a channel. Closing: " + ctx.channel(), cause);
  }
  ctx.close();
}
origin: aws/aws-sdk-java

@Override
public void channelRead0(final ChannelHandlerContext ctx, final AckEvent msg) {
  if (msg instanceof FinalAckEvent) {
    ctx.channel().attr(ChannelAttributeKeys.FINAL_ACK_RECEIVED).set(Boolean.TRUE);
    responseHandler.onComplete();
    ctx.close();
  } else {
    responseHandler.onAckEvent(msg);
  }
}
origin: jamesdbloom/mockserver

  @Override
  public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) {
    mockServerLogger.error("web socket client caught exception", cause);
    final SettableFuture<String> registrationFuture = ctx.channel().attr(REGISTRATION_FUTURE).get();
    if (!registrationFuture.isDone()) {
      registrationFuture.setException(cause);
    }
    ctx.close();
  }
}
io.netty.channelChannelHandlerContextclose

Popular methods of ChannelHandlerContext

  • channel
    Return the Channel which is bound to the ChannelHandlerContext.
  • writeAndFlush
  • write
  • flush
  • fireChannelRead
  • pipeline
    Return the assigned ChannelPipeline
  • alloc
    Return the assigned ByteBufAllocator which will be used to allocate ByteBufs.
  • executor
    Returns the EventExecutor which is used to execute an arbitrary task.
  • fireExceptionCaught
  • fireUserEventTriggered
  • newPromise
  • fireChannelActive
  • newPromise,
  • fireChannelActive,
  • fireChannelInactive,
  • voidPromise,
  • read,
  • fireChannelReadComplete,
  • name,
  • attr,
  • disconnect

Popular in Java

  • Updating database using SQL prepared statement
  • getContentResolver (Context)
  • orElseThrow (Optional)
  • getSystemService (Context)
  • Container (java.awt)
    A generic Abstract Window Toolkit(AWT) container object is a component that can contain other AWT co
  • Socket (java.net)
    Provides a client-side TCP socket.
  • SQLException (java.sql)
    An exception that indicates a failed JDBC operation. It provides the following information about pro
  • Arrays (java.util)
    This class contains various methods for manipulating arrays (such as sorting and searching). This cl
  • SortedMap (java.util)
    A map that has its keys ordered. The sorting is according to either the natural ordering of its keys
  • JList (javax.swing)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now