Package org.apache.http.conn

Examples of org.apache.http.conn.HttpHostConnectException


        final Socket sock;
        try {
            sock = lsf.createSocket
                (conn.getSocket(), target.getHostName(), target.getPort(), true);
        } catch (ConnectException ex) {
            throw new HttpHostConnectException(target, ex);
        }
        prepareSocket(sock, context, params);
        conn.update(sock, target, lsf.isSecure(sock), params);
    }
View Full Code Here


                }
                conn.bind(sock);
                return;
            } catch (final ConnectException ex) {
                if (last) {
                    throw new HttpHostConnectException(host, ex);
                }
            } catch (final ConnectTimeoutException ex) {
                if (last) {
                    throw ex;
                }
View Full Code Here

        Socket sock = conn.getSocket();
        try {
            final int port = this.schemePortResolver.resolve(host);
            sock = lsf.createLayeredSocket(sock, host.getHostName(), port, context);
        } catch (final ConnectException ex) {
            throw new HttpHostConnectException(host, ex);
        }
        conn.bind(sock);
    }
View Full Code Here

                prepareSocket(sock, context, params);
                conn.openCompleted(sf.isSecure(sock), params);
                return;
            } catch (ConnectException ex) {
                if (last) {
                    throw new HttpHostConnectException(target, ex);
                }
            } catch (ConnectTimeoutException ex) {
                if (last) {
                    throw ex;
                }
View Full Code Here

        Socket sock;
        try {
            sock = lsf.createLayeredSocket(
                    conn.getSocket(), target.getHostName(), schm.resolvePort(target.getPort()), params);
        } catch (ConnectException ex) {
            throw new HttpHostConnectException(target, ex);
        }
        prepareSocket(sock, context, params);
        conn.update(sock, target, lsf.isSecure(sock), params);
    }
View Full Code Here

        localServer.stop();

        Exchange exchange = template.request("direct:start", null);
        assertTrue(exchange.isFailed());

        HttpHostConnectException cause = assertIsInstanceOf(HttpHostConnectException.class, exchange.getException());
        assertIsInstanceOf(ConnectException.class, cause.getCause());

        assertEquals(true, exchange.getIn().getHeader(Exchange.REDELIVERED));
        assertEquals(4, exchange.getIn().getHeader(Exchange.REDELIVERY_COUNTER));
    }
View Full Code Here

        try {
            template.request(url, null);
            fail("Should have thrown an exception");
        } catch (RuntimeCamelException e) {
            HttpHostConnectException cause = assertIsInstanceOf(HttpHostConnectException.class, e.getCause());
            assertIsInstanceOf(ConnectException.class, cause.getCause());
        }
    }
View Full Code Here

        localServer.awaitTermination(5000);

        Exchange exchange = template.request("direct:start", null);
        assertTrue(exchange.isFailed());

        HttpHostConnectException cause = assertIsInstanceOf(HttpHostConnectException.class, exchange.getException());
        assertIsInstanceOf(ConnectException.class, cause.getCause());

        assertEquals(true, exchange.getIn().getHeader(Exchange.REDELIVERED));
        assertEquals(4, exchange.getIn().getHeader(Exchange.REDELIVERY_COUNTER));
    }
View Full Code Here

        localServer.awaitTermination(1000);

        Exchange reply = template.request(url, null);
        Exception e = reply.getException();
        assertNotNull("Should have thrown an exception", e);
        HttpHostConnectException cause = assertIsInstanceOf(HttpHostConnectException.class, e);
        assertIsInstanceOf(ConnectException.class, cause.getCause());
    }
View Full Code Here

                prepareSocket(sock, context, params);
                conn.openCompleted(sf.isSecure(sock), params);
                break;
            } catch (ConnectException ex) {
                if (last) {
                    throw new HttpHostConnectException(target, ex);
                }
            } catch (ConnectTimeoutException ex) {
                if (last) {
                    throw ex;
                }
View Full Code Here

TOP

Related Classes of org.apache.http.conn.HttpHostConnectException

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.