Example usage for io.netty.channel Channel hasAttr

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

Introduction

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

Prototype

<T> boolean hasAttr(AttributeKey<T> key);

Source Link

Document

Returns true if and only if the given Attribute exists in this AttributeMap .

Usage

From source file:com.ibasco.agql.core.transport.NettyPooledTransport.java

License:Open Source License

/**
 * <p>A method to perform cleanup operations on a {@link Channel}. This is called after every invocation of {@link
 * #send(AbstractRequest)}.</p>/*ww  w  . jav  a  2  s .  co  m*/
 *
 * @param c
 *         The {@link Channel} that will need to be cleaned-up/released.
 */
@Override
public void cleanupChannel(Channel c) {
    //Release channel from the pool
    if (c.hasAttr(ChannelAttributes.CHANNEL_POOL))
        c.attr(ChannelAttributes.CHANNEL_POOL).get().release(c);
}