summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKim van der Riet <kpvdr@apache.org>2007-01-30 16:40:41 +0000
committerKim van der Riet <kpvdr@apache.org>2007-01-30 16:40:41 +0000
commit0a0d784009eadd3d7679a8cb6a73258562616af7 (patch)
treed9ff386f7ec63c4d75b11999840a4911459c7fc1
parentdb6f152f26ae8de79b1aec55a16af401b97548d9 (diff)
downloadqpid-python-0a0d784009eadd3d7679a8cb6a73258562616af7.tar.gz
Separated the errata in the XML spec file and put them into a file amqp-errara.0-9.xml. Added this file to the codegen. Fixed minor codegen bug in which fields in merged classes have repeating ordinal numbers. Added missing mandatory field to Message.Transger in the new errata file.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/branches/qpid.0-9@501456 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--cpp/gen/Makefile.am4
-rw-r--r--gentools/src/org/apache/qpid/gentools/AmqpClass.java3
-rw-r--r--gentools/src/org/apache/qpid/gentools/AmqpMethod.java2
-rw-r--r--gentools/src/org/apache/qpid/gentools/Main.java2
-rw-r--r--java/client/src/main/java/org/apache/qpid/client/BasicMessageProducer.java7
-rw-r--r--java/common/protocol-version.xml4
-rw-r--r--java/common/src/main/java/org/apache/qpid/framing/RequestManager.java4
-rw-r--r--specs/amqp-errata.0-9.xml44
-rw-r--r--specs/amqp.0-9.xml2
9 files changed, 57 insertions, 15 deletions
diff --git a/cpp/gen/Makefile.am b/cpp/gen/Makefile.am
index 29b4cc7d0a..796707b411 100644
--- a/cpp/gen/Makefile.am
+++ b/cpp/gen/Makefile.am
@@ -19,8 +19,8 @@ spec_dir = $(srcdir)/../../specs
# FIXME aconway 2007-01-04: Enabling Basic class until
# new messaging class is ready to replace it.
-# spec = $(spec_dir)/amqp.0-9.xml $(spec_dir)/amqp-nogen.0-9.xml
-spec = $(spec_dir)/amqp.0-9.xml
+# spec = $(spec_dir)/amqp.0-9.xml $(spec_dir)/amqp-errata.0-9.xml $(spec_dir)/amqp-nogen.0-9.xml
+spec = $(spec_dir)/amqp.0-9.xml $(spec_dir)/amqp-errata.0-9.xml
gentools_srcdir = $(gentools_dir)/src/org/apache/qpid/gentools
diff --git a/gentools/src/org/apache/qpid/gentools/AmqpClass.java b/gentools/src/org/apache/qpid/gentools/AmqpClass.java
index 190070ad45..b801677f9b 100644
--- a/gentools/src/org/apache/qpid/gentools/AmqpClass.java
+++ b/gentools/src/org/apache/qpid/gentools/AmqpClass.java
@@ -59,7 +59,7 @@ public class AmqpClass implements Printable, NodeAware
indexMap.put(index, indexVersionSet);
}
NodeList nList = classNode.getChildNodes();
- int fieldCntr = 0;
+ int fieldCntr = fieldMap.size();
for (int i=0; i<nList.getLength(); i++)
{
Node child = nList.item(i);
@@ -82,7 +82,6 @@ public class AmqpClass implements Printable, NodeAware
thisField.removeVersion(version);
fieldMap.remove(fieldName);
}
- fieldCntr++;
}
else if (child.getNodeName().compareTo(Utils.ELEMENT_METHOD) == 0)
{
diff --git a/gentools/src/org/apache/qpid/gentools/AmqpMethod.java b/gentools/src/org/apache/qpid/gentools/AmqpMethod.java
index 31a9275dad..00d6a9c044 100644
--- a/gentools/src/org/apache/qpid/gentools/AmqpMethod.java
+++ b/gentools/src/org/apache/qpid/gentools/AmqpMethod.java
@@ -64,7 +64,7 @@ public class AmqpMethod implements Printable, NodeAware, VersionConsistencyCheck
indexMap.put(index, indexVersionSet);
}
NodeList nList = methodNode.getChildNodes();
- int fieldCntr = 0;
+ int fieldCntr = fieldMap.size();
isRequest = false; // Assume not a request unless we find a response node.
for (int i=0; i<nList.getLength(); i++)
{
diff --git a/gentools/src/org/apache/qpid/gentools/Main.java b/gentools/src/org/apache/qpid/gentools/Main.java
index 7e6248817c..3ba6801375 100644
--- a/gentools/src/org/apache/qpid/gentools/Main.java
+++ b/gentools/src/org/apache/qpid/gentools/Main.java
@@ -202,7 +202,7 @@ public class Main
new File(tmplDir + Utils.fileSeparator + "AMQP_Constants.h.tmpl"),
new File(tmplDir + Utils.fileSeparator + "AMQP_MethodVersionMap.h.tmpl"),
new File(tmplDir + Utils.fileSeparator + "AMQP_MethodVersionMap.cpp.tmpl"),
- new File(tmplDir + Utils.fileSeparator + "AMQP_HighestVersion.h.tmpl")
+ new File(tmplDir + Utils.fileSeparator + "AMQP_HighestVersion.h.tmpl")
};
methodTemplateFiles = new File[]
{
diff --git a/java/client/src/main/java/org/apache/qpid/client/BasicMessageProducer.java b/java/client/src/main/java/org/apache/qpid/client/BasicMessageProducer.java
index dba8049657..39c4c28baf 100644
--- a/java/client/src/main/java/org/apache/qpid/client/BasicMessageProducer.java
+++ b/java/client/src/main/java/org/apache/qpid/client/BasicMessageProducer.java
@@ -579,7 +579,7 @@ public class BasicMessageProducer extends Closeable implements org.apache.qpid.j
Content data = new Content(Content.TypeEnum.INLINE_T, payload);
- doMessageTransfer(messageHeaders,destination,data,message,deliveryMode,priority,timeToLive,immediate);
+ doMessageTransfer(messageHeaders,destination,data,message,deliveryMode,priority,timeToLive,mandatory,immediate);
} else {
// Reference message case
// Sequence is as follows
@@ -599,7 +599,7 @@ public class BasicMessageProducer extends Closeable implements org.apache.qpid.j
// Message.Transfer
Content data = new Content(Content.TypeEnum.REF_T, referenceId.getBytes());
- doMessageTransfer(messageHeaders,destination,data,message,deliveryMode,priority,timeToLive,immediate);
+ doMessageTransfer(messageHeaders,destination,data,message,deliveryMode,priority,timeToLive,mandatory,immediate);
//Message.Append
for(Iterator it = content.iterator(); it.hasNext();){
@@ -622,7 +622,7 @@ public class BasicMessageProducer extends Closeable implements org.apache.qpid.j
}
private void doMessageTransfer(MessageHeaders messageHeaders,AMQDestination destination, Content content, AbstractJMSMessage message, int deliveryMode, int priority,
- long timeToLive, boolean immediate)throws JMSException{
+ long timeToLive, boolean mandatory, boolean immediate)throws JMSException{
try
{
AMQMethodBody methodBody = MessageTransferBody.createMethodBody(
@@ -638,6 +638,7 @@ public class BasicMessageProducer extends Closeable implements org.apache.qpid.j
destination.getExchangeName(), // String exchange
messageHeaders.getExpiration(), // long expiration
immediate, // boolean immediate
+ mandatory, // boolean mandatory
messageHeaders.getMessageId(), // String messageId
(short)priority, // short priority
message.getJMSRedelivered(), // boolean redelivered
diff --git a/java/common/protocol-version.xml b/java/common/protocol-version.xml
index 711efc4481..f70e1263bd 100644
--- a/java/common/protocol-version.xml
+++ b/java/common/protocol-version.xml
@@ -27,8 +27,8 @@
<property name="generated.dir" location="${generated.path}/${generated.package}" />
<property name="generated.timestamp" location="${generated.dir}/timestamp" />
<property name="xml.spec.dir" location="${topDirectoryLocation}/../specs" />
- <property name="xml.spec.deps" value="amqp.0-9.xml cluster.0-9.xml exchange-bound.0-9.xml amqp-nogen.0-9.xml" />
- <property name="xml.spec.list" value="${xml.spec.dir}/amqp.0-9.xml ${xml.spec.dir}/cluster.0-9.xml ${xml.spec.dir}/exchange-bound.0-9.xml ${xml.spec.dir}/amqp-nogen.0-9.xml" />
+ <property name="xml.spec.deps" value="amqp.0-9.xml amqp-errata.0-9.xml cluster.0-9.xml exchange-bound.0-9.xml amqp-nogen.0-9.xml" />
+ <property name="xml.spec.list" value="${xml.spec.dir}/amqp.0-9.xml ${xml.spec.dir}/amqp-errata.0-9.xml ${xml.spec.dir}/cluster.0-9.xml ${xml.spec.dir}/exchange-bound.0-9.xml ${xml.spec.dir}/amqp-nogen.0-9.xml" />
<target name="generate" depends="compile_generator,check_generate_deps" unless="generation.notRequired">
<mkdir dir="${generated.dir}"/>
diff --git a/java/common/src/main/java/org/apache/qpid/framing/RequestManager.java b/java/common/src/main/java/org/apache/qpid/framing/RequestManager.java
index cd63a60c04..836c4ad985 100644
--- a/java/common/src/main/java/org/apache/qpid/framing/RequestManager.java
+++ b/java/common/src/main/java/org/apache/qpid/framing/RequestManager.java
@@ -75,8 +75,6 @@ public class RequestManager
long requestId = getNextRequestId(); // Get new request ID
AMQFrame requestFrame = AMQRequestBody.createAMQFrame(channel, requestId,
lastProcessedResponseId, requestMethodBody);
- requestSentMap.put(requestId, methodListener);
- protocolWriter.writeFrame(requestFrame);
if (logger.isDebugEnabled())
{
logger.debug((serverFlag ? "SRV[" : "CLI[") + connectionId + "," + channel +
@@ -84,6 +82,8 @@ public class RequestManager
}
//System.out.println((serverFlag ? "SRV[" : "CLI[") + connectionId + "," + channel +
// "] TX REQ: Req[" + requestId + " " + lastProcessedResponseId + "]; " + requestMethodBody);
+ requestSentMap.put(requestId, methodListener);
+ protocolWriter.writeFrame(requestFrame);
return requestId;
}
diff --git a/specs/amqp-errata.0-9.xml b/specs/amqp-errata.0-9.xml
new file mode 100644
index 0000000000..8b9d818234
--- /dev/null
+++ b/specs/amqp-errata.0-9.xml
@@ -0,0 +1,44 @@
+<?xml version = "1.0"?>
+<!--
+ -
+ - Licensed to the Apache Software Foundation (ASF) under one
+ - or more contributor license agreements. See the NOTICE file
+ - distributed with this work for additional information
+ - regarding copyright ownership. The ASF licenses this file
+ - to you under the Apache License, Version 2.0 (the
+ - "License"); you may not use this file except in compliance
+ - with the License. You may obtain a copy of the License at
+ -
+ - http://www.apache.org/licenses/LICENSE-2.0
+ -
+ - Unless required by applicable law or agreed to in writing,
+ - software distributed under the License is distributed on an
+ - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ - KIND, either express or implied. See the License for the
+ - specific language governing permissions and limitations
+ - under the License.
+ -
+ -->
+<amqp major = "0" minor = "9" port = "5672" comment = "AMQ Protocol version 0-9">
+
+ <constant name = "frame-request" value = "9" />
+ <constant name = "frame-response" value = "10" />
+
+ <!-- == MESSAGE =========================================================== -->
+
+ <class name = "message" index = "120">
+ <method name = "transfer" index = "10">
+ <chassis name = "server" implement = "MUST" />
+ <chassis name = "client" implement = "MUST" />
+ <field name = "mandatory" type = "bit" label = "indicate mandatory routing">
+ <doc>
+ This flag tells the server how to react if the message cannot be
+ routed to a queue. If this flag is set, the server will return an
+ unroutable message with a Return method. If this flag is zero, the
+ server silently drops the message.
+ </doc>
+ </field>
+ </method>
+ </class>
+
+</amqp>
diff --git a/specs/amqp.0-9.xml b/specs/amqp.0-9.xml
index e6f0e49285..9d1b488c03 100644
--- a/specs/amqp.0-9.xml
+++ b/specs/amqp.0-9.xml
@@ -169,8 +169,6 @@
<constant name = "frame-oob-body" value = "6" />
<constant name = "frame-trace" value = "7" />
<constant name = "frame-heartbeat" value = "8" />
- <constant name = "frame-request" value = "9" />
- <constant name = "frame-response" value = "10" />
<!-- Protocol constants -->
<constant name = "frame-min-size" value = "4096" />