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 [1/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/...

Author: rgodfrey
Date: Sat Nov 24 13:14:14 2007
New Revision: 597918

URL: http://svn.apache.org/viewvc?rev=597918&view=rev
Log:
QPID-567 : Add mutliversion support to Qpid/Java.
           

Added:
    incubator/qpid/branches/M2.1/gentools/lib/
    incubator/qpid/branches/M2.1/gentools/lib/LICENSE
    incubator/qpid/branches/M2.1/gentools/lib/NOTICE
    incubator/qpid/branches/M2.1/gentools/lib/README.txt
    incubator/qpid/branches/M2.1/gentools/lib/velocity-1.4.jar   (with props)
    incubator/qpid/branches/M2.1/gentools/lib/velocity-dep-1.4.jar   (with props)
    incubator/qpid/branches/M2.1/gentools/src/org/apache/qpid/gentools/BitFieldGenerateMethod.java
    incubator/qpid/branches/M2.1/gentools/src/org/apache/qpid/gentools/CommandGenerateMethod.java
    incubator/qpid/branches/M2.1/gentools/src/org/apache/qpid/gentools/ConsolidatedField.java
    incubator/qpid/branches/M2.1/gentools/src/org/apache/qpid/gentools/GenerateMethod.java
    incubator/qpid/branches/M2.1/gentools/src/org/apache/qpid/gentools/MangledGenerateMethod.java
    incubator/qpid/branches/M2.1/gentools/src/org/apache/qpid/gentools/SingleVersionClass.java
    incubator/qpid/branches/M2.1/gentools/src/org/apache/qpid/gentools/SingleVersionField.java
    incubator/qpid/branches/M2.1/gentools/src/org/apache/qpid/gentools/SingleVersionMethod.java
    incubator/qpid/branches/M2.1/gentools/src/org/apache/qpid/gentools/SingleVersionModel.java
    incubator/qpid/branches/M2.1/java/broker/src/main/java/org/apache/qpid/server/handler/AccessRequestHandler.java
    incubator/qpid/branches/M2.1/java/broker/src/main/java/org/apache/qpid/server/handler/BasicRecoverSyncMethodHandler.java
    incubator/qpid/branches/M2.1/java/broker/src/main/java/org/apache/qpid/server/handler/ServerMethodDispatcherImpl.java
    incubator/qpid/branches/M2.1/java/broker/src/main/java/org/apache/qpid/server/handler/ServerMethodDispatcherImpl_0_9.java
    incubator/qpid/branches/M2.1/java/broker/src/main/java/org/apache/qpid/server/handler/ServerMethodDispatcherImpl_8_0.java
    incubator/qpid/branches/M2.1/java/broker/src/main/java/org/apache/qpid/server/handler/UnexpectedMethodException.java
    incubator/qpid/branches/M2.1/java/broker/src/main/java/org/apache/qpid/server/output/amqp0_9/
    incubator/qpid/branches/M2.1/java/broker/src/main/java/org/apache/qpid/server/output/amqp0_9/ProtocolOutputConverterImpl.java
    incubator/qpid/branches/M2.1/java/client/src/main/java/org/apache/qpid/client/handler/AccessRequestOkMethodHandler.java
    incubator/qpid/branches/M2.1/java/client/src/main/java/org/apache/qpid/client/handler/ClientMethodDispatcherImpl.java
    incubator/qpid/branches/M2.1/java/client/src/main/java/org/apache/qpid/client/handler/ClientMethodDispatcherImpl_0_9.java
    incubator/qpid/branches/M2.1/java/client/src/main/java/org/apache/qpid/client/handler/ClientMethodDispatcherImpl_8_0.java
    incubator/qpid/branches/M2.1/java/client/src/main/java/org/apache/qpid/client/state/AMQMethodNotImplementedException.java
    incubator/qpid/branches/M2.1/java/common/src/main/java/org/apache/qpid/framing/AMQMethodBodyImpl.java
    incubator/qpid/branches/M2.1/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/
    incubator/qpid/branches/M2.1/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/AMQMethodBody_0_9.java
    incubator/qpid/branches/M2.1/java/common/src/main/java/org/apache/qpid/framing/amqp_0_9/MethodConverter_0_9.java
    incubator/qpid/branches/M2.1/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/
    incubator/qpid/branches/M2.1/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/AMQMethodBody_8_0.java
    incubator/qpid/branches/M2.1/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/MethodConverter_8_0.java
    incubator/qpid/branches/M2.1/java/common/templates/
    incubator/qpid/branches/M2.1/java/common/templates/class/
    incubator/qpid/branches/M2.1/java/common/templates/field/
    incubator/qpid/branches/M2.1/java/common/templates/method/
    incubator/qpid/branches/M2.1/java/common/templates/method/MethodBodyInterface.vm
    incubator/qpid/branches/M2.1/java/common/templates/method/version/
    incubator/qpid/branches/M2.1/java/common/templates/method/version/MethodBodyClass.vm
    incubator/qpid/branches/M2.1/java/common/templates/model/
    incubator/qpid/branches/M2.1/java/common/templates/model/ClientMethodDispatcherInterface.vm
    incubator/qpid/branches/M2.1/java/common/templates/model/MethodDispatcherInterface.vm
    incubator/qpid/branches/M2.1/java/common/templates/model/MethodRegistryClass.vm
    incubator/qpid/branches/M2.1/java/common/templates/model/ProtocolVersionListClass.vm
    incubator/qpid/branches/M2.1/java/common/templates/model/ServerMethodDispatcherInterface.vm
    incubator/qpid/branches/M2.1/java/common/templates/model/version/
    incubator/qpid/branches/M2.1/java/common/templates/model/version/AmqpConstantsClass.vm
    incubator/qpid/branches/M2.1/java/common/templates/model/version/ClientMethodDispatcherInterface.vm
    incubator/qpid/branches/M2.1/java/common/templates/model/version/MethodDispatcherInterface.vm
    incubator/qpid/branches/M2.1/java/common/templates/model/version/MethodRegistryClass.vm
    incubator/qpid/branches/M2.1/java/common/templates/model/version/ServerMethodDispatcherInterface.vm
Removed:
    incubator/qpid/branches/M2.1/java/common/src/main/java/org/apache/qpid/framing/MethodConverter_8_0.java
Modified:
    incubator/qpid/branches/M2.1/gentools/build.xml
    incubator/qpid/branches/M2.1/gentools/src/org/apache/qpid/gentools/AmqpClass.java
    incubator/qpid/branches/M2.1/gentools/src/org/apache/qpid/gentools/AmqpClassMap.java
    incubator/qpid/branches/M2.1/gentools/src/org/apache/qpid/gentools/AmqpConstant.java
    incubator/qpid/branches/M2.1/gentools/src/org/apache/qpid/gentools/AmqpConstantSet.java
    incubator/qpid/branches/M2.1/gentools/src/org/apache/qpid/gentools/AmqpDomain.java
    incubator/qpid/branches/M2.1/gentools/src/org/apache/qpid/gentools/AmqpDomainMap.java
    incubator/qpid/branches/M2.1/gentools/src/org/apache/qpid/gentools/AmqpDomainVersionMap.java
    incubator/qpid/branches/M2.1/gentools/src/org/apache/qpid/gentools/AmqpField.java
    incubator/qpid/branches/M2.1/gentools/src/org/apache/qpid/gentools/AmqpFieldMap.java
    incubator/qpid/branches/M2.1/gentools/src/org/apache/qpid/gentools/AmqpFlagMap.java
    incubator/qpid/branches/M2.1/gentools/src/org/apache/qpid/gentools/AmqpMethod.java
    incubator/qpid/branches/M2.1/gentools/src/org/apache/qpid/gentools/AmqpMethodMap.java
    incubator/qpid/branches/M2.1/gentools/src/org/apache/qpid/gentools/AmqpModel.java
    incubator/qpid/branches/M2.1/gentools/src/org/apache/qpid/gentools/AmqpOrdinalFieldMap.java
    incubator/qpid/branches/M2.1/gentools/src/org/apache/qpid/gentools/AmqpOrdinalVersionMap.java
    incubator/qpid/branches/M2.1/gentools/src/org/apache/qpid/gentools/AmqpParseException.java
    incubator/qpid/branches/M2.1/gentools/src/org/apache/qpid/gentools/AmqpTemplateException.java
    incubator/qpid/branches/M2.1/gentools/src/org/apache/qpid/gentools/AmqpTypeMappingException.java
    incubator/qpid/branches/M2.1/gentools/src/org/apache/qpid/gentools/AmqpVersion.java
    incubator/qpid/branches/M2.1/gentools/src/org/apache/qpid/gentools/AmqpVersionSet.java
    incubator/qpid/branches/M2.1/gentools/src/org/apache/qpid/gentools/CppGenerator.java
    incubator/qpid/branches/M2.1/gentools/src/org/apache/qpid/gentools/DotnetGenerator.java
    incubator/qpid/branches/M2.1/gentools/src/org/apache/qpid/gentools/Generator.java
    incubator/qpid/branches/M2.1/gentools/src/org/apache/qpid/gentools/JavaGenerator.java
    incubator/qpid/branches/M2.1/gentools/src/org/apache/qpid/gentools/LanguageConverter.java
    incubator/qpid/branches/M2.1/gentools/src/org/apache/qpid/gentools/Main.java
    incubator/qpid/branches/M2.1/gentools/src/org/apache/qpid/gentools/NodeAware.java
    incubator/qpid/branches/M2.1/gentools/src/org/apache/qpid/gentools/Printable.java
    incubator/qpid/branches/M2.1/gentools/src/org/apache/qpid/gentools/TargetDirectoryException.java
    incubator/qpid/branches/M2.1/gentools/src/org/apache/qpid/gentools/Utils.java
    incubator/qpid/branches/M2.1/gentools/src/org/apache/qpid/gentools/VersionConsistencyCheck.java
    incubator/qpid/branches/M2.1/java/broker/src/main/java/org/apache/qpid/server/AMQChannel.java
    incubator/qpid/branches/M2.1/java/broker/src/main/java/org/apache/qpid/server/handler/BasicAckMethodHandler.java
    incubator/qpid/branches/M2.1/java/broker/src/main/java/org/apache/qpid/server/handler/BasicCancelMethodHandler.java
    incubator/qpid/branches/M2.1/java/broker/src/main/java/org/apache/qpid/server/handler/BasicConsumeMethodHandler.java
    incubator/qpid/branches/M2.1/java/broker/src/main/java/org/apache/qpid/server/handler/BasicGetMethodHandler.java
    incubator/qpid/branches/M2.1/java/broker/src/main/java/org/apache/qpid/server/handler/BasicPublishMethodHandler.java
    incubator/qpid/branches/M2.1/java/broker/src/main/java/org/apache/qpid/server/handler/BasicQosHandler.java
    incubator/qpid/branches/M2.1/java/broker/src/main/java/org/apache/qpid/server/handler/BasicRecoverMethodHandler.java
    incubator/qpid/branches/M2.1/java/broker/src/main/java/org/apache/qpid/server/handler/BasicRejectMethodHandler.java
    incubator/qpid/branches/M2.1/java/broker/src/main/java/org/apache/qpid/server/handler/ChannelCloseHandler.java
    incubator/qpid/branches/M2.1/java/broker/src/main/java/org/apache/qpid/server/handler/ChannelCloseOkHandler.java
    incubator/qpid/branches/M2.1/java/broker/src/main/java/org/apache/qpid/server/handler/ChannelFlowHandler.java
    incubator/qpid/branches/M2.1/java/broker/src/main/java/org/apache/qpid/server/handler/ChannelOpenHandler.java
    incubator/qpid/branches/M2.1/java/broker/src/main/java/org/apache/qpid/server/handler/ConnectionCloseMethodHandler.java
    incubator/qpid/branches/M2.1/java/broker/src/main/java/org/apache/qpid/server/handler/ConnectionCloseOkMethodHandler.java
    incubator/qpid/branches/M2.1/java/broker/src/main/java/org/apache/qpid/server/handler/ConnectionOpenMethodHandler.java
    incubator/qpid/branches/M2.1/java/broker/src/main/java/org/apache/qpid/server/handler/ConnectionSecureOkMethodHandler.java
    incubator/qpid/branches/M2.1/java/broker/src/main/java/org/apache/qpid/server/handler/ConnectionStartOkMethodHandler.java
    incubator/qpid/branches/M2.1/java/broker/src/main/java/org/apache/qpid/server/handler/ConnectionTuneOkMethodHandler.java
    incubator/qpid/branches/M2.1/java/broker/src/main/java/org/apache/qpid/server/handler/ExchangeBoundHandler.java
    incubator/qpid/branches/M2.1/java/broker/src/main/java/org/apache/qpid/server/handler/ExchangeDeclareHandler.java
    incubator/qpid/branches/M2.1/java/broker/src/main/java/org/apache/qpid/server/handler/ExchangeDeleteHandler.java
    incubator/qpid/branches/M2.1/java/broker/src/main/java/org/apache/qpid/server/handler/QueueBindHandler.java
    incubator/qpid/branches/M2.1/java/broker/src/main/java/org/apache/qpid/server/handler/QueueDeclareHandler.java
    incubator/qpid/branches/M2.1/java/broker/src/main/java/org/apache/qpid/server/handler/QueueDeleteHandler.java
    incubator/qpid/branches/M2.1/java/broker/src/main/java/org/apache/qpid/server/handler/QueuePurgeHandler.java
    incubator/qpid/branches/M2.1/java/broker/src/main/java/org/apache/qpid/server/handler/TxCommitHandler.java
    incubator/qpid/branches/M2.1/java/broker/src/main/java/org/apache/qpid/server/handler/TxRollbackHandler.java
    incubator/qpid/branches/M2.1/java/broker/src/main/java/org/apache/qpid/server/handler/TxSelectHandler.java
    incubator/qpid/branches/M2.1/java/broker/src/main/java/org/apache/qpid/server/output/ProtocolOutputConverterRegistry.java
    incubator/qpid/branches/M2.1/java/broker/src/main/java/org/apache/qpid/server/output/amqp0_8/ProtocolOutputConverterImpl.java
    incubator/qpid/branches/M2.1/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQMinaProtocolSession.java
    incubator/qpid/branches/M2.1/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQPFastProtocolHandler.java
    incubator/qpid/branches/M2.1/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQProtocolSession.java
    incubator/qpid/branches/M2.1/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQProtocolSessionMBean.java
    incubator/qpid/branches/M2.1/java/broker/src/main/java/org/apache/qpid/server/queue/AMQMessage.java
    incubator/qpid/branches/M2.1/java/broker/src/main/java/org/apache/qpid/server/state/AMQStateManager.java
    incubator/qpid/branches/M2.1/java/broker/src/main/java/org/apache/qpid/server/state/StateAwareMethodListener.java
    incubator/qpid/branches/M2.1/java/broker/src/test/java/org/apache/qpid/server/RunBrokerWithCommand.java
    incubator/qpid/branches/M2.1/java/broker/src/test/java/org/apache/qpid/server/queue/AMQQueueMBeanTest.java
    incubator/qpid/branches/M2.1/java/client/src/main/java/org/apache/qpid/client/AMQConnection.java
    incubator/qpid/branches/M2.1/java/client/src/main/java/org/apache/qpid/client/AMQHeadersExchange.java
    incubator/qpid/branches/M2.1/java/client/src/main/java/org/apache/qpid/client/AMQSession.java
    incubator/qpid/branches/M2.1/java/client/src/main/java/org/apache/qpid/client/AMQTopic.java
    incubator/qpid/branches/M2.1/java/client/src/main/java/org/apache/qpid/client/BasicMessageConsumer.java
    incubator/qpid/branches/M2.1/java/client/src/main/java/org/apache/qpid/client/BasicMessageProducer.java
    incubator/qpid/branches/M2.1/java/client/src/main/java/org/apache/qpid/client/handler/BasicCancelOkMethodHandler.java
    incubator/qpid/branches/M2.1/java/client/src/main/java/org/apache/qpid/client/handler/BasicDeliverMethodHandler.java
    incubator/qpid/branches/M2.1/java/client/src/main/java/org/apache/qpid/client/handler/BasicReturnMethodHandler.java
    incubator/qpid/branches/M2.1/java/client/src/main/java/org/apache/qpid/client/handler/ChannelCloseMethodHandler.java
    incubator/qpid/branches/M2.1/java/client/src/main/java/org/apache/qpid/client/handler/ChannelCloseOkMethodHandler.java
    incubator/qpid/branches/M2.1/java/client/src/main/java/org/apache/qpid/client/handler/ChannelFlowOkMethodHandler.java
    incubator/qpid/branches/M2.1/java/client/src/main/java/org/apache/qpid/client/handler/ConnectionCloseMethodHandler.java
    incubator/qpid/branches/M2.1/java/client/src/main/java/org/apache/qpid/client/handler/ConnectionOpenOkMethodHandler.java
    incubator/qpid/branches/M2.1/java/client/src/main/java/org/apache/qpid/client/handler/ConnectionRedirectMethodHandler.java
    incubator/qpid/branches/M2.1/java/client/src/main/java/org/apache/qpid/client/handler/ConnectionSecureMethodHandler.java
    incubator/qpid/branches/M2.1/java/client/src/main/java/org/apache/qpid/client/handler/ConnectionStartMethodHandler.java
    incubator/qpid/branches/M2.1/java/client/src/main/java/org/apache/qpid/client/handler/ConnectionTuneMethodHandler.java
    incubator/qpid/branches/M2.1/java/client/src/main/java/org/apache/qpid/client/handler/ExchangeBoundOkMethodHandler.java
    incubator/qpid/branches/M2.1/java/client/src/main/java/org/apache/qpid/client/handler/QueueDeleteOkMethodHandler.java
    incubator/qpid/branches/M2.1/java/client/src/main/java/org/apache/qpid/client/protocol/AMQProtocolHandler.java
    incubator/qpid/branches/M2.1/java/client/src/main/java/org/apache/qpid/client/protocol/AMQProtocolSession.java
    incubator/qpid/branches/M2.1/java/client/src/main/java/org/apache/qpid/client/state/AMQStateManager.java
    incubator/qpid/branches/M2.1/java/client/src/main/java/org/apache/qpid/client/state/StateAwareMethodListener.java
    incubator/qpid/branches/M2.1/java/client/src/test/java/org/apache/qpid/client/SpecificMethodFrameListenerTest.java
    incubator/qpid/branches/M2.1/java/client/src/test/java/org/apache/qpid/test/unit/client/channelclose/ChannelCloseMethodHandlerNoCloseOk.java
    incubator/qpid/branches/M2.1/java/client/src/test/java/org/apache/qpid/test/unit/client/channelclose/ChannelCloseTest.java
    incubator/qpid/branches/M2.1/java/client/src/test/java/org/apache/qpid/test/unit/client/channelclose/NoCloseOKStateManager.java
    incubator/qpid/branches/M2.1/java/cluster/src/main/java/org/apache/qpid/server/cluster/ClientHandlerRegistry.java
    incubator/qpid/branches/M2.1/java/cluster/src/main/java/org/apache/qpid/server/cluster/SimpleSendable.java
    incubator/qpid/branches/M2.1/java/common/protocol-version.xml
    incubator/qpid/branches/M2.1/java/common/src/main/java/org/apache/qpid/AMQChannelException.java
    incubator/qpid/branches/M2.1/java/common/src/main/java/org/apache/qpid/AMQConnectionException.java
    incubator/qpid/branches/M2.1/java/common/src/main/java/org/apache/qpid/framing/AMQBody.java
    incubator/qpid/branches/M2.1/java/common/src/main/java/org/apache/qpid/framing/AMQFrameDecodingException.java
    incubator/qpid/branches/M2.1/java/common/src/main/java/org/apache/qpid/framing/AMQMethodBody.java
    incubator/qpid/branches/M2.1/java/common/src/main/java/org/apache/qpid/framing/AMQMethodBodyFactory.java
    incubator/qpid/branches/M2.1/java/common/src/main/java/org/apache/qpid/framing/AMQMethodBodyInstanceFactory.java
    incubator/qpid/branches/M2.1/java/common/src/main/java/org/apache/qpid/framing/ContentBody.java
    incubator/qpid/branches/M2.1/java/common/src/main/java/org/apache/qpid/framing/ContentHeaderBody.java
    incubator/qpid/branches/M2.1/java/common/src/main/java/org/apache/qpid/framing/ContentHeaderPropertiesFactory.java
    incubator/qpid/branches/M2.1/java/common/src/main/java/org/apache/qpid/framing/EncodingUtils.java
    incubator/qpid/branches/M2.1/java/common/src/main/java/org/apache/qpid/framing/HeartbeatBody.java
    incubator/qpid/branches/M2.1/java/common/src/main/java/org/apache/qpid/framing/ProtocolInitiation.java
    incubator/qpid/branches/M2.1/java/common/src/main/java/org/apache/qpid/framing/VersionSpecificRegistry.java
    incubator/qpid/branches/M2.1/java/common/src/main/java/org/apache/qpid/protocol/AMQVersionAwareProtocolSession.java
    incubator/qpid/branches/M2.1/java/common/src/main/java/org/apache/qpid/protocol/ProtocolVersionAware.java
    incubator/qpid/branches/M2.1/java/pom.xml
    incubator/qpid/branches/M2.1/java/systests/src/main/java/org/apache/qpid/server/queue/MockProtocolSession.java
    incubator/qpid/branches/M2.1/specs/amqp.0-8.xml
    incubator/qpid/branches/M2.1/specs/amqp.0-9.xml

Modified: incubator/qpid/branches/M2.1/gentools/build.xml
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/M2.1/gentools/build.xml?rev=597918&r1=597917&r2=597918&view=diff
==============================================================================
--- incubator/qpid/branches/M2.1/gentools/build.xml (original)
+++ incubator/qpid/branches/M2.1/gentools/build.xml Sat Nov 24 13:14:14 2007
@@ -22,7 +22,14 @@
 	<property name="src" location="src" />
 
 	<target name="compile">
-    	<javac srcdir="${src}" source="1.5" fork="true" debug="on"/>
+    	<javac srcdir="${src}" source="1.5" fork="true" debug="on">
+			<classpath>
+			    <fileset dir="${src}/../lib">
+					<include name="**/*.jar"/>
+				</fileset>
+			</classpath>
+
+		</javac>
     </target>
     
 	<target name="clean">

Added: incubator/qpid/branches/M2.1/gentools/lib/LICENSE
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/M2.1/gentools/lib/LICENSE?rev=597918&view=auto
==============================================================================
--- incubator/qpid/branches/M2.1/gentools/lib/LICENSE (added)
+++ incubator/qpid/branches/M2.1/gentools/lib/LICENSE Sat Nov 24 13:14:14 2007
@@ -0,0 +1,202 @@
+                               Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed 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.
+

Added: incubator/qpid/branches/M2.1/gentools/lib/NOTICE
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/M2.1/gentools/lib/NOTICE?rev=597918&view=auto
==============================================================================
--- incubator/qpid/branches/M2.1/gentools/lib/NOTICE (added)
+++ incubator/qpid/branches/M2.1/gentools/lib/NOTICE Sat Nov 24 13:14:14 2007
@@ -0,0 +1,2 @@
+This product includes software developed by The Apache Software Foundation (http://www.apache.org/).
+

Added: incubator/qpid/branches/M2.1/gentools/lib/README.txt
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/M2.1/gentools/lib/README.txt?rev=597918&view=auto
==============================================================================
--- incubator/qpid/branches/M2.1/gentools/lib/README.txt (added)
+++ incubator/qpid/branches/M2.1/gentools/lib/README.txt Sat Nov 24 13:14:14 2007
@@ -0,0 +1,102 @@
+--------
+Velocity
+--------
+
+Welcome to Velocity. Velocity is a general purpose template engine
+written in Java. For more information about Velocity, please look at the
+HTML documentation in the docs/ directory, as well as the Velocity
+web site
+
+  http://jakarta.apache.org/velocity/index.html
+
+Here is a description of what each of the top level directories
+contains. Please consult the documentation in each of the lower level
+directories for information that is specific to their contents.
+
+bin/        This is a temporary build directory.
+build/      This is where the build scripts live.
+docs/       This is where the documentation lives.
+examples/   This is where the examples live.
+src/        This is where all of the source code to Velocity lives.
+test/       This is where all of the tests live.
+xdocs/      This is the .xml files for building the .html files
+            related to the website and documentation.
+            
+REQUIREMENTS
+------------
+
+The Java 2 SDK is required to build Velocity.
+
+For users that wish to use Log4J as the logging
+system, version 1.1 or newer of Log4J is required.
+
+
+INCLUDED PRE-BUILT JARS
+-----------------------
+If you are using an offical Velocity release distribution, 
+you will find two pre-built Velocity jars in the top level 
+directory.
+
+PLEASE NOTE : Starting with the 1.2 release, we include two jars 
+ with the distribution.
+
+1) velocity-<version>.jar : The Velocity jar that does not include
+any external dependencies needed by Velocity, such as the 
+jakarta-commons-collection classes, Jakarta Avalon Logkit, or 
+Jakarta ORO. We do this to allow you to use whatever version of
+collections, logkit, etc that you wish w/o fear of collision.
+These jars are included in the distribution, in
+the build/lib directory, or at the respective project sites.
+
+2) velocity-dep-<version>.jar : This is a Velocity jar that includes
+all dependencies that were included with previous distribution
+jars.  It is intended as a convenience to allow you to drop
+this 1.3 (or later)  distribution in place of existing 1.1 or 1.2-dep
+ distributions.
+
+Please see the developers guide for more information.
+
+BUILDING VELOCITY
+-----------------
+
+In order to get started with Velocity, you may want to build it. 
+
+Building Velocity is easy.  All components necessary to build Velocity are
+included, except for the Java 2 SDK and the fabulous Ant build tool
+from the Jakarta project.
+
+http://jakarta.apache.org/ant/
+
+Note that you must use Ant version 1.4 or later.
+
+To build Velocity's jar, change directory into the build/ directory and 
+simply type :
+
+ant jar
+
+This will create a bin/ directory containing the Velocity .jar file. Be
+sure to update your classpath to include Velocity's .jar file, or when using a 
+modern servlet container, put it in the WEB-INF/lib directory.
+
+If you wish to build a Velocity jar that contains all dependencies, we have
+provided an optional build target for our convenience :
+
+ant jar-dep
+
+This will build a complete Velocity jar with dependencies included, and it can
+be found in the /bin directory as
+
+velocity-dep-<version>.jar
+
+TRYING THE EXAMPLES
+-------------------
+
+After building Velocity, you can also buld the examples that are included
+with the Velocity distribution.  These examples show how to use Velocity
+in your Java applications and Servlets.  There also are examples of
+how to use Anakia, a XML transformation engine and an example of a servlet-
+based forum application.
+
+For more information, please see the README.txt in the examples/ directory.
+
+-The Velocity Team

