Examples of NHttpClientConnection


Examples of org.apache.http.nio.NHttpClientConnection

        final HttpContext context = new BasicHttpContext();

        final Log log = Mockito.mock(Log.class);
        final CPoolEntry poolentry = new CPoolEntry(log, "some-id", route, conn, -1, TimeUnit.MILLISECONDS);
        poolentry.markRouteComplete();
        final NHttpClientConnection managedConn = CPoolProxy.newProxy(poolentry);

        Mockito.when(conn.getIOSession()).thenReturn(iosession);
        Mockito.when(sslStrategy.upgrade(target, iosession)).thenReturn(iosession);

        connman.upgrade(managedConn, route, context);
View Full Code Here

Examples of org.apache.http.nio.NHttpClientConnection

        final HttpContext context = new BasicHttpContext();

        final Log log = Mockito.mock(Log.class);
        final CPoolEntry poolentry = new CPoolEntry(log, "some-id", route, conn, -1, TimeUnit.MILLISECONDS);
        poolentry.markRouteComplete();
        final NHttpClientConnection managedConn = CPoolProxy.newProxy(poolentry);

        Mockito.when(conn.getIOSession()).thenReturn(iosession);
        Mockito.when(sslStrategy.upgrade(target, iosession)).thenReturn(iosession);

        connman.upgrade(managedConn, route, context);
View Full Code Here

Examples of org.apache.http.nio.NHttpClientConnection

        final HttpContext context = new BasicHttpContext();

        final Log log = Mockito.mock(Log.class);
        final CPoolEntry poolentry = new CPoolEntry(log, "some-id", route, conn, -1, TimeUnit.MILLISECONDS);
        poolentry.markRouteComplete();
        final NHttpClientConnection managedConn = CPoolProxy.newProxy(poolentry);

        Mockito.when(conn.getIOSession()).thenReturn(iosession);
        Mockito.when(sslStrategy.upgrade(target, iosession)).thenReturn(iosession);

        connman.startRoute(managedConn, route, context);
View Full Code Here

Examples of org.apache.http.nio.NHttpClientConnection

            this.request = request;
        }

        public Void answer(final InvocationOnMock invocation) throws Throwable {
            final Object[] args = invocation.getArguments();
            final NHttpClientConnection conn = (NHttpClientConnection) args[0];
            conn.submitRequest(request);
            return null;
        }
View Full Code Here

Examples of org.apache.http.nio.NHttpClientConnection

            this.responses = responses;
        }

        public Void answer(final InvocationOnMock invocation) throws Throwable {
            final Object[] args = invocation.getArguments();
            final NHttpClientConnection conn = (NHttpClientConnection) args[0];
            if (conn != null) {
                final HttpResponse response = conn.getHttpResponse();
                if (response != null) {
                    responses.add(response);
                }
            }
            return null;
View Full Code Here

Examples of org.apache.http.nio.NHttpClientConnection

        Args.notNull(responseConsumer, "HTTP response consumer");
        Args.notNull(connPool, "HTTP connection pool");
        Args.notNull(poolEntry, "Pool entry");
        Args.notNull(context, "HTTP context");
        final BasicFuture<T> future = new BasicFuture<T>(callback);
        final NHttpClientConnection conn = poolEntry.getConnection();
        final BasicAsyncClientExchangeHandler<T> handler = new BasicAsyncClientExchangeHandler<T>(
                requestProducer, responseConsumer,
                new RequestExecutionCallback<T, E>(future, poolEntry, connPool),
                context, conn,
                this.httppocessor, this.connReuseStrategy);
View Full Code Here

Examples of org.apache.http.nio.NHttpClientConnection

        public void completed(final E result) {
            if (this.requestFuture.isDone()) {
                this.connPool.release(result, true);
                return;
            }
            final NHttpClientConnection conn = result.getConnection();
            final BasicAsyncClientExchangeHandler<T> handler = new BasicAsyncClientExchangeHandler<T>(
                    this.requestProducer, this.responseConsumer,
                    new RequestExecutionCallback<T, E>(this.requestFuture, result, this.connPool),
                    this.context, conn, httppocessor, connReuseStrategy);
            initExection(handler, conn);
View Full Code Here

Examples of org.apache.http.nio.NHttpClientConnection

            }
            HttpHost httpHost = new HttpHost(url.getHost(), port, url.getProtocol());

            Axis2HttpRequest axis2Req = new Axis2HttpRequest(epr, httpHost, msgContext);

            NHttpClientConnection conn = ConnectionPool.getConnection(url.getHost(), port);

            if (conn == null) {
                ioReactor.connect(new InetSocketAddress(url.getHost(), port),
                    null, axis2Req, sessionRequestCallback);
                if (log.isDebugEnabled()) {
View Full Code Here

Examples of org.apache.http.nio.NHttpClientConnection

    public BasicNIOConnFactory(final HttpParams params) {
        this(null, null, params);
    }

    public NHttpClientConnection create(final HttpHost route, final IOSession session) throws IOException {
        NHttpClientConnection conn;
        if (route.getSchemeName().equalsIgnoreCase("https")) {
            if (this.sslFactory == null) {
                throw new IOException("SSL not supported");
            }
            conn = this.sslFactory.createConnection(session);
View Full Code Here

Examples of org.apache.http.nio.NHttpClientConnection

        public void completed(final E result) {
            if (this.requestFuture.isDone()) {
                this.connPool.release(result, true);
                return;
            }
            NHttpClientConnection conn = result.getConnection();
            BasicFuture<T> execFuture = new BasicFuture<T>(new RequestExecutionCallback<T, E>(
                    this.requestFuture, result, this.connPool));
            HttpAsyncClientExchangeHandler<T> handler = new HttpAsyncClientExchangeHandlerImpl<T>(
                    execFuture, this.requestProducer, this.responseConsumer, this.context,
                    httppocessor, conn, reuseStrategy, params);
            conn.getContext().setAttribute(HttpAsyncClientProtocolHandler.HTTP_HANDLER, handler);
            conn.requestOutput();
        }
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.