Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Timothy A. Bish committed Apr 18, 2013
1 parent 558fc0d commit b78d698
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 9 deletions.
16 changes: 8 additions & 8 deletions pom.xml
Expand Up @@ -33,7 +33,7 @@
<description>Tool used to create the NMS.ActiveMQ OpenWire Commands and Marshallers.</description>
<inceptionYear>2009</inceptionYear>
<prerequisites>
<maven>2.0.9</maven>
<maven>3.0.4</maven>
</prerequisites>

<organization>
Expand Down Expand Up @@ -61,12 +61,12 @@
</mailingLists>

<properties>
<activemq-version>5.5-SNAPSHOT</activemq-version>
<activemq-version>5.9-SNAPSHOT</activemq-version>
<projectName>Apache NMS.ActiveMQ</projectName>
<annogen-version>0.1.0</annogen-version>
<ant-version>1.6.2</ant-version>
<xstream-version>1.3.1</xstream-version>
<activemq-core-dir>${ACTIVEMQ_SRC_HOME}/activemq-core/</activemq-core-dir>
<xstream-version>1.4.2</xstream-version>
<activemq-core-dir>${ACTIVEMQ_SRC_HOME}/activemq-client/</activemq-core-dir>
<nms-activemq-dir>${NMS_ACTIVEMQ_HOME}</nms-activemq-dir>
</properties>

Expand All @@ -78,20 +78,20 @@
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-core</artifactId>
<artifactId>activemq-client</artifactId>
<version>${activemq-version}</version>
</dependency>
</dependencies>

<distributionManagement>
<repository>
<id>release.apache.org</id>
<name>ActiveMQ-CPP Release Repository</name>
<name>ActiveMQ NMS Release Repository</name>
<url>file:///home/tabish/dev/maven2/repo/release</url>
</repository>
<snapshotRepository>
<id>snapshots.apache.org</id>
<name>ActiveMQ-CPP Snapshots Repository</name>
<name>ActiveMQ NMS Snapshots Repository</name>
<url>file:///home/tabish/dev/maven2/repo/snapshots</url>
</snapshotRepository>
</distributionManagement>
Expand Down Expand Up @@ -139,7 +139,7 @@
<tasks>
<echo>Running OpenWire Generator</echo>
<taskdef name="generate" classname="org.apache.activemq.nms.openwire.tool.AmqCSharpGeneratorTask" classpathref="maven.compile.classpath" />
<generate maxVersion="6" source="${activemq-core-dir}" target="${nms-activemq-dir}" />
<generate maxVersion="9" source="${activemq-core-dir}" target="${nms-activemq-dir}" />
</tasks>
</configuration>
</plugin>
Expand Down
Expand Up @@ -30,7 +30,7 @@

public class AmqCSharpGeneratorTask extends Task {

int maxVersion = 5;
int maxVersion = 9;
File source = new File(".");
File target = new File(".");

Expand Down
@@ -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);
}

}

0 comments on commit b78d698

Please sign in to comment.