Examples of newConnection()


Examples of com.facebook.presto.jdbc.internal.jetty.io.ClientConnectionFactory.newConnection()

                HttpDestination destination = (HttpDestination)context.get(HttpClientTransport.HTTP_DESTINATION_CONTEXT_KEY);
                HttpClient client = destination.getHttpClient();
                ClientConnectionFactory connectionFactory = this.connectionFactory;
                if (HttpScheme.HTTPS.is(destination.getScheme()))
                    connectionFactory = new SslClientConnectionFactory(client.getSslContextFactory(), client.getByteBufferPool(), client.getExecutor(), connectionFactory);
                com.facebook.presto.jdbc.internal.jetty.io.Connection connection = connectionFactory.newConnection(getEndPoint(), context);
                ClientConnectionFactory.Helper.replaceConnection(this, connection);
                LOG.debug("SOCKS4 tunnel established: {} over {}", this, connection);
            }
            catch (Throwable x)
            {
View Full Code Here

Examples of com.facebook.presto.jdbc.internal.jetty.io.ClientConnectionFactory.newConnection()

                    context.put(HttpClientTransport.HTTP_CONNECTION_PROMISE_CONTEXT_KEY, promise);
                    HttpDestination destination = (HttpDestination)context.get(HttpClientTransport.HTTP_DESTINATION_CONTEXT_KEY);
                    HttpClient client = destination.getHttpClient();
                    ClientConnectionFactory sslConnectionFactory = new SslClientConnectionFactory(client.getSslContextFactory(), client.getByteBufferPool(), client.getExecutor(), connectionFactory);
                    HttpConnectionOverHTTP oldConnection = (HttpConnectionOverHTTP)endPoint.getConnection();
                    com.facebook.presto.jdbc.internal.jetty.io.Connection newConnection = sslConnectionFactory.newConnection(endPoint, context);
                    Helper.replaceConnection(oldConnection, newConnection);
                    // Avoid setting fill interest in the old Connection,
                    // without closing the underlying EndPoint.
                    oldConnection.softClose();
                    LOG.debug("HTTP tunnel established: {} over {}", oldConnection, newConnection);
View Full Code Here

Examples of com.facebook.presto.jdbc.internal.jetty.io.ssl.SslClientConnectionFactory.newConnection()

                    context.put(HttpClientTransport.HTTP_CONNECTION_PROMISE_CONTEXT_KEY, promise);
                    HttpDestination destination = (HttpDestination)context.get(HttpClientTransport.HTTP_DESTINATION_CONTEXT_KEY);
                    HttpClient client = destination.getHttpClient();
                    ClientConnectionFactory sslConnectionFactory = new SslClientConnectionFactory(client.getSslContextFactory(), client.getByteBufferPool(), client.getExecutor(), connectionFactory);
                    HttpConnectionOverHTTP oldConnection = (HttpConnectionOverHTTP)endPoint.getConnection();
                    com.facebook.presto.jdbc.internal.jetty.io.Connection newConnection = sslConnectionFactory.newConnection(endPoint, context);
                    Helper.replaceConnection(oldConnection, newConnection);
                    // Avoid setting fill interest in the old Connection,
                    // without closing the underlying EndPoint.
                    oldConnection.softClose();
                    LOG.debug("HTTP tunnel established: {} over {}", oldConnection, newConnection);
View Full Code Here

Examples of com.rabbitmq.client.ConnectionFactory.newConnection()

        public Connection call() throws IOException {
          log.info("{} connection {} to {}", recovery ? "Recovering" : "Creating", connectionName,
              options.getAddresses());
          ConnectionFactory cxnFactory = options.getConnectionFactory();
          Connection connection =
              cxnFactory.newConnection(consumerThreadPool, options.getAddresses());
          final String amqpAddress =
              String.format("%s://%s:%s/%s", cxnFactory.isSSL() ? "amqps" : "amqp",
                  connection.getAddress().getHostAddress(), connection.getPort(),
                  "/".equals(cxnFactory.getVirtualHost()) ? "" : cxnFactory.getVirtualHost());
          log.info("{} connection {} to {}", recovery ? "Recovered" : "Created", connectionName,
View Full Code Here

Examples of com.rabbitmq.client.ConnectionFactory.newConnection()

        ConnectionFactory factory = new ConnectionFactory();
        Address[] addresses = getAddresses(configuration);
        if (addresses.length == 0) {
            throw new LumifyException("Could not configure RabbitMQ. No addresses specified. expecting configuration parameter 'rabbitmq.addr.0.host'.");
        }
        return factory.newConnection(addresses);
    }

    private static Address[] getAddresses(Configuration configuration) {
        List<Address> addresses = new ArrayList<Address>();
        for (String key : configuration.getKeys(RABBITMQ_ADDR_PREFIX)) {
View Full Code Here

Examples of com.rabbitmq.client.ConnectionFactory.newConnection()

        } else {
            factory.setVirtualHost(getVhost());
        }
        factory.setHost(getHostname());
        factory.setPort(getPortNumber());
        return factory.newConnection(executor);
    }

    @Override
    public Producer createProducer() throws Exception {
        return new RabbitMQProducer(this);
View Full Code Here

Examples of com.rabbitmq.client.ConnectionFactory.newConnection()

    Connection connection = null;
    try
    {
      ConnectionFactory factory = new ConnectionFactory();
      factory.setHost(_mqServer);
      connection = factory.newConnection();
      Channel channel = connection.createChannel();

      channel.exchangeDeclare(EXCHANGE_NAME, "topic");
      String queueName = channel.queueDeclare().getQueue();
View Full Code Here

Examples of com.rabbitmq.client.ConnectionFactory.newConnection()

    System.out.println("Sending " + count + " messages with random topic id");
   

    ConnectionFactory factory = new ConnectionFactory();
    factory.setHost(mqServer);
    Connection connection = factory.newConnection();
    Channel channel = connection.createChannel();

    channel.exchangeDeclare(EXCHANGE_NAME, "topic");

    for (int i = 0; i < count; i++)
View Full Code Here

Examples of com.rabbitmq.client.ConnectionFactory.newConnection()

  public void run() {
    Connection connection = null;
    try {
      ConnectionFactory factory = new ConnectionFactory();
      factory.setHost(_mqServer);
      connection = factory.newConnection();
      Channel channel = connection.createChannel();

      channel.exchangeDeclare(EXCHANGE_NAME, "topic");
      String queueName = channel.queueDeclare().getQueue();
View Full Code Here

Examples of com.rabbitmq.client.ConnectionFactory.newConnection()

    }
    System.out.println("Sending " + count + " messages with random topic id");

    ConnectionFactory factory = new ConnectionFactory();
    factory.setHost(mqServer);
    Connection connection = factory.newConnection();
    Channel channel = connection.createChannel();

    channel.exchangeDeclare(EXCHANGE_NAME, "topic");

    for (int i = 0; i < count; i++) {
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.