summaryrefslogtreecommitdiff
path: root/qpid/java/common/Invoker.tpl
diff options
context:
space:
mode:
authorRafael H. Schloming <rhs@apache.org>2008-10-13 16:07:01 +0000
committerRafael H. Schloming <rhs@apache.org>2008-10-13 16:07:01 +0000
commit9ebd8a5bd4dd60e5983cfa998fea1c78fdb87401 (patch)
tree6cbde7bc931ccfc726a27cd5b1573c43dea5fc8e /qpid/java/common/Invoker.tpl
parentea476363bc00e42de3b1e39f2c6d4a2ed6cb677f (diff)
downloadqpid-python-9ebd8a5bd4dd60e5983cfa998fea1c78fdb87401.tar.gz
QPID-1339:
- Removed the Channel class in order to simplify the state management surrounding Sessions and Connections. - Consolidated the ChannelDelegate into the ConnectionDelegate. - Modified MethodDelegate to invoke a generic handle method as the default action for each dispatched method. - Modified the code generator to produce a separate ConnectionInvoker and SessionInvoker. - Modified the invoker template to use package level visibility for all controls rather than public visibility. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk@704147 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/java/common/Invoker.tpl')
-rw-r--r--qpid/java/common/Invoker.tpl24
1 files changed, 17 insertions, 7 deletions
diff --git a/qpid/java/common/Invoker.tpl b/qpid/java/common/Invoker.tpl
index 9158922df7..eb01329374 100644
--- a/qpid/java/common/Invoker.tpl
+++ b/qpid/java/common/Invoker.tpl
@@ -5,14 +5,12 @@ import java.util.List;
import java.util.Map;
import java.util.UUID;
-public abstract class Invoker {
-
- protected abstract void invoke(Method method);
- protected abstract <T> Future<T> invoke(Method method, Class<T> resultClass);
-
+public abstract class $(invoker) {
${
from genutil import *
+results = False
+
for c in composites:
name = cname(c)
fields = get_fields(c)
@@ -20,6 +18,7 @@ for c in composites:
args = get_arguments(c, fields)
result = c["result"]
if result:
+ results = True
if not result["@type"]:
rname = cname(result["struct"])
else:
@@ -32,11 +31,22 @@ for c in composites:
jreturn = ""
jclass = ""
+ if c.name == "command":
+ access = "public "
+ else:
+ access = ""
+
out("""
- public final $jresult $(dromedary(name))($(", ".join(params))) {
+ $(access)final $jresult $(dromedary(name))($(", ".join(params))) {
$(jreturn)invoke(new $name($(", ".join(args)))$jclass);
}
""")
}
-
+ protected abstract void invoke(Method method);
+${
+if results:
+ out("""
+ protected abstract <T> Future<T> invoke(Method method, Class<T> resultClass);
+""")
+}
}