diff options
author | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2010-12-08 23:45:29 +0000 |
---|---|---|
committer | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2010-12-08 23:45:29 +0000 |
commit | ad5fdef89966e011f61503244831225c0b9bdb6f (patch) | |
tree | 33bf75a188df478ddac1c77690dbc27d50f14b20 /sca-java-2.x/trunk/modules/binding-atom-runtime/src | |
parent | 92af2b263ee06d75adad9256ec9d22cdf751efb9 (diff) |
Move HttpClientFactory from common-http to host-http
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1043774 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/modules/binding-atom-runtime/src')
2 files changed, 8 insertions, 9 deletions
diff --git a/sca-java-2.x/trunk/modules/binding-atom-runtime/src/main/java/org/apache/tuscany/sca/binding/atom/provider/AtomReferenceBindingProvider.java b/sca-java-2.x/trunk/modules/binding-atom-runtime/src/main/java/org/apache/tuscany/sca/binding/atom/provider/AtomReferenceBindingProvider.java index 3612442e90..9f4ea496c1 100644 --- a/sca-java-2.x/trunk/modules/binding-atom-runtime/src/main/java/org/apache/tuscany/sca/binding/atom/provider/AtomReferenceBindingProvider.java +++ b/sca-java-2.x/trunk/modules/binding-atom-runtime/src/main/java/org/apache/tuscany/sca/binding/atom/provider/AtomReferenceBindingProvider.java @@ -22,8 +22,8 @@ package org.apache.tuscany.sca.binding.atom.provider; import org.apache.http.client.HttpClient; import org.apache.tuscany.sca.assembly.EndpointReference; import org.apache.tuscany.sca.binding.atom.AtomBinding; -import org.apache.tuscany.sca.common.http.client.HttpClientFactory; import org.apache.tuscany.sca.databinding.Mediator; +import org.apache.tuscany.sca.host.http.client.HttpClientFactory; import org.apache.tuscany.sca.interfacedef.DataType; import org.apache.tuscany.sca.interfacedef.InterfaceContract; import org.apache.tuscany.sca.interfacedef.Operation; @@ -69,9 +69,6 @@ class AtomReferenceBindingProvider implements ReferenceBindingProvider { //String authorization = "admin" + ":" + "admin"; //authorizationHeader = "Basic " + new String(Base64.encodeBase64(authorization.getBytes())); - // Create an HTTP client - HttpClientFactory clientFactory = new HttpClientFactory(); - httpClient = clientFactory.createHttpClient(); } public Invoker createInvoker(Operation operation) { @@ -123,13 +120,15 @@ class AtomReferenceBindingProvider implements ReferenceBindingProvider { //httpClient.getState().setCredentials(new AuthScope(uri.getHost(), uri.getPort()), credentials); // Find the get operation on the reference interface - if (true) { - return; - } + // Create an HTTP client + HttpClientFactory clientFactory = new HttpClientFactory(); + httpClient = clientFactory.createHttpClient(); } public void stop() { - + if (httpClient != null) { + httpClient.getConnectionManager().shutdown(); + } } public boolean supportsOneWayInvocation() { diff --git a/sca-java-2.x/trunk/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/MediaCollectionTestCase.java b/sca-java-2.x/trunk/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/MediaCollectionTestCase.java index 57eacab0e2..f3cb052e39 100644 --- a/sca-java-2.x/trunk/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/MediaCollectionTestCase.java +++ b/sca-java-2.x/trunk/modules/binding-atom-runtime/src/test/java/org/apache/tuscany/sca/binding/atom/MediaCollectionTestCase.java @@ -37,7 +37,7 @@ import org.apache.http.client.HttpClient; import org.apache.http.client.methods.HttpPost; import org.apache.http.client.methods.HttpPut; import org.apache.http.entity.FileEntity; -import org.apache.tuscany.sca.common.http.client.HttpClientFactory; +import org.apache.tuscany.sca.host.http.client.HttpClientFactory; import org.apache.tuscany.sca.node.Contribution; import org.apache.tuscany.sca.node.ContributionLocationHelper; import org.apache.tuscany.sca.node.Node; |