org.fishwife.jrugged.httpclient
Class ServiceWrappedHttpClient

java.lang.Object
  extended by org.fishwife.jrugged.httpclient.AbstractHttpClientDecorator
      extended by org.fishwife.jrugged.httpclient.ServiceWrappedHttpClient
All Implemented Interfaces:
org.apache.http.client.HttpClient

public class ServiceWrappedHttpClient
extends AbstractHttpClientDecorator

Facade class for assembling an HttpClient that will feed request executions through a ServiceWrapper, while exposing 4XX and 5XX responses as exceptions so that the ServiceWrapper can experience them as failures, but unwrapping those exceptions before getting up to the original caller.


Field Summary
 
Fields inherited from class org.fishwife.jrugged.httpclient.AbstractHttpClientDecorator
backend
 
Constructor Summary
ServiceWrappedHttpClient(org.apache.http.client.HttpClient backend, ServiceWrapper wrapper)
           
ServiceWrappedHttpClient(org.apache.http.client.HttpClient backend, ServiceWrapper wrapper, ResponseFailureAssessor assessor)
           
 
Method Summary
 org.apache.http.HttpResponse execute(org.apache.http.HttpHost host, org.apache.http.HttpRequest req, org.apache.http.protocol.HttpContext ctx)
           
 
Methods inherited from class org.fishwife.jrugged.httpclient.AbstractHttpClientDecorator
execute, execute, execute, execute, execute, execute, execute, getConnectionManager, getHttpHost, getParams
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServiceWrappedHttpClient

public ServiceWrappedHttpClient(org.apache.http.client.HttpClient backend,
                                ServiceWrapper wrapper)

ServiceWrappedHttpClient

public ServiceWrappedHttpClient(org.apache.http.client.HttpClient backend,
                                ServiceWrapper wrapper,
                                ResponseFailureAssessor assessor)
Method Detail

execute

public org.apache.http.HttpResponse execute(org.apache.http.HttpHost host,
                                            org.apache.http.HttpRequest req,
                                            org.apache.http.protocol.HttpContext ctx)
                                     throws IOException,
                                            org.apache.http.client.ClientProtocolException
Specified by:
execute in interface org.apache.http.client.HttpClient
Specified by:
execute in class AbstractHttpClientDecorator
Throws:
IOException
org.apache.http.client.ClientProtocolException


Copyright © 2013. All Rights Reserved.