Allowing arbitrary return types for the OO part.

Project: http://git-wip-us.apache.org/repos/asf/ode-jacob/repo
Commit: http://git-wip-us.apache.org/repos/asf/ode-jacob/commit/a9555ba6
Tree: http://git-wip-us.apache.org/repos/asf/ode-jacob/tree/a9555ba6
Diff: http://git-wip-us.apache.org/repos/asf/ode-jacob/diff/a9555ba6

Branch: refs/heads/master
Commit: a9555ba6c621216c6d1a5cd566d80cbb3f172b0b
Parents: 9a3382b
Author: Tammo van Lessen <[email protected]>
Authored: Wed Aug 14 22:58:41 2013 +0200
Committer: Tammo van Lessen <[email protected]>
Committed: Wed Aug 14 22:58:41 2013 +0200

----------------------------------------------------------------------
 src/main/java/org/apache/ode/jacob/vpu/JacobVPU.java | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ode-jacob/blob/a9555ba6/src/main/java/org/apache/ode/jacob/vpu/JacobVPU.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/ode/jacob/vpu/JacobVPU.java 
b/src/main/java/org/apache/ode/jacob/vpu/JacobVPU.java
index 462846f..10f3631 100644
--- a/src/main/java/org/apache/ode/jacob/vpu/JacobVPU.java
+++ b/src/main/java/org/apache/ode/jacob/vpu/JacobVPU.java
@@ -256,15 +256,15 @@ public final class JacobVPU {
 
             _statistics.messagesSent++;
 
-            Synch replyChannel = null;
+            Channel replyChannel = null;
             CommChannel replyCommChannel = null;
             // Check for synchronous methods; create a synchronization channel
             if (method.getReturnType() != void.class) {
-                if (method.getReturnType() != Synch.class) {
+                if (!Channel.class.isAssignableFrom(method.getReturnType())) {
                     throw new IllegalStateException(
-                        "Channel method '" + method + "' must only return void 
or Synch");
+                        "Channel method '" + method + "' must only return void 
or an implementation of " + Channel.class.getName());
                 }
-                replyChannel = (Synch)newChannel(Synch.class, "", "Reply 
Channel");
+                replyChannel = newChannel(method.getReturnType(), "", "Reply 
Channel");
                 replyCommChannel = (CommChannel) 
ChannelFactory.getBackend((Channel)replyChannel);
             }
             

Reply via email to