Package org.eclipse.jetty.client.http

Examples of org.eclipse.jetty.client.http.HttpDestinationOverHTTP


                }
            });

            String host = "localhost";
            int port = connector.getLocalPort();
            HttpDestinationOverHTTP destination = (HttpDestinationOverHTTP)client.getDestination(scheme, host, port);
            ConnectionPool connectionPool = destination.getConnectionPool();

            final BlockingQueue<Connection> idleConnections = connectionPool.getIdleConnections();
            Assert.assertEquals(0, idleConnections.size());

            final BlockingQueue<Connection> activeConnections = connectionPool.getActiveConnections();
View Full Code Here


    {
        start(new EmptyServerHandler());

        String host = "localhost";
        int port = connector.getLocalPort();
        HttpDestinationOverHTTP destination = (HttpDestinationOverHTTP)client.getDestination(scheme, host, port);
        ConnectionPool connectionPool = destination.getConnectionPool();

        final BlockingQueue<Connection> idleConnections = connectionPool.getIdleConnections();
        Assert.assertEquals(0, idleConnections.size());

        final BlockingQueue<Connection> activeConnections = connectionPool.getActiveConnections();
View Full Code Here

    {
        start(new EmptyServerHandler());

        String host = "localhost";
        int port = connector.getLocalPort();
        HttpDestinationOverHTTP destination = (HttpDestinationOverHTTP)client.getDestination(scheme, host, port);
        ConnectionPool connectionPool = destination.getConnectionPool();

        final BlockingQueue<Connection> idleConnections = connectionPool.getIdleConnections();
        Assert.assertEquals(0, idleConnections.size());

        final BlockingQueue<Connection> activeConnections = connectionPool.getActiveConnections();
View Full Code Here

        client = new HttpClient(new HttpClientTransportOverHTTP()
        {
            @Override
            public HttpDestination newHttpDestination(Origin origin)
            {
                return new HttpDestinationOverHTTP(getHttpClient(), origin)
                {
                    @Override
                    protected ClientConnectionFactory newSslClientConnectionFactory(ClientConnectionFactory connectionFactory)
                    {
                        HttpClient client = getHttpClient();
View Full Code Here

        HttpClient newClient = new HttpClient(new HttpClientTransportOverHTTP()
        {
            @Override
            public HttpDestination newHttpDestination(Origin origin)
            {
                return new HttpDestinationOverHTTP(getHttpClient(), origin)
                {
                    @Override
                    protected ConnectionPool newConnectionPool(HttpClient client)
                    {
                        return new LeakTrackingConnectionPool(this, client.getMaxConnectionsPerDestination(), this)
View Full Code Here

            public void run()
            {
                logger.warn("Interrupting test, it is taking too long");
                for (String host : Arrays.asList("localhost", "127.0.0.1"))
                {
                    HttpDestinationOverHTTP destination = (HttpDestinationOverHTTP)client.getDestination(scheme, host, connector.getLocalPort());
                    ConnectionPool connectionPool = destination.getConnectionPool();
                    for (Connection connection : new ArrayList<>(connectionPool.getActiveConnections()))
                    {
                        HttpConnectionOverHTTP active = (HttpConnectionOverHTTP)connection;
                        logger.warn(active.getEndPoint() + " exchange " + active.getHttpChannel().getHttpExchange());
                    }
View Full Code Here

            ContentResponse response = listener.get(5, TimeUnit.SECONDS);

            Assert.assertNotNull(response);
            Assert.assertEquals(200, response.getStatus());

            HttpDestinationOverHTTP httpDestination = (HttpDestinationOverHTTP)destination;
            ConnectionPool connectionPool = httpDestination.getConnectionPool();
            Assert.assertTrue(connectionPool.getActiveConnections().isEmpty());
            Assert.assertTrue(connectionPool.getIdleConnections().isEmpty());
        }
    }
View Full Code Here

        TimeUnit.SECONDS.sleep(1);

        HttpConnectionOverHTTP httpConnection = (HttpConnectionOverHTTP)connection;
        Assert.assertFalse(httpConnection.getEndPoint().isOpen());

        HttpDestinationOverHTTP httpDestination = (HttpDestinationOverHTTP)destination;
        ConnectionPool connectionPool = httpDestination.getConnectionPool();
        Assert.assertTrue(connectionPool.getActiveConnections().isEmpty());
        Assert.assertTrue(connectionPool.getIdleConnections().isEmpty());
    }
View Full Code Here

TOP

Related Classes of org.eclipse.jetty.client.http.HttpDestinationOverHTTP

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.