diff options
Diffstat (limited to '')
-rw-r--r-- | sca-java-2.x/trunk/modules/binding-jsonrpc-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/protocol/JsonRpc20Result.java | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/sca-java-2.x/trunk/modules/binding-jsonrpc-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/protocol/JsonRpc20Result.java b/sca-java-2.x/trunk/modules/binding-jsonrpc-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/protocol/JsonRpc20Result.java index 95bec61b4b..cece8029d6 100644 --- a/sca-java-2.x/trunk/modules/binding-jsonrpc-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/protocol/JsonRpc20Result.java +++ b/sca-java-2.x/trunk/modules/binding-jsonrpc-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/protocol/JsonRpc20Result.java @@ -19,6 +19,9 @@ package org.apache.tuscany.sca.binding.jsonrpc.protocol; +import java.io.IOException; +import java.io.Writer; + import org.json.JSONException; import org.json.JSONObject; @@ -31,4 +34,12 @@ public abstract class JsonRpc20Result { } public abstract JSONObject toJSONObject() throws JSONException; + + public void write(Writer writer) throws IOException { + try { + toJSONObject().write(writer); + } catch (JSONException e) { + throw new IOException(e); + } + } } |