added patch for AMQ-1099

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@511939 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
James Strachan 2007-02-26 18:16:06 +00:00
parent c3fd0a65b1
commit 63b2d6837d
2 changed files with 23 additions and 1 deletions

View File

@ -194,7 +194,11 @@ public class HttpClientTransport extends HttpTransportSupport {
}
protected HttpClient createHttpClient() {
return new HttpClient();
HttpClient client = new HttpClient();
if (getProxyHost() != null) {
client.getHostConfiguration().setProxy(getProxyHost(), getProxyPort());
}
return client;
}
protected void configureMethod(HttpMethod method) {

View File

@ -30,6 +30,8 @@ import java.net.URI;
public abstract class HttpTransportSupport extends TransportThreadSupport {
private TextWireFormat textWireFormat;
private URI remoteUrl;
private String proxyHost;
private int proxyPort = 8080;
public HttpTransportSupport(TextWireFormat textWireFormat, URI remoteUrl) {
this.textWireFormat = textWireFormat;
@ -57,4 +59,20 @@ public abstract class HttpTransportSupport extends TransportThreadSupport {
public void setTextWireFormat(TextWireFormat textWireFormat) {
this.textWireFormat = textWireFormat;
}
public String getProxyHost() {
return proxyHost;
}
public void setProxyHost(String proxyHost) {
this.proxyHost = proxyHost;
}
public int getProxyPort() {
return proxyPort;
}
public void setProxyPort(int proxyPort) {
this.proxyPort = proxyPort;
}
}