Package org.apache.commons.httpclient

Examples of org.apache.commons.httpclient.HttpMethod.releaseConnection()


            HttpClient client = new HttpClient();
            assertEquals(417, client.executeMethod(method));
            assertTrue(method.getResponseHeader("Content-Type").getValue()
                    .startsWith("application/JSON"));
        } finally {
            method.releaseConnection();
        }

    }
}
View Full Code Here


            RequestEntity requestEntity = new StringRequestEntity(MSG_BODY, null, null);
            ((EntityEnclosingMethod)method).setRequestEntity(requestEntity);
            HttpClient client = new HttpClient();
            assertEquals(200, client.executeMethod(method));
        } finally {
            method.releaseConnection();
        }

    }
}
View Full Code Here

                    throw exception;
                }
            }

        } finally {
            method.releaseConnection();
        }
    }

    /**
     * Strategy when executing the method (calling the remote server).
View Full Code Here

            message.setHeader("http.responseCode", responseCode);
            return exchange;
        } catch (IOException e) {
            throw new RuntimeCamelException(e);
        } finally {
            method.releaseConnection();
        }
    }

    // Properties
    //-------------------------------------------------------------------------
View Full Code Here

        //write out the response body
        System.out.println("*** Response Body ***");
        System.out.println(responseBody);

        //clean up the connection resources
        method.releaseConnection();

        System.exit(0);
    }
}
View Full Code Here

        //write out the response body
        System.out.println("*** Response Body ***");
        System.out.println(responseBody);

        //clean up the connection resources
        method.releaseConnection();

        System.exit(0);
    }
}
View Full Code Here

        //write out the response headers
        System.out.println("*** Response Headers ***");
        for (int i=0; i<responseHeaders.length; i++){
            System.out.print(responseHeaders[i]);
        }
        method.releaseConnection();

        System.exit(0);
    }
}
View Full Code Here

            System.out.println(response);
            rules = (RuleSet) xstream.fromXML(method.getResponseBodyAsStream());
        } catch (IOException e) {
            throw new RuleOracleUnavailableException(e);
        }
        method.releaseConnection();
        return rules;
    }

    /**
     * @return the oracleUrl
View Full Code Here

            throw new IllegalStateException(new String(get.getResponseBody()));
         }
      }
      finally
      {
         get.releaseConnection();
         ManagersImpl.cleanUp();
      }
   }

   protected String getManagerUrl(String command, String... parameters)
View Full Code Here

                    // operation failed so populate exception to throw
                    throw populateHttpOperationFailedException(exchange, method, responseCode);
                }
            }
        } finally {
            method.releaseConnection();
        }
    }

    @Override
    public HttpEndpoint getEndpoint() {
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.