public class WebConnectionWrapper extends Object implements WebConnection
Provides a convenient implementation of the WebConnection
interface that can be subclassed by developers
wishing to adapt a particular WebConnection.
This class implements the Wrapper or Decorator pattern. Methods default to calling through to the wrapped web connection object.
Constructor and Description |
---|
WebConnectionWrapper(WebClient webClient)
Constructs a WebConnection object wrapping the connection of the WebClient and places itself as
connection of the WebClient.
|
WebConnectionWrapper(WebConnection webConnection)
Constructs a WebConnection object wrapping provided WebConnection.
|
Modifier and Type | Method and Description |
---|---|
WebResponse |
getResponse(WebRequestSettings settings)
Submits a request and retrieves a response.
|
public WebConnectionWrapper(WebConnection webConnection) throws IllegalArgumentException
webConnection
- the webConnection that does the real workIllegalArgumentException
- if the connection is null
public WebConnectionWrapper(WebClient webClient) throws IllegalArgumentException
webClient
- the WebClient which WebConnection should be wrappedIllegalArgumentException
- if the WebClient is null
public WebResponse getResponse(WebRequestSettings settings) throws IOException
getResponse
in interface WebConnection
settings
- Settings to make the request withIOException
- if an IO error occursCopyright © 2002–2014 Gargoyle Software Inc.. All rights reserved.