You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by kp...@apache.org on 2006/12/22 18:00:31 UTC
svn commit: r489691 [2/2] - in /incubator/qpid/trunk/qpid/java:
broker/src/main/java/org/apache/qpid/server/
broker/src/main/java/org/apache/qpid/server/handler/
broker/src/main/java/org/apache/qpid/server/protocol/
broker/src/main/java/org/apache/qpid...
Modified: incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/handler/ConnectionTuneMethodHandler.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/handler/ConnectionTuneMethodHandler.java?view=diff&rev=489691&r1=489690&r2=489691
==============================================================================
--- incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/handler/ConnectionTuneMethodHandler.java (original)
+++ incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/handler/ConnectionTuneMethodHandler.java Fri Dec 22 09:00:28 2006
@@ -72,11 +72,25 @@
protected AMQFrame createConnectionOpenFrame(int channel, String path, String capabilities, boolean insist)
{
- return ConnectionOpenBody.createAMQFrame(channel, path, capabilities, insist);
+ // AMQP version change: Hardwire the version to 0-8 (major=8, minor=0)
+ // TODO: Connect this to the session version obtained from ProtocolInitiation for this session.
+ // Be aware of possible changes to parameter order as versions change.
+ return ConnectionOpenBody.createAMQFrame(channel,
+ (byte)8, (byte)0, // AMQP version (major, minor)
+ capabilities, // capabilities
+ insist, // insist
+ path); // virtualHost
}
protected AMQFrame createTuneOkFrame(int channel, ConnectionTuneParameters params)
{
- return ConnectionTuneOkBody.createAMQFrame(channel, params.getChannelMax(), params.getFrameMax(), params.getHeartbeat());
+ // AMQP version change: Hardwire the version to 0-8 (major=8, minor=0)
+ // TODO: Connect this to the session version obtained from ProtocolInitiation for this session.
+ // Be aware of possible changes to parameter order as versions change.
+ return ConnectionTuneOkBody.createAMQFrame(channel,
+ (byte)8, (byte)0, // AMQP version (major, minor)
+ params.getChannelMax(), // channelMax
+ params.getFrameMax(), // frameMax
+ params.getHeartbeat()); // heartbeat
}
}
Modified: incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/protocol/AMQProtocolHandler.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/protocol/AMQProtocolHandler.java?view=diff&rev=489691&r1=489690&r2=489691
==============================================================================
--- incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/protocol/AMQProtocolHandler.java (original)
+++ incubator/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/protocol/AMQProtocolHandler.java Fri Dec 22 09:00:28 2006
@@ -472,8 +472,15 @@
{
_stateManager.changeState(AMQState.CONNECTION_CLOSING);
- final AMQFrame frame = ConnectionCloseBody.createAMQFrame(
- 0, AMQConstant.REPLY_SUCCESS.getCode(), "JMS client is closing the connection.", 0, 0);
+ // AMQP version change: Hardwire the version to 0-8 (major=8, minor=0)
+ // TODO: Connect this to the session version obtained from ProtocolInitiation for this session.
+ // Be aware of possible changes to parameter order as versions change.
+ final AMQFrame frame = ConnectionCloseBody.createAMQFrame(0,
+ (byte)8, (byte)0, // AMQP version (major, minor)
+ 0, // classId
+ 0, // methodId
+ AMQConstant.REPLY_SUCCESS.getCode(), // replyCode
+ "JMS client is closing the connection."); // replyText
syncWrite(frame, ConnectionCloseOkBody.class);
_protocolSession.closeProtocolSession();
Modified: incubator/qpid/trunk/qpid/java/cluster/src/main/java/org/apache/qpid/server/cluster/DefaultGroupManager.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/cluster/src/main/java/org/apache/qpid/server/cluster/DefaultGroupManager.java?view=diff&rev=489691&r1=489690&r2=489691
==============================================================================
--- incubator/qpid/trunk/qpid/java/cluster/src/main/java/org/apache/qpid/server/cluster/DefaultGroupManager.java (original)
+++ incubator/qpid/trunk/qpid/java/cluster/src/main/java/org/apache/qpid/server/cluster/DefaultGroupManager.java Fri Dec 22 09:00:28 2006
@@ -112,7 +112,9 @@
private void ping(Broker b) throws AMQException
{
- ClusterPingBody ping = new ClusterPingBody();
+ // AMQP version change: Hardwire the version to 0-8 (major=8, minor=0)
+ // TODO: Connect this to the session version obtained from ProtocolInitiation for this session.
+ ClusterPingBody ping = new ClusterPingBody((byte)8, (byte)0);
ping.broker = _group.getLocal().getDetails();
ping.responseRequired = true;
ping.load = _loadTable.getLocalLoad();
@@ -158,7 +160,9 @@
Broker leader = connectToLeader(member);
_logger.info(new LogMessage("Connected to {0}. joining", leader));
- ClusterJoinBody join = new ClusterJoinBody();
+ // AMQP version change: Hardwire the version to 0-8 (major=8, minor=0)
+ // TODO: Connect this to the session version obtained from ProtocolInitiation for this session.
+ ClusterJoinBody join = new ClusterJoinBody((byte)8, (byte)0);
join.broker = _group.getLocal().getDetails();
send(leader, new SimpleSendable(join));
}
@@ -177,7 +181,9 @@
public void leave() throws AMQException
{
- ClusterLeaveBody leave = new ClusterLeaveBody();
+ // AMQP version change: Hardwire the version to 0-8 (major=8, minor=0)
+ // TODO: Connect this to the session version obtained from ProtocolInitiation for this session.
+ ClusterLeaveBody leave = new ClusterLeaveBody((byte)8, (byte)0);
leave.broker = _group.getLocal().getDetails();
send(getLeader(), new SimpleSendable(leave));
}
@@ -198,7 +204,9 @@
}
else
{
- ClusterSuspectBody suspect = new ClusterSuspectBody();
+ // AMQP version change: Hardwire the version to 0-8 (major=8, minor=0)
+ // TODO: Connect this to the session version obtained from ProtocolInitiation for this session.
+ ClusterSuspectBody suspect = new ClusterSuspectBody((byte)8, (byte)0);
suspect.broker = broker.getDetails();
send(getLeader(), new SimpleSendable(suspect));
}
@@ -220,7 +228,9 @@
else
{
//pass request on to leader:
- ClusterJoinBody request = new ClusterJoinBody();
+ // AMQP version change: Hardwire the version to 0-8 (major=8, minor=0)
+ // TODO: Connect this to the session version obtained from ProtocolInitiation for this session.
+ ClusterJoinBody request = new ClusterJoinBody((byte)8, (byte)0);
request.broker = member.getDetails();
Broker leader = getLeader();
send(leader, new SimpleSendable(request));
@@ -265,7 +275,9 @@
private ClusterMembershipBody createAnnouncement(String membership)
{
- ClusterMembershipBody announce = new ClusterMembershipBody();
+ // AMQP version change: Hardwire the version to 0-8 (major=8, minor=0)
+ // TODO: Connect this to the session version obtained from ProtocolInitiation for this session.
+ ClusterMembershipBody announce = new ClusterMembershipBody((byte)8, (byte)0);
//TODO: revise this way of converting String to bytes...
announce.members = membership.getBytes();
return announce;
Modified: incubator/qpid/trunk/qpid/java/cluster/src/main/java/org/apache/qpid/server/cluster/handler/RemoteConsumeHandler.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/cluster/src/main/java/org/apache/qpid/server/cluster/handler/RemoteConsumeHandler.java?view=diff&rev=489691&r1=489690&r2=489691
==============================================================================
--- incubator/qpid/trunk/qpid/java/cluster/src/main/java/org/apache/qpid/server/cluster/handler/RemoteConsumeHandler.java (original)
+++ incubator/qpid/trunk/qpid/java/cluster/src/main/java/org/apache/qpid/server/cluster/handler/RemoteConsumeHandler.java Fri Dec 22 09:00:28 2006
@@ -48,7 +48,13 @@
if (queue instanceof ClusteredQueue)
{
((ClusteredQueue) queue).addRemoteSubcriber(ClusteredProtocolSession.getSessionPeer(session));
- session.writeFrame(BasicConsumeOkBody.createAMQFrame(evt.getChannelId(), evt.getMethod().queue));
+ // AMQP version change: Hardwire the version to 0-8 (major=8, minor=0)
+ // TODO: Connect this to the session version obtained from ProtocolInitiation for this session.
+ // Be aware of possible changes to parameter order as versions change.
+ session.writeFrame(BasicConsumeOkBody.createAMQFrame(evt.getChannelId(),
+ (byte)8, (byte)0, // AMQP version (major, minor)
+ evt.getMethod().queue // consumerTag
+ ));
}
else
{
Modified: incubator/qpid/trunk/qpid/java/cluster/src/main/java/org/apache/qpid/server/cluster/replay/ConsumerCounts.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/cluster/src/main/java/org/apache/qpid/server/cluster/replay/ConsumerCounts.java?view=diff&rev=489691&r1=489690&r2=489691
==============================================================================
--- incubator/qpid/trunk/qpid/java/cluster/src/main/java/org/apache/qpid/server/cluster/replay/ConsumerCounts.java (original)
+++ incubator/qpid/trunk/qpid/java/cluster/src/main/java/org/apache/qpid/server/cluster/replay/ConsumerCounts.java Fri Dec 22 09:00:28 2006
@@ -51,7 +51,9 @@
{
for(String queue : _counts.keySet())
{
- BasicConsumeBody m = new BasicConsumeBody();
+ // AMQP version change: Hardwire the version to 0-8 (major=8, minor=0)
+ // TODO: Connect this to the session version obtained from ProtocolInitiation for this session.
+ BasicConsumeBody m = new BasicConsumeBody((byte)8, (byte)0);
m.queue = queue;
m.consumerTag = queue;
replay(m, messages);
Modified: incubator/qpid/trunk/qpid/java/cluster/src/main/java/org/apache/qpid/server/cluster/replay/RecordingMethodHandlerFactory.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/cluster/src/main/java/org/apache/qpid/server/cluster/replay/RecordingMethodHandlerFactory.java?view=diff&rev=489691&r1=489690&r2=489691
==============================================================================
--- incubator/qpid/trunk/qpid/java/cluster/src/main/java/org/apache/qpid/server/cluster/replay/RecordingMethodHandlerFactory.java (original)
+++ incubator/qpid/trunk/qpid/java/cluster/src/main/java/org/apache/qpid/server/cluster/replay/RecordingMethodHandlerFactory.java Fri Dec 22 09:00:28 2006
@@ -44,15 +44,19 @@
public class RecordingMethodHandlerFactory extends WrappingMethodHandlerFactory
{
+ // AMQP version change: Hardwire the version to 0-8 (major=8, minor=0)
+ // TODO: Connect this to the session version obtained from ProtocolInitiation for this session.
+ private final byte major = (byte)8;
+ private final byte minor = (byte)0;
private final Iterable<FrameDescriptor> _frames = Arrays.asList(new FrameDescriptor[]
{
- new FrameDescriptor(QueueDeclareBody.class, new QueueDeclareBody()),
- new FrameDescriptor(QueueDeleteBody.class, new QueueDeleteBody()),
- new FrameDescriptor(QueueBindBody.class, new QueueBindBody()),
- new FrameDescriptor(ExchangeDeclareBody.class, new ExchangeDeclareBody()),
- new FrameDescriptor(ExchangeDeleteBody.class, new ExchangeDeleteBody()),
- new FrameDescriptor(BasicConsumeBody.class, new BasicConsumeBody()),
- new FrameDescriptor(BasicCancelBody.class, new BasicCancelBody())
+ new FrameDescriptor(QueueDeclareBody.class, new QueueDeclareBody(major, minor)),
+ new FrameDescriptor(QueueDeleteBody.class, new QueueDeleteBody(major, minor)),
+ new FrameDescriptor(QueueBindBody.class, new QueueBindBody(major, minor)),
+ new FrameDescriptor(ExchangeDeclareBody.class, new ExchangeDeclareBody(major, minor)),
+ new FrameDescriptor(ExchangeDeleteBody.class, new ExchangeDeleteBody(major, minor)),
+ new FrameDescriptor(BasicConsumeBody.class, new BasicConsumeBody(major, minor)),
+ new FrameDescriptor(BasicCancelBody.class, new BasicCancelBody(major, minor))
});
Modified: incubator/qpid/trunk/qpid/java/cluster/src/main/java/org/apache/qpid/server/cluster/replay/ReplayStore.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/cluster/src/main/java/org/apache/qpid/server/cluster/replay/ReplayStore.java?view=diff&rev=489691&r1=489690&r2=489691
==============================================================================
--- incubator/qpid/trunk/qpid/java/cluster/src/main/java/org/apache/qpid/server/cluster/replay/ReplayStore.java (original)
+++ incubator/qpid/trunk/qpid/java/cluster/src/main/java/org/apache/qpid/server/cluster/replay/ReplayStore.java Fri Dec 22 09:00:28 2006
@@ -124,7 +124,9 @@
}
}
_consumers.replay(methods);
- methods.add(new ClusterSynchBody());
+ // AMQP version change: Hardwire the version to 0-8 (major=8, minor=0)
+ // TODO: Connect this to the session version obtained from ProtocolInitiation for this session.
+ methods.add(new ClusterSynchBody((byte)8, (byte)0));
return methods;
}
Modified: incubator/qpid/trunk/qpid/java/cluster/src/main/java/org/apache/qpid/server/queue/ClusteredQueue.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/cluster/src/main/java/org/apache/qpid/server/queue/ClusteredQueue.java?view=diff&rev=489691&r1=489690&r2=489691
==============================================================================
--- incubator/qpid/trunk/qpid/java/cluster/src/main/java/org/apache/qpid/server/queue/ClusteredQueue.java (original)
+++ incubator/qpid/trunk/qpid/java/cluster/src/main/java/org/apache/qpid/server/queue/ClusteredQueue.java Fri Dec 22 09:00:28 2006
@@ -75,7 +75,9 @@
delete();
//send deletion request to all other members:
- QueueDeleteBody request = new QueueDeleteBody();
+ // AMQP version change: Hardwire the version to 0-8 (major=8, minor=0)
+ // TODO: Connect this to the session version obtained from ProtocolInitiation for this session.
+ QueueDeleteBody request = new QueueDeleteBody((byte)8, (byte)0);
request.queue = getName();
_groupMgr.broadcast(new SimpleSendable(request));
}
@@ -87,7 +89,9 @@
super.unregisterProtocolSession(ps, channel, consumerTag);
//signal other members:
- BasicCancelBody request = new BasicCancelBody();
+ // AMQP version change: Hardwire the version to 0-8 (major=8, minor=0)
+ // TODO: Connect this to the session version obtained from ProtocolInitiation for this session.
+ BasicCancelBody request = new BasicCancelBody((byte)8, (byte)0);
request.consumerTag = getName();
_groupMgr.broadcast(new SimpleSendable(request));
}
Modified: incubator/qpid/trunk/qpid/java/cluster/src/main/java/org/apache/qpid/server/queue/PrivateQueue.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/cluster/src/main/java/org/apache/qpid/server/queue/PrivateQueue.java?view=diff&rev=489691&r1=489690&r2=489691
==============================================================================
--- incubator/qpid/trunk/qpid/java/cluster/src/main/java/org/apache/qpid/server/queue/PrivateQueue.java (original)
+++ incubator/qpid/trunk/qpid/java/cluster/src/main/java/org/apache/qpid/server/queue/PrivateQueue.java Fri Dec 22 09:00:28 2006
@@ -56,7 +56,9 @@
super.autodelete();
//send delete request to peers:
- QueueDeleteBody request = new QueueDeleteBody();
+ // AMQP version change: Hardwire the version to 0-8 (major=8, minor=0)
+ // TODO: Connect this to the session version obtained from ProtocolInitiation for this session.
+ QueueDeleteBody request = new QueueDeleteBody((byte)8, (byte)0);
request.queue = getName();
_groupMgr.broadcast(new SimpleSendable(request));
}
Modified: incubator/qpid/trunk/qpid/java/cluster/src/test/java/org/apache/qpid/server/cluster/BrokerTest.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/cluster/src/test/java/org/apache/qpid/server/cluster/BrokerTest.java?view=diff&rev=489691&r1=489690&r2=489691
==============================================================================
--- incubator/qpid/trunk/qpid/java/cluster/src/test/java/org/apache/qpid/server/cluster/BrokerTest.java (original)
+++ incubator/qpid/trunk/qpid/java/cluster/src/test/java/org/apache/qpid/server/cluster/BrokerTest.java Fri Dec 22 09:00:28 2006
@@ -148,6 +148,9 @@
TestMethod(Object id)
{
+ // AMQP version change: Hardwire the version to 0-8 (major=8, minor=0)
+ // TODO: Connect this to the session version obtained from ProtocolInitiation for this session.
+ super((byte)8, (byte)0);
this.id = id;
}
Modified: incubator/qpid/trunk/qpid/java/common/pom.xml
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/common/pom.xml?view=diff&rev=489691&r1=489690&r2=489691
==============================================================================
--- incubator/qpid/trunk/qpid/java/common/pom.xml (original)
+++ incubator/qpid/trunk/qpid/java/common/pom.xml Fri Dec 22 09:00:28 2006
@@ -35,14 +35,12 @@
<properties>
<topDirectoryLocation>..</topDirectoryLocation>
- <cluster.asl>${basedir}/src/main/xsl/cluster.asl</cluster.asl>
- <spec.stylesheet>${basedir}/src/main/xsl/framing.xsl</spec.stylesheet>
- <registry.stylesheet>${basedir}/src/main/xsl/registry.xsl</registry.stylesheet>
- <registry.template>${basedir}/src/main/xsl/registry.template</registry.template>
+ <gentools.home>${topDirectoryLocation}/../gentools</gentools.home>
<generated.path>${project.build.directory}/generated-sources/xsl</generated.path>
<generated.package>org/apache/qpid/framing</generated.package>
<generated.dir>${generated.path}/${generated.package}</generated.dir>
<specs.dir>${topDirectoryLocation}/../specs</specs.dir>
+ <cluster.asl>${basedir}/src/main/xsl/cluster.asl</cluster.asl>
</properties>
<build>
@@ -57,13 +55,10 @@
<configuration>
<tasks>
<ant antfile="protocol-version.xml">
- <property name="cluster.asl" value="${cluster.asl}"/>
- <property name="spec.stylesheet" value="${spec.stylesheet}"/>
- <property name="registry.stylesheet" value="${registry.stylesheet}"/>
- <property name="registry.template" value="${registry.template}"/>
+ <property name="gentools.home" value="${gentools.home}"/>
<property name="generated.dir" value="${generated.dir}"/>
- <property name="proto_version" value="${generated.dir}/ProtocolVersionList.java"/>
- <property name="specs.dir" value="${specs.dir}"/>
+ <property name="cluster.asl" value="${cluster.asl}"/>
+ <property name="xml.spec.list" value="${specs.dir}/amqp-8.0.xml ${cluster.asl}"/>
</ant>
</tasks>
<sourceRoot>${generated.path}</sourceRoot>
Modified: incubator/qpid/trunk/qpid/java/common/protocol-version.xml
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/common/protocol-version.xml?view=diff&rev=489691&r1=489690&r2=489691
==============================================================================
--- incubator/qpid/trunk/qpid/java/common/protocol-version.xml (original)
+++ incubator/qpid/trunk/qpid/java/common/protocol-version.xml Fri Dec 22 09:00:28 2006
@@ -20,102 +20,21 @@
-->
<project name="Qpid Common Protocol Versions" default="generate">
- <property name="saxon.jar" value="lib/saxon/saxon8.jar"/>
- <!-- temporarily hard-wired XML spec version for build avoidance -->
- <property name="amqp.xml" value="${specs.dir}/amqp-8.0.xml"/>
-
- <macrodef name="saxon">
- <attribute name="out"/>
- <attribute name="src"/>
- <attribute name="xsl"/>
- <element name="args" implicit="true" optional="true"/>
- <sequential>
- <java jar="${saxon.jar}" fork="true">
- <arg value="-o"/>
- <arg value="@{out}"/>
- <arg value="@{src}"/>
- <arg value="@{xsl}"/>
- <args/>
- </java>
- </sequential>
- </macrodef>
+<!--
+ <property name="specs.dir" value="../../specs"/>
+ <property name="gentools.home" value="../../gentools"/>
+ <property name="generated.dir" value="target/generated-sources/xsl/org/apache/qpid/framing"/>
+ <property name="cluster.asl" value="src/main/xsl/cluster.asl"/>
+ <property name="xml.spec.list" value="${specs.dir}/amqp-8.0.xml ${cluster.asl}"/>
+-->
- <macrodef name="amqp">
- <attribute name="ver"/>
- <sequential>
- <!-- Check for the existence of the AMQP specification file -->
- <property name="amqpspecfile-@{ver}" value="${specs.dir}/amqp-@{ver}.xml"/>
- <available file="${specs.dir}/amqp-@{ver}.xml"
- property="amqpspecfile.present-@{ver}"/>
- <fail unless="amqpspecfile.present-@{ver}"
- message="ERROR: AMQP specification file ${specs.dir}/amqp-@{ver}.xml not found."/>
-
- <!-- Read in the file as a set of properties; extract the amqp version -->
- <xmlproperty prefix="@{ver}" file="${specs.dir}/amqp-@{ver}.xml"/>
- <echo>Found AMQP specification file "${specs.dir}/amqp-@{ver}.xml"; major=${@{ver}.amqp(major)} minor=${@{ver}.amqp(minor)}</echo>
-
- <!-- Add the version to the ProtocolVersionList.java file -->
- <replaceregexp file="${proto_version}" match=" // !VER!"
- replace=",${line.separator} {${@{ver}.amqp(major)}, ${@{ver}.amqp(minor)}} // !VER!"
- flags="s" byline="true"/>
- <replaceregexp file="${proto_version}" match=" // !VER1!"
- replace="{${@{ver}.amqp(major)}, ${@{ver}.amqp(minor)}} // !VER!"
- flags="s" byline="true"/>
-
- <!-- Create directory; generate from specification file -->
- <saxon out="${generated.dir}/results.out"
- src="${specs.dir}/amqp-@{ver}.xml"
- xsl="${spec.stylesheet}">
- <arg value="major=${@{ver}.amqp(major)}"/>
- <arg value="minor=${@{ver}.amqp(minor)}"/>
- <arg value="registry_name=MainRegistry"/>
- </saxon>
- <!-- -->
- <saxon out="${generated.dir}/cluster.out"
- src="${cluster.asl}"
- xsl="${spec.stylesheet}">
- <arg value="major=${@{ver}.amqp(major)}"/>
- <arg value="minor=${@{ver}.amqp(minor)}"/>
- <arg value="registry_name=ClusterRegistry"/>
- </saxon>
- <saxon out="${generated.dir}/registry.out"
- src="${registry.template}"
- xsl="${registry.stylesheet}">
- <arg value="major=${@{ver}.amqp(major)}"/>
- <arg value="minor=${@{ver}.amqp(minor)}"/>
- </saxon>
- </sequential>
- </macrodef>
-
- <uptodate property="generated" targetfile="${generated.dir}/results.out"
- srcfile="${amqp.xml}"/>
-
- <target name="generate" unless="generated">
+ <target name="generate">
<mkdir dir="${generated.dir}"/>
- <copy file="src/main/versions/ProtocolVersionList.java.tmpl" tofile="${proto_version}"
- overwrite="true"/>
- <!--
- NOTE: Set the AMQP version numbers to be supported in this build here.
- The last version in this list will be the version returned when a protocol
- ProtocolInitiation NAK frame is returned by the broker. Usually this is the
- highest or most recent version.
- -->
- <!-- <amqp ver="0.8"/>
- <amqp ver="0.9"/>
- <amqp ver="0.10"/> -->
- <amqp ver="8.0"/>
-
-<!-- <saxon out="${generated.dir}/results.out" src="${amqp.xml}"
- xsl="${stylesheet}">
- <arg value="asl_base=${asl.base}"/>
- <arg value="registry_name=MainRegistry"/>
- </saxon>
- <saxon out="${generated.dir}/cluster.out" src="${cluster.asl}"
- xsl="${stylesheet}">
- <arg value="registry_name=ClusterRegistry"/>
- </saxon>
- <saxon out="${generated.dir}/registry.out" src="${registry_template}"
- xsl="${registry_stylesheet}"/> -->
+ <exec dir="${gentools.home}/src" executable="pwd" />
+ <echo>XML files to be processed: ${xml.spec.list}</echo>
+ <java classname="org.apache.qpid.gentools.Main" fork="true" dir="${gentools.home}/src">
+ <arg line="-j -o ${generated.dir} -t ${gentools.home}/templ.java ${xml.spec.list}"/>
+ </java>
</target>
<target name="precompile" depends="generate"/>
Modified: incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/AMQChannelException.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/AMQChannelException.java?view=diff&rev=489691&r1=489690&r2=489691
==============================================================================
--- incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/AMQChannelException.java (original)
+++ incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/AMQChannelException.java Fri Dec 22 09:00:28 2006
@@ -27,23 +27,30 @@
{
private final int _classId;
private final int _methodId;
+ /* AMQP version for which exception ocurred */
+ private final byte major;
+ private final byte minor;
- public AMQChannelException(int errorCode, String msg, int classId, int methodId, Throwable t)
+ public AMQChannelException(int errorCode, String msg, int classId, int methodId, byte major, byte minor, Throwable t)
{
super(errorCode, msg, t);
_classId = classId;
_methodId = methodId;
+ this.major = major;
+ this.minor = minor;
}
- public AMQChannelException(int errorCode, String msg, int classId, int methodId)
+ public AMQChannelException(int errorCode, String msg, int classId, int methodId, byte major, byte minor)
{
super(errorCode, msg);
_classId = classId;
_methodId = methodId;
+ this.major = major;
+ this.minor = minor;
}
public AMQFrame getCloseFrame(int channel)
{
- return ChannelCloseBody.createAMQFrame(channel, getErrorCode(), getMessage(), _classId, _methodId);
+ return ChannelCloseBody.createAMQFrame(channel, major, minor, _classId, _methodId, getErrorCode(), getMessage());
}
}
Modified: incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQBody.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQBody.java?view=diff&rev=489691&r1=489690&r2=489691
==============================================================================
--- incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQBody.java (original)
+++ incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQBody.java Fri Dec 22 09:00:28 2006
@@ -34,5 +34,6 @@
protected abstract void writePayload(ByteBuffer buffer);
- protected abstract void populateFromBuffer(ByteBuffer buffer, long size) throws AMQFrameDecodingException;
+ protected abstract void populateFromBuffer(ByteBuffer buffer, long size)
+ throws AMQFrameDecodingException, AMQProtocolVersionException;
}
Modified: incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQDataBlockDecoder.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQDataBlockDecoder.java?view=diff&rev=489691&r1=489690&r2=489691
==============================================================================
--- incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQDataBlockDecoder.java (original)
+++ incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQDataBlockDecoder.java Fri Dec 22 09:00:28 2006
@@ -81,7 +81,7 @@
}
protected Object createAndPopulateFrame(ByteBuffer in)
- throws AMQFrameDecodingException
+ throws AMQFrameDecodingException, AMQProtocolVersionException
{
final byte type = in.get();
if (!isSupportedFrameType(type))
Modified: incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQFrame.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQFrame.java?view=diff&rev=489691&r1=489690&r2=489691
==============================================================================
--- incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQFrame.java (original)
+++ incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQFrame.java Fri Dec 22 09:00:28 2006
@@ -62,7 +62,7 @@
* @throws AMQFrameDecodingException
*/
public void populateFromBuffer(ByteBuffer buffer, int channel, long bodySize, BodyFactory bodyFactory)
- throws AMQFrameDecodingException
+ throws AMQFrameDecodingException, AMQProtocolVersionException
{
this.channel = channel;
bodyFrame = bodyFactory.createBody(buffer);
Modified: incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQMethodBody.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQMethodBody.java?view=diff&rev=489691&r1=489690&r2=489691
==============================================================================
--- incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQMethodBody.java (original)
+++ incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQMethodBody.java Fri Dec 22 09:00:28 2006
@@ -26,6 +26,20 @@
public abstract class AMQMethodBody extends AMQBody
{
public static final byte TYPE = 1;
+
+ /**
+ * AMQP version
+ */
+ protected byte major;
+ protected byte minor;
+ public byte getMajor() { return major; }
+ public byte getMinor() { return minor; }
+
+ public AMQMethodBody(byte major, byte minor)
+ {
+ this.major = major;
+ this.minor = minor;
+ }
/** unsigned short */
protected abstract int getBodySize();
@@ -80,11 +94,11 @@
*/
public AMQChannelException getChannelException(int code, String message)
{
- return new AMQChannelException(code, message, getClazz(), getMethod());
+ return new AMQChannelException(code, message, getClazz(), getMethod(), major, minor);
}
public AMQChannelException getChannelException(int code, String message, Throwable cause)
{
- return new AMQChannelException(code, message, getClazz(), getMethod(), cause);
+ return new AMQChannelException(code, message, getClazz(), getMethod(), major, minor, cause);
}
}
Modified: incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQMethodBodyFactory.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQMethodBodyFactory.java?view=diff&rev=489691&r1=489690&r2=489691
==============================================================================
--- incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQMethodBodyFactory.java (original)
+++ incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQMethodBodyFactory.java Fri Dec 22 09:00:28 2006
@@ -41,6 +41,11 @@
public AMQBody createBody(ByteBuffer in) throws AMQFrameDecodingException
{
- return MethodBodyDecoderRegistry.get(in.getUnsignedShort(), in.getUnsignedShort());
+ // AMQP version change: MethodBodyDecoderRegistry is obsolete, since all the XML
+ // segments generated together are now handled by MainRegistry. The Cluster class,
+ // if generated together with amqp.xml is a part of MainRegistry.
+ // TODO: Connect with version acquired from ProtocolInitiation class.
+ return MainRegistry.get((short)in.getUnsignedShort(), (short)in.getUnsignedShort(),
+ (byte)8, (byte)0);
}
}
Modified: incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/framing/BasicContentHeaderProperties.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/framing/BasicContentHeaderProperties.java?view=diff&rev=489691&r1=489690&r2=489691
==============================================================================
--- incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/framing/BasicContentHeaderProperties.java (original)
+++ incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/framing/BasicContentHeaderProperties.java Fri Dec 22 09:00:28 2006
@@ -245,7 +245,7 @@
}
public void populatePropertiesFromBuffer(ByteBuffer buffer, int propertyFlags, int size)
- throws AMQFrameDecodingException
+ throws AMQFrameDecodingException, AMQProtocolVersionException
{
_propertyFlags = propertyFlags;
Modified: incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/framing/ContentHeaderBody.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/framing/ContentHeaderBody.java?view=diff&rev=489691&r1=489690&r2=489691
==============================================================================
--- incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/framing/ContentHeaderBody.java (original)
+++ incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/framing/ContentHeaderBody.java Fri Dec 22 09:00:28 2006
@@ -58,7 +58,8 @@
return TYPE;
}
- protected void populateFromBuffer(ByteBuffer buffer, long size) throws AMQFrameDecodingException
+ protected void populateFromBuffer(ByteBuffer buffer, long size)
+ throws AMQFrameDecodingException, AMQProtocolVersionException
{
classId = buffer.getUnsignedShort();
weight = buffer.getUnsignedShort();
@@ -75,7 +76,8 @@
* @return
* @throws AMQFrameDecodingException
*/
- public static ContentHeaderBody createFromBuffer(ByteBuffer buffer, long size) throws AMQFrameDecodingException
+ public static ContentHeaderBody createFromBuffer(ByteBuffer buffer, long size)
+ throws AMQFrameDecodingException, AMQProtocolVersionException
{
ContentHeaderBody body = new ContentHeaderBody();
body.populateFromBuffer(buffer, size);
Modified: incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/framing/ContentHeaderProperties.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/framing/ContentHeaderProperties.java?view=diff&rev=489691&r1=489690&r2=489691
==============================================================================
--- incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/framing/ContentHeaderProperties.java (original)
+++ incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/framing/ContentHeaderProperties.java Fri Dec 22 09:00:28 2006
@@ -41,7 +41,7 @@
* @throws AMQFrameDecodingException when the buffer does not contain valid data
*/
void populatePropertiesFromBuffer(ByteBuffer buffer, int propertyFlags, int size)
- throws AMQFrameDecodingException;
+ throws AMQFrameDecodingException, AMQProtocolVersionException;
/**
* @return the size of the encoded property list in bytes.
Modified: incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/framing/ContentHeaderPropertiesFactory.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/framing/ContentHeaderPropertiesFactory.java?view=diff&rev=489691&r1=489690&r2=489691
==============================================================================
--- incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/framing/ContentHeaderPropertiesFactory.java (original)
+++ incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/framing/ContentHeaderPropertiesFactory.java Fri Dec 22 09:00:28 2006
@@ -37,16 +37,19 @@
public ContentHeaderProperties createContentHeaderProperties(int classId, int propertyFlags,
ByteBuffer buffer, int size)
- throws AMQFrameDecodingException
+ throws AMQFrameDecodingException, AMQProtocolVersionException
{
ContentHeaderProperties properties;
- switch (classId)
+ // AMQP version change: "Hardwired" version to major=8, minor=0
+ // TODO: Change so that the actual version is obtained from
+ // the ProtocolInitiation object for this session.
+ if (classId == BasicConsumeBody.getClazz((byte)8, (byte)0))
{
- case BasicConsumeBody.CLASS_ID:
- properties = new BasicContentHeaderProperties();
- break;
- default:
- throw new AMQFrameDecodingException("Unsupport content header class id: " + classId);
+ properties = new BasicContentHeaderProperties();
+ }
+ else
+ {
+ throw new AMQFrameDecodingException("Unsupport content header class id: " + classId);
}
properties.populatePropertiesFromBuffer(buffer, propertyFlags, size);
return properties;
Modified: incubator/qpid/trunk/qpid/java/common/src/main/xsl/cluster.asl
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/common/src/main/xsl/cluster.asl?view=diff&rev=489691&r1=489690&r2=489691
==============================================================================
--- incubator/qpid/trunk/qpid/java/common/src/main/xsl/cluster.asl (original)
+++ incubator/qpid/trunk/qpid/java/common/src/main/xsl/cluster.asl Fri Dec 22 09:00:28 2006
@@ -29,26 +29,26 @@
provide a clustered service to clients.
</doc>
-<method name = "join">
+<method name = "join" index="10">
<field name = "broker" type = "shortstr" />
</method>
-<method name = "membership">
+<method name = "membership" index="20">
<field name = "members" type = "longstr" />
</method>
-<method name = "synch">
+<method name = "synch" index="30">
</method>
-<method name = "leave">
+<method name = "leave" index="40">
<field name = "broker" type = "shortstr" />
</method>
-<method name = "suspect">
+<method name = "suspect" index="50">
<field name = "broker" type = "shortstr" />
</method>
-<method name = "ping">
+<method name = "ping" index="60">
<field name = "broker" type = "shortstr" />
<field name = "load" type = "long" />
<field name = "response required" type = "bit" />
Modified: incubator/qpid/trunk/qpid/java/systests/src/test/java/org/apache/qpid/server/exchange/AbstractHeadersExchangeTestBase.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/systests/src/test/java/org/apache/qpid/server/exchange/AbstractHeadersExchangeTestBase.java?view=diff&rev=489691&r1=489690&r2=489691
==============================================================================
--- incubator/qpid/trunk/qpid/java/systests/src/test/java/org/apache/qpid/server/exchange/AbstractHeadersExchangeTestBase.java (original)
+++ incubator/qpid/trunk/qpid/java/systests/src/test/java/org/apache/qpid/server/exchange/AbstractHeadersExchangeTestBase.java Fri Dec 22 09:00:28 2006
@@ -140,7 +140,9 @@
static BasicPublishBody getPublishRequest(String id)
{
- BasicPublishBody request = new BasicPublishBody();
+ // AMQP version change: Hardwire the version to 0-8 (major=8, minor=0)
+ // TODO: Establish some way to determine the version for the test.
+ BasicPublishBody request = new BasicPublishBody((byte)8, (byte)0);
request.routingKey = id;
return request;
}
Modified: incubator/qpid/trunk/qpid/java/systests/src/test/java/org/apache/qpid/server/queue/AMQQueueMBeanTest.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/systests/src/test/java/org/apache/qpid/server/queue/AMQQueueMBeanTest.java?view=diff&rev=489691&r1=489690&r2=489691
==============================================================================
--- incubator/qpid/trunk/qpid/java/systests/src/test/java/org/apache/qpid/server/queue/AMQQueueMBeanTest.java (original)
+++ incubator/qpid/trunk/qpid/java/systests/src/test/java/org/apache/qpid/server/queue/AMQQueueMBeanTest.java Fri Dec 22 09:00:28 2006
@@ -148,7 +148,9 @@
private AMQMessage message(boolean immediate) throws AMQException
{
- BasicPublishBody publish = new BasicPublishBody();
+ // AMQP version change: Hardwire the version to 0-8 (major=8, minor=0)
+ // TODO: Establish some way to determine the version for the test.
+ BasicPublishBody publish = new BasicPublishBody((byte)8, (byte)0);
publish.immediate = immediate;
ContentHeaderBody contentHeaderBody = new ContentHeaderBody();
contentHeaderBody.bodySize = 1000; // in bytes
Modified: incubator/qpid/trunk/qpid/java/systests/src/test/java/org/apache/qpid/server/queue/AckTest.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/systests/src/test/java/org/apache/qpid/server/queue/AckTest.java?view=diff&rev=489691&r1=489690&r2=489691
==============================================================================
--- incubator/qpid/trunk/qpid/java/systests/src/test/java/org/apache/qpid/server/queue/AckTest.java (original)
+++ incubator/qpid/trunk/qpid/java/systests/src/test/java/org/apache/qpid/server/queue/AckTest.java Fri Dec 22 09:00:28 2006
@@ -80,7 +80,9 @@
{
for (int i = 1; i <= count; i++)
{
- BasicPublishBody publishBody = new BasicPublishBody();
+ // AMQP version change: Hardwire the version to 0-8 (major=8, minor=0)
+ // TODO: Establish some way to determine the version for the test.
+ BasicPublishBody publishBody = new BasicPublishBody((byte)8, (byte)0);
publishBody.routingKey = "rk";
publishBody.exchange = "someExchange";
AMQMessage msg = new AMQMessage(_messageStore, publishBody);
Modified: incubator/qpid/trunk/qpid/java/systests/src/test/java/org/apache/qpid/server/queue/MessageTestHelper.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/systests/src/test/java/org/apache/qpid/server/queue/MessageTestHelper.java?view=diff&rev=489691&r1=489690&r2=489691
==============================================================================
--- incubator/qpid/trunk/qpid/java/systests/src/test/java/org/apache/qpid/server/queue/MessageTestHelper.java (original)
+++ incubator/qpid/trunk/qpid/java/systests/src/test/java/org/apache/qpid/server/queue/MessageTestHelper.java Fri Dec 22 09:00:28 2006
@@ -46,7 +46,9 @@
AMQMessage message(boolean immediate) throws AMQException
{
- BasicPublishBody publish = new BasicPublishBody();
+ // AMQP version change: Hardwire the version to 0-8 (major=8, minor=0)
+ // TODO: Establish some way to determine the version for the test.
+ BasicPublishBody publish = new BasicPublishBody((byte)8, (byte)0);
publish.immediate = immediate;
return new AMQMessage(_messageStore, publish, new ContentHeaderBody(), null);
}