Added: incubator/qpid/branches/M2.1/gentools/lib/velocity-1.4.jar
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/M2.1/gentools/lib/velocity-1.4.jar?rev=597918&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/qpid/branches/M2.1/gentools/lib/velocity-1.4.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: incubator/qpid/branches/M2.1/gentools/lib/velocity-dep-1.4.jar
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/M2.1/gentools/lib/velocity-dep-1.4.jar?rev=597918&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/qpid/branches/M2.1/gentools/lib/velocity-dep-1.4.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Modified: incubator/qpid/branches/M2.1/gentools/src/org/apache/qpid/gentools/AmqpClass.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/M2.1/gentools/src/org/apache/qpid/gentools/AmqpClass.java?rev=597918&r1=597917&r2=597918&view=diff
==============================================================================
--- incubator/qpid/branches/M2.1/gentools/src/org/apache/qpid/gentools/AmqpClass.java (original)
+++ incubator/qpid/branches/M2.1/gentools/src/org/apache/qpid/gentools/AmqpClass.java Sat Nov 24 13:14:14 2007
@@ -20,129 +20,180 @@
  */
 package org.apache.qpid.gentools;
 
-import java.io.PrintStream;
-
 import org.w3c.dom.Node;
 import org.w3c.dom.NodeList;
 
