You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by rg...@apache.org on 2007/11/24 22:14:23 UTC
svn commit: r597918 [12/12] - in /incubator/qpid/branches/M2.1: gentools/
gentools/lib/ gentools/src/org/apache/qpid/gentools/ java/
java/broker/src/main/java/org/apache/qpid/server/
java/broker/src/main/java/org/apache/qpid/server/handler/ java/broker...
Modified: incubator/qpid/branches/M2.1/java/common/src/main/java/org/apache/qpid/framing/VersionSpecificRegistry.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/M2.1/java/common/src/main/java/org/apache/qpid/framing/VersionSpecificRegistry.java?rev=597918&r1=597917&r2=597918&view=diff
==============================================================================
--- incubator/qpid/branches/M2.1/java/common/src/main/java/org/apache/qpid/framing/VersionSpecificRegistry.java (original)
+++ incubator/qpid/branches/M2.1/java/common/src/main/java/org/apache/qpid/framing/VersionSpecificRegistry.java Sat Nov 24 13:14:14 2007
@@ -182,7 +182,7 @@
+ " method " + methodID + ".", null);
}
- return bodyFactory.newInstance(_protocolMajorVersion, _protocolMinorVersion, classID, methodID, in, size);
+ return bodyFactory.newInstance( in, size);
}
Added: incubator/qpid/branches/M2.1/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/AMQMethodBody_0_9.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/M2.1/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/AMQMethodBody_0_9.java?rev=597918&view=auto
==============================================================================
--- incubator/qpid/branches/M2.1/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/AMQMethodBody_0_9.java (added)
+++ incubator/qpid/branches/M2.1/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/AMQMethodBody_0_9.java Sat Nov 24 13:14:14 2007
@@ -0,0 +1,188 @@
+package org.apache.qpid.framing.amqp_0_9;
+
+import org.apache.qpid.framing.EncodingUtils;
+import org.apache.qpid.framing.AMQShortString;
+import org.apache.qpid.framing.FieldTable;
+import org.apache.qpid.framing.AMQFrameDecodingException;
+import org.apache.qpid.framing.Content;
+
+import org.apache.mina.common.ByteBuffer;
+
+public abstract class AMQMethodBody_0_9 extends org.apache.qpid.framing.AMQMethodBodyImpl
+{
+
+ public byte getMajor()
+ {
+ return 0;
+ }
+
+ public byte getMinor()
+ {
+ return 9;
+ }
+
+ public int getSize()
+ {
+ return 2 + 2 + getBodySize();
+ }
+
+ public void writePayload(ByteBuffer buffer)
+ {
+ EncodingUtils.writeUnsignedShort(buffer, getClazz());
+ EncodingUtils.writeUnsignedShort(buffer, getMethod());
+ writeMethodPayload(buffer);
+ }
+
+
+ protected byte readByte(ByteBuffer buffer)
+ {
+ return buffer.get();
+ }
+
+ protected AMQShortString readAMQShortString(ByteBuffer buffer)
+ {
+ return EncodingUtils.readAMQShortString(buffer);
+ }
+
+ protected int getSizeOf(AMQShortString string)
+ {
+ return EncodingUtils.encodedShortStringLength(string);
+ }
+
+ protected void writeByte(ByteBuffer buffer, byte b)
+ {
+ buffer.put(b);
+ }
+
+ protected void writeAMQShortString(ByteBuffer buffer, AMQShortString string)
+ {
+ EncodingUtils.writeShortStringBytes(buffer, string);
+ }
+
+ protected int readInt(ByteBuffer buffer)
+ {
+ return buffer.getInt();
+ }
+
+ protected void writeInt(ByteBuffer buffer, int i)
+ {
+ buffer.putInt(i);
+ }
+
+ protected FieldTable readFieldTable(ByteBuffer buffer) throws AMQFrameDecodingException
+ {
+ return EncodingUtils.readFieldTable(buffer);
+ }
+
+ protected int getSizeOf(FieldTable table)
+ {
+ return EncodingUtils.encodedFieldTableLength(table); //To change body of created methods use File | Settings | File Templates.
+ }
+
+ protected void writeFieldTable(ByteBuffer buffer, FieldTable table)
+ {
+ EncodingUtils.writeFieldTableBytes(buffer, table);
+ }
+
+ protected long readLong(ByteBuffer buffer)
+ {
+ return buffer.getLong();
+ }
+
+ protected void writeLong(ByteBuffer buffer, long l)
+ {
+ buffer.putLong(l);
+ }
+
+ protected int getSizeOf(byte[] response)
+ {
+ return (response == null) ? 4 :response.length + 4;
+ }
+
+ protected void writeBytes(ByteBuffer buffer, byte[] data)
+ {
+ EncodingUtils.writeBytes(buffer,data);
+ }
+
+ protected byte[] readBytes(ByteBuffer buffer)
+ {
+ return EncodingUtils.readBytes(buffer);
+ }
+
+ protected short readShort(ByteBuffer buffer)
+ {
+ return EncodingUtils.readShort(buffer);
+ }
+
+ protected void writeShort(ByteBuffer buffer, short s)
+ {
+ EncodingUtils.writeShort(buffer, s);
+ }
+
+ protected Content readContent(ByteBuffer buffer)
+ {
+ return null; //To change body of created methods use File | Settings | File Templates.
+ }
+
+ protected int getSizeOf(Content body)
+ {
+ return 0; //To change body of created methods use File | Settings | File Templates.
+ }
+
+ protected void writeContent(ByteBuffer buffer, Content body)
+ {
+ //To change body of created methods use File | Settings | File Templates.
+ }
+
+ protected byte readBitfield(ByteBuffer buffer)
+ {
+ return readByte(buffer); //To change body of created methods use File | Settings | File Templates.
+ }
+
+ protected int readUnsignedShort(ByteBuffer buffer)
+ {
+ return buffer.getUnsignedShort(); //To change body of created methods use File | Settings | File Templates.
+ }
+
+ protected void writeBitfield(ByteBuffer buffer, byte bitfield0)
+ {
+ buffer.put(bitfield0);
+ }
+
+ protected void writeUnsignedShort(ByteBuffer buffer, int s)
+ {
+ EncodingUtils.writeUnsignedShort(buffer, s);
+ }
+
+ protected long readUnsignedInteger(ByteBuffer buffer)
+ {
+ return buffer.getUnsignedInt();
+ }
+ protected void writeUnsignedInteger(ByteBuffer buffer, long i)
+ {
+ EncodingUtils.writeUnsignedInteger(buffer, i);
+ }
+
+
+ protected short readUnsignedByte(ByteBuffer buffer)
+ {
+ return buffer.getUnsigned();
+ }
+
+ protected void writeUnsignedByte(ByteBuffer buffer, short unsignedByte)
+ {
+ EncodingUtils.writeUnsignedByte(buffer, unsignedByte);
+ }
+
+ protected long readTimestamp(ByteBuffer buffer)
+ {
+ return EncodingUtils.readTimestamp(buffer);
+ }
+
+ protected void writeTimestamp(ByteBuffer buffer, long t)
+ {
+ EncodingUtils.writeTimestamp(buffer, t);
+ }
+
+
+}
Added: incubator/qpid/branches/M2.1/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/MethodConverter_0_9.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/M2.1/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/MethodConverter_0_9.java?rev=597918&view=auto
==============================================================================
--- incubator/qpid/branches/M2.1/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/MethodConverter_0_9.java (added)
+++ incubator/qpid/branches/M2.1/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/MethodConverter_0_9.java Sat Nov 24 13:14:14 2007
@@ -0,0 +1,126 @@
+package org.apache.qpid.framing.amqp_0_9;
+
+import org.apache.mina.common.ByteBuffer;
+
+import org.apache.qpid.framing.abstraction.AbstractMethodConverter;
+import org.apache.qpid.framing.abstraction.ProtocolVersionMethodConverter;
+import org.apache.qpid.framing.abstraction.ContentChunk;
+import org.apache.qpid.framing.abstraction.MessagePublishInfo;
+import org.apache.qpid.framing.*;
+import org.apache.qpid.framing.amqp_0_9.*;
+import org.apache.qpid.framing.amqp_0_9.BasicPublishBodyImpl;
+
+public class MethodConverter_0_9 extends AbstractMethodConverter implements ProtocolVersionMethodConverter
+{
+ private int _basicPublishClassId;
+ private int _basicPublishMethodId;
+
+ public MethodConverter_0_9()
+ {
+ super((byte)0,(byte)9);
+
+
+ }
+
+ public AMQBody convertToBody(ContentChunk contentChunk)
+ {
+ return new ContentBody(contentChunk.getData());
+ }
+
+ public ContentChunk convertToContentChunk(AMQBody body)
+ {
+ final ContentBody contentBodyChunk = (ContentBody) body;
+
+ return new ContentChunk()
+ {
+
+ public int getSize()
+ {
+ return contentBodyChunk.getSize();
+ }
+
+ public ByteBuffer getData()
+ {
+ return contentBodyChunk.payload;
+ }
+
+ public void reduceToFit()
+ {
+ contentBodyChunk.reduceBufferToFit();
+ }
+ };
+
+ }
+
+ public void configure()
+ {
+
+ _basicPublishClassId = org.apache.qpid.framing.amqp_0_9.BasicPublishBodyImpl.CLASS_ID;
+ _basicPublishMethodId = BasicPublishBodyImpl.METHOD_ID;
+
+ }
+
+ public MessagePublishInfo convertToInfo(AMQMethodBody methodBody)
+ {
+ final BasicPublishBody publishBody = ((BasicPublishBody) methodBody);
+
+ final AMQShortString exchange = publishBody.getExchange();
+ final AMQShortString routingKey = publishBody.getRoutingKey();
+
+ return new MethodConverter_0_9.MessagePublishInfoImpl(exchange == null ? null : exchange.intern(),
+ publishBody.getImmediate(),
+ publishBody.getMandatory(),
+ routingKey == null ? null : routingKey.intern());
+
+ }
+
+ public AMQMethodBody convertToBody(MessagePublishInfo info)
+ {
+
+ return new BasicPublishBodyImpl(0,
+ info.getExchange(),
+ info.getRoutingKey(),
+ info.isMandatory(),
+ info.isImmediate()) ;
+
+ }
+
+ private static class MessagePublishInfoImpl implements MessagePublishInfo
+ {
+ private final AMQShortString _exchange;
+ private final boolean _immediate;
+ private final boolean _mandatory;
+ private final AMQShortString _routingKey;
+
+ public MessagePublishInfoImpl(final AMQShortString exchange,
+ final boolean immediate,
+ final boolean mandatory,
+ final AMQShortString routingKey)
+ {
+ _exchange = exchange;
+ _immediate = immediate;
+ _mandatory = mandatory;
+ _routingKey = routingKey;
+ }
+
+ public AMQShortString getExchange()
+ {
+ return _exchange;
+ }
+
+ public boolean isImmediate()
+ {
+ return _immediate;
+ }
+
+ public boolean isMandatory()
+ {
+ return _mandatory;
+ }
+
+ public AMQShortString getRoutingKey()
+ {
+ return _routingKey;
+ }
+ }
+}
Added: incubator/qpid/branches/M2.1/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/AMQMethodBody_8_0.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/M2.1/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/AMQMethodBody_8_0.java?rev=597918&view=auto
==============================================================================
--- incubator/qpid/branches/M2.1/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/AMQMethodBody_8_0.java (added)
+++ incubator/qpid/branches/M2.1/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/AMQMethodBody_8_0.java Sat Nov 24 13:14:14 2007
@@ -0,0 +1,188 @@
+package org.apache.qpid.framing.amqp_8_0;
+
+import org.apache.qpid.framing.EncodingUtils;
+import org.apache.qpid.framing.AMQShortString;
+import org.apache.qpid.framing.FieldTable;
+import org.apache.qpid.framing.AMQFrameDecodingException;
+import org.apache.qpid.framing.Content;
+
+import org.apache.mina.common.ByteBuffer;
+
+public abstract class AMQMethodBody_8_0 extends org.apache.qpid.framing.AMQMethodBodyImpl
+{
+
+ public byte getMajor()
+ {
+ return 8;
+ }
+
+ public byte getMinor()
+ {
+ return 0;
+ }
+
+ public int getSize()
+ {
+ return 2 + 2 + getBodySize();
+ }
+
+ public void writePayload(ByteBuffer buffer)
+ {
+ EncodingUtils.writeUnsignedShort(buffer, getClazz());
+ EncodingUtils.writeUnsignedShort(buffer, getMethod());
+ writeMethodPayload(buffer);
+ }
+
+
+ protected byte readByte(ByteBuffer buffer)
+ {
+ return buffer.get();
+ }
+
+ protected AMQShortString readAMQShortString(ByteBuffer buffer)
+ {
+ return EncodingUtils.readAMQShortString(buffer);
+ }
+
+ protected int getSizeOf(AMQShortString string)
+ {
+ return EncodingUtils.encodedShortStringLength(string);
+ }
+
+ protected void writeByte(ByteBuffer buffer, byte b)
+ {
+ buffer.put(b);
+ }
+
+ protected void writeAMQShortString(ByteBuffer buffer, AMQShortString string)
+ {
+ EncodingUtils.writeShortStringBytes(buffer, string);
+ }
+
+ protected int readInt(ByteBuffer buffer)
+ {
+ return buffer.getInt();
+ }
+
+ protected void writeInt(ByteBuffer buffer, int i)
+ {
+ buffer.putInt(i);
+ }
+
+ protected FieldTable readFieldTable(ByteBuffer buffer) throws AMQFrameDecodingException
+ {
+ return EncodingUtils.readFieldTable(buffer);
+ }
+
+ protected int getSizeOf(FieldTable table)
+ {
+ return EncodingUtils.encodedFieldTableLength(table); //To change body of created methods use File | Settings | File Templates.
+ }
+
+ protected void writeFieldTable(ByteBuffer buffer, FieldTable table)
+ {
+ EncodingUtils.writeFieldTableBytes(buffer, table);
+ }
+
+ protected long readLong(ByteBuffer buffer)
+ {
+ return buffer.getLong();
+ }
+
+ protected void writeLong(ByteBuffer buffer, long l)
+ {
+ buffer.putLong(l);
+ }
+
+ protected int getSizeOf(byte[] response)
+ {
+ return (response == null) ? 4 : response.length + 4;
+ }
+
+ protected void writeBytes(ByteBuffer buffer, byte[] data)
+ {
+ EncodingUtils.writeBytes(buffer,data);
+ }
+
+ protected byte[] readBytes(ByteBuffer buffer)
+ {
+ return EncodingUtils.readBytes(buffer);
+ }
+
+ protected short readShort(ByteBuffer buffer)
+ {
+ return EncodingUtils.readShort(buffer);
+ }
+
+ protected void writeShort(ByteBuffer buffer, short s)
+ {
+ EncodingUtils.writeShort(buffer, s);
+ }
+
+ protected Content readContent(ByteBuffer buffer)
+ {
+ return null; //To change body of created methods use File | Settings | File Templates.
+ }
+
+ protected int getSizeOf(Content body)
+ {
+ return 0; //To change body of created methods use File | Settings | File Templates.
+ }
+
+ protected void writeContent(ByteBuffer buffer, Content body)
+ {
+ //To change body of created methods use File | Settings | File Templates.
+ }
+
+ protected byte readBitfield(ByteBuffer buffer)
+ {
+ return readByte(buffer); //To change body of created methods use File | Settings | File Templates.
+ }
+
+ protected int readUnsignedShort(ByteBuffer buffer)
+ {
+ return buffer.getUnsignedShort(); //To change body of created methods use File | Settings | File Templates.
+ }
+
+ protected void writeBitfield(ByteBuffer buffer, byte bitfield0)
+ {
+ buffer.put(bitfield0);
+ }
+
+ protected void writeUnsignedShort(ByteBuffer buffer, int s)
+ {
+ EncodingUtils.writeUnsignedShort(buffer, s);
+ }
+
+ protected long readUnsignedInteger(ByteBuffer buffer)
+ {
+ return buffer.getUnsignedInt();
+ }
+ protected void writeUnsignedInteger(ByteBuffer buffer, long i)
+ {
+ EncodingUtils.writeUnsignedInteger(buffer, i);
+ }
+
+
+ protected short readUnsignedByte(ByteBuffer buffer)
+ {
+ return buffer.getUnsigned();
+ }
+
+ protected void writeUnsignedByte(ByteBuffer buffer, short unsignedByte)
+ {
+ EncodingUtils.writeUnsignedByte(buffer, unsignedByte);
+ }
+
+ protected long readTimestamp(ByteBuffer buffer)
+ {
+ return EncodingUtils.readTimestamp(buffer);
+ }
+
+ protected void writeTimestamp(ByteBuffer buffer, long t)
+ {
+ EncodingUtils.writeTimestamp(buffer, t);
+ }
+
+
+}
Added: incubator/qpid/branches/M2.1/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/MethodConverter_8_0.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/M2.1/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/MethodConverter_8_0.java?rev=597918&view=auto
==============================================================================
--- incubator/qpid/branches/M2.1/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/MethodConverter_8_0.java (added)
+++ incubator/qpid/branches/M2.1/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/MethodConverter_8_0.java Sat Nov 24 13:14:14 2007
@@ -0,0 +1,146 @@
+/*
+ *
+ * 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.
+ *
+ */
+
+package org.apache.qpid.framing.amqp_8_0;
+
+import org.apache.qpid.framing.abstraction.ProtocolVersionMethodConverter;
+import org.apache.qpid.framing.abstraction.ContentChunk;
+import org.apache.qpid.framing.abstraction.MessagePublishInfo;
+import org.apache.qpid.framing.abstraction.AbstractMethodConverter;
+import org.apache.qpid.framing.amqp_8_0.BasicPublishBodyImpl;
+import org.apache.qpid.framing.*;
+
+import org.apache.mina.common.ByteBuffer;
+
+public class MethodConverter_8_0 extends AbstractMethodConverter implements ProtocolVersionMethodConverter
+{
+ private int _basicPublishClassId;
+ private int _basicPublishMethodId;
+
+ public MethodConverter_8_0()
+ {
+ super((byte)8,(byte)0);
+
+
+ }
+
+ public AMQBody convertToBody(ContentChunk contentChunk)
+ {
+ return new ContentBody(contentChunk.getData());
+ }
+
+ public ContentChunk convertToContentChunk(AMQBody body)
+ {
+ final ContentBody contentBodyChunk = (ContentBody) body;
+
+ return new ContentChunk()
+ {
+
+ public int getSize()
+ {
+ return contentBodyChunk.getSize();
+ }
+
+ public ByteBuffer getData()
+ {
+ return contentBodyChunk.payload;
+ }
+
+ public void reduceToFit()
+ {
+ contentBodyChunk.reduceBufferToFit();
+ }
+ };
+
+ }
+
+ public void configure()
+ {
+
+ _basicPublishClassId = BasicPublishBodyImpl.CLASS_ID;
+ _basicPublishMethodId = BasicPublishBodyImpl.METHOD_ID;
+
+ }
+
+ public MessagePublishInfo convertToInfo(AMQMethodBody methodBody)
+ {
+ final BasicPublishBody publishBody = ((BasicPublishBody) methodBody);
+
+ final AMQShortString exchange = publishBody.getExchange();
+ final AMQShortString routingKey = publishBody.getRoutingKey();
+
+ return new MessagePublishInfoImpl(exchange == null ? null : exchange.intern(),
+ publishBody.getImmediate(),
+ publishBody.getMandatory(),
+ routingKey == null ? null : routingKey.intern());
+
+ }
+
+ public AMQMethodBody convertToBody(MessagePublishInfo info)
+ {
+
+ return new BasicPublishBodyImpl(0,
+ info.getExchange(),
+ info.getRoutingKey(),
+ info.isMandatory(),
+ info.isImmediate()) ;
+
+ }
+
+ private static class MessagePublishInfoImpl implements MessagePublishInfo
+ {
+ private final AMQShortString _exchange;
+ private final boolean _immediate;
+ private final boolean _mandatory;
+ private final AMQShortString _routingKey;
+
+ public MessagePublishInfoImpl(final AMQShortString exchange,
+ final boolean immediate,
+ final boolean mandatory,
+ final AMQShortString routingKey)
+ {
+ _exchange = exchange;
+ _immediate = immediate;
+ _mandatory = mandatory;
+ _routingKey = routingKey;
+ }
+
+ public AMQShortString getExchange()
+ {
+ return _exchange;
+ }
+
+ public boolean isImmediate()
+ {
+ return _immediate;
+ }
+
+ public boolean isMandatory()
+ {
+ return _mandatory;
+ }
+
+ public AMQShortString getRoutingKey()
+ {
+ return _routingKey;
+ }
+ }
+}
Modified: incubator/qpid/branches/M2.1/java/common/src/main/java/org/apache/qpid/protocol/AMQVersionAwareProtocolSession.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/M2.1/java/common/src/main/java/org/apache/qpid/protocol/AMQVersionAwareProtocolSession.java?rev=597918&r1=597917&r2=597918&view=diff
==============================================================================
--- incubator/qpid/branches/M2.1/java/common/src/main/java/org/apache/qpid/protocol/AMQVersionAwareProtocolSession.java (original)
+++ incubator/qpid/branches/M2.1/java/common/src/main/java/org/apache/qpid/protocol/AMQVersionAwareProtocolSession.java Sat Nov 24 13:14:14 2007
@@ -21,6 +21,7 @@
package org.apache.qpid.protocol;
import org.apache.qpid.framing.VersionSpecificRegistry;
+import org.apache.qpid.framing.MethodRegistry;
/**
* AMQVersionAwareProtocolSession is implemented by all AMQP session classes, that need to provide an awareness to
@@ -42,5 +43,7 @@
*
* @return The method registry for a specific version of the AMQP.
*/
- public VersionSpecificRegistry getRegistry();
+// public VersionSpecificRegistry getRegistry();
+
+ MethodRegistry getMethodRegistry();
}
Modified: incubator/qpid/branches/M2.1/java/common/src/main/java/org/apache/qpid/protocol/ProtocolVersionAware.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/M2.1/java/common/src/main/java/org/apache/qpid/protocol/ProtocolVersionAware.java?rev=597918&r1=597917&r2=597918&view=diff
==============================================================================
--- incubator/qpid/branches/M2.1/java/common/src/main/java/org/apache/qpid/protocol/ProtocolVersionAware.java (original)
+++ incubator/qpid/branches/M2.1/java/common/src/main/java/org/apache/qpid/protocol/ProtocolVersionAware.java Sat Nov 24 13:14:14 2007
@@ -20,6 +20,8 @@
*/
package org.apache.qpid.protocol;
+import org.apache.qpid.framing.ProtocolVersion;
+
/**
* ProtocolVersionAware is implemented by all AMQP handling classes, that need to provide an awareness to callers of
* the version of the AMQP protocol that they are able to handle.
@@ -32,6 +34,7 @@
public interface ProtocolVersionAware
{
/**
+ * @deprecated
* Reports the AMQP minor version, that the implementer can handle.
*
* @return The AMQP minor version.
@@ -39,9 +42,12 @@
public byte getProtocolMinorVersion();
/**
+ * @deprecated
* Reports the AMQP major version, that the implementer can handle.
*
* @return The AMQP major version.
*/
public byte getProtocolMajorVersion();
+
+ public ProtocolVersion getProtocolVersion();
}
Added: incubator/qpid/branches/M2.1/java/common/templates/method/MethodBodyInterface.vm
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/M2.1/java/common/templates/method/MethodBodyInterface.vm?rev=597918&view=auto
==============================================================================
--- incubator/qpid/branches/M2.1/java/common/templates/method/MethodBodyInterface.vm (added)
+++ incubator/qpid/branches/M2.1/java/common/templates/method/MethodBodyInterface.vm Sat Nov 24 13:14:14 2007
@@ -0,0 +1,62 @@
+#macro( UpperCamel $name )
+#set( $name = "${name.substring(0,1).toUpperCase()}${name.substring(1)}" )
+#end
+#macro( toUpperCamel $name )${name.substring(0,1).toUpperCase()}${name.substring(1)}#end
+
+
+
+#set( $amqp_ClassName = $amqpClass.Name)
+#UpperCamel( $amqp_ClassName )
+#set( $amqp_MethodName = $amqpMethod.Name )
+#UpperCamel( $amqp_MethodName )
+#set( $javaClassName = "${amqp_ClassName}${amqp_MethodName}Body" )
+
+
+#set( $filename = "${javaClassName}.java")
+/*
+ *
+ * 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.
+ *
+ */
+
+/*
+ * This file is auto-generated by ${generator} - do not modify.
+ * Supported AMQP version:
+ #foreach( $supportedVersion in $model.VersionSet )
+ * $supportedVersion.getMajor()-$supportedVersion.getMinor()
+ #end
+ */
+
+
+package org.apache.qpid.framing;
+
+
+public interface ${javaClassName} extends EncodableAMQDataBlock, AMQMethodBody
+{
+
+
+#foreach( $field in $amqpMethod.Fields )
+
+#if( $amqpMethod.isCommon( $field ) )
+ public $field.ConsistentNativeType get#toUpperCamel( ${field.Name} )();
+#end
+#end
+
+
+
+}
Added: incubator/qpid/branches/M2.1/java/common/templates/method/version/MethodBodyClass.vm
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/M2.1/java/common/templates/method/version/MethodBodyClass.vm?rev=597918&view=auto
==============================================================================
--- incubator/qpid/branches/M2.1/java/common/templates/method/version/MethodBodyClass.vm (added)
+++ incubator/qpid/branches/M2.1/java/common/templates/method/version/MethodBodyClass.vm Sat Nov 24 13:14:14 2007
@@ -0,0 +1,209 @@
+#macro( UpperCamel $name )
+#set( $name = "${name.substring(0,1).toUpperCase()}${name.substring(1)}" )
+#end
+#macro( toUpperCamel $name )${name.substring(0,1).toUpperCase()}${name.substring(1)}#end
+
+
+
+#set( $amqp_ClassName = $amqpClass.Name)
+#UpperCamel( $amqp_ClassName )
+#set( $amqp_MethodName = $amqpMethod.Name )
+#UpperCamel( $amqp_MethodName )
+#set( $javaClassName = "${amqp_ClassName}${amqp_MethodName}BodyImpl" )
+#set( $interfaceName = "${amqp_ClassName}${amqp_MethodName}Body" )
+#set( $amqpPackageName = "amqp_$version.getMajor()_$version.getMinor()" )
+
+#set( $filename = "${amqpPackageName}/${javaClassName}.java")
+/*
+ *
+ * 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.
+ *
+ */
+
+/*
+ * This file is auto-generated by ${generator} - do not modify.
+ * Supported AMQP version:
+ * $version.getMajor()-$version.getMinor()
+ */
+
+#set( $clazz = $amqpClass.asSingleVersionClass( $version ) )
+#set( $method = $amqpMethod.asSingleVersionMethod( $version ) )
+
+package org.apache.qpid.framing.amqp_$version.getMajor()_$version.getMinor();
+
+import java.util.HashMap;
+
+import org.apache.mina.common.ByteBuffer;
+import org.apache.qpid.framing.*;
+import org.apache.qpid.AMQException;
+
+public class ${javaClassName} extends AMQMethodBody_$version.getMajor()_$version.getMinor() implements $interfaceName
+{
+ private static final AMQMethodBodyInstanceFactory FACTORY_INSTANCE = new AMQMethodBodyInstanceFactory()
+ {
+ public AMQMethodBody newInstance(ByteBuffer in, long size) throws AMQFrameDecodingException
+ {
+ return new ${javaClassName}(in);
+ }
+
+
+ };
+
+
+ public static AMQMethodBodyInstanceFactory getFactory()
+ {
+ return FACTORY_INSTANCE;
+ }
+
+ public static int CLASS_ID = $clazz.ClassId;
+
+ public static int METHOD_ID = $method.MethodId;
+
+
+
+ // Fields declared in specification
+#foreach( $field in $method.ConsolidatedFields )
+ private final $field.NativeType _$field.getName(); // $field.UnderlyingFields
+#end
+
+
+ // Constructor
+
+ public ${javaClassName}(ByteBuffer buffer) throws AMQFrameDecodingException
+ {
+#foreach( $field in $method.ConsolidatedFields )
+ _$field.Name = read$field.getEncodingType()( buffer );
+#end
+ }
+
+ public ${javaClassName}(
+#foreach( $field in $method.FieldList )
+#if( $velocityCount == $method.getFieldList().size() )
+ $field.NativeType $field.Name
+#else
+ $field.NativeType $field.Name,
+#end
+#end
+ )
+ {
+#set( $consolidatedFieldName = "" )
+#foreach( $field in $method.FieldList )
+#if( $method.isConsolidated( $field.Name ) )
+#if( !$method.getConsolidatedFieldName( $field.Name ).equals( $consolidatedFieldName ) )
+#if( !$consolidatedFieldName.equals("") )
+ _$consolidatedFieldName = $consolidatedFieldName; // 1
+#end
+#set( $consolidatedFieldName = $method.getConsolidatedFieldName( $field.Name ) )
+ byte $consolidatedFieldName = (byte)0;
+#end
+ if( $field.Name )
+ {
+ $consolidatedFieldName = (byte) (((int) $consolidatedFieldName) | (1 << $method.getPositionInBitField( $field.Name )));
+ }
+#if( $velocityCount == $method.getFieldList().size())
+ _$consolidatedFieldName = $consolidatedFieldName;
+#else
+
+#end
+#else
+#if( !$consolidatedFieldName.equals("") )
+ _$consolidatedFieldName = $consolidatedFieldName;
+#end
+#set( $consolidatedFieldName = "" )
+ _$field.Name = $field.Name;
+#end
+#end
+ }
+
+ public int getClazz()
+ {
+ return CLASS_ID;
+ }
+
+ public int getMethod()
+ {
+ return METHOD_ID;
+ }
+
+
+#foreach( $field in $method.FieldList )
+ public final $field.NativeType get#toUpperCamel( ${field.Name} )()
+ {
+#if( $method.isConsolidated( $field.Name ) )
+ return (((int)(_$method.getConsolidatedFieldName( $field.Name ))) & ( 1 << $method.getPositionInBitField( $field.Name ))) != 0;
+#else
+ return _$field.Name;
+#end
+ }
+#end
+
+ protected int getBodySize()
+ {
+#set( $fixedSize = 0 )
+#foreach( $field in $method.ConsolidatedFields )
+#if( $field.isFixedSize() )
+#set( $fixedSize = $fixedSize + $field.Size )
+#end
+#end
+ int size = $fixedSize;
+#foreach( $field in $method.ConsolidatedFields )
+#if( ! $field.isFixedSize() )
+ size += getSizeOf( _$field.Name );
+#end
+#end
+ return size;
+ }
+
+ public void writeMethodPayload(ByteBuffer buffer)
+ {
+#foreach( $field in $method.ConsolidatedFields )
+ write$field.getEncodingType()( buffer, _$field.Name );
+#end
+ }
+
+ public boolean execute(MethodDispatcher dispatcher, int channelId) throws AMQException
+ {
+#set( $amqpMethodNameFirstChar = $amqpMethod.getName().substring(0,1) )
+#set( $amqpMethodNameFirstCharU = $amqpMethodNameFirstChar.toUpperCase() )
+#set( $amqpMethodNameUpperCamel = "$amqpMethodNameFirstCharU$amqpMethod.getName().substring(1)" )
+#if( $amqpMethod.inAllVersions() )
+ return dispatcher.dispatch${amqpClassNameUpperCamel}${amqpMethodNameUpperCamel}(this, channelId);
+#else
+ return ((MethodDispatcher_$version.getMajor()_$version.getMinor())dispatcher).dispatch${amqp_ClassName}${amqpMethodNameUpperCamel}(this, channelId);
+
+#end
+
+ }
+
+
+ public String toString()
+ {
+ StringBuilder buf = new StringBuilder("[$javaClassName: ");
+#foreach( $field in $method.FieldList )
+ buf.append( "$field.Name=" );
+ buf.append( get#toUpperCamel( $field.Name )() );
+#if( $velocityCount != $method.FieldList.size() )
+ buf.append( ", " );
+#end
+#end
+ buf.append("]");
+ return buf.toString();
+ }
+
+
+}
Added: incubator/qpid/branches/M2.1/java/common/templates/model/ClientMethodDispatcherInterface.vm
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/M2.1/java/common/templates/model/ClientMethodDispatcherInterface.vm?rev=597918&view=auto
==============================================================================
--- incubator/qpid/branches/M2.1/java/common/templates/model/ClientMethodDispatcherInterface.vm (added)
+++ incubator/qpid/branches/M2.1/java/common/templates/model/ClientMethodDispatcherInterface.vm Sat Nov 24 13:14:14 2007
@@ -0,0 +1,56 @@
+#set( $filename = "ClientMethodDispatcher.java")
+/*
+ *
+ * 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.
+ *
+ */
+
+/*
+ * This file is auto-generated by $generator - do not modify.
+ * Supported AMQP version:
+ #foreach( $supportedVersion in $model.VersionSet )
+ * $supportedVersion.getMajor()-$supportedVersion.getMinor()
+ #end
+ */
+
+package org.apache.qpid.framing;
+
+import org.apache.qpid.AMQException;
+
+
+public interface ClientMethodDispatcher
+{
+
+#foreach( $amqpClass in $model.getClasses() )
+#set( $amqpClassNameFirstChar = $amqpClass.getName().substring(0,1) )
+#set( $amqpClassNameFirstCharU = $amqpClassNameFirstChar.toUpperCase() )
+#set( $amqpClassNameUpperCamel = "$amqpClassNameFirstCharU$amqpClass.getName().substring(1)" )
+#foreach( $amqpMethodVersions in $amqpClass.getMethods() )
+#if( $amqpMethodVersions.inAllVersions() )
+#set( $amqpMethod = $amqpMethodVersions.asSingleVersionMethod($amqpMethodVersions.getVersionSet().first()) )
+#if( $amqpMethod.isClientMethod() )
+#set( $amqpMethodNameFirstChar = $amqpMethod.getName().substring(0,1) )
+#set( $amqpMethodNameFirstCharU = $amqpMethodNameFirstChar.toUpperCase() )
+#set( $amqpMethodNameUpperCamel = "$amqpMethodNameFirstCharU$amqpMethod.getName().substring(1)" )
+ public boolean dispatch${amqpClassNameUpperCamel}${amqpMethodNameUpperCamel}(${amqpClassNameUpperCamel}${amqpMethodNameUpperCamel}Body body, int channelId) throws AMQException;
+#end
+#end
+#end
+#end
+
+}
\ No newline at end of file
Added: incubator/qpid/branches/M2.1/java/common/templates/model/MethodDispatcherInterface.vm
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/M2.1/java/common/templates/model/MethodDispatcherInterface.vm?rev=597918&view=auto
==============================================================================
--- incubator/qpid/branches/M2.1/java/common/templates/model/MethodDispatcherInterface.vm (added)
+++ incubator/qpid/branches/M2.1/java/common/templates/model/MethodDispatcherInterface.vm Sat Nov 24 13:14:14 2007
@@ -0,0 +1,39 @@
+#set( $filename = "MethodDispatcher.java")
+/*
+ *
+ * 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.
+ *
+ */
+
+/*
+ * This file is auto-generated by $generator - do not modify.
+ * Supported AMQP version:
+ #foreach( $supportedVersion in $model.VersionSet )
+ * $supportedVersion.getMajor()-$supportedVersion.getMinor()
+ #end
+ */
+
+package org.apache.qpid.framing;
+
+import org.apache.qpid.AMQException;
+
+
+public interface MethodDispatcher extends
+ ClientMethodDispatcher, ServerMethodDispatcher
+{
+}
\ No newline at end of file
Added: incubator/qpid/branches/M2.1/java/common/templates/model/MethodRegistryClass.vm
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/M2.1/java/common/templates/model/MethodRegistryClass.vm?rev=597918&view=auto
==============================================================================
--- incubator/qpid/branches/M2.1/java/common/templates/model/MethodRegistryClass.vm (added)
+++ incubator/qpid/branches/M2.1/java/common/templates/model/MethodRegistryClass.vm Sat Nov 24 13:14:14 2007
@@ -0,0 +1,104 @@
+#set( $filename = "MethodRegistry.java")
+/*
+ *
+ * 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.
+ *
+ */
+
+/*
+ * This file is auto-generated by $generator - do not modify.
+ * Supported AMQP version:
+ #foreach( $supportedVersion in $model.VersionSet )
+ * $supportedVersion.getMajor()-$supportedVersion.getMinor()
+ #end
+ */
+
+package org.apache.qpid.framing;
+
+import org.apache.mina.common.ByteBuffer;
+
+import org.apache.qpid.framing.abstraction.ProtocolVersionMethodConverter;
+
+import java.util.Map;
+import java.util.HashMap;
+
+
+public abstract class MethodRegistry
+{
+ private static final Map<ProtocolVersion, MethodRegistry> _registries =
+ new HashMap<ProtocolVersion, MethodRegistry>();
+
+#foreach( $supportedVersion in $model.VersionSet )
+
+#set( $verName = "_$supportedVersion.getMajor()_$supportedVersion.getMinor()" )
+#set( $regPackage = "org.apache.qpid.framing.amqp$verName" )
+ public static final MethodRegistry registry_$supportedVersion.getMajor()_$supportedVersion.getMinor() =
+ new ${regPackage}.MethodRegistry${verName}();
+
+#end
+
+
+ public abstract AMQMethodBody convertToBody(ByteBuffer in, long size)
+ throws AMQFrameDecodingException;
+
+ public abstract int getMaxClassId();
+
+ public abstract int getMaxMethodId(int classId);
+
+
+ protected MethodRegistry(ProtocolVersion pv)
+ {
+ _registries.put(pv, this);
+ }
+
+ public static MethodRegistry getMethodRegistry(ProtocolVersion pv)
+ {
+ return _registries.get(pv);
+ }
+
+#foreach( $amqpClass in $model.getClasses() )
+#set( $amqpClassNameFirstChar = $amqpClass.getName().substring(0,1) )
+#set( $amqpClassNameFirstCharU = $amqpClassNameFirstChar.toUpperCase() )
+#set( $amqpClassNameUpperCamel = "$amqpClassNameFirstCharU$amqpClass.getName().substring(1)" )
+
+#foreach( $amqpMethodVersions in $amqpClass.getMethods() )
+#if( $amqpMethodVersions.isVersionInterfaceConsistent() )
+#set( $amqpMethod = $amqpMethodVersions.asSingleVersionMethod($amqpMethodVersions.getVersionSet().first()) )
+
+#set( $amqpMethodNameFirstChar = $amqpMethod.getName().substring(0,1) )
+#set( $amqpMethodNameFirstCharU = $amqpMethodNameFirstChar.toUpperCase() )
+#set( $amqpMethodNameUpperCamel = "$amqpMethodNameFirstCharU$amqpMethod.getName().substring(1)" )
+ public abstract ${amqpClassNameUpperCamel}${amqpMethodNameUpperCamel}Body create${amqpClassNameUpperCamel}${amqpMethodNameUpperCamel}Body(
+#foreach( $field in $amqpMethod.FieldList )
+#if( $velocityCount == $amqpMethod.getFieldList().size() )
+ final $field.NativeType $field.Name
+#else
+ final $field.NativeType $field.Name,
+#end
+#end
+ );
+
+
+#end
+#end
+#end
+
+
+ public abstract ProtocolVersionMethodConverter getProtocolVersionMethodConverter();
+
+}
\ No newline at end of file
Added: incubator/qpid/branches/M2.1/java/common/templates/model/ProtocolVersionListClass.vm
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/M2.1/java/common/templates/model/ProtocolVersionListClass.vm?rev=597918&view=auto
==============================================================================
--- incubator/qpid/branches/M2.1/java/common/templates/model/ProtocolVersionListClass.vm (added)
+++ incubator/qpid/branches/M2.1/java/common/templates/model/ProtocolVersionListClass.vm Sat Nov 24 13:14:14 2007
@@ -0,0 +1,155 @@
+#set( $filename = "ProtocolVersion.java" )
+/*
+*
+* 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.
+*
+*/
+
+/*
+* This file is auto-generated by $generator - do not modify.
+* Supported AMQP versions:
+#foreach( $version in $model.getVersionSet() )
+* $version.getMajor()-$version.getMinor()
+#end
+*/
+
+package org.apache.qpid.framing;
+
+import java.util.SortedSet;
+import java.util.Collections;
+import java.util.TreeSet;
+
+
+public class ProtocolVersion implements Comparable
+{
+ private final byte _majorVersion;
+ private final byte _minorVersion;
+
+
+ public ProtocolVersion(byte majorVersion, byte minorVersion)
+ {
+ _majorVersion = majorVersion;
+ _minorVersion = minorVersion;
+ }
+
+ public byte getMajorVersion()
+ {
+ return _majorVersion;
+ }
+
+ public byte getMinorVersion()
+ {
+ return _minorVersion;
+ }
+
+
+ public int compareTo(Object o)
+ {
+ ProtocolVersion pv = (ProtocolVersion) o;
+
+ /*
+ * 0-8 has it's major and minor numbers the wrong way round (it's actually 8-0)...
+ * so we need to deal with that case specially
+ */
+
+ if((_majorVersion == (byte) 8) && (_minorVersion == (byte) 0))
+ {
+ ProtocolVersion fixedThis = new ProtocolVersion(_minorVersion, _majorVersion);
+ return fixedThis.compareTo(pv);
+ }
+
+ if((pv.getMajorVersion() == (byte) 8) && (pv.getMinorVersion() == (byte) 0))
+ {
+ ProtocolVersion fixedOther = new ProtocolVersion(pv.getMinorVersion(), pv.getMajorVersion());
+ return this.compareTo(fixedOther);
+ }
+
+ if(_majorVersion > pv.getMajorVersion())
+ {
+ return 1;
+ }
+ else if(_majorVersion < pv.getMajorVersion())
+ {
+ return -1;
+ }
+ else if(_minorVersion > pv.getMinorVersion())
+ {
+ return 1;
+ }
+ else if(getMinorVersion() < pv.getMinorVersion())
+ {
+ return -1;
+ }
+ else
+ {
+ return 0;
+ }
+
+ }
+
+ public boolean equals(Object o)
+ {
+ return o != null && (o == this || (compareTo(o) == 0));
+ }
+
+ public int hashCode()
+ {
+ return (0xFF & (int)_minorVersion) | ((0xFF & (int)_majorVersion) << 8);
+ }
+
+
+ public boolean isSupported()
+ {
+ return _supportedVersions.contains(this);
+ }
+
+ public static ProtocolVersion getLatestSupportedVersion()
+ {
+ return _supportedVersions.last();
+ }
+
+ private static final SortedSet<ProtocolVersion> _supportedVersions;
+
+
+#foreach( $version in $model.getVersionSet() )
+#set( $versionId = "v$version.getMajor()_$version.getMinor()" )
+ public static final ProtocolVersion $versionId = new ProtocolVersion((byte)$version.getMajor(),(byte)$version.getMinor());
+#end
+
+ static
+ {
+ SortedSet<ProtocolVersion> versions = new TreeSet<ProtocolVersion>();
+
+#foreach( $version in $model.getVersionSet() )
+#set( $versionId = "v$version.getMajor()_$version.getMinor()" )
+ versions.add($versionId);
+#end
+ _supportedVersions = Collections.unmodifiableSortedSet(versions);
+ }
+
+
+ public static SortedSet<ProtocolVersion> getSupportedProtocolVersions()
+ {
+ return _supportedVersions;
+ }
+
+
+
+
+
+}
Added: incubator/qpid/branches/M2.1/java/common/templates/model/ServerMethodDispatcherInterface.vm
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/M2.1/java/common/templates/model/ServerMethodDispatcherInterface.vm?rev=597918&view=auto
==============================================================================
--- incubator/qpid/branches/M2.1/java/common/templates/model/ServerMethodDispatcherInterface.vm (added)
+++ incubator/qpid/branches/M2.1/java/common/templates/model/ServerMethodDispatcherInterface.vm Sat Nov 24 13:14:14 2007
@@ -0,0 +1,56 @@
+#set( $filename = "ServerMethodDispatcher.java")
+/*
+ *
+ * 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.
+ *
+ */
+
+/*
+ * This file is auto-generated by $generator - do not modify.
+ * Supported AMQP version:
+ #foreach( $supportedVersion in $model.VersionSet )
+ * $supportedVersion.getMajor()-$supportedVersion.getMinor()
+ #end
+ */
+
+package org.apache.qpid.framing;
+
+import org.apache.qpid.AMQException;
+
+
+public interface ServerMethodDispatcher
+{
+
+#foreach( $amqpClass in $model.getClasses() )
+#set( $amqpClassNameFirstChar = $amqpClass.getName().substring(0,1) )
+#set( $amqpClassNameFirstCharU = $amqpClassNameFirstChar.toUpperCase() )
+#set( $amqpClassNameUpperCamel = "$amqpClassNameFirstCharU$amqpClass.getName().substring(1)" )
+#foreach( $amqpMethodVersions in $amqpClass.getMethods() )
+#if( $amqpMethodVersions.inAllVersions() )
+#set( $amqpMethod = $amqpMethodVersions.asSingleVersionMethod($amqpMethodVersions.getVersionSet().first()) )
+#if( $amqpMethod.isServerMethod() )
+#set( $amqpMethodNameFirstChar = $amqpMethod.getName().substring(0,1) )
+#set( $amqpMethodNameFirstCharU = $amqpMethodNameFirstChar.toUpperCase() )
+#set( $amqpMethodNameUpperCamel = "$amqpMethodNameFirstCharU$amqpMethod.getName().substring(1)" )
+ public boolean dispatch${amqpClassNameUpperCamel}${amqpMethodNameUpperCamel}(${amqpClassNameUpperCamel}${amqpMethodNameUpperCamel}Body body, int channelId) throws AMQException;
+#end
+#end
+#end
+#end
+
+}
\ No newline at end of file
Added: incubator/qpid/branches/M2.1/java/common/templates/model/version/AmqpConstantsClass.vm
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/M2.1/java/common/templates/model/version/AmqpConstantsClass.vm?rev=597918&view=auto
==============================================================================
--- incubator/qpid/branches/M2.1/java/common/templates/model/version/AmqpConstantsClass.vm (added)
+++ incubator/qpid/branches/M2.1/java/common/templates/model/version/AmqpConstantsClass.vm Sat Nov 24 13:14:14 2007
@@ -0,0 +1,37 @@
+&{AmqpConstants.java}
+/*
+ *
+ * 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.
+ *
+ */
+
+/*
+ * This file is auto-generated by ${GENERATOR} - do not modify.
+ * Supported AMQP versions:
+%{VLIST} * ${major}-${minor}
+ */
+
+package org.apache.qpid.framing;
+
+class AmqpConstants
+{
+ // Constant getValue methods
+
+%{TLIST} ${const_get_method}
+
+}
Added: incubator/qpid/branches/M2.1/java/common/templates/model/version/ClientMethodDispatcherInterface.vm
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/M2.1/java/common/templates/model/version/ClientMethodDispatcherInterface.vm?rev=597918&view=auto
==============================================================================
--- incubator/qpid/branches/M2.1/java/common/templates/model/version/ClientMethodDispatcherInterface.vm (added)
+++ incubator/qpid/branches/M2.1/java/common/templates/model/version/ClientMethodDispatcherInterface.vm Sat Nov 24 13:14:14 2007
@@ -0,0 +1,55 @@
+#set( $filename = "amqp_$version.getMajor()_$version.getMinor()/ClientMethodDispatcher_${version.getMajor()}_${version.getMinor()}.java")
+/*
+ *
+ * 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.
+ *
+ */
+
+/*
+ * This file is auto-generated by $generator - do not modify.
+ * Supported AMQP version:
+ #foreach( $supportedVersion in $model.VersionSet )
+ * $supportedVersion.getMajor()-$supportedVersion.getMinor()
+ #end
+ */
+
+package org.apache.qpid.framing.amqp_$version.getMajor()_$version.getMinor();
+
+import org.apache.qpid.AMQException;
+import org.apache.qpid.framing.*;
+
+
+public interface ClientMethodDispatcher_${version.getMajor()}_${version.getMinor()} extends ClientMethodDispatcher
+{
+
+#foreach( $amqpClass in $model.getClasses() )
+#set( $amqpClassNameFirstChar = $amqpClass.getName().substring(0,1) )
+#set( $amqpClassNameFirstCharU = $amqpClassNameFirstChar.toUpperCase() )
+#set( $amqpClassNameUpperCamel = "$amqpClassNameFirstCharU$amqpClass.getName().substring(1)" )
+#foreach( $amqpMethodVersions in $amqpClass.getMethods() )
+#set( $amqpMethod = $amqpMethodVersions.asSingleVersionMethod($amqpMethodVersions.getVersionSet().first()) )
+#if( $amqpMethod.isClientMethod() )
+#set( $amqpMethodNameFirstChar = $amqpMethod.getName().substring(0,1) )
+#set( $amqpMethodNameFirstCharU = $amqpMethodNameFirstChar.toUpperCase() )
+#set( $amqpMethodNameUpperCamel = "$amqpMethodNameFirstCharU$amqpMethod.getName().substring(1)" )
+ public boolean dispatch${amqpClassNameUpperCamel}${amqpMethodNameUpperCamel}(${amqpClassNameUpperCamel}${amqpMethodNameUpperCamel}Body body, int channelId) throws AMQException;
+#end
+#end
+#end
+
+}
\ No newline at end of file
Added: incubator/qpid/branches/M2.1/java/common/templates/model/version/MethodDispatcherInterface.vm
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/M2.1/java/common/templates/model/version/MethodDispatcherInterface.vm?rev=597918&view=auto
==============================================================================
--- incubator/qpid/branches/M2.1/java/common/templates/model/version/MethodDispatcherInterface.vm (added)
+++ incubator/qpid/branches/M2.1/java/common/templates/model/version/MethodDispatcherInterface.vm Sat Nov 24 13:14:14 2007
@@ -0,0 +1,43 @@
+#set( $filename = "amqp_$version.getMajor()_$version.getMinor()/MethodDispatcher_${version.getMajor()}_${version.getMinor()}.java")
+/*
+ *
+ * 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.
+ *
+ */
+
+/*
+ * This file is auto-generated by $generator - do not modify.
+ * Supported AMQP version:
+ #foreach( $supportedVersion in $model.VersionSet )
+ * $supportedVersion.getMajor()-$supportedVersion.getMinor()
+ #end
+ */
+
+package org.apache.qpid.framing.amqp_$version.getMajor()_$version.getMinor();
+
+import org.apache.qpid.AMQException;
+import org.apache.qpid.framing.*;
+
+
+public interface MethodDispatcher_${version.getMajor()}_${version.getMinor()}
+ extends MethodDispatcher,
+ ServerMethodDispatcher_${version.getMajor()}_${version.getMinor()},
+ ClientMethodDispatcher_${version.getMajor()}_${version.getMinor()}
+{
+
+}
\ No newline at end of file
Added: incubator/qpid/branches/M2.1/java/common/templates/model/version/MethodRegistryClass.vm
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/M2.1/java/common/templates/model/version/MethodRegistryClass.vm?rev=597918&view=auto
==============================================================================
--- incubator/qpid/branches/M2.1/java/common/templates/model/version/MethodRegistryClass.vm (added)
+++ incubator/qpid/branches/M2.1/java/common/templates/model/version/MethodRegistryClass.vm Sat Nov 24 13:14:14 2007
@@ -0,0 +1,193 @@
+#set( $filename = "amqp_$version.getMajor()_$version.getMinor()/MethodRegistry_${version.getMajor()}_${version.getMinor()}.java")
+/*
+ *
+ * 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.
+ *
+ */
+
+/*
+ * This file is auto-generated by $generator - do not modify.
+ * Supported AMQP version:
+ * $version.getMajor()-$version.getMinor()
+ */
+
+package org.apache.qpid.framing.amqp_${version.getMajor()}_${version.getMinor()};
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.protocol.AMQConstant;
+
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import org.apache.mina.common.ByteBuffer;
+
+import org.apache.qpid.framing.abstraction.ProtocolVersionMethodConverter;
+
+
+public class MethodRegistry_$version.getMajor()_$version.getMinor() extends MethodRegistry
+{
+
+ private static final Logger _log = LoggerFactory.getLogger(MethodRegistry.class);
+
+ private ProtocolVersionMethodConverter _protocolVersionConverter = new MethodConverter_$version.getMajor()_$version.getMinor()();
+
+#set( $specificModel = $model.asSingleVersionModel() )
+
+
+#set( $maxClassId = $specificModel.getMaximumClassId()+1 )
+ private final AMQMethodBodyInstanceFactory[][] _factories = new AMQMethodBodyInstanceFactory[$maxClassId][];
+
+ public MethodRegistry_$version.getMajor()_$version.getMinor()()
+ {
+ this(new ProtocolVersion((byte)$version.getMajor(),(byte)$version.getMinor()));
+ }
+
+ public MethodRegistry_$version.getMajor()_$version.getMinor()(ProtocolVersion pv)
+ {
+ super(pv);
+#foreach( $amqpClass in $specificModel.getClassList() )
+#set( $amqpClassNameFirstChar = $amqpClass.getName().substring(0,1) )
+#set( $amqpClassNameFirstCharU = $amqpClassNameFirstChar.toUpperCase() )
+#set( $amqpClassNameUpperCamel = "$amqpClassNameFirstCharU$amqpClass.getName().substring(1)" )
+
+
+
+ // Register method body instance factories for the $amqpClassNameUpperCamel class.
+
+#set( $maxMethodId = $amqpClass.getMaximumMethodId()+1 )
+ _factories[$amqpClass.getClassId()] = new AMQMethodBodyInstanceFactory[$maxMethodId];
+
+#foreach( $amqpMethod in $amqpClass.getMethodList() )
+#set( $amqpMethodNameFirstChar = $amqpMethod.getName().substring(0,1) )
+#set( $amqpMethodNameFirstCharU = $amqpMethodNameFirstChar.toUpperCase() )
+#set( $amqpMethodNameUpperCamel = "$amqpMethodNameFirstCharU$amqpMethod.getName().substring(1)" )
+ _factories[$amqpClass.getClassId()][$amqpMethod.getMethodId()] = ${amqpClassNameUpperCamel}${amqpMethodNameUpperCamel}BodyImpl.getFactory();
+#end
+
+#end
+
+
+ }
+
+
+ public AMQMethodBody convertToBody(ByteBuffer in, long size)
+ throws AMQFrameDecodingException
+ {
+ int classId = in.getUnsignedShort();
+ int methodId = in.getUnsignedShort();
+
+ AMQMethodBodyInstanceFactory bodyFactory;
+ try
+ {
+ bodyFactory = _factories[classId][methodId];
+ }
+ catch(NullPointerException e)
+ {
+ throw new AMQFrameDecodingException(AMQConstant.COMMAND_INVALID,
+ "Class " + classId + " unknown in AMQP version $version.getMajor()-$version.getMinor()"
+ + " (while trying to decode class " + classId + " method " + methodId + ".");
+ }
+ catch(IndexOutOfBoundsException e)
+ {
+ if(classId >= _factories.length)
+ {
+ throw new AMQFrameDecodingException(AMQConstant.COMMAND_INVALID,
+ "Class " + classId + " unknown in AMQP version $version.getMajor()-$version.getMinor()"
+ + " (while trying to decode class " + classId + " method " + methodId + ".");
+
+ }
+ else
+ {
+ throw new AMQFrameDecodingException(AMQConstant.COMMAND_INVALID,
+ "Method " + methodId + " unknown in AMQP version $version.getMajor()-$version.getMinor()"
+ + " (while trying to decode class " + classId + " method " + methodId + ".");
+
+ }
+ }
+
+
+ if (bodyFactory == null)
+ {
+ throw new AMQFrameDecodingException(AMQConstant.COMMAND_INVALID,
+ "Method " + methodId + " unknown in AMQP version $version.getMajor()-$version.getMinor()"
+ + " (while trying to decode class " + classId + " method " + methodId + ".");
+ }
+
+
+ return bodyFactory.newInstance(in, size);
+
+
+ }
+
+
+ public int getMaxClassId()
+ {
+ return $specificModel.getMaximumClassId();
+ }
+
+ public int getMaxMethodId(int classId)
+ {
+ return _factories[classId].length - 1;
+ }
+
+
+
+#foreach( $amqpClass in $specificModel.getClassList() )
+#set( $amqpClassNameFirstChar = $amqpClass.getName().substring(0,1) )
+#set( $amqpClassNameFirstCharU = $amqpClassNameFirstChar.toUpperCase() )
+#set( $amqpClassNameUpperCamel = "$amqpClassNameFirstCharU$amqpClass.getName().substring(1)" )
+
+
+#foreach( $amqpMethod in $amqpClass.getMethodList() )
+#set( $amqpMethodNameFirstChar = $amqpMethod.getName().substring(0,1) )
+#set( $amqpMethodNameFirstCharU = $amqpMethodNameFirstChar.toUpperCase() )
+#set( $amqpMethodNameUpperCamel = "$amqpMethodNameFirstCharU$amqpMethod.getName().substring(1)" )
+ public ${amqpClassNameUpperCamel}${amqpMethodNameUpperCamel}Body create${amqpClassNameUpperCamel}${amqpMethodNameUpperCamel}Body(
+#foreach( $field in $amqpMethod.FieldList )
+#if( $velocityCount == $amqpMethod.getFieldList().size() )
+ final $field.NativeType $field.Name
+#else
+ final $field.NativeType $field.Name,
+#end
+#end
+ )
+ {
+ return new ${amqpClassNameUpperCamel}${amqpMethodNameUpperCamel}BodyImpl(
+#foreach( $field in $amqpMethod.FieldList )
+#if( $velocityCount == $amqpMethod.getFieldList().size() )
+ $field.Name
+#else
+ $field.Name,
+#end
+#end
+ );
+ }
+
+#end
+
+#end
+
+
+ public ProtocolVersionMethodConverter getProtocolVersionMethodConverter()
+ {
+ return _protocolVersionConverter;
+ }
+
+
+}
Added: incubator/qpid/branches/M2.1/java/common/templates/model/version/ServerMethodDispatcherInterface.vm
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/M2.1/java/common/templates/model/version/ServerMethodDispatcherInterface.vm?rev=597918&view=auto
==============================================================================
--- incubator/qpid/branches/M2.1/java/common/templates/model/version/ServerMethodDispatcherInterface.vm (added)
+++ incubator/qpid/branches/M2.1/java/common/templates/model/version/ServerMethodDispatcherInterface.vm Sat Nov 24 13:14:14 2007
@@ -0,0 +1,55 @@
+#set( $filename = "amqp_$version.getMajor()_$version.getMinor()/ServerMethodDispatcher_${version.getMajor()}_${version.getMinor()}.java")
+/*
+ *
+ * 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.
+ *
+ */
+
+/*
+ * This file is auto-generated by $generator - do not modify.
+ * Supported AMQP version:
+ #foreach( $supportedVersion in $model.VersionSet )
+ * $supportedVersion.getMajor()-$supportedVersion.getMinor()
+ #end
+ */
+
+package org.apache.qpid.framing.amqp_$version.getMajor()_$version.getMinor();
+
+import org.apache.qpid.AMQException;
+import org.apache.qpid.framing.*;
+
+
+public interface ServerMethodDispatcher_${version.getMajor()}_${version.getMinor()} extends ServerMethodDispatcher
+{
+
+#foreach( $amqpClass in $model.getClasses() )
+#set( $amqpClassNameFirstChar = $amqpClass.getName().substring(0,1) )
+#set( $amqpClassNameFirstCharU = $amqpClassNameFirstChar.toUpperCase() )
+#set( $amqpClassNameUpperCamel = "$amqpClassNameFirstCharU$amqpClass.getName().substring(1)" )
+#foreach( $amqpMethodVersions in $amqpClass.getMethods() )
+#set( $amqpMethod = $amqpMethodVersions.asSingleVersionMethod($amqpMethodVersions.getVersionSet().first()) )
+#if( $amqpMethod.isServerMethod() )
+#set( $amqpMethodNameFirstChar = $amqpMethod.getName().substring(0,1) )
+#set( $amqpMethodNameFirstCharU = $amqpMethodNameFirstChar.toUpperCase() )
+#set( $amqpMethodNameUpperCamel = "$amqpMethodNameFirstCharU$amqpMethod.getName().substring(1)" )
+ public boolean dispatch${amqpClassNameUpperCamel}${amqpMethodNameUpperCamel}(${amqpClassNameUpperCamel}${amqpMethodNameUpperCamel}Body body, int channelId) throws AMQException;
+#end
+#end
+#end
+
+}
\ No newline at end of file
Modified: incubator/qpid/branches/M2.1/java/pom.xml
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/M2.1/java/pom.xml?rev=597918&r1=597917&r2=597918&view=diff
==============================================================================
--- incubator/qpid/branches/M2.1/java/pom.xml (original)
+++ incubator/qpid/branches/M2.1/java/pom.xml Sat Nov 24 13:14:14 2007
@@ -150,7 +150,6 @@
<module>common</module>
<module>broker</module>
<module>client</module>
- <module>cluster</module>
<module>systests</module>
<module>perftests</module>
<module>integrationtests</module>
@@ -585,11 +584,6 @@
<dependency>
<groupId>org.apache.qpid</groupId>
<artifactId>qpid-mgmt-client</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.qpid</groupId>
- <artifactId>qpid-cluster</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
Modified: incubator/qpid/branches/M2.1/java/systests/src/main/java/org/apache/qpid/server/queue/MockProtocolSession.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/M2.1/java/systests/src/main/java/org/apache/qpid/server/queue/MockProtocolSession.java?rev=597918&r1=597917&r2=597918&view=diff
==============================================================================
--- incubator/qpid/branches/M2.1/java/systests/src/main/java/org/apache/qpid/server/queue/MockProtocolSession.java (original)
+++ incubator/qpid/branches/M2.1/java/systests/src/main/java/org/apache/qpid/server/queue/MockProtocolSession.java Sat Nov 24 13:14:14 2007
@@ -21,10 +21,7 @@
package org.apache.qpid.server.queue;
import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.AMQDataBlock;
-import org.apache.qpid.framing.FieldTable;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.framing.VersionSpecificRegistry;
+import org.apache.qpid.framing.*;
import org.apache.qpid.server.AMQChannel;
import org.apache.qpid.server.output.ProtocolOutputConverter;
import org.apache.qpid.server.output.ProtocolOutputConverterRegistry;
@@ -188,15 +185,32 @@
return null; //To change body of implemented methods use File | Settings | File Templates.
}
+ public MethodRegistry getMethodRegistry()
+ {
+ return null; //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public MethodDispatcher getMethodDispatcher()
+ {
+ return null; //To change body of implemented methods use File | Settings | File Templates.
+ }
+
public byte getProtocolMajorVersion()
{
- return 8; //To change body of implemented methods use File | Settings | File Templates.
+ return getProtocolVersion().getMajorVersion();
}
public byte getProtocolMinorVersion()
{
- return 0; //To change body of implemented methods use File | Settings | File Templates.
+ return getProtocolVersion().getMinorVersion();
+ }
+
+
+ public ProtocolVersion getProtocolVersion()
+ {
+ return ProtocolVersion.getLatestSupportedVersion(); //To change body of implemented methods use File | Settings | File Templates.
}
+
public VersionSpecificRegistry getRegistry()
{
Modified: incubator/qpid/branches/M2.1/specs/amqp.0-8.xml
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/M2.1/specs/amqp.0-8.xml?rev=597918&r1=597917&r2=597918&view=diff
==============================================================================
--- incubator/qpid/branches/M2.1/specs/amqp.0-8.xml (original)
+++ incubator/qpid/branches/M2.1/specs/amqp.0-8.xml Sat Nov 24 13:14:14 2007
@@ -790,7 +790,7 @@
class of the method.
</doc>
</field>
- <field name="method id" domain="class id">
+ <field name="method id" domain="method id">
failing method ID
<doc>
When the close is provoked by a method exception, this is the
@@ -1354,6 +1354,7 @@
</method>
<method name="bound" synchronous="1" index="22">
+ <chassis name="server" implement="SHOULD"/>
<field name="exchange" domain="exchange name"/>
<field name = "routing key" type = "shortstr">
Message routing key
@@ -1368,6 +1369,7 @@
<method name="bound-ok" synchronous="1" index="23">
<field name="reply code" domain="reply code"/>
<field name="reply text" domain="reply text"/>
+ <chassis name="client" implement="SHOULD"/>
</method>
</class>
Modified: incubator/qpid/branches/M2.1/specs/amqp.0-9.xml
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/M2.1/specs/amqp.0-9.xml?rev=597918&r1=597917&r2=597918&view=diff
==============================================================================
--- incubator/qpid/branches/M2.1/specs/amqp.0-9.xml (original)
+++ incubator/qpid/branches/M2.1/specs/amqp.0-9.xml Sat Nov 24 13:14:14 2007
@@ -1659,6 +1659,29 @@
<doc>This method confirms the deletion of an exchange.</doc>
<chassis name = "client" implement = "MUST" />
</method>
+
+ <!-- RG : Added Exchange.bound and Exchange.bound-ok -->
+ <method name="bound" synchronous="1" index="22">
+ <chassis name="server" implement="SHOULD"/>
+ <field name="exchange" domain="exchange-name"/>
+ <field name = "routing-key" type = "shortstr">
+ Message routing key
+ <doc>
+ Specifies the routing key for the message. The routing key is
+ used for routing messages depending on the exchange configuration.
+ </doc>
+ </field>
+ <field name = "queue" domain = "queue name"/>
+ </method>
+
+ <method name="bound-ok" synchronous="1" index="23">
+ <field name="reply-code" domain="reply-code"/>
+ <field name="reply-text" domain="reply-text"/>
+ <chassis name="client" implement="SHOULD"/>
+ </method>
+
+
+
</class>
<!-- == QUEUE ============================================================ -->
@@ -2704,7 +2727,9 @@
</doc>
</field>
- <field name = "filter" domain = "table" label = "arguments for consuming">
+ <!-- RG changed name from filter to arguments on basic.consume: this is inline with qpid0-8 and 0-10 and has no effect on the wire level encoding
+ <field name = "arguments" domain = "table" label = "arguments for consuming"> -->
+ <field name = "arguments" domain = "table" label = "arguments for consuming">
<doc>
A set of filters for the consume. The syntax and semantics
of these filters depends on the providers implementation.
@@ -3183,6 +3208,45 @@
</doc>
</field>
</method>
+
+
+ <!-- RG : Added recover-sync and recover-sync-ok to give a synchronous recover without interfering with the correct 0-9 recover method -->
+ <method name = "recover-sync" index = "102">
+ redeliver unacknowledged messages
+ <doc>
+ This method asks the broker to redeliver all unacknowledged messages on a
+ specified channel. Zero or more messages may be redelivered. This method
+ is only allowed on non-transacted channels.
+ </doc>
+ <chassis name = "server" implement = "MUST" />
+
+ <field name = "requeue" type = "bit">
+ requeue the message
+ <doc>
+ If this field is zero, the message will be redelivered to the original
+ recipient. If this bit is 1, the server will attempt to requeue the
+ message, potentially then delivering it to an alternative subscriber.
+ </doc>
+ </field>
+ <doc name="rule">
+ The server MUST set the redelivered flag on all messages that are resent.
+ </doc>
+ <doc name="rule">
+ The server MUST raise a channel exception if this is called on a
+ transacted channel.
+ </doc>
+ <response name="recover-sync-ok"/>
+ </method>
+ <method name="recover-sync-ok" synchronous="1" index="101">
+ confirm a successful recover
+ <doc>
+ This method confirms to the client that the recover succeeded.
+ Note that if an recover fails, the server raises a channel exception.
+ </doc>
+ <chassis name="client" implement="MUST"/>
+ </method>
+
+
</class>
<!-- == FILE ============================================================= -->