summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2012-03-21 18:54:47 +0000
committerrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2012-03-21 18:54:47 +0000
commitbc8a9da92105e3d0b043f81927b78a7eb0c4c28e (patch)
tree33a1c7401b8ea74fdba4f5d56be1769da757aa56
parent3a79b7b568bbb55f25d950dd6789ef761ff14f76 (diff)
Improve the REST binding for inputstream and context
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1303501 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--sca-java-2.x/trunk/modules/binding-rest-runtime/src/main/java/org/apache/tuscany/sca/binding/rest/provider/RESTBindingInvoker.java3
-rw-r--r--sca-java-2.x/trunk/modules/databinding-json/src/main/resources/META-INF/services/org.apache.tuscany.sca.databinding.PushTransformer1
2 files changed, 4 insertions, 0 deletions
diff --git a/sca-java-2.x/trunk/modules/binding-rest-runtime/src/main/java/org/apache/tuscany/sca/binding/rest/provider/RESTBindingInvoker.java b/sca-java-2.x/trunk/modules/binding-rest-runtime/src/main/java/org/apache/tuscany/sca/binding/rest/provider/RESTBindingInvoker.java
index b6c598996f..36beb707d7 100644
--- a/sca-java-2.x/trunk/modules/binding-rest-runtime/src/main/java/org/apache/tuscany/sca/binding/rest/provider/RESTBindingInvoker.java
+++ b/sca-java-2.x/trunk/modules/binding-rest-runtime/src/main/java/org/apache/tuscany/sca/binding/rest/provider/RESTBindingInvoker.java
@@ -33,6 +33,7 @@ import java.util.Set;
import javax.ws.rs.Consumes;
import javax.ws.rs.CookieParam;
+import javax.ws.rs.HeaderParam;
import javax.ws.rs.DELETE;
import javax.ws.rs.FormParam;
import javax.ws.rs.GET;
@@ -49,6 +50,7 @@ import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.Application;
import javax.ws.rs.core.Cookie;
+import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.UriBuilder;
@@ -218,6 +220,7 @@ public class RESTBindingInvoker implements Invoker {
isEntity = false;
cookieParams.put(cookieParam.value(), args[i]);
}
+ isEntity = (getAnnotation(annotations, Context.class) == null);
if (isEntity) {
entity = args[i];
}
diff --git a/sca-java-2.x/trunk/modules/databinding-json/src/main/resources/META-INF/services/org.apache.tuscany.sca.databinding.PushTransformer b/sca-java-2.x/trunk/modules/databinding-json/src/main/resources/META-INF/services/org.apache.tuscany.sca.databinding.PushTransformer
index f880719ff7..24889a156f 100644
--- a/sca-java-2.x/trunk/modules/databinding-json/src/main/resources/META-INF/services/org.apache.tuscany.sca.databinding.PushTransformer
+++ b/sca-java-2.x/trunk/modules/databinding-json/src/main/resources/META-INF/services/org.apache.tuscany.sca.databinding.PushTransformer
@@ -18,3 +18,4 @@ org.apache.tuscany.sca.databinding.json.jackson.JSON2OutputStream;source=JSON;ta
org.apache.tuscany.sca.databinding.json.jackson.JSON2OutputStream;source=javax.xml.bind.JAXBElement;target=application/json#java.io.OutputStream,weight=50,public=true
org.apache.tuscany.sca.databinding.json.jackson.JSON2OutputStream;source=java:complexType;target=application/json#java.io.OutputStream,weight=50,public=true
org.apache.tuscany.sca.databinding.json.jackson.JSON2OutputStream;source=java:simpleType;target=application/json#java.io.OutputStream,weight=50,public=true
+org.apache.tuscany.sca.databinding.json.jackson.JSON2OutputStream;source=java.io.InputStream;target=application/json#java.io.OutputStream,weight=50,public=true