io.netty.util.concurrent.ScheduledFuture.isCancellable()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(5.4k)|赞(0)|评价(0)|浏览(189)

本文整理了Java中io.netty.util.concurrent.ScheduledFuture.isCancellable()方法的一些代码示例,展示了ScheduledFuture.isCancellable()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ScheduledFuture.isCancellable()方法的具体详情如下:
包路径:io.netty.util.concurrent.ScheduledFuture
类名称:ScheduledFuture
方法名:isCancellable

ScheduledFuture.isCancellable介绍

暂无

代码示例

代码示例来源:origin: apache/incubator-dubbo

@Override
protected void decode(ChannelHandlerContext ctx, ByteBuf in, List<Object> out) throws Exception {
  if (in.readableBytes() < 1) {
    return;
  }
  // read one byte to guess protocol
  final int magic = in.getByte(in.readerIndex());
  ChannelPipeline p = ctx.pipeline();
  p.addLast(new LocalHostPermitHandler(acceptForeignIp));
  if (isHttp(magic)) {
    // no welcome output for http protocol
    if (welcomeFuture != null && welcomeFuture.isCancellable()) {
      welcomeFuture.cancel(false);
    }
    p.addLast(new HttpServerCodec());
    p.addLast(new HttpObjectAggregator(1048576));
    p.addLast(new HttpProcessHandler());
    p.remove(this);
  } else {
    p.addLast(new LineBasedFrameDecoder(2048));
    p.addLast(new StringDecoder(CharsetUtil.UTF_8));
    p.addLast(new StringEncoder(CharsetUtil.UTF_8));
    p.addLast(new IdleStateHandler(0, 0, 5 * 60));
    p.addLast(new TelnetProcessHandler());
    p.remove(this);
  }
}

代码示例来源:origin: apache/incubator-dubbo

@Override
protected void decode(ChannelHandlerContext ctx, ByteBuf in, List<Object> out) throws Exception {
  if (in.readableBytes() < 1) {
    return;
  }
  // read one byte to guess protocol
  final int magic = in.getByte(in.readerIndex());
  ChannelPipeline p = ctx.pipeline();
  p.addLast(new LocalHostPermitHandler(acceptForeignIp));
  if (isHttp(magic)) {
    // no welcome output for http protocol
    if (welcomeFuture != null && welcomeFuture.isCancellable()) {
      welcomeFuture.cancel(false);
    }
    p.addLast(new HttpServerCodec());
    p.addLast(new HttpObjectAggregator(1048576));
    p.addLast(new HttpProcessHandler());
    p.remove(this);
  } else {
    p.addLast(new LineBasedFrameDecoder(2048));
    p.addLast(new StringDecoder(CharsetUtil.UTF_8));
    p.addLast(new StringEncoder(CharsetUtil.UTF_8));
    p.addLast(new IdleStateHandler(0, 0, 5 * 60));
    p.addLast(new TelnetProcessHandler());
    p.remove(this);
  }
}

代码示例来源:origin: com.alibaba/dubbo

@Override
protected void decode(ChannelHandlerContext ctx, ByteBuf in, List<Object> out) throws Exception {
  if (in.readableBytes() < 1) {
    return;
  }
  // read one byte to guess protocol
  final int magic = in.getByte(in.readerIndex());
  ChannelPipeline p = ctx.pipeline();
  p.addLast(new LocalHostPermitHandler(acceptForeignIp));
  if (isHttp(magic)) {
    // no welcome output for http protocol
    if (welcomeFuture != null && welcomeFuture.isCancellable()) {
      welcomeFuture.cancel(false);
    }
    p.addLast(new HttpServerCodec());
    p.addLast(new HttpObjectAggregator(1048576));
    p.addLast(new HttpProcessHandler());
    p.remove(this);
  } else {
    p.addLast(new LineBasedFrameDecoder(2048));
    p.addLast(new StringDecoder(CharsetUtil.UTF_8));
    p.addLast(new StringEncoder(CharsetUtil.UTF_8));
    p.addLast(new IdleStateHandler(0, 0, 5 * 60));
    p.addLast(new TelnetProcessHandler());
    p.remove(this);
  }
}

