From b78d6980b4cce4b82d94d535f84c4532d592ce1b Mon Sep 17 00:00:00 2001 From: "Timothy A. Bish" Date: Thu, 18 Apr 2013 21:03:13 +0000 Subject: [PATCH] fix for: https://issues.apache.org/jira/browse/AMQNET-427 --- pom.xml | 16 +++--- .../openwire/tool/AmqCSharpGeneratorTask.java | 2 +- .../tool/commands/MessageAckGenerator.java | 50 +++++++++++++++++++ 3 files changed, 59 insertions(+), 9 deletions(-) create mode 100644 src/main/java/org/apache/activemq/nms/openwire/tool/commands/MessageAckGenerator.java diff --git a/pom.xml b/pom.xml index 97d668d..180bba8 100644 --- a/pom.xml +++ b/pom.xml @@ -33,7 +33,7 @@ Tool used to create the NMS.ActiveMQ OpenWire Commands and Marshallers. 2009 - 2.0.9 + 3.0.4 @@ -61,12 +61,12 @@ - 5.5-SNAPSHOT + 5.9-SNAPSHOT Apache NMS.ActiveMQ 0.1.0 1.6.2 - 1.3.1 - ${ACTIVEMQ_SRC_HOME}/activemq-core/ + 1.4.2 + ${ACTIVEMQ_SRC_HOME}/activemq-client/ ${NMS_ACTIVEMQ_HOME} @@ -78,7 +78,7 @@ org.apache.activemq - activemq-core + activemq-client ${activemq-version} @@ -86,12 +86,12 @@ release.apache.org - ActiveMQ-CPP Release Repository + ActiveMQ NMS Release Repository file:///home/tabish/dev/maven2/repo/release snapshots.apache.org - ActiveMQ-CPP Snapshots Repository + ActiveMQ NMS Snapshots Repository file:///home/tabish/dev/maven2/repo/snapshots @@ -139,7 +139,7 @@ Running OpenWire Generator - + diff --git a/src/main/java/org/apache/activemq/nms/openwire/tool/AmqCSharpGeneratorTask.java b/src/main/java/org/apache/activemq/nms/openwire/tool/AmqCSharpGeneratorTask.java index a8d9027..b340436 100644 --- a/src/main/java/org/apache/activemq/nms/openwire/tool/AmqCSharpGeneratorTask.java +++ b/src/main/java/org/apache/activemq/nms/openwire/tool/AmqCSharpGeneratorTask.java @@ -30,7 +30,7 @@ public class AmqCSharpGeneratorTask extends Task { - int maxVersion = 5; + int maxVersion = 9; File source = new File("."); File target = new File("."); diff --git a/src/main/java/org/apache/activemq/nms/openwire/tool/commands/MessageAckGenerator.java b/src/main/java/org/apache/activemq/nms/openwire/tool/commands/MessageAckGenerator.java new file mode 100644 index 0000000..a1f4cde --- /dev/null +++ b/src/main/java/org/apache/activemq/nms/openwire/tool/commands/MessageAckGenerator.java @@ -0,0 +1,50 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.activemq.nms.openwire.tool.commands; + +import java.io.PrintWriter; + +public class MessageAckGenerator extends CommandClassGenerator { + + protected void generateConstructors( PrintWriter out ) { + + out.println(" public "+getClassName()+"() : base()"); + out.println(" {"); + out.println(" }"); + out.println(""); + out.println(" public "+getClassName()+"(MessageDispatch dispatch, byte ackType, int messageCount) : base()"); + out.println(" {"); + out.println(" this.ackType = ackType;"); + out.println(" this.consumerId = dispatch.ConsumerId;"); + out.println(" this.destination = dispatch.Destination;"); + out.println(" this.lastMessageId = dispatch.Message.MessageId;"); + out.println(" this.messageCount = messageCount;"); + out.println(" }"); + out.println(""); + out.println(" public "+getClassName()+"(Message message, byte ackType, int messageCount) : base()"); + out.println(" {"); + out.println(" this.ackType = ackType;"); + out.println(" this.destination = message.Destination;"); + out.println(" this.lastMessageId = message.MessageId;"); + out.println(" this.messageCount = messageCount;"); + out.println(" }"); + out.println(""); + + super.generateConstructors(out); + } + +}