-public class AmqpClass implements Printable, NodeAware 
+import java.io.PrintStream;
+import java.util.Collection;
+
+public class AmqpClass implements Printable, NodeAware
 {
-	public LanguageConverter converter;
-	public AmqpVersionSet versionSet;
-	public AmqpFieldMap fieldMap;
-	public AmqpMethodMap methodMap;
-	public String name;
-	public AmqpOrdinalVersionMap indexMap;
-	
-	public AmqpClass(String name, LanguageConverter converter)
-	{
-		this.name = name;
-		this.converter = converter;
-		versionSet = new AmqpVersionSet();
-		fieldMap = new AmqpFieldMap();
-		methodMap = new AmqpMethodMap();
-		indexMap = new AmqpOrdinalVersionMap();
-	}
-
-	public boolean addFromNode(Node classNode, int ordinal, AmqpVersion version)
-		throws AmqpParseException, AmqpTypeMappingException
-	{
-		versionSet.add(version);
-		int index = Utils.getNamedIntegerAttribute(classNode, "index");
-		AmqpVersionSet indexVersionSet = indexMap.get(index);
-		if (indexVersionSet != null)
-			indexVersionSet.add(version);
-		else
-		{
-			indexVersionSet = new AmqpVersionSet();
-			indexVersionSet.add(version);
-			indexMap.put(index, indexVersionSet);
-		}
-		NodeList nList = classNode.getChildNodes();
-		int fieldCntr = fieldMap.size();
-		for (int i=0; i<nList.getLength(); i++)
-		{
-			Node child = nList.item(i);
-			if (child.getNodeName().compareTo(Utils.ELEMENT_FIELD) == 0)
-			{
-				String fieldName = converter.prepareDomainName(Utils.getNamedAttribute(child,
-						Utils.ATTRIBUTE_NAME));
-				AmqpField thisField = fieldMap.get(fieldName);
-				if (thisField == null)
-				{
-					thisField = new AmqpField(fieldName, converter);
-					fieldMap.put(fieldName, thisField);
-				}
-				if (!thisField.addFromNode(child, fieldCntr++, version))
-				{
-					String className = converter.prepareClassName(Utils.getNamedAttribute(classNode,
-							Utils.ATTRIBUTE_NAME));
-					System.out.println("INFO: Generation supression tag found for field " +
-							className + "." + fieldName + " - removing.");
-					thisField.removeVersion(version);
-					fieldMap.remove(fieldName);
-				}
-			}
-			else if (child.getNodeName().compareTo(Utils.ELEMENT_METHOD) == 0)
-			{
-				String methodName = converter.prepareMethodName(Utils.getNamedAttribute(child,
-						Utils.ATTRIBUTE_NAME));
-				AmqpMethod thisMethod = methodMap.get(methodName);
-				if (thisMethod == null)
-				{
-					thisMethod = new AmqpMethod(methodName, converter);
-					methodMap.put(methodName, thisMethod);
-				}			
-				if (!thisMethod.addFromNode(child, 0, version))
-				{
-					String className = converter.prepareClassName(Utils.getNamedAttribute(classNode,
-							Utils.ATTRIBUTE_NAME));
-					System.out.println("INFO: Generation supression tag found for method " +
-							className + "." + methodName + " - removing.");
-					thisMethod.removeVersion(version);
-					methodMap.remove(methodName);
-				}
-			}
-			else if (child.getNodeName().compareTo(Utils.ELEMENT_CODEGEN) == 0)
-			{
-				String value = Utils.getNamedAttribute(child, Utils.ATTRIBUTE_VALUE);
-				if (value.compareTo("no-gen") == 0)
-					return false;
-			}
-		}
-		return true;
-	}
-	
-	public void removeVersion(AmqpVersion version)
-	{
-		indexMap.removeVersion(version);
-		fieldMap.removeVersion(version);
-		methodMap.removeVersion(version);
-		versionSet.remove(version);
-	}
-	
-	public void print(PrintStream out, int marginSize, int tabSize)
-	{
-		String margin = Utils.createSpaces(marginSize);
-		String tab = Utils.createSpaces(tabSize);
-		out.println(margin + "[C] " + name + ": " + versionSet);
-		
-		for (Integer thisIndex : indexMap.keySet())
-		{
-			AmqpVersionSet indexVersionSet = indexMap.get(thisIndex);
-			out.println(margin + tab + "[I] " + thisIndex + indexVersionSet);
-		}
-		
-		for (String thisFieldName : fieldMap.keySet())
-		{
-			AmqpField thisField = fieldMap.get(thisFieldName);
-			thisField.print(out, marginSize + tabSize, tabSize);
-		}
-		
-		for (String thisMethodName : methodMap.keySet())
-		{
-			AmqpMethod thisMethod = methodMap.get(thisMethodName);
-			thisMethod.print(out, marginSize + tabSize, tabSize);
-		}
-	}
+
+    private final AmqpVersionSet _versionSet = new AmqpVersionSet();
+    private final AmqpFieldMap _fieldMap = new AmqpFieldMap();
+    private final AmqpMethodMap _methodMap = new AmqpMethodMap();
+    private final AmqpOrdinalVersionMap _indexMap = new AmqpOrdinalVersionMap();
+
+
+    private final String _name;
+    private final Generator _generator;
+
+    public AmqpClass(String name, Generator generator)
+    {
+        _name = name;
+        _generator = generator;
+    }
+
+    public boolean addFromNode(Node classNode, int ordinal, AmqpVersion version)
+            throws AmqpParseException, AmqpTypeMappingException
+    {
+        getVersionSet().add(version);
+        int index = Utils.getNamedIntegerAttribute(classNode, "index");
+        AmqpVersionSet indexVersionSet = getIndexMap().get(index);
+        if (indexVersionSet != null)
+        {
+            indexVersionSet.add(version);
+        }
+        else
+        {
+            indexVersionSet = new AmqpVersionSet();
+            indexVersionSet.add(version);
+            getIndexMap().put(index, indexVersionSet);
+        }
+        NodeList nList = classNode.getChildNodes();
+        int fieldCntr = getFieldMap().size();
+        for (int i = 0; i < nList.getLength(); i++)
+        {
+            Node child = nList.item(i);
+            if (child.getNodeName().compareTo(Utils.ELEMENT_FIELD) == 0)
+            {
+                String fieldName = getGenerator().prepareDomainName(Utils.getNamedAttribute(child,
+                                                                                            Utils.ATTRIBUTE_NAME));
+                AmqpField thisField = getFieldMap().get(fieldName);
+                if (thisField == null)
+                {
+                    thisField = new AmqpField(fieldName, getGenerator());
+                    getFieldMap().add(fieldName, thisField);
+                }
+                if (!thisField.addFromNode(child, fieldCntr++, version))
+                {
+                    String className = getGenerator().prepareClassName(Utils.getNamedAttribute(classNode,
+                                                                                               Utils.ATTRIBUTE_NAME));
+                    System.out.println("INFO: Generation supression tag found for field " +
+                                       className + "." + fieldName + " - removing.");
+                    thisField.removeVersion(version);
+                    getFieldMap().remove(fieldName);
+                }
+            }
+            else if (child.getNodeName().compareTo(Utils.ELEMENT_METHOD) == 0)
+            {
+                String methodName = getGenerator().prepareMethodName(Utils.getNamedAttribute(child,
+                                                                                             Utils.ATTRIBUTE_NAME));
+                AmqpMethod thisMethod = getMethodMap().get(methodName);
+                if (thisMethod == null)
+                {
+                    thisMethod = new AmqpMethod(methodName, getGenerator());
+                    getMethodMap().put(methodName, thisMethod);
+                }
+                if (!thisMethod.addFromNode(child, 0, version))
+                {
+                    String className = getGenerator().prepareClassName(Utils.getNamedAttribute(classNode,
+                                                                                               Utils.ATTRIBUTE_NAME));
+                    System.out.println("INFO: Generation supression tag found for method " +
+                                       className + "." + methodName + " - removing.");
+                    thisMethod.removeVersion(version);
+                    getMethodMap().remove(methodName);
+                }
+            }
+            else if (child.getNodeName().compareTo(Utils.ELEMENT_CODEGEN) == 0)
+            {
+                String value = Utils.getNamedAttribute(child, Utils.ATTRIBUTE_VALUE);
+                if (value.compareTo("no-gen") == 0)
+                {
+                    return false;
+                }
+            }
+        }
+        return true;
+    }
+
+    public void removeVersion(AmqpVersion version)
+    {
+        getIndexMap().removeVersion(version);
+        getFieldMap().removeVersion(version);
+        getMethodMap().removeVersion(version);
+        getVersionSet().remove(version);
+    }
+
+    public void print(PrintStream out, int marginSize, int tabSize)
+    {
+        String margin = Utils.createSpaces(marginSize);
+        String tab = Utils.createSpaces(tabSize);
+        out.println(margin + "[C] " + getName() + ": " + getVersionSet());
+
+        for (Integer thisIndex : getIndexMap().keySet())
+        {
+            AmqpVersionSet indexVersionSet = getIndexMap().get(thisIndex);
+            out.println(margin + tab + "[I] " + thisIndex + indexVersionSet);
+        }
+
+        for (String thisFieldName : getFieldMap().keySet())
+        {
+            AmqpField thisField = getFieldMap().get(thisFieldName);
+            thisField.print(out, marginSize + tabSize, tabSize);
+        }
+
+        for (String thisMethodName : getMethodMap().keySet())
+        {
+            AmqpMethod thisMethod = getMethodMap().get(thisMethodName);
+            thisMethod.print(out, marginSize + tabSize, tabSize);
+        }
+    }
+
+    public AmqpVersionSet getVersionSet()
+    {
+        return _versionSet;
+    }
+
+    public Generator getGenerator()
+    {
+        return _generator;
+    }
+
+
+    public AmqpFieldMap getFieldMap()
+    {
+        return _fieldMap;
+    }
+
+
+    public AmqpMethodMap getMethodMap()
+    {
+        return _methodMap;
+    }
+
+    public Collection<AmqpMethod> getMethods()
+    {
+        return getMethodMap().values();
+    }
+
+
+    public String getName()
+    {
+        return _name;
+    }
+
+
+    public AmqpOrdinalVersionMap getIndexMap()
+    {
+        return _indexMap;
+    }
+
+    public SingleVersionClass asSingleVersionClass(AmqpVersion version)
+    {
+        return new SingleVersionClass(this,version, _generator);
+    }
+
+    
+
 }

