Examples of releaseConnection()


Examples of org.apache.http.client.methods.HttpHead.releaseConnection()

        try {
            if (config.getNtlmDomain() != null && !config.getNtlmDomain().equals("")) {
                // need to send a HEAD request to trigger NTLM authentication
                HttpHead head = new HttpHead("http://salesforce.com");
                client.execute(head);
                head.releaseConnection();
            }
            HttpResponse response = client.execute(post);
           
            if (response.getStatusLine().getStatusCode() > 399) {
                successful = false;
View Full Code Here

Examples of org.apache.http.client.methods.HttpOptions.releaseConnection()

        } catch (UnsupportedEncodingException e) {
            log.error("could not encode URI parameter",e);
            return false;
        } finally {
            options.releaseConnection();
        }
    }

    /**
     * Return the resource metadata for the resource with the given URI, if it exists. Returns null if the
View Full Code Here

Examples of org.apache.http.client.methods.HttpPost.releaseConnection()

            HttpResponse response = httpClient.execute(request);
            assertEquals(200, response.getStatusLine().getStatusCode());
        } catch (Exception ex) {
            fail(ex.toString());
        } finally {
            request.releaseConnection();
        }
    }
}
View Full Code Here

Examples of org.apache.http.client.methods.HttpPut.releaseConnection()

        } catch (UnsupportedEncodingException e) {
            log.error("could not encode URI parameter",e);
            throw new MarmottaClientException("could not encode URI parameter");
        } finally {
            put.releaseConnection();
        }
    }

    /**
     * Retrieve the (human-readable) content of the given mimeType of the given resource. Will return a content
View Full Code Here

Examples of org.apache.http.client.methods.HttpRequestBase.releaseConnection()

            logger.error("A runtime exception has occured while executing request", e);
            req.abort();
            throw e;
        }
        finally {
            req.releaseConnection();
        }
    }

    public String getDslName(final Class<?> clazz) {
        final String domainObjectName = clazz.getName();
View Full Code Here

Examples of org.apache.http.conn.ClientConnectionManager.releaseConnection()

                    x.printStackTrace(System.out);
                }
            }

            System.out.println("releasing connection");
            clcm.releaseConnection(conn);
        }

    } // main

View Full Code Here

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

                    this.log.debug(ex.getMessage(), ex);
                }
            }
            // ensure the connection manager properly releases this connection
            try {
                mcc.releaseConnection();
            } catch(IOException ignored) {
                this.log.debug("Error releasing connection", ignored);
            }
        }
    } // abortConnection
View Full Code Here

Examples of org.apache.http.impl.conn.BasicClientConnectionManager.releaseConnection()

                        };
                    }

                    @Override
                    public void releaseConnection(ManagedClientConnection conn, long keepalive, TimeUnit tunit) {
                        cm.releaseConnection(conn, keepalive, tunit);
                    }

                    @Override
                    public void closeExpiredConnections() {
                        cm.closeExpiredConnections();
View Full Code Here

Examples of org.apache.http.impl.conn.PoolingClientConnectionManager.releaseConnection()

        // Make sure one connection is available
        connreq = mgr.requestConnection(new HttpRoute(target), null);
        ManagedClientConnection conn = connreq.getConnection(250, TimeUnit.MILLISECONDS);

        mgr.releaseConnection(conn, -1, null);

        mgr.shutdown();
    }

    @Test
View Full Code Here

Examples of org.apache.http.impl.conn.PoolingHttpClientConnectionManager.releaseConnection()

        } catch (final ConnectionPoolTimeoutException e) {
            // expected
        }

        conn.close();
        mgr.releaseConnection(conn, null, -1, null);
        conn = getConnection(mgr, route);
        Assert.assertFalse("connection should have been closed", conn.isOpen());

        mgr.connect(conn, route.getTargetHost(), route.getLocalAddress(), 0, context);
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.