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(WebRequest request)
Submits a request and retrieves a response.
|
WebConnection |
getWrappedWebConnection()
Gets the wrapped
WebConnection . |
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(WebRequest request) throws IOException
getResponse
in interface WebConnection
request
- the requestIOException
- if an IO error occurspublic WebConnection getWrappedWebConnection()
WebConnection
.Copyright © 2002-2012 Gargoyle Software Inc.. All Rights Reserved.