Modified: incubator/qpid/branches/M2.1/gentools/src/org/apache/qpid/gentools/AmqpClassMap.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/M2.1/gentools/src/org/apache/qpid/gentools/AmqpClassMap.java?rev=597918&r1=597917&r2=597918&view=diff
==============================================================================
--- incubator/qpid/branches/M2.1/gentools/src/org/apache/qpid/gentools/AmqpClassMap.java (original)
+++ incubator/qpid/branches/M2.1/gentools/src/org/apache/qpid/gentools/AmqpClassMap.java Sat Nov 24 13:14:14 2007
@@ -25,5 +25,5 @@
 @SuppressWarnings("serial")
 public class AmqpClassMap extends TreeMap<String, AmqpClass>
 {
-	
+
 }

Modified: incubator/qpid/branches/M2.1/gentools/src/org/apache/qpid/gentools/AmqpConstant.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/M2.1/gentools/src/org/apache/qpid/gentools/AmqpConstant.java?rev=597918&r1=597917&r2=597918&view=diff
==============================================================================
--- incubator/qpid/branches/M2.1/gentools/src/org/apache/qpid/gentools/AmqpConstant.java (original)
+++ incubator/qpid/branches/M2.1/gentools/src/org/apache/qpid/gentools/AmqpConstant.java Sat Nov 24 13:14:14 2007
@@ -25,151 +25,134 @@
 
 /**
  * @author kpvdr
- * Class to represent the &lt;constant&gt; declaration within the AMQP specification.
- * Currently, only integer values exist within the specification, however looking forward
- * to other possible types in the future, string and double types are also supported.
- * 
- * The &lt;constant&gt; declaration in the specification contains only two attributes:
- * name and value.
- * 
- * The value of the constant is mapped against the version(s) for which the name is defined.
- * This allows for a change in the value rather than the name only from one version to the next.
+ *         Class to represent the &lt;constant&gt; declaration within the AMQP specification.
+ *         Currently, only integer values exist within the specification, however looking forward
+ *         to other possible types in the future, string and double types are also supported.
+ *         <p/>
+ *         The &lt;constant&gt; declaration in the specification contains only two attributes:
+ *         name and value.
+ *         <p/>
+ *         The value of the constant is mapped against the version(s) for which the name is defined.
+ *         This allows for a change in the value rather than the name only from one version to the next.
  */
 @SuppressWarnings("serial")
 public class AmqpConstant extends TreeMap<String, AmqpVersionSet>
