activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r775190 - in /activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands: CommandCodeGeneratorsFactory.java SessionInfoHeaderGenerator.java SessionInfoSourceGenerator.java
Date Fri, 15 May 2009 15:28:10 GMT
Author: tabish
Date: Fri May 15 15:28:10 2009
New Revision: 775190

URL: http://svn.apache.org/viewvc?rev=775190&view=rev
Log:
Added a new Generator for the Session Info command that stores a transient ackMode value indicating
the Acknowledge mode of the Session for use elsewhere in the client code.

Added:
    activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/SessionInfoHeaderGenerator.java
  (with props)
    activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/SessionInfoSourceGenerator.java
  (with props)
Modified:
    activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/CommandCodeGeneratorsFactory.java

Modified: activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/CommandCodeGeneratorsFactory.java
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/CommandCodeGeneratorsFactory.java?rev=775190&r1=775189&r2=775190&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/CommandCodeGeneratorsFactory.java
(original)
+++ activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/CommandCodeGeneratorsFactory.java
Fri May 15 15:28:10 2009
@@ -77,6 +77,8 @@
             generator = new ProducerIdHeaderGenerator();
         } else if( className.equals("SessionId") ) {
             generator = new SessionIdHeaderGenerator();
+        } else if( className.equals("SessionInfo") ) {
+            generator = new SessionInfoHeaderGenerator();
         } else {
             generator = new CommandHeaderGenerator();
         }
@@ -114,6 +116,8 @@
             generator = new ProducerIdSourceGenerator();
         } else if( className.equals("SessionId") ) {
             generator = new SessionIdSourceGenerator();
+        } else if( className.equals("SessionInfo") ) {
+            generator = new SessionInfoSourceGenerator();
         } else {
             generator = new CommandSourceGenerator();
         }

Added: activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/SessionInfoHeaderGenerator.java
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/SessionInfoHeaderGenerator.java?rev=775190&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/SessionInfoHeaderGenerator.java
(added)
+++ activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/SessionInfoHeaderGenerator.java
Fri May 15 15:28:10 2009
@@ -0,0 +1,46 @@
+/**
+ * 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 SessionInfoHeaderGenerator extends CommandHeaderGenerator {
+
+    protected void generateProperties( PrintWriter out ) {
+
+        out.println("    private:");
+        out.println("");
+        out.println("        // The ACK mode that the Session was created with" );
+        out.println("        unsigned int ackMode;");
+        out.println("");
+
+        super.generateProperties(out);
+    }
+
+    protected void generateAdditonalMembers( PrintWriter out ) {
+        out.println("        unsigned int getAckMode() const {");
+        out.println("            return this->ackMode;");
+        out.println("        }");
+        out.println("");
+        out.println("        void setAckMode( unsigned int mode ) {");
+        out.println("            this->ackMode = mode;");
+        out.println("        }");
+        out.println("");
+
+        super.generateAdditonalMembers( out );
+    }
+}

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

Added: activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/SessionInfoSourceGenerator.java
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/SessionInfoSourceGenerator.java?rev=775190&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/SessionInfoSourceGenerator.java
(added)
+++ activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/SessionInfoSourceGenerator.java
Fri May 15 15:28:10 2009
@@ -0,0 +1,37 @@
+/**
+ * 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 SessionInfoSourceGenerator extends CommandSourceGenerator {
+
+    protected void populateIncludeFilesSet() {
+
+        Set<String> includes = getIncludeFiles();
+        includes.add("<cms/Session.h>");
+
+        super.populateIncludeFilesSet();
+    }
+
+    protected void generateDefaultConstructorBody( PrintWriter out ) {
+
+        out.println( "    this->ackMode = (unsigned int)cms::Session::AUTO_ACKNOWLEDGE;"
);
+        super.generateDefaultConstructorBody(out);
+    }
+}

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



Mime
View raw message