Author: tabish
Date: Sun Mar  7 16:59:29 2010
New Revision: 920034

URL: http://svn.apache.org/viewvc?rev=920034&view=rev
Log:
http://issues.apache.org/activemq/browse/AMQCPP-287

Move pointer to the ActiveMQConnection down to the Message class in Commands.

Modified:
    
activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/MessageHeaderGenerator.java
    
activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/MessageSourceGenerator.java

Modified: 
activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/MessageHeaderGenerator.java
URL: 
http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/MessageHeaderGenerator.java?rev=920034&r1=920033&r2=920034&view=diff
==============================================================================
--- 
activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/MessageHeaderGenerator.java
 (original)
+++ 
activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/MessageHeaderGenerator.java
 Sun Mar  7 16:59:29 2010
@@ -34,6 +34,7 @@
         out.println("namespace activemq{");
         out.println("namespace core{");
         out.println("    class ActiveMQAckHandler;");
+        out.println("    class ActiveMQConnection;");
         out.println("}");
         out.println("namespace commands{");
         out.println("");
@@ -59,6 +60,8 @@
         out.println("");
         out.println("    protected:");
         out.println("");
+        out.println("        core::ActiveMQConnection* connection;");
+        out.println("");
         out.println("        static const unsigned int DEFAULT_MESSAGE_SIZE = 
1024;");
         out.println("");
 
@@ -114,6 +117,24 @@
         out.println("        }");
         out.println("");
         out.println("        /**");
+        out.println("         * Sets the ActiveMQConnection instance that this 
Command was created from");
+        out.println("         * when the session create methods are called to 
create a Message..");
+        out.println("         * @param handler ActiveMQConnection parent for 
this message");
+        out.println("         */");
+        out.println("        void setConnection( core::ActiveMQConnection* 
connection ) {");
+        out.println("            this->connection = connection;");
+        out.println("        }");
+        out.println("");
+        out.println("        /**");
+        out.println("         * Gets the ActiveMQConnection instance that this 
Command was created from");
+        out.println("         * when the session create methods are called to 
create a Message..");
+        out.println("         * @returns the ActiveMQConnection parent for 
this Message or NULL if not set.");
+        out.println("         */");
+        out.println("        core::ActiveMQConnection* getConnection() const 
{");
+        out.println("            return this->connection;");
+        out.println("        }");
+        out.println("");
+        out.println("        /**");
         out.println("         * Returns the Size of this message in Bytes.");
         out.println("         * @returns number of bytes this message equates 
to.");
         out.println("         */");

Modified: 
activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/MessageSourceGenerator.java
URL: 
http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/MessageSourceGenerator.java?rev=920034&r1=920033&r2=920034&view=diff
==============================================================================
--- 
activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/MessageSourceGenerator.java
 (original)
+++ 
activemq/activemq-cpp/trunk/activemq-cpp-openwire-generator/src/main/java/org/apache/activemq/openwire/tool/commands/MessageSourceGenerator.java
 Sun Mar  7 16:59:29 2010
@@ -26,6 +26,8 @@
         Set<String> includes = getIncludeFiles();
         
includes.add("<activemq/wireformat/openwire/marshal/BaseDataStreamMarshaller.h>");
         
includes.add("<activemq/wireformat/openwire/marshal/PrimitiveTypesMarshaller.h>");
+        includes.add("<activemq/core/ActiveMQAckHandler.h>");
+        includes.add("<activemq/core/ActiveMQConnection.h>");
         includes.add("<decaf/lang/System.h>");
     }
 
@@ -33,6 +35,7 @@
 
         out.println("    this->readOnlyBody = false;");
         out.println("    this->readOnlyProperties = false;");
+        out.println("    this->connection = NULL;");
 
         super.generateDefaultConstructorBody(out);
     }
@@ -44,6 +47,7 @@
         out.println("    this->setAckHandler( srcPtr->getAckHandler() );");
         out.println("    this->setReadOnlyBody( srcPtr->isReadOnlyBody() );");
         out.println("    this->setReadOnlyProperties( 
srcPtr->isReadOnlyProperties() );");
+        out.println("    this->setConnection( srcPtr->getConnection() );");
     }
 
     protected void generateToStringBody( PrintWriter out ) {


Reply via email to