Allowing arbitrary return types for the OO part.
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 @@
_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);
}