diff options
author | Rafael H. Schloming <rhs@apache.org> | 2008-04-16 13:32:13 +0000 |
---|---|---|
committer | Rafael H. Schloming <rhs@apache.org> | 2008-04-16 13:32:13 +0000 |
commit | d054b41aaa1466b65c9dc2acf1b22ca98ec3128c (patch) | |
tree | 08055eba3020d3dcad5c9a9587d98b15d0b97c89 /java/common/StructFactory.tpl | |
parent | f375be1908ad22329fe9ed21a8c196475ade7e59 (diff) | |
download | qpid-python-d054b41aaa1466b65c9dc2acf1b22ca98ec3128c.tar.gz |
QPID-901: updates to the java client to use the 0-10 final spec instead of the 0-10 preview spec; this includes improvements to the codegen process as well as some modifications to the shared code path in the client to not lose per message state when consumers are closed.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@648692 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/common/StructFactory.tpl')
-rw-r--r-- | java/common/StructFactory.tpl | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/java/common/StructFactory.tpl b/java/common/StructFactory.tpl new file mode 100644 index 0000000000..b27621b1d2 --- /dev/null +++ b/java/common/StructFactory.tpl @@ -0,0 +1,39 @@ +package org.apache.qpidity.transport; + +class StructFactory { + + public static Struct create(int type) + { + switch (type) + { +${ +from genutil import * + +fragment = """ case $name.TYPE: + return new $name(); +""" + +for c in composites: + name = cname(c) + if c.name == "struct": + out(fragment) +} default: + throw new IllegalArgumentException("type: " + type); + } + } + + public static Struct createInstruction(int type) + { + switch (type) + { +${ +for c in composites: + name = cname(c) + if c.name in ("command", "control"): + out(fragment) +} default: + throw new IllegalArgumentException("type: " + type); + } + } + +} |