代码示例来源:origin: org.apache.dubbo/dubbo-qos

@Override
protected void decode(ChannelHandlerContext ctx, ByteBuf in, List<Object> out) throws Exception {
  if (in.readableBytes() < 1) {
    return;
  }
  // read one byte to guess protocol
  final int magic = in.getByte(in.readerIndex());
  ChannelPipeline p = ctx.pipeline();
  p.addLast(new LocalHostPermitHandler(acceptForeignIp));
  if (isHttp(magic)) {
    // no welcome output for http protocol
    if (welcomeFuture != null && welcomeFuture.isCancellable()) {
      welcomeFuture.cancel(false);
    }
    p.addLast(new HttpServerCodec());
    p.addLast(new HttpObjectAggregator(1048576));
    p.addLast(new HttpProcessHandler());
    p.remove(this);
  } else {
    p.addLast(new LineBasedFrameDecoder(2048));
    p.addLast(new StringDecoder(CharsetUtil.UTF_8));
    p.addLast(new StringEncoder(CharsetUtil.UTF_8));
    p.addLast(new IdleStateHandler(0, 0, 5 * 60));
    p.addLast(new TelnetProcessHandler());
    p.remove(this);
  }
}

代码示例来源:origin: com.alibaba/dubbo-qos

@Override
protected void decode(ChannelHandlerContext ctx, ByteBuf in, List<Object> out) throws Exception {
  if (in.readableBytes() < 1) {
    return;
  }
  // read one byte to guess protocol
  final int magic = in.getByte(in.readerIndex());
  ChannelPipeline p = ctx.pipeline();
  p.addLast(new LocalHostPermitHandler(acceptForeignIp));
  if (isHttp(magic)) {
    // no welcome output for http protocol
    if (welcomeFuture != null && welcomeFuture.isCancellable()) {
      welcomeFuture.cancel(false);
    }
    p.addLast(new HttpServerCodec());
    p.addLast(new HttpObjectAggregator(1048576));
    p.addLast(new HttpProcessHandler());
    p.remove(this);
  } else {
    p.addLast(new LineBasedFrameDecoder(2048));
    p.addLast(new StringDecoder(CharsetUtil.UTF_8));
    p.addLast(new StringEncoder(CharsetUtil.UTF_8));
    p.addLast(new IdleStateHandler(0, 0, 5 * 60));
    p.addLast(new TelnetProcessHandler());
    p.remove(this);
  }
}

代码示例来源:origin: org.apache.dubbo/dubbo

@Override
protected void decode(ChannelHandlerContext ctx, ByteBuf in, List<Object> out) throws Exception {
  if (in.readableBytes() < 1) {
    return;
  }
  // read one byte to guess protocol
  final int magic = in.getByte(in.readerIndex());
  ChannelPipeline p = ctx.pipeline();
  p.addLast(new LocalHostPermitHandler(acceptForeignIp));
  if (isHttp(magic)) {
    // no welcome output for http protocol
    if (welcomeFuture != null && welcomeFuture.isCancellable()) {
      welcomeFuture.cancel(false);
    }
    p.addLast(new HttpServerCodec());
    p.addLast(new HttpObjectAggregator(1048576));
    p.addLast(new HttpProcessHandler());
    p.remove(this);
  } else {
    p.addLast(new LineBasedFrameDecoder(2048));
    p.addLast(new StringDecoder(CharsetUtil.UTF_8));
    p.addLast(new StringEncoder(CharsetUtil.UTF_8));
    p.addLast(new IdleStateHandler(0, 0, 5 * 60));
    p.addLast(new TelnetProcessHandler());
    p.remove(this);
  }
}

相关文章

微信公众号

最新文章

更多