Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/org.eclipse.net4j.http/src/org/eclipse/net4j/internal/http/HTTPClientConnector.java')
-rw-r--r--plugins/org.eclipse.net4j.http/src/org/eclipse/net4j/internal/http/HTTPClientConnector.java15
1 files changed, 13 insertions, 2 deletions
diff --git a/plugins/org.eclipse.net4j.http/src/org/eclipse/net4j/internal/http/HTTPClientConnector.java b/plugins/org.eclipse.net4j.http/src/org/eclipse/net4j/internal/http/HTTPClientConnector.java
index db1cfa94b3..299969d1ee 100644
--- a/plugins/org.eclipse.net4j.http/src/org/eclipse/net4j/internal/http/HTTPClientConnector.java
+++ b/plugins/org.eclipse.net4j.http/src/org/eclipse/net4j/internal/http/HTTPClientConnector.java
@@ -68,6 +68,7 @@ public class HTTPClientConnector extends HTTPConnector
this.url = url;
}
+ @Override
public void multiplexChannel(final IChannel channel)
{
Queue<IBuffer> localQueue = ((InternalChannel)channel).getSendQueue();
@@ -144,7 +145,7 @@ public class HTTPClientConnector extends HTTPConnector
protected void doActivate() throws Exception
{
super.doActivate();
- httpClient = new HttpClient();
+ httpClient = createHTTPClient();
connect();
}
@@ -155,6 +156,16 @@ public class HTTPClientConnector extends HTTPConnector
super.doDeactivate();
}
+ protected HttpClient createHTTPClient()
+ {
+ return new HttpClient();
+ }
+
+ protected PostMethod createHTTPMethod(String url)
+ {
+ return new PostMethod(url);
+ }
+
@Override
protected void registerChannelWithPeer(final int channelID, final short channelIndex, final IProtocol protocol)
throws ConnectorException
@@ -218,7 +229,7 @@ public class HTTPClientConnector extends HTTPConnector
handler.handleOut(out);
out.flush();
byte[] content = baos.toByteArray();
- PostMethod method = new PostMethod(url);
+ PostMethod method = createHTTPMethod(url);
method.setRequestEntity(new ByteArrayRequestEntity(content));
httpClient.executeMethod(method);

Back to the top