Examples of releaseExternalResources()


Examples of org.elasticsearch.common.netty.bootstrap.ClientBootstrap.releaseExternalResources()

        long end = System.currentTimeMillis();
        long seconds = (end - start) / 1000;
        System.out.println("Ran [" + NUMBER_OF_ITERATIONS + "] iterations, payload [" + payloadSize + "]: took [" + seconds + "], TPS: " + ((double) NUMBER_OF_ITERATIONS) / seconds);

        clientChannel.close().awaitUninterruptibly();
        clientBootstrap.releaseExternalResources();
        serverBootstrap.releaseExternalResources();
    }

    public static class EchoClientHandler extends SimpleChannelUpstreamHandler {
View Full Code Here

Examples of org.elasticsearch.common.netty.bootstrap.ServerBootstrap.releaseExternalResources()

        long seconds = (end - start) / 1000;
        System.out.println("Ran [" + NUMBER_OF_ITERATIONS + "] iterations, payload [" + payloadSize + "]: took [" + seconds + "], TPS: " + ((double) NUMBER_OF_ITERATIONS) / seconds);

        clientChannel.close().awaitUninterruptibly();
        clientBootstrap.releaseExternalResources();
        serverBootstrap.releaseExternalResources();
    }

    public static class EchoClientHandler extends SimpleChannelUpstreamHandler {

        public volatile CountDownLatch latch;
View Full Code Here

Examples of org.jboss.netty.bootstrap.ClientBootstrap.releaseExternalResources()

        // Print out the answer.
        System.err.format(
                "Factorial of %,d is: %,d", count, handler.getFactorial());

        // Shut down all thread pools to exit.
        bootstrap.releaseExternalResources();
    }
}
View Full Code Here

Examples of org.jboss.netty.bootstrap.ClientBootstrap.releaseExternalResources()

        // Wait until the connection attempt succeeds or fails.
        Channel channel = future.awaitUninterruptibly().getChannel();
        if (!future.isSuccess()) {
            future.getCause().printStackTrace();
            bootstrap.releaseExternalResources();
            return;
        }

        // Prepare the HTTP request.
        HttpRequest request = new DefaultHttpRequest(
View Full Code Here

Examples of org.jboss.netty.bootstrap.ClientBootstrap.releaseExternalResources()

        // Wait for the server to close the connection.
        channel.getCloseFuture().awaitUninterruptibly();

        // Shut down executor threads to exit.
        bootstrap.releaseExternalResources();
    }
}
View Full Code Here

Examples of org.jboss.netty.bootstrap.ClientBootstrap.releaseExternalResources()

  } catch (Exception e) {// Catch exception if any
      System.err.println("Error: " + e.getMessage());
  }
  channel.getCloseFuture().awaitUninterruptibly();

  client.releaseExternalResources();

    }

    public void initcassandradb() {
  ClientBootstrap client = new ClientBootstrap(
View Full Code Here

Examples of org.jboss.netty.bootstrap.ClientBootstrap.releaseExternalResources()

        buffer.readableBytes());
  request.setContent(buffer);
  channel.write(request).awaitUninterruptibly().getChannel()
      .getCloseFuture().awaitUninterruptibly();

  client.releaseExternalResources();

    }

    private static class TestResponseHandler extends
             SimpleChannelUpstreamHandler {
View Full Code Here

Examples of org.jboss.netty.bootstrap.ClientBootstrap.releaseExternalResources()

      ChannelFuture future = bootstrap.connect(serverAddress);

      // Wait until the connection attempt succeeds or fails.
      channel = future.awaitUninterruptibly().getChannel();
      if (!future.isSuccess()) {
         bootstrap.releaseExternalResources();
         throw new TransportException("Could not create netty transport", future.getCause());
      }
   }

   @Override
View Full Code Here

Examples of org.jboss.netty.bootstrap.ClientBootstrap.releaseExternalResources()

      ChannelFuture future = bootstrap.connect(serverAddress);

      // Wait until the connection attempt succeeds or fails.
      channel = future.awaitUninterruptibly().getChannel();
      if (!future.isSuccess()) {
         bootstrap.releaseExternalResources();
         throw new TransportException("Could not create netty transport", future.getCause());
      }
   }

   @Override
View Full Code Here

Examples of org.jboss.netty.bootstrap.ClientBootstrap.releaseExternalResources()

        clientBootstrap.setPipelineFactory(new HttpClientPipelineFactory(tmpFile));
        ChannelFuture channelFuture = clientBootstrap.connect(new InetSocketAddress(host, port));
        // TODO timeout?
        Channel channel = channelFuture.awaitUninterruptibly().getChannel();
        if (!channelFuture.isSuccess()) {
            clientBootstrap.releaseExternalResources();
            throw new DeploymentFailedException("Cannot connect to http uri [" + uri.toString() + "]",
                    channelFuture.getCause());
        }

        HttpRequest request = new DefaultHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.GET, uri.toASCIIString());
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.