diff options
author | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2011-10-10 05:01:04 +0000 |
---|---|---|
committer | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2011-10-10 05:01:04 +0000 |
commit | 7eafc42e6b7b01d9dfd8d7f4f1e68969d3ace806 (patch) | |
tree | 6aa85c3578b8b58ac8fdc1527e538c2d9c236f3e /sca-java-2.x/trunk/modules/binding-jsonrpc-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/protocol/JsonRpc20Response.java | |
parent | e36653405dac9419e8ae60d1d014f1eea38852a2 (diff) |
Use home-grown JSONRPC implementation
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1180780 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/modules/binding-jsonrpc-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/protocol/JsonRpc20Response.java')
-rw-r--r-- | sca-java-2.x/trunk/modules/binding-jsonrpc-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/protocol/JsonRpc20Response.java | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/sca-java-2.x/trunk/modules/binding-jsonrpc-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/protocol/JsonRpc20Response.java b/sca-java-2.x/trunk/modules/binding-jsonrpc-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/protocol/JsonRpc20Response.java index df6f1b9f5b..e6f8282faf 100644 --- a/sca-java-2.x/trunk/modules/binding-jsonrpc-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/protocol/JsonRpc20Response.java +++ b/sca-java-2.x/trunk/modules/binding-jsonrpc-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/protocol/JsonRpc20Response.java @@ -30,8 +30,16 @@ public class JsonRpc20Response extends JsonRpc20Result { this.result = result; } + public JsonRpc20Response(JSONObject response) { + super(response); + this.result = response.opt("result"); + } + public JSONObject toJSONObject() throws JSONException { - JSONObject response = new JSONObject(); + if (response != null) { + return response; + } + response = new JSONObject(); response.put("jsonrpc", "2.0"); response.put("id", id); response.put("result", result); |