Package org.jboss.netty.channel

Examples of org.jboss.netty.channel.FileRegion.releaseExternalResources()


      final FileRegion region = new DefaultFileRegion(fc, 0, file.length());
      writeFuture = channel.write(region);
      writeFuture.addListener(new ChannelFutureProgressListener() {
        public void operationComplete(ChannelFuture future) {
          region.releaseExternalResources();
          if (!keepalive) {
            channel.close();
          }
        }
View Full Code Here


                        }
                    }
                } finally {
                    if (fr instanceof DefaultFileRegion) {
                        if (((DefaultFileRegion) fr).releaseAfterTransfer()) {
                            fr.releaseExternalResources();
                        }
                    }

                }
            } else {
View Full Code Here

                        }
                    }
                } finally {
                    if (fr instanceof DefaultFileRegion) {
                        if (((DefaultFileRegion) fr).releaseAfterTransfer()) {
                            fr.releaseExternalResources();
                        }
                    }

                }
            } else {
View Full Code Here

                    }
                } finally {
                    if (fr instanceof DefaultFileRegion) {
                        DefaultFileRegion dfr = (DefaultFileRegion) fr;
                        if (dfr.releaseAfterTransfer()) {
                            fr.releaseExternalResources();
                        }
                    }
                }
            } else {
                ChannelBuffer a = (ChannelBuffer) message;
View Full Code Here

            final FileRegion region =
                new DefaultFileRegion(raf.getChannel(), 0, fileLength);
            writeFuture = ch.write(region);
            writeFuture.addListener(new ChannelFutureProgressListener() {
                public void operationComplete(ChannelFuture future) {
                    region.releaseExternalResources();
                }

                public void operationProgressed(
                        ChannelFuture future, long amount, long current, long total) {
                    System.out.printf("%s: %d / %d (+%d)%n", path, current, total, amount);
View Full Code Here

      final FileRegion region = new DefaultFileRegion(fc, 0, file.length());
      writeFuture = channel.write(region);
      writeFuture.addListener(new ChannelFutureProgressListener() {
        public void operationComplete(ChannelFuture future) {
          region.releaseExternalResources();
          if (!keepalive) {
            channel.close();
          }
        }
View Full Code Here

            final FileRegion region =
                new DefaultFileRegion(raf.getChannel(), 0, fileLength);
            writeFuture = ch.write(region);
            writeFuture.addListener(new ChannelFutureProgressListener() {
                public void operationComplete(ChannelFuture future) {
                    region.releaseExternalResources();
                }

                public void operationProgressed(
                        ChannelFuture future, long amount, long current, long total) {
                    System.out.printf("%s: %d / %d (+%d)%n", path, current, total, amount);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.