-    implements Printable, VersionConsistencyCheck, Comparable<AmqpConstant>
+        implements Printable, VersionConsistencyCheck, Comparable<AmqpConstant>
 {
     /**
      * Constant name as defined by the name attribute of the &lt;constant&gt; declaration.
      */
-    protected String name;
-    
+    private final String _name;
+
     /**
      * Set of versions for which this constant name is defined.
      */
-    protected AmqpVersionSet versionSet;
+    private final AmqpVersionSet _versionSet;
 
     /**
      * Constructor
-     * @param name Constant name as defined by the name attribute of the &lt;constant&gt; declaration.
-     * @param value Constant value as defined by the value attribute of the &lt;constant&gt; declaration.
+     *
+     * @param name    Constant name as defined by the name attribute of the &lt;constant&gt; declaration.
+     * @param value   Constant value as defined by the value attribute of the &lt;constant&gt; declaration.
      * @param version AMQP version for which this constant is defined
      */
-    public AmqpConstant (String name, String value, AmqpVersion version)
+    public AmqpConstant(String name, String value, AmqpVersion version)
     {
-        this.name = name;
-        versionSet = new AmqpVersionSet(version);
-        AmqpVersionSet valueVersionSet = new  AmqpVersionSet(version);
+        _name = name;
+        _versionSet = new AmqpVersionSet(version);
+        AmqpVersionSet valueVersionSet = new AmqpVersionSet(version);
         put(value, valueVersionSet);
-     }
-
-    /**
-     * Constructor
-     * @param name Constant name as defined by the name attribute of the &lt;constant&gt; declaration.
-     * @param value Constant value as defined by the value attribute of the &lt;constant&gt; declaration.
-     * @param version AMQP version for which this constant is defined
-     */
-    public AmqpConstant (String name, int value, AmqpVersion version)
-    {
-        this.name = name;
-        versionSet = new AmqpVersionSet(version);
-        AmqpVersionSet valueVersionSet = new  AmqpVersionSet(version);
-        put(String.valueOf(value), valueVersionSet);
     }
 
-    /**
-     * Constructor
-     * @param name Constant name as defined by the name attribute of the &lt;constant&gt; declaration.
-     * @param value Constant value as defined by the value attribute of the &lt;constant&gt; declaration.
-     * @param version AMQP version for which this constant is defined
-     */
-    public AmqpConstant (String name, double value, AmqpVersion version)
-    {
-        this.name = name;
-        versionSet = new AmqpVersionSet(version);
-        AmqpVersionSet valueVersionSet = new  AmqpVersionSet(version);
-        put(String.valueOf(value), valueVersionSet);
-    }
 
     /**
      * Get the name of this constant.
+     *
      * @return Name of this constant, being the name attribute of the &lt;constant&gt; declaration
-     * represented by this class.
+     *         represented by this class.
      */
     public String getName()
     {
-        return name;
+        return _name;
     }
-    
+
     /**
      * Get the value of this constant as a String.
+     *
      * @param version AMQP version for which this value is required.
      * @return Value of this constant, being the value attribute of the &lt;constant&gt; declaration
-     * represented by this class.
+     *         represented by this class.
      * @throws AmqpTypeMappingException when a value is requested for a version for which it is not
-     * defined in the AMQP specifications.
+     *                                  defined in the AMQP specifications.
      */
     public String getStringValue(AmqpVersion version)
-    throws AmqpTypeMappingException
+            throws AmqpTypeMappingException
     {
-    	for (String thisValue : keySet())
+        for (String thisValue : keySet())
         {
             AmqpVersionSet versionSet = get(thisValue);
             if (versionSet.contains(version))
+            {
                 return thisValue;
+            }
         }
-        throw new AmqpTypeMappingException("Unable to find value for constant \"" + name +
-            "\" for version " + version.toString() + ".");
+        throw new AmqpTypeMappingException("Unable to find value for constant \"" + getName() +
+                                           "\" for version " + version.toString() + ".");
     }
-    
+
     /**
      * Get the value of this constant as an integer.
+     *
      * @param version AMQP version for which this value is required.
      * @return Value of this constant, being the value attribute of the &lt;constant&gt; declaration
-     * represented by this class.
+     *         represented by this class.
      * @throws AmqpTypeMappingException when a value is requested for a version for which it is not
-     * defined in the AMQP specifications.
+     *                                  defined in the AMQP specifications.
      */
     public int getIntegerValue(AmqpVersion version)
-    throws AmqpTypeMappingException
+            throws AmqpTypeMappingException
     {
         return Integer.parseInt(getStringValue(version));
     }
-    
+
     /**
      * Get the value of this constant as a double.
+     *
      * @param version AMQP version for which this value is required.
      * @return Value of this constant, being the value attribute of the &lt;constant&gt; declaration
-     * represented by this class.
+     *         represented by this class.
      * @throws AmqpTypeMappingException when a value is requested for a version for which it is not
-     * defined in the AMQP specifications.
+     *                                  defined in the AMQP specifications.
      */
     public double getDoubleValue(AmqpVersion version)
-    throws AmqpTypeMappingException
+            throws AmqpTypeMappingException
     {
         return Double.parseDouble(getStringValue(version));
     }
-    
+
     /**
      * Get the version set for this constant. It contains the all the versions for which this
      * constant name exists.
+     *
      * @return Set of versions for which this constant exists.
      */
     public AmqpVersionSet getVersionSet()
     {
-        return versionSet;
+        return _versionSet;
     }
-    
+
     /* (non-Javadoc)
-     * @see java.lang.Comparable#compareTo(java.lang.Object)
-     */
-    
+    * @see java.lang.Comparable#compareTo(java.lang.Object)
+    */
+
     public int compareTo(AmqpConstant other)
     {
-        int res = name.compareTo(other.name);
+        int res = getName().compareTo(other.getName());
         if (res != 0)
+        {
             return res;
-        return versionSet.compareTo(other.versionSet);
+        }
+        return getVersionSet().compareTo(other.getVersionSet());
     }
 
     /* (non-Javadoc)
@@ -178,7 +161,9 @@
     public boolean isVersionConsistent(AmqpVersionSet globalVersionSet)
     {
         if (size() != 1)
+        {
             return false;
+        }
         return get(firstKey()).equals(globalVersionSet);
     }
 
@@ -191,15 +176,16 @@
         String tab = Utils.createSpaces(tabSize);
         if (size() == 1)
         {
-            out.println(margin + tab + "[C] " + name + " = \"" + firstKey() + "\" " + versionSet);
+            out.println(margin + tab + "[C] " + getName() + " = \"" + firstKey() + "\" " + getVersionSet());
         }
         else
         {
-            out.println(margin + tab + "[C] " + name + ": " + versionSet);
+            out.println(margin + tab + "[C] " + getName() + ": " + getVersionSet());
             for (String thisValue : keySet())
             {
-                 out.println(margin + tab + tab + "= \"" + thisValue + "\" " + get(thisValue));
+                out.println(margin + tab + tab + "= \"" + thisValue + "\" " + get(thisValue));
             }
         }
     }
+
 }

Modified: incubator/qpid/branches/M2.1/gentools/src/org/apache/qpid/gentools/AmqpConstantSet.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/M2.1/gentools/src/org/apache/qpid/gentools/AmqpConstantSet.java?rev=597918&r1=597917&r2=597918&view=diff
==============================================================================
--- incubator/qpid/branches/M2.1/gentools/src/org/apache/qpid/gentools/AmqpConstantSet.java (original)
+++ incubator/qpid/branches/M2.1/gentools/src/org/apache/qpid/gentools/AmqpConstantSet.java Sat Nov 24 13:14:14 2007
@@ -20,55 +20,58 @@
  */
 package org.apache.qpid.gentools;
 
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
 import java.io.PrintStream;
 import java.util.Iterator;
 import java.util.TreeSet;
 
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
 /**
  * @author kpvdr
- * This class implements a set collection for {@link #AmqpConstant AmqpConstant} objects, being the collection
- * of constants accumulated from various AMQP specification files processed. Each name occurs once only in the set.
- * The {@link #AmqpConstant AmqpConstant} objects (derived from {@link java.util#TreeMap TreeMap}) keep track of
- * the value and version(s) assigned to this name.
+ *         This class implements a set collection for {@link AmqpConstant AmqpConstant} objects, being the collection
+ *         of constants accumulated from various AMQP specification files processed. Each name occurs once only in the set.
+ *         The {@link AmqpConstant AmqpConstant} objects (derived from {@link java.util.TreeMap TreeMap}) keep track of
+ *         the value and version(s) assigned to this name.
  */
 @SuppressWarnings("serial")
-public class AmqpConstantSet extends TreeSet<AmqpConstant> implements Printable, NodeAware, Comparable<AmqpConstantSet>
+public class AmqpConstantSet implements Printable, NodeAware //, Comparable<AmqpConstantSet>
 {
-    public LanguageConverter converter;
+    private final LanguageConverter _converter;
+    private final TreeSet<AmqpConstant> _constants = new TreeSet<AmqpConstant>();
+    private final AmqpVersionSet _versionSet = new AmqpVersionSet();
 
     public AmqpConstantSet(LanguageConverter converter)
     {
-        this.converter = converter;
-        this.converter.setConstantSet(this);
+        _converter = converter;
+
     }
-    
-   /* (non-Javadoc)
-     * @see org.apache.qpid.gentools.NodeAware#addFromNode(org.w3c.dom.Node, int, org.apache.qpid.gentools.AmqpVersion)
-     */
+
+    /* (non-Javadoc)
+    * @see org.apache.qpid.gentools.NodeAware#addFromNode(org.w3c.dom.Node, int, org.apache.qpid.gentools.AmqpVersion)
+    */
     public boolean addFromNode(Node node, int ordinal, AmqpVersion version)
-        throws AmqpParseException, AmqpTypeMappingException
+            throws AmqpParseException, AmqpTypeMappingException
     {
+        _versionSet.add(version);
         NodeList nodeList = node.getChildNodes();
-        for (int i=0; i<nodeList.getLength(); i++)
+        for (int i = 0; i < nodeList.getLength(); i++)
         {
             Node childNode = nodeList.item(i);
             if (childNode.getNodeName().compareTo(Utils.ELEMENT_CONSTANT) == 0)
             {
-                String name = converter.prepareDomainName(Utils.getNamedAttribute(childNode, Utils.ATTRIBUTE_NAME));
+                String name = getConverter().prepareConstantName(Utils.getNamedAttribute(childNode, Utils.ATTRIBUTE_NAME));
                 String value = Utils.getNamedAttribute(childNode, Utils.ATTRIBUTE_VALUE);
                 // Find this name in the existing set of objects
                 boolean foundName = false;
-                Iterator<AmqpConstant> cItr = iterator();
+                Iterator<AmqpConstant> cItr = _constants.iterator();
                 while (cItr.hasNext() && !foundName)
                 {
                     AmqpConstant thisConstant = cItr.next();
-                    if (name.compareTo(thisConstant.name) == 0)
+                    if (name.compareTo(thisConstant.getName()) == 0)
                     {
                         foundName = true;
-                        thisConstant.versionSet.add(version);
+                        thisConstant.getVersionSet().add(version);
                         // Now, find the value in the map
                         boolean foundValue = false;
                         for (String thisValue : thisConstant.keySet())
@@ -76,7 +79,7 @@
                             if (value.compareTo(thisValue) == 0)
                             {
                                 foundValue = true;
-                               // Add this version to existing version set.
+                                // Add this version to existing version set.
                                 AmqpVersionSet versionSet = thisConstant.get(thisValue);
                                 versionSet.add(version);
                             }
@@ -85,49 +88,65 @@
                         if (!foundValue)
                         {
                             thisConstant.put(value, new AmqpVersionSet(version));
-                        }              
+                        }
                     }
                 }
                 // Check that the name was found - if not, add it
                 if (!foundName)
                 {
-                    add(new AmqpConstant(name, value, version));
+                    _constants.add(new AmqpConstant(name, value, version));
                 }
-           }
+            }
         }
         return true;
     }
