diff options
author | Rafael H. Schloming <rhs@apache.org> | 2007-07-26 13:44:17 +0000 |
---|---|---|
committer | Rafael H. Schloming <rhs@apache.org> | 2007-07-26 13:44:17 +0000 |
commit | 89a8765ee2bac1d77be65f1011ffeeb2cbbabe2d (patch) | |
tree | 002a1a6860714749da7518eb894565a260cd6074 | |
parent | c5863f77aa84f267e7ce8518a5fd104e9a15b0ed (diff) | |
download | qpid-python-89a8765ee2bac1d77be65f1011ffeeb2cbbabe2d.tar.gz |
exclude ticket arguments and extraneous classes
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@559815 13f79535-47bb-0310-9956-ffa450edef68
-rwxr-xr-x | java/common/generate | 12 | ||||
-rw-r--r-- | java/common/src/main/java/org/apache/qpidity/Stub.java | 8 |
2 files changed, 14 insertions, 6 deletions
diff --git a/java/common/generate b/java/common/generate index 4a2e878685..145e3b66ed 100755 --- a/java/common/generate +++ b/java/common/generate @@ -74,6 +74,7 @@ def scream(*args): return "_".join([a.replace("-", "_").upper() for a in args]) DOMAINS = {} +EXCLUDE = {"access-ticket": True} for d in spec.query["amqp/domain"]: DOMAINS[d["@name"]] = d["@type"] @@ -84,6 +85,7 @@ def resolve(type): else: return type + OPTIONS = {} class Struct: @@ -142,6 +144,8 @@ class Struct: for type, name in self.fields: if OPTIONS.has_key(name): out.line(" case %s: _%s=true; break;" % (OPTIONS[name], name)) + out.line(' default: throw new IllegalArgumentException' + '("invalid option: " + _options[i]);') out.line(" }") out.line(" }") for type, name in self.fields: @@ -193,13 +197,17 @@ class Struct: args.append("_options") return ", ".join(args) +CLASSES = {"file": False, "basic": False, "stream": False, "tunnel": False} +FIELDS = {"ticket": False} + opts = Output(out_dir, out_pkg, "Option") opts.line("public enum Option {") structs = [] -for m in spec.query["amqp/class/method"]: +for m in spec.query["amqp/class/method", + lambda m: CLASSES.get(m.parent["@name"], True)]: struct = Struct(int(m.parent["@index"])*256 + int(m["@index"]), camel(0, m.parent["@name"], m["@name"])) - for f in m.query["field"]: + for f in m.query["field", lambda f: FIELDS.get(f["@name"], True)]: type = resolve(f["@domain"]) name = camel(1, f["@name"]) struct.field(type, name) diff --git a/java/common/src/main/java/org/apache/qpidity/Stub.java b/java/common/src/main/java/org/apache/qpidity/Stub.java index 1e42096462..34a4e4bd44 100644 --- a/java/common/src/main/java/org/apache/qpidity/Stub.java +++ b/java/common/src/main/java/org/apache/qpidity/Stub.java @@ -33,10 +33,10 @@ public class Stub { StructFactory f = new StructFactory_v0_10(); frame(Frame.L2, Frame.METHOD, true, true, f.newSessionOpen(0)); frame(Frame.L4, Frame.METHOD, true, false, - f.newQueueDeclare((short) 0, "asdf", "alternate", null, DURABLE)); + f.newQueueDeclare("asdf", "alternate", null, DURABLE)); frame(Frame.L4, Frame.METHOD, false, false); frame(Frame.L3, Frame.METHOD, true, true, - f.newExchangeDeclare((short) 0, "exchange", "type", "alternate", null)); + f.newExchangeDeclare("exchange", "type", "alternate", null)); frame(Frame.L4, Frame.METHOD, false, true); frame(Frame.L4, Frame.HEADER, true, false); frame(Frame.L4, Frame.HEADER, false, false); @@ -45,7 +45,7 @@ public class Stub { frame(Frame.L4, Frame.BODY, false, false); frame(Frame.L4, Frame.BODY, false, false); frame(Frame.L1, Frame.METHOD, true, true, - f.newExchangeDeclare((short) 0, "exchange", "type", "alternate", null)); + f.newExchangeDeclare("exchange", "type", "alternate", null)); frame(Frame.L4, Frame.BODY, false, false); frame(Frame.L4, Frame.BODY, false, true); } @@ -72,7 +72,7 @@ class SessionDelegate extends Delegate<Session> { public @Override void exchangeDeclare(Session session, ExchangeDeclare ed) { System.out.println("got an exchange declare: " + ed.getExchange() + ", " + ed.getType()); - session.queueDeclare((short) 0, "asdf", "alternate", null); + session.queueDeclare("asdf", "alternate", null); } /* |