Examples of markReusable()


Examples of org.apache.http.conn.ManagedClientConnection.markReusable()

                     rsplen, data.length);
        // ignore data, but it must be read

        // release connection after marking it for re-use
        // expect the next connection obtained to be open
        conn.markReusable();
        mgr.releaseConnection(conn);
        conn = mgr.getConnection(route);
        assertTrue("connection should have been open", conn.isOpen());

        // repeat the communication, no need to prepare the request again
View Full Code Here

Examples of org.apache.http.conn.ManagedClientConnection.markReusable()

        Helper.execute(request, conn, target,
                httpExecutor, httpProcessor, defaultParams, httpContext);

        // we leave the connection in mid-use
        // it's not really re-usable, but it must be closed anyway
        conn.markReusable();

        // first check that we can't get another connection
        try {
            // this should fail quickly, connection has not been released
            mgr.getConnection(route, 10L);
View Full Code Here

Examples of org.apache.http.conn.ManagedClientConnection.markReusable()

        HttpResponse response = Helper.execute(request, conn, target,
                httpExecutor, httpProcessor, defaultParams, httpContext);
        EntityUtils.toByteArray(response.getEntity());

        // release connection after marking it for re-use
        conn.markReusable();
        mgr.releaseConnection(conn);

        // We now have a manager with an open connection. We drop all
        // potential hard reference to it and check whether it is GCed.
        // Note that the connection keeps a reference even if detached.
View Full Code Here

Examples of org.apache.http.conn.ManagedClientConnection.markReusable()

                     rsplen, data.length);
        // ignore data, but it must be read

        // release connection after marking it for re-use
        // expect the next connection obtained to be open
        conn.markReusable();
        mgr.releaseConnection(conn);
        conn = mgr.getConnection(route);
        assertTrue("connection should have been open", conn.isOpen());

        // repeat the communication, no need to prepare the request again
View Full Code Here

Examples of org.apache.http.conn.ManagedClientConnection.markReusable()

        Helper.execute(request, conn, target,
                httpExecutor, httpProcessor, defaultParams, httpContext);

        // we leave the connection in mid-use
        // it's not really re-usable, but it must be closed anyway
        conn.markReusable();

        // first check that we can't get another connection
        try {
            // this should fail quickly, connection has not been released
            mgr.getConnection(route, 10L);
View Full Code Here

Examples of org.apache.http.conn.ManagedClientConnection.markReusable()

        HttpResponse response = Helper.execute(request, conn, target,
                httpExecutor, httpProcessor, defaultParams, httpContext);
        EntityUtils.toByteArray(response.getEntity());

        // release connection after marking it for re-use
        conn.markReusable();
        mgr.releaseConnection(conn);

        // We now have a manager with an open connection in it's pool.
        // We drop all potential hard reference to the manager and check
        // whether it is GCed. Internal references might prevent that
View Full Code Here

Examples of org.apache.http.conn.ManagedClientConnection.markReusable()

                     rsplen, data.length);
        // ignore data, but it must be read

        // release connection after marking it for re-use
        // expect the next connection obtained to be open
        conn.markReusable();
        mgr.releaseConnection(conn);
        conn = mgr.getConnection(route);
        assertTrue("connection should have been open", conn.isOpen());

        // repeat the communication, no need to prepare the request again
View Full Code Here

Examples of org.apache.http.conn.ManagedClientConnection.markReusable()

        Helper.execute(request, conn, target,
                httpExecutor, httpProcessor, defaultParams, httpContext);

        // we leave the connection in mid-use
        // it's not really re-usable, but it must be closed anyway
        conn.markReusable();

        // first check that we can't get another connection
        try {
            // this should fail quickly, connection has not been released
            mgr.getConnection(route, 10L, TimeUnit.MILLISECONDS);
View Full Code Here

Examples of org.apache.http.conn.ManagedClientConnection.markReusable()

        HttpResponse response = Helper.execute(request, conn, target,
                httpExecutor, httpProcessor, defaultParams, httpContext);
        EntityUtils.toByteArray(response.getEntity());

        // release connection after marking it for re-use
        conn.markReusable();
        mgr.releaseConnection(conn);

        // We now have a manager with an open connection in it's pool.
        // We drop all potential hard reference to the manager and check
        // whether it is GCed. Internal references might prevent that
View Full Code Here

Examples of org.apache.http.conn.ManagedClientConnection.markReusable()

                     rsplen, data.length);
        // ignore data, but it must be read

        // release connection after marking it for re-use
        // expect the next connection obtained to be open
        conn.markReusable();
        mgr.releaseConnection(conn, 100, TimeUnit.MILLISECONDS);
        conn =  mgr.getConnection(route, null);
        Assert.assertTrue("connection should have been open", conn.isOpen());

        // repeat the communication, no need to prepare the request again
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.