Example usage for io.netty.channel Channel metadata

List of usage examples for io.netty.channel Channel metadata

Introduction

In this page you can find the example usage for io.netty.channel Channel metadata.

Prototype

ChannelMetadata metadata();

Source Link

Document

Return the ChannelMetadata of the Channel which describe the nature of the Channel .

Usage

From source file:org.vertx.java.core.impl.FlowControlHandler.java

License:Apache License

@Override
public void beforeAdd(final ChannelHandlerContext ctx) throws Exception {
    this.ctx = ctx;
    Channel channel = ctx.channel();
    if (channel.metadata().bufferType() == BufType.BYTE) {
        outboundBuf = channel.unsafe().directOutboundContext().outboundByteBuffer();
    } else {//w  w  w. j  a  v  a2  s  .c  om
        throw new IllegalStateException("Only supported for Channels which handle bytes");
    }
    super.beforeAdd(ctx);
}