-    
+
     /* (non-Javadoc)
-     * @see org.apache.qpid.gentools.Printable#print(java.io.PrintStream, int, int)
-     */
+    * @see org.apache.qpid.gentools.Printable#print(java.io.PrintStream, int, int)
+    */
     public void print(PrintStream out, int marginSize, int tabSize)
     {
         out.println(Utils.createSpaces(marginSize) + "Constants: ");
-        for (AmqpConstant thisAmqpConstant : this)
+        for (AmqpConstant thisAmqpConstant : _constants)
         {
-        	thisAmqpConstant.print(out, marginSize, tabSize);
+            thisAmqpConstant.print(out, marginSize, tabSize);
         }
     }
-    
+
     /* (non-Javadoc)
-     * @see java.lang.Comparable#compareTo(java.lang.Object)
-     */
-    public int compareTo(AmqpConstantSet other)
-    {
-        int res = size() - other.size();
-        if (res != 0)
-            return res;
-        Iterator<AmqpConstant> cItr = iterator();
-        Iterator<AmqpConstant> oItr = other.iterator();
-        while (cItr.hasNext() && oItr.hasNext())
-        {
-            AmqpConstant constant = cItr.next();
-            AmqpConstant oConstant = oItr.next();
-            res = constant.compareTo(oConstant);
-            if (res != 0)
-                return res;
-        }
-        return 0;
+    * @see java.lang.Comparable#compareTo(java.lang.Object)
+    */
+//    public int compareTo(AmqpConstantSet other)
+//    {
+//        int res = size() - other.size();
+//        if (res != 0)
+//            return res;
+//        Iterator<AmqpConstant> cItr = iterator();
+//        Iterator<AmqpConstant> oItr = other.iterator();
+//        while (cItr.hasNext() && oItr.hasNext())
+//        {
+//            AmqpConstant constant = cItr.next();
+//            AmqpConstant oConstant = oItr.next();
+//            res = constant.compareTo(oConstant);
+//            if (res != 0)
+//                return res;
+//        }
+//        return 0;
+//    }
+
+    public Iterable<? extends AmqpConstant> getContstants()
+    {
+        return _constants;
     }
+
+    public AmqpVersionSet getVersionSet()
+    {
+        return _versionSet;
+    }
+
+    public LanguageConverter getConverter()
+    {
+        return _converter;
+    }
+
 }

