org.apache.http.impl.client
Class DefaultHttpClient

java.lang.Object
  extended by org.apache.http.impl.client.AbstractHttpClient
      extended by org.apache.http.impl.client.DefaultHttpClient
All Implemented Interfaces:
HttpClient, org.apache.http.protocol.HttpRequestInterceptorList, org.apache.http.protocol.HttpResponseInterceptorList

public class DefaultHttpClient
extends AbstractHttpClient

Default implementation of an HTTP client.
This class replaces HttpClient in HttpClient 3.

Since:
4.0
Version:
$Revision: 554003 $
Author:
Roland Weber, Oleg Kalnichevski

Constructor Summary
DefaultHttpClient()
           
DefaultHttpClient(ClientConnectionManager conman, org.apache.http.params.HttpParams params)
          Creates a new HTTP client from parameters and a connection manager.
DefaultHttpClient(org.apache.http.params.HttpParams params)
           
 
Method Summary
protected  AuthenticationHandler createAuthenticationHandler()
           
protected  AuthSchemeRegistry createAuthSchemeRegistry()
           
protected  ClientConnectionManager createClientConnectionManager()
           
protected  org.apache.http.ConnectionReuseStrategy createConnectionReuseStrategy()
           
protected  CookieSpecRegistry createCookieSpecRegistry()
           
protected  org.apache.http.protocol.HttpContext createHttpContext()
           
protected  org.apache.http.params.HttpParams createHttpParams()
           
protected  org.apache.http.protocol.BasicHttpProcessor createHttpProcessor()
           
protected  HttpRequestRetryHandler createHttpRequestRetryHandler()
           
protected  HttpState createHttpState()
           
protected  RedirectHandler createRedirectHandler()
           
protected  RoutedRequest determineRoute(org.apache.http.HttpHost target, org.apache.http.HttpRequest request, org.apache.http.protocol.HttpContext context)
          Determines the route for a request.
protected  void populateContext(org.apache.http.protocol.HttpContext context)
           
 
Methods inherited from class org.apache.http.impl.client.AbstractHttpClient
addRequestInterceptor, addResponseInterceptor, clearRequestInterceptors, clearResponseInterceptors, execute, execute, execute, execute, getAuthenticationHandler, getAuthSchemes, getConnectionManager, getConnectionReuseStrategy, getCookieSpecs, getDefaultContext, getHttpProcessor, getHttpRequestRetryHandler, getParams, getRedirectHandler, getRequestInterceptor, getRequestInterceptorCount, getResponseInterceptor, getResponseInterceptorCount, getState, setAuthenticationHandler, setAuthSchemes, setCookieSpecs, setHttpRequestRetryHandler, setInterceptors, setParams, setRedirectHandler, setReuseStrategy, setState
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultHttpClient

public DefaultHttpClient(ClientConnectionManager conman,
                         org.apache.http.params.HttpParams params)
Creates a new HTTP client from parameters and a connection manager.

Parameters:
params - the parameters
conman - the connection manager

DefaultHttpClient

public DefaultHttpClient(org.apache.http.params.HttpParams params)

DefaultHttpClient

public DefaultHttpClient()
Method Detail

createHttpParams

protected org.apache.http.params.HttpParams createHttpParams()
Specified by:
createHttpParams in class AbstractHttpClient

createClientConnectionManager

protected ClientConnectionManager createClientConnectionManager()
Specified by:
createClientConnectionManager in class AbstractHttpClient

createHttpContext

protected org.apache.http.protocol.HttpContext createHttpContext()
Specified by:
createHttpContext in class AbstractHttpClient

createConnectionReuseStrategy

protected org.apache.http.ConnectionReuseStrategy createConnectionReuseStrategy()
Specified by:
createConnectionReuseStrategy in class AbstractHttpClient

createAuthSchemeRegistry

protected AuthSchemeRegistry createAuthSchemeRegistry()
Specified by:
createAuthSchemeRegistry in class AbstractHttpClient

createCookieSpecRegistry

protected CookieSpecRegistry createCookieSpecRegistry()
Specified by:
createCookieSpecRegistry in class AbstractHttpClient

createHttpProcessor

protected org.apache.http.protocol.BasicHttpProcessor createHttpProcessor()
Specified by:
createHttpProcessor in class AbstractHttpClient

createHttpRequestRetryHandler

protected HttpRequestRetryHandler createHttpRequestRetryHandler()
Specified by:
createHttpRequestRetryHandler in class AbstractHttpClient

createRedirectHandler

protected RedirectHandler createRedirectHandler()
Specified by:
createRedirectHandler in class AbstractHttpClient

createAuthenticationHandler

protected AuthenticationHandler createAuthenticationHandler()
Specified by:
createAuthenticationHandler in class AbstractHttpClient

createHttpState

protected HttpState createHttpState()
Specified by:
createHttpState in class AbstractHttpClient

populateContext

protected void populateContext(org.apache.http.protocol.HttpContext context)
Specified by:
populateContext in class AbstractHttpClient

determineRoute

protected RoutedRequest determineRoute(org.apache.http.HttpHost target,
                                       org.apache.http.HttpRequest request,
                                       org.apache.http.protocol.HttpContext context)
                                throws org.apache.http.HttpException
Description copied from class: AbstractHttpClient
Determines the route for a request. Called by execute(urirequest, context) to map to execute(roureq, context).

Specified by:
determineRoute in class AbstractHttpClient
Parameters:
target - the target host for the request. Implementations may accept null if they can still determine a route, for example to a default target or by inspecting the request.
request - the request to execute
context - the context to use for the execution, never null
Returns:
the request along with the route it should take
Throws:
org.apache.http.HttpException - in case of a problem


Copyright © 2000-2007 Apache Software Foundation. All Rights Reserved.