Package org.elasticsearch.common.netty

Examples of org.elasticsearch.common.netty.ReleaseChannelFutureListener


                }
            }

            ChannelFuture future = channel.write(resp);
            if (response.contentThreadSafe() && content instanceof Releasable) {
                future.addListener(new ReleaseChannelFutureListener((Releasable) content));
                addedReleaseListener = true;
            }
            if (close) {
                future.addListener(ChannelFutureListener.CLOSE);
            }
View Full Code Here


            } else {
                future = channel.write(resp);
            }

            if (response.contentThreadSafe() && content instanceof Releasable) {
                future.addListener(new ReleaseChannelFutureListener((Releasable) content));
                addedReleaseListener = true;
            }

            if (close) {
                future.addListener(ChannelFutureListener.CLOSE);
View Full Code Here

            ReleasableBytesReference bytes = bStream.bytes();
            ChannelBuffer buffer = bytes.toChannelBuffer();
            NettyHeader.writeHeader(buffer, requestId, status, version);
            ChannelFuture future = channel.write(buffer);
            ReleaseChannelFutureListener listener = new ReleaseChannelFutureListener(bytes);
            future.addListener(listener);
            addedReleaseListener = true;
        } finally {
            if (!addedReleaseListener) {
                Releasables.close(bStream.bytes());
View Full Code Here

                bytes = bStream.bytes();
                buffer = bytes.toChannelBuffer();
            }
            NettyHeader.writeHeader(buffer, requestId, status, version);
            ChannelFuture future = targetChannel.write(buffer);
            ReleaseChannelFutureListener listener = new ReleaseChannelFutureListener(bytes);
            future.addListener(listener);
            addedReleaseListener = true;
        } finally {
            if (!addedReleaseListener) {
                Releasables.close(bStream.bytes());
View Full Code Here

TOP

Related Classes of org.elasticsearch.common.netty.ReleaseChannelFutureListener

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.