activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r1463776 - /activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/
Date Tue, 02 Apr 2013 22:04:47 GMT
Author: tabish
Date: Tue Apr  2 22:04:47 2013
New Revision: 1463776

URL: http://svn.apache.org/r1463776
Log:
Add fields for carrying poison ack cause and some utility constructors.

Added:
    activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/MessageAckHeaderGenerator.java
  (with props)
    activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/MessageAckSourceGenerator.java
  (with props)
    activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/MessageDispatchHeaderGenerator.java
  (with props)
    activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/MessageDispatchSourceGenerator.java
  (with props)
Modified:
    activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/MessageIdSourceGenerator.java

Added: activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/MessageAckHeaderGenerator.java
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/MessageAckHeaderGenerator.java?rev=1463776&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/MessageAckHeaderGenerator.java
(added)
+++ activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/MessageAckHeaderGenerator.java
Tue Apr  2 22:04:47 2013
@@ -0,0 +1,42 @@
+/**
+ * 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.openwire.tool.commands;
+
+import java.io.PrintWriter;
+import java.util.Set;
+
+public class MessageAckHeaderGenerator extends CommandHeaderGenerator {
+
+    protected void populateIncludeFilesSet() {
+        Set<String> includes = getIncludeFiles();
+        includes.add("<activemq/commands/Message.h>");
+        includes.add("<activemq/commands/MessageDispatch.h>");
+
+        super.populateIncludeFilesSet();
+    }
+
+    protected void generateAdditionalConstructors( PrintWriter out ) {
+
+        out.println("        "+getClassName()+"(const Pointer<Message>& message,
int ackType, int messageCount);");
+        out.println("");
+        out.println("        "+getClassName()+"(const Pointer<MessageDispatch>&
dispatch, int ackType, int messageCount);");
+        out.println("");
+
+        super.generateAdditionalConstructors(out);
+    }
+
+}

Propchange: activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/MessageAckHeaderGenerator.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/MessageAckSourceGenerator.java
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/MessageAckSourceGenerator.java?rev=1463776&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/MessageAckSourceGenerator.java
(added)
+++ activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/MessageAckSourceGenerator.java
Tue Apr  2 22:04:47 2013
@@ -0,0 +1,49 @@
+/**
+ * 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.openwire.tool.commands;
+
+import java.io.PrintWriter;
+
+public class MessageAckSourceGenerator extends CommandSourceGenerator {
+
+    protected void generateAdditionalConstructors( PrintWriter out ) {
+
+        out.println("////////////////////////////////////////////////////////////////////////////////");
+        out.println("MessageAck::MessageAck(const Pointer<Message>& message, int
ackType, int messageCount) :");
+        out.println("    " + generateInitializerList() + " {");
+        out.println("");
+        out.println("    this->ackType = (unsigned char)ackType;");
+        out.println("    this->destination = message->getDestination();");
+        out.println("    this->lastMessageId = message->getMessageId();");
+        out.println("    this->messageCount = messageCount;");
+        out.println("}");
+        out.println("");
+        out.println("////////////////////////////////////////////////////////////////////////////////");
+        out.println("MessageAck::MessageAck(const Pointer<MessageDispatch>& dispatch,
int ackType, int messageCount) :");
+        out.println("    " + generateInitializerList() + " {");
+        out.println("");
+        out.println("    this->ackType = (unsigned char)ackType;");
+        out.println("    this->consumerId = dispatch->getConsumerId();");
+        out.println("    this->destination = dispatch->getDestination();");
+        out.println("    this->lastMessageId = dispatch->getMessage()->getMessageId();");
+        out.println("    this->messageCount = messageCount;");
+        out.println("}");
+        out.println("");
+
+        super.generateAdditionalConstructors(out);
+    }
+}

Propchange: activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/MessageAckSourceGenerator.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/MessageDispatchHeaderGenerator.java
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/MessageDispatchHeaderGenerator.java?rev=1463776&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/MessageDispatchHeaderGenerator.java
(added)
+++ activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/MessageDispatchHeaderGenerator.java
Tue Apr  2 22:04:47 2013
@@ -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.openwire.tool.commands;
+
+import java.io.PrintWriter;
+import java.util.Set;
+
+public class MessageDispatchHeaderGenerator extends CommandHeaderGenerator {
+
+    protected void populateIncludeFilesSet() {
+        Set<String> includes = getIncludeFiles();
+        includes.add("<decaf/lang/Exception.h>");
+
+        super.populateIncludeFilesSet();
+    }
+
+    protected void generateProperties( PrintWriter out ) {
+
+        super.generateProperties(out);
+
+        out.println("    private:");
+        out.println("");
+        out.println("        decaf::lang::Exception rollbackCause;");
+        out.println("");
+    }
+
+    protected void generateAdditonalMembers( PrintWriter out ) {
+        out.println("        void setRollbackCause(const decaf::lang::Exception& cause);");
+        out.println("");
+        out.println("        decaf::lang::Exception getRollbackCause() const;");
+        out.println("");
+
+        super.generateAdditonalMembers( out );
+    }
+
+}

Propchange: activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/MessageDispatchHeaderGenerator.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/MessageDispatchSourceGenerator.java
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/MessageDispatchSourceGenerator.java?rev=1463776&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/MessageDispatchSourceGenerator.java
(added)
+++ activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/MessageDispatchSourceGenerator.java
Tue Apr  2 22:04:47 2013
@@ -0,0 +1,42 @@
+/**
+ * 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.openwire.tool.commands;
+
+import java.io.PrintWriter;
+
+public class MessageDispatchSourceGenerator extends CommandSourceGenerator {
+
+    protected String generateInitializerList() {
+        return super.generateInitializerList() + ", rollbackCause()";
+    }
+
+    protected void generateAdditionalMethods( PrintWriter out ) {
+        out.println("////////////////////////////////////////////////////////////////////////////////");
+        out.println("void MessageDispatch::setRollbackCause(const decaf::lang::Exception&
cause) {");
+        out.println("    this->rollbackCause = cause;");
+        out.println("}");
+        out.println("");
+        out.println("////////////////////////////////////////////////////////////////////////////////");
+        out.println("decaf::lang::Exception MessageDispatch::getRollbackCause() const {");
+        out.println("    return this->rollbackCause;");
+        out.println("}");
+        out.println("");
+
+        super.generateAdditionalMethods(out);
+    }
+
+}

Propchange: activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/MessageDispatchSourceGenerator.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/MessageIdSourceGenerator.java
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/MessageIdSourceGenerator.java?rev=1463776&r1=1463775&r2=1463776&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/MessageIdSourceGenerator.java
(original)
+++ activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/MessageIdSourceGenerator.java
Tue Apr  2 22:04:47 2013
@@ -102,8 +102,8 @@ public class MessageIdSourceGenerator ex
         out.println("");
         out.println("    if( key == \"\" ) {");
         out.println("        this->key = this->producerId->toString() + \":\" +
");
-        out.println("                    Long::toString( this->producerSequenceId) + \":\"
+ ");
-        out.println("                    Long::toString( this->brokerSequenceId);");
+        out.println("                    Long::toString(this->producerSequenceId) + \":\"
+ ");
+        out.println("                    Long::toString(this->brokerSequenceId);");
         out.println("    }");
         out.println("");
         out.println("    return this->key;");



Mime
View raw message