Modified: incubator/qpid/branches/M2.1/gentools/src/org/apache/qpid/gentools/AmqpDomain.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/M2.1/gentools/src/org/apache/qpid/gentools/AmqpDomain.java?rev=597918&r1=597917&r2=597918&view=diff
==============================================================================
--- incubator/qpid/branches/M2.1/gentools/src/org/apache/qpid/gentools/AmqpDomain.java (original)
+++ incubator/qpid/branches/M2.1/gentools/src/org/apache/qpid/gentools/AmqpDomain.java Sat Nov 24 13:14:14 2007
@@ -26,53 +26,64 @@
 @SuppressWarnings("serial")
 public class AmqpDomain extends TreeMap<String, AmqpVersionSet> implements Printable
 {
-	public String domainName;
+    private final String _domainName;
+
+    public AmqpDomain(String domainName)
+    {
+        _domainName = domainName;
+    }
+
+    public void addDomain(String domainType, AmqpVersion version) throws AmqpParseException
+    {
+        AmqpVersionSet versionSet = get(domainType);
+        if (versionSet == null) // First time, create new entry
+        {
+            versionSet = new AmqpVersionSet();
+            put(domainType, versionSet);
+        }
+        versionSet.add(version);
+    }
+
+    public String getDomainType(AmqpVersion version)
+            throws AmqpTypeMappingException
+    {
+        for (String thisDomainType : keySet())
+        {
+            AmqpVersionSet versionSet = get(thisDomainType);
+            if (versionSet.contains(version))
+            {
+                return thisDomainType;
+            }
+        }
+        throw new AmqpTypeMappingException("Unable to find version " + version + ".");
+    }
+
+    public boolean hasVersion(String type, AmqpVersion v)
+    {
+        AmqpVersionSet vs = get(type);
+        if (vs == null)
+        {
+            return false;
+        }
+        return vs.contains(v);
+    }
+
+    public void print(PrintStream out, int marginSize, int tabSize)
+    {
+        String margin = Utils.createSpaces(marginSize);
+        String tab = Utils.createSpaces(tabSize);
+        out.println(margin + getDomainName() + ":");
+
+        for (String thisDomainType : keySet())
+        {
+            AmqpVersionSet vs = get(thisDomainType);
+            out.println(margin + tab + thisDomainType + " : " + vs.toString());
+        }
+    }
+
+    public String getDomainName()
+    {
+        return _domainName;
+    }
 
-	public AmqpDomain(String domainName)
-	{
-		this.domainName = domainName;
-	}
-
-	public void addDomain(String domainType, AmqpVersion version) throws AmqpParseException
-	{
-		AmqpVersionSet versionSet = get(domainType);
-		if (versionSet == null) // First time, create new entry
-		{
-			versionSet = new AmqpVersionSet();
-			put(domainType, versionSet);
-		}
-		versionSet.add(version);
-	}
-
-	public String getDomainType(AmqpVersion version)
-	    throws AmqpTypeMappingException
-	{
-		for (String thisDomainType : keySet())
-		{
-			AmqpVersionSet versionSet = get(thisDomainType);
-			if (versionSet.contains(version))
-				return thisDomainType;
-		} throw new AmqpTypeMappingException("Unable to find version " + version + ".");
-	}
-	
-	public boolean hasVersion(String type, AmqpVersion v)
-	{
-		AmqpVersionSet vs = get(type);
-		if (vs == null)
-			return false;
-		return vs.contains(v);
-	}
-	
-	public void print(PrintStream out, int marginSize, int tabSize)
-	{
-		String margin = Utils.createSpaces(marginSize);
-		String tab = Utils.createSpaces(tabSize);
-		out.println(margin + domainName + ":");
-		
-		for (String thisDomainType : keySet())
-		{
-			AmqpVersionSet vs = get(thisDomainType);
-			out.println(margin + tab + thisDomainType + " : " + vs.toString());
-		}
-	}
 }

Modified: incubator/qpid/branches/M2.1/gentools/src/org/apache/qpid/gentools/AmqpDomainMap.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/M2.1/gentools/src/org/apache/qpid/gentools/AmqpDomainMap.java?rev=597918&r1=597917&r2=597918&view=diff
==============================================================================
--- incubator/qpid/branches/M2.1/gentools/src/org/apache/qpid/gentools/AmqpDomainMap.java (original)
+++ incubator/qpid/branches/M2.1/gentools/src/org/apache/qpid/gentools/AmqpDomainMap.java Sat Nov 24 13:14:14 2007
@@ -20,100 +20,109 @@
  */
 package org.apache.qpid.gentools;
 
-import java.io.PrintStream;
-import java.util.TreeMap;
-
 import org.w3c.dom.Node;
 import org.w3c.dom.NodeList;
 
+import java.io.PrintStream;
+import java.util.TreeMap;
+
 @SuppressWarnings("serial")
 public class AmqpDomainMap extends TreeMap<String, AmqpDomain> implements Printable, NodeAware
 {
-	public LanguageConverter converter;
+    private final LanguageConverter _converter;
+
+    public AmqpDomainMap(LanguageConverter converter)
+    {
+        _converter = converter;
 
-	public AmqpDomainMap(LanguageConverter converter)
-	{
-		this.converter = converter;
-		this.converter.setDomainMap(this);
-	}
-	
-	public boolean addFromNode(Node n, int o, AmqpVersion v)
-		throws AmqpParseException, AmqpTypeMappingException
-	{
-		NodeList nl = n.getChildNodes();
-		for (int i=0; i<nl.getLength(); i++)
-		{
-			Node c = nl.item(i);
-			// All versions 0.9 and greater use <domain> for all domains
-			if (c.getNodeName().compareTo(Utils.ELEMENT_DOMAIN) == 0)
-			{
-				String domainName = converter.prepareDomainName(Utils.getNamedAttribute(c, Utils.ATTRIBUTE_NAME));
-				String type = Utils.getNamedAttribute(c, Utils.ATTRIBUTE_TYPE);
-				AmqpDomain thisDomain = get(domainName);
-				if (thisDomain == null)
-				{
-					thisDomain = new AmqpDomain(domainName);
-					put(domainName, thisDomain);
-				}
-				thisDomain.addDomain(type, v);
-			}
-			// Version(s) 0.8 and earlier use <domain> for all complex domains and use
-			// attribute <field type=""...> for simple types. Add these simple types to
-			// domain list - but beware of duplicates!
-			else if (c.getNodeName().compareTo(Utils.ELEMENT_FIELD) == 0)
-			{
-				try
-				{
-					String type = converter.prepareDomainName(Utils.getNamedAttribute(c, Utils.ATTRIBUTE_TYPE));
-					AmqpDomain thisDomain = get(type);
-					if (thisDomain == null)
-					{
-						thisDomain = new AmqpDomain(type);
-						put(type, thisDomain);
-					}
-					if (!thisDomain.hasVersion(type, v))
-						thisDomain.addDomain(type, v);
-				}
-				catch (AmqpParseException e) {} // Ignore fields without type attribute
-			}
-			else if (c.getNodeName().compareTo(Utils.ELEMENT_CLASS) == 0 ||
-					 c.getNodeName().compareTo(Utils.ELEMENT_METHOD) == 0)
-			{
-				addFromNode(c, 0, v);
-			}
-		}
-		return true;
-	}
-
-	public String getDomainType(String domainName, AmqpVersion version)
-	    throws AmqpTypeMappingException
-	{
-		AmqpDomain domainType = get(domainName);
-		// For AMQP 8.0, primitive types were not described as domains, so
-		// return itself as the type.
-		if (domainType == null)
-		{
-			return domainName;
-		}
-		try
-		{
-			return domainType.getDomainType(version);
-		}
-		catch (AmqpTypeMappingException e)
-		{
-			throw new AmqpTypeMappingException("Unable to find domain type for domain \"" + domainName +
-				"\" version " + version + ".");
-		}
-	}
-	
-	
-	public void print(PrintStream out, int marginSize, int tabSize)
-	{
+    }
+
+    public boolean addFromNode(Node n, int o, AmqpVersion v)
+            throws AmqpParseException, AmqpTypeMappingException
+    {
+        NodeList nl = n.getChildNodes();
+        for (int i = 0; i < nl.getLength(); i++)
+        {
+            Node c = nl.item(i);
+            // All versions 0.9 and greater use <domain> for all domains
+            if (c.getNodeName().compareTo(Utils.ELEMENT_DOMAIN) == 0)
+            {
+                String domainName = getConverter().prepareDomainName(Utils.getNamedAttribute(c, Utils.ATTRIBUTE_NAME));
+                String type = Utils.getNamedAttribute(c, Utils.ATTRIBUTE_TYPE);
+                AmqpDomain thisDomain = get(domainName);
+                if (thisDomain == null)
+                {
+                    thisDomain = new AmqpDomain(domainName);
+                    put(domainName, thisDomain);
+                }
+                thisDomain.addDomain(type, v);
+            }
+            // Version(s) 0.8 and earlier use <domain> for all complex domains and use
+            // attribute <field type=""...> for simple types. Add these simple types to
+            // domain list - but beware of duplicates!
+            else if (c.getNodeName().compareTo(Utils.ELEMENT_FIELD) == 0)
+            {
+                try
+                {
+                    String type = getConverter().prepareDomainName(Utils.getNamedAttribute(c, Utils.ATTRIBUTE_TYPE));
+                    AmqpDomain thisDomain = get(type);
+                    if (thisDomain == null)
+                    {
+                        thisDomain = new AmqpDomain(type);
+                        put(type, thisDomain);
+                    }
+                    if (!thisDomain.hasVersion(type, v))
+                    {
+                        thisDomain.addDomain(type, v);
+                    }
+                }
+                catch (AmqpParseException e)
+                {
+                } // Ignore fields without type attribute
+            }
+            else if (c.getNodeName().compareTo(Utils.ELEMENT_CLASS) == 0 ||
+                     c.getNodeName().compareTo(Utils.ELEMENT_METHOD) == 0)
+            {
+                addFromNode(c, 0, v);
+            }
+        }
+        return true;
+    }
+
+    public String getDomainType(String domainName, AmqpVersion version)
+    {
+        AmqpDomain domainType = get(domainName);
+        // For AMQP 8.0, primitive types were not described as domains, so
+        // return itself as the type.
+        if (domainType == null)
+        {
+            return domainName;
+        }
+        try
+        {
+            return domainType.getDomainType(version);
+        }
+        catch (AmqpTypeMappingException e)
+        {
+            throw new AmqpTypeMappingException("Unable to find domain type for domain \"" + domainName +
+                                               "\" version " + version + ".");
+        }
+    }
+
+
+    public void print(PrintStream out, int marginSize, int tabSize)
+    {
         out.println(Utils.createSpaces(marginSize) + "Domain Map:");
         for (String thisDomainName : keySet())
-		{
-			AmqpDomain domain = get(thisDomainName);
-			domain.print(out, marginSize + tabSize, tabSize);
-		}
-	}
+        {
+            AmqpDomain domain = get(thisDomainName);
+            domain.print(out, marginSize + tabSize, tabSize);
+        }
+    }
+
+    public LanguageConverter getConverter()
+    {
+        return _converter;
+    }
+
 }

Modified: incubator/qpid/branches/M2.1/gentools/src/org/apache/qpid/gentools/AmqpDomainVersionMap.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/M2.1/gentools/src/org/apache/qpid/gentools/AmqpDomainVersionMap.java?rev=597918&r1=597917&r2=597918&view=diff
==============================================================================
--- incubator/qpid/branches/M2.1/gentools/src/org/apache/qpid/gentools/AmqpDomainVersionMap.java (original)
+++ incubator/qpid/branches/M2.1/gentools/src/org/apache/qpid/gentools/AmqpDomainVersionMap.java Sat Nov 24 13:14:14 2007
@@ -25,34 +25,38 @@
 
 @SuppressWarnings("serial")
 public class AmqpDomainVersionMap extends TreeMap<String, AmqpVersionSet> implements VersionConsistencyCheck
-{	
-	public boolean isVersionConsistent(AmqpVersionSet globalVersionSet)
-	{
-		if (size() != 1)
-			return false;
-		return get(firstKey()).equals(globalVersionSet);
-	}
-	
-	public boolean removeVersion(AmqpVersion version)
-	{
-		Boolean res = false;
-		ArrayList<String> removeList = new ArrayList<String>();
-		for (String domainName : keySet())
-		{
-			AmqpVersionSet versionSet = get(domainName);
-			if (versionSet.contains(version))
-			{
-				versionSet.remove(version);
-				if (versionSet.isEmpty())
-					removeList.add(domainName);
-				res = true;
-			}
-		}
-		// Get rid of domains no longer in use
-		for (String domainName : removeList)
-		{
-			remove(domainName);
-		}
-		return res;
-	}
+{
+    public boolean isVersionConsistent(AmqpVersionSet globalVersionSet)
+    {
+        if (size() != 1)
+        {
+            return false;
+        }
+        return get(firstKey()).equals(globalVersionSet);
+    }
+
+    public boolean removeVersion(AmqpVersion version)
+    {
+        Boolean res = false;
+        ArrayList<String> removeList = new ArrayList<String>();
+        for (String domainName : keySet())
+        {
+            AmqpVersionSet versionSet = get(domainName);
+            if (versionSet.contains(version))
+            {
+                versionSet.remove(version);
+                if (versionSet.isEmpty())
+                {
+                    removeList.add(domainName);
+                }
+                res = true;
+            }
+        }
+        // Get rid of domains no longer in use
+        for (String domainName : removeList)
+        {
+            remove(domainName);
+        }
+        return res;
+    }
 }