You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ta...@apache.org on 2009/07/29 21:11:12 UTC

svn commit: r799021 - in /activemq/activemq-dotnet/Apache.NMS.ActiveMQ.Openwire.Generator/src/main/java/org/apache/activemq/nms/openwire/tool: ./ commands/

Author: tabish
Date: Wed Jul 29 19:11:11 2009
New Revision: 799021

URL: http://svn.apache.org/viewvc?rev=799021&view=rev
Log:
Commands Generator, produces CSharp Openwire Command classes with mostly all the same functionality as the older hand hacked ones, plus all the correct Openwire Protocol values for v1-v5

Added:
    activemq/activemq-dotnet/Apache.NMS.ActiveMQ.Openwire.Generator/src/main/java/org/apache/activemq/nms/openwire/tool/commands/ConnectionIdGenerator.java   (with props)
    activemq/activemq-dotnet/Apache.NMS.ActiveMQ.Openwire.Generator/src/main/java/org/apache/activemq/nms/openwire/tool/commands/ConnectionInfoGenerator.java   (with props)
    activemq/activemq-dotnet/Apache.NMS.ActiveMQ.Openwire.Generator/src/main/java/org/apache/activemq/nms/openwire/tool/commands/ConsumerIdGenerator.java   (with props)
    activemq/activemq-dotnet/Apache.NMS.ActiveMQ.Openwire.Generator/src/main/java/org/apache/activemq/nms/openwire/tool/commands/ConsumerInfoGenerator.java   (with props)
    activemq/activemq-dotnet/Apache.NMS.ActiveMQ.Openwire.Generator/src/main/java/org/apache/activemq/nms/openwire/tool/commands/DestinationInfoGenerator.java   (with props)
    activemq/activemq-dotnet/Apache.NMS.ActiveMQ.Openwire.Generator/src/main/java/org/apache/activemq/nms/openwire/tool/commands/MessageGenerator.java   (with props)
    activemq/activemq-dotnet/Apache.NMS.ActiveMQ.Openwire.Generator/src/main/java/org/apache/activemq/nms/openwire/tool/commands/ProducerIdGenerator.java   (with props)
    activemq/activemq-dotnet/Apache.NMS.ActiveMQ.Openwire.Generator/src/main/java/org/apache/activemq/nms/openwire/tool/commands/ProducerInfoGenerator.java   (with props)
    activemq/activemq-dotnet/Apache.NMS.ActiveMQ.Openwire.Generator/src/main/java/org/apache/activemq/nms/openwire/tool/commands/RemoveInfoGenerator.java   (with props)
    activemq/activemq-dotnet/Apache.NMS.ActiveMQ.Openwire.Generator/src/main/java/org/apache/activemq/nms/openwire/tool/commands/SessionIdGenerator.java   (with props)
    activemq/activemq-dotnet/Apache.NMS.ActiveMQ.Openwire.Generator/src/main/java/org/apache/activemq/nms/openwire/tool/commands/SessionInfoGenerator.java   (with props)
    activemq/activemq-dotnet/Apache.NMS.ActiveMQ.Openwire.Generator/src/main/java/org/apache/activemq/nms/openwire/tool/commands/TransactionInfoGenerator.java   (with props)
Modified:
    activemq/activemq-dotnet/Apache.NMS.ActiveMQ.Openwire.Generator/src/main/java/org/apache/activemq/nms/openwire/tool/AmqCSharpGeneratorTask.java
    activemq/activemq-dotnet/Apache.NMS.ActiveMQ.Openwire.Generator/src/main/java/org/apache/activemq/nms/openwire/tool/commands/CommandClassGenerator.java
    activemq/activemq-dotnet/Apache.NMS.ActiveMQ.Openwire.Generator/src/main/java/org/apache/activemq/nms/openwire/tool/commands/CommandCodeGenerator.java
    activemq/activemq-dotnet/Apache.NMS.ActiveMQ.Openwire.Generator/src/main/java/org/apache/activemq/nms/openwire/tool/commands/CommandCodeGeneratorsFactory.java
    activemq/activemq-dotnet/Apache.NMS.ActiveMQ.Openwire.Generator/src/main/java/org/apache/activemq/nms/openwire/tool/commands/CommandGenerator.java

Modified: activemq/activemq-dotnet/Apache.NMS.ActiveMQ.Openwire.Generator/src/main/java/org/apache/activemq/nms/openwire/tool/AmqCSharpGeneratorTask.java
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ActiveMQ.Openwire.Generator/src/main/java/org/apache/activemq/nms/openwire/tool/AmqCSharpGeneratorTask.java?rev=799021&r1=799020&r2=799021&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.ActiveMQ.Openwire.Generator/src/main/java/org/apache/activemq/nms/openwire/tool/AmqCSharpGeneratorTask.java (original)
+++ activemq/activemq-dotnet/Apache.NMS.ActiveMQ.Openwire.Generator/src/main/java/org/apache/activemq/nms/openwire/tool/AmqCSharpGeneratorTask.java Wed Jul 29 19:11:11 2009
@@ -29,7 +29,7 @@
 
 public class AmqCSharpGeneratorTask extends Task {
 
-    int maxVersion = 3;
+    int maxVersion = 5;
     File source = new File(".");
     File target = new File(".");
 

Modified: activemq/activemq-dotnet/Apache.NMS.ActiveMQ.Openwire.Generator/src/main/java/org/apache/activemq/nms/openwire/tool/commands/CommandClassGenerator.java
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ActiveMQ.Openwire.Generator/src/main/java/org/apache/activemq/nms/openwire/tool/commands/CommandClassGenerator.java?rev=799021&r1=799020&r2=799021&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.ActiveMQ.Openwire.Generator/src/main/java/org/apache/activemq/nms/openwire/tool/commands/CommandClassGenerator.java (original)
+++ activemq/activemq-dotnet/Apache.NMS.ActiveMQ.Openwire.Generator/src/main/java/org/apache/activemq/nms/openwire/tool/commands/CommandClassGenerator.java Wed Jul 29 19:11:11 2009
@@ -38,7 +38,6 @@
         out.println("");
         out.println("namespace Apache.NMS.ActiveMQ.Commands");
         out.println("{");
-        out.println("");
         out.println("    /*");
         out.println("     *");
         out.println("     *  Command code for OpenWire format for "+getClassName() );
@@ -57,6 +56,10 @@
         generateProperties( out );
 
         out.println("");
+
+        generateConstructors(out);
+
+        out.println("");
         out.println("        ///");
         out.println("        /// <summery>");
         out.println("        ///  Get the unique identifier that this object and its own");
@@ -68,16 +71,20 @@
         out.println("            return ID_" + getClassName().toUpperCase() + ";");
         out.println("        }");
         out.println("");
-//        out.println("        ///");
-//        out.println("        /// <summery>");
-//        out.println("        ///  Clone this object and return a new instance that the caller now owns.");
-//        out.println("        /// </summery>");
-//        out.println("        ///");
-//        out.println("        public override Object Clone()");
-//        out.println("        {");
-//        generateCloneBody( out );
-//        out.println("        }");
-//        out.println("");
+
+        if( isCloneable() ) {
+            out.println("        ///");
+            out.println("        /// <summery>");
+            out.println("        ///  Clone this object and return a new instance that the caller now owns.");
+            out.println("        /// </summery>");
+            out.println("        ///");
+            out.println("        public override Object Clone()");
+            out.println("        {");
+            generateCloneBody( out );
+            out.println("        }");
+            out.println("");
+        }
+
         out.println("        ///");
         out.println("        /// <summery>");
         out.println("        ///  Returns a string containing the information for this DataStructure");
@@ -93,7 +100,30 @@
         generateAdditonalMembers( out );
         generatePropertyAccessors( out );
 
-        if( isGenIsClass() ) {
+        if( isComparable() ) {
+
+            out.println("        public override int GetHashCode()");
+            out.println("        {");
+            generateHashCodeBody(out);
+            out.println("        }");
+            out.println("");
+            out.println("        public override bool Equals(object that)");
+            out.println("        {");
+            out.println("            if(that is "+getClassName()+")");
+            out.println("            {");
+            out.println("                return Equals(("+getClassName()+") that);");
+            out.println("            }");
+            out.println("            return false;");
+            out.println("        }");
+            out.println("");
+            out.println("        public virtual bool Equals("+getClassName()+" that)");
+            out.println("        {");
+            generateEqualsBody(out);
+            out.println("        }");
+
+        }
+
+        if( getBaseClassName().equals( "BaseCommand" ) ) {
             out.println("        ///");
             out.println("        /// <summery>");
             out.println("        ///  Return an answer of true to the is"+getClassName()+"() query.");
@@ -117,7 +147,7 @@
             out.println("        ///  the proper processXXX method in the visitor." );
             out.println("        /// </summery>");
             out.println("        ///");
-            out.println("        public override Response visit( ICommandVisitor visitor )" );
+            out.println("        public override Response visit(ICommandVisitor visitor)" );
             out.println("        {");
             generateVisitBody(out);
             out.println("        }");
@@ -135,14 +165,26 @@
 
         out.print( getBaseClassName() );
 
+        for( String name : getAdditionalBases() ) {
+            out.print( ", "+name );
+        }
+
         if( isMarshalAware() ) {
             out.print( ", MarshallAware" );
         }
 
+        if( isCloneable() ) {
+            out.print( ", ICloneable" );
+        }
+
         out.println();
         out.println("    {");
     }
 
+    protected void generateConstructors( PrintWriter out ) {
+        // The default constructor is fine for basic Commands.
+    }
+
     protected void generateProperties( PrintWriter out ) {
 
         for( JProperty property : getProperties() ) {
@@ -178,24 +220,7 @@
         out.println("            // this method is an override.");
         out.println("            " + getClassName() + " o = (" + getClassName() + ") base.Clone();");
         out.println("");
-
-        for( JProperty property : getProperties() ) {
-
-            String type = toCSharpType(property.getType());
-            String name = decapitalize(property.getSimpleName());
-
-            if( property.getType().isArrayType() ) {
-
-            } else if( !property.getType().isPrimitiveType() ) {
-
-                out.println("            if(o." + name + " != null)");
-                out.println("            {");
-                out.println("                o." + name + " = (" + type + ") o." + name + ".Clone();");
-                out.println("            }");
-                out.println("");
-            }
-
-        }
+        out.println("            return o;");
     }
 
     protected void generateAdditonalMembers( PrintWriter out ) {
@@ -218,4 +243,33 @@
         }
     }
 
+    protected void generateHashCodeBody( PrintWriter out ) {
+        out.println("            int answer = 0;");
+        out.println("");
+
+        for( JProperty property : getProperties() ) {
+            String accessorName = property.getSimpleName();
+
+            out.println("            answer = (answer * 37) + HashCode("+accessorName+");");
+        }
+
+        out.println("");
+        out.println("            return answer;");
+    }
+
+    protected void generateEqualsBody( PrintWriter out ) {
+
+        for( JProperty property : getProperties() ) {
+            String accessorName = property.getSimpleName();
+
+            out.println("            if(!Equals(this."+accessorName+", that."+accessorName+"))");
+            out.println("            {");
+            out.println("                return false;");
+            out.println("            }");
+        }
+
+        out.println("");
+        out.println("            return true;");
+    }
+
 }

Modified: activemq/activemq-dotnet/Apache.NMS.ActiveMQ.Openwire.Generator/src/main/java/org/apache/activemq/nms/openwire/tool/commands/CommandCodeGenerator.java
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ActiveMQ.Openwire.Generator/src/main/java/org/apache/activemq/nms/openwire/tool/commands/CommandCodeGenerator.java?rev=799021&r1=799020&r2=799021&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.ActiveMQ.Openwire.Generator/src/main/java/org/apache/activemq/nms/openwire/tool/commands/CommandCodeGenerator.java (original)
+++ activemq/activemq-dotnet/Apache.NMS.ActiveMQ.Openwire.Generator/src/main/java/org/apache/activemq/nms/openwire/tool/commands/CommandCodeGenerator.java Wed Jul 29 19:11:11 2009
@@ -18,6 +18,8 @@
 
 import java.io.PrintWriter;
 import java.util.List;
+import java.util.Set;
+import java.util.TreeSet;
 
 import org.codehaus.jam.JClass;
 import org.codehaus.jam.JProperty;
@@ -26,11 +28,13 @@
 
     private JClass jClass;
     private List<JProperty> properties;
+    private Set<String> additionalBases = new TreeSet<String>();
     private boolean marshalAware = false;
     private String className;
     private String baseClassName;
     private String openWireOpCode;
-    private boolean genIsClass = false;
+    private boolean cloneable;
+    private boolean comparable;
 
     public abstract void generate( PrintWriter out );
 
@@ -54,14 +58,6 @@
         out.println("");
     }
 
-    public boolean isGenIsClass() {
-        return genIsClass;
-    }
-
-    public void setGenIsClass(boolean genIsClass) {
-        this.genIsClass = genIsClass;
-    }
-
     public JClass getJClass() {
         return jClass;
     }
@@ -78,6 +74,14 @@
         this.properties = properties;
     }
 
+    public boolean isComparable() {
+        return comparable;
+    }
+
+    public void setComparable(boolean comparable) {
+        this.comparable = comparable;
+    }
+
     public boolean isMarshalAware() {
         return marshalAware;
     }
@@ -86,6 +90,14 @@
         this.marshalAware = marshalAware;
     }
 
+    public boolean isCloneable() {
+        return cloneable;
+    }
+
+    public void setCloneable(boolean cloneable) {
+        this.cloneable = cloneable;
+    }
+
     public String getClassName() {
         return className;
     }
@@ -110,26 +122,17 @@
         this.openWireOpCode = openWireOpCode;
     }
 
-//    protected String toFileName( JClass type ) {
-//        String name = type.getSimpleName();
-//
-//        if( name.equals( "String" ) ) {
-//            return null;
-//        } else if( type.isArrayType() ) {
-//            JClass arrayClass = type.getArrayComponentType();
-//            return toHeaderFileName( arrayClass );
-//        } else if( name.equals( "Throwable" ) || name.equals( "Exception" ) ) {
-//            return "BrokerError";
-//        } else if( name.equals("BaseDataStructure" ) ){
-//            return "DataStructure";
-//        } else if( name.equals("ByteSequence") ) {
-//            return "std::vector<unsigned char>";
-//        } else if( !type.isPrimitiveType() ) {
-//            return name;
-//        } else {
-//            return null;
-//        }
-//    }
+    public void addAdditionalBase( String name ) {
+        this.additionalBases.add(name);
+    }
+
+    public Set<String> getAdditionalBases() {
+        return additionalBases;
+    }
+
+    public void setAdditionalBases(Set<String> additionalBases) {
+        this.additionalBases = additionalBases;
+    }
 
     protected String toCSharpType(JClass type) {
         String name = type.getSimpleName();

Modified: activemq/activemq-dotnet/Apache.NMS.ActiveMQ.Openwire.Generator/src/main/java/org/apache/activemq/nms/openwire/tool/commands/CommandCodeGeneratorsFactory.java
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ActiveMQ.Openwire.Generator/src/main/java/org/apache/activemq/nms/openwire/tool/commands/CommandCodeGeneratorsFactory.java?rev=799021&r1=799020&r2=799021&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.ActiveMQ.Openwire.Generator/src/main/java/org/apache/activemq/nms/openwire/tool/commands/CommandCodeGeneratorsFactory.java (original)
+++ activemq/activemq-dotnet/Apache.NMS.ActiveMQ.Openwire.Generator/src/main/java/org/apache/activemq/nms/openwire/tool/commands/CommandCodeGeneratorsFactory.java Wed Jul 29 19:11:11 2009
@@ -16,9 +16,6 @@
  */
 package org.apache.activemq.nms.openwire.tool.commands;
 
-import java.util.HashSet;
-import java.util.Set;
-
 /**
  * Provides methods to get a Source file and Header file Code generator given a Class
  * name.
@@ -27,35 +24,6 @@
  */
 public class CommandCodeGeneratorsFactory {
 
-    private Set<String> commandsWithShortcuts;
-
-    /*
-     * Here we store all Commands that need to have a isXXX method generated
-     * such as isMessage.  We then check in the <code>checkNeedsShortcut</code>
-     * method and if the Command being generated is in this list we create a
-     * method call to override the virtual method in the base Command interface.
-     */
-    {
-        commandsWithShortcuts = new HashSet<String>();
-        commandsWithShortcuts.add( "Response" );
-        commandsWithShortcuts.add( "RemoveInfo" );
-        commandsWithShortcuts.add( "MessageDispatch" );
-        commandsWithShortcuts.add( "BrokerInfo" );
-        commandsWithShortcuts.add( "KeepAliveInfo" );
-        commandsWithShortcuts.add( "WireFormatInfo" );
-        commandsWithShortcuts.add( "Message" );
-        commandsWithShortcuts.add( "MessageAck" );
-        commandsWithShortcuts.add( "ProducerAck" );
-        commandsWithShortcuts.add( "ProducerInfo" );
-        commandsWithShortcuts.add( "MessageDispatchNotification" );
-        commandsWithShortcuts.add( "ShutdownInfo" );
-        commandsWithShortcuts.add( "TransactionInfo" );
-        commandsWithShortcuts.add( "ConnectionInfo" );
-        commandsWithShortcuts.add( "ConsumerInfo" );
-        commandsWithShortcuts.add( "RemoveSubscriptionInfo" );
-
-    }
-
     /**
      * Given a class name return an instance of a CSharp Class File Generator
      * that can generate the file for the Class.
@@ -66,25 +34,23 @@
      */
     public CommandCodeGenerator getCodeGenerator( String className ) {
 
-        CommandCodeGenerator generator = null;
-//        if( className.equals("Message") ) {
-//            generator = new MessageHeaderGenerator();
-//        } else if( className.equals("ConnectionId") ) {
-//            generator = new ConnectionIdHeaderGenerator();
-//        } else if( className.equals("ConsumerId") ) {
-//            generator = new ConsumerIdHeaderGenerator();
-//        } else if( className.equals("ProducerId") ) {
-//            generator = new ProducerIdHeaderGenerator();
-//        } else if( className.equals("SessionId") ) {
-//            generator = new SessionIdHeaderGenerator();
-//        } else if( className.equals("SessionInfo") ) {
-//            generator = new SessionInfoHeaderGenerator();
-//        } else {
-            generator = new CommandClassGenerator();
-//        }
+        Class<?> generatorClass = null;
+
+        try {
+            generatorClass = Class.forName( "org.apache.activemq.nms.openwire.tool.commands." + className + "Generator" );
+        } catch (ClassNotFoundException e) {
+            return new CommandClassGenerator();
+        }
 
-        if( this.commandsWithShortcuts.contains( className ) ) {
-            generator.setGenIsClass( true );
+        CommandCodeGenerator generator;
+        try {
+            generator = (CommandCodeGenerator) generatorClass.newInstance();
+        } catch (InstantiationException e) {
+            e.printStackTrace();
+            return null;
+        } catch (IllegalAccessException e) {
+            e.printStackTrace();
+            return null;
         }
 
         return generator;

Modified: activemq/activemq-dotnet/Apache.NMS.ActiveMQ.Openwire.Generator/src/main/java/org/apache/activemq/nms/openwire/tool/commands/CommandGenerator.java
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ActiveMQ.Openwire.Generator/src/main/java/org/apache/activemq/nms/openwire/tool/commands/CommandGenerator.java?rev=799021&r1=799020&r2=799021&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.ActiveMQ.Openwire.Generator/src/main/java/org/apache/activemq/nms/openwire/tool/commands/CommandGenerator.java (original)
+++ activemq/activemq-dotnet/Apache.NMS.ActiveMQ.Openwire.Generator/src/main/java/org/apache/activemq/nms/openwire/tool/commands/CommandGenerator.java Wed Jul 29 19:11:11 2009
@@ -56,7 +56,7 @@
 
         try {
             // Using the current JClass state in the MultiSourceGenerator we can
-            // now generate the Header and Source for the CSharp commands.
+            // now generate the Source for the CSharp commands.
             generateClassFile();
         } catch (Exception e) {
             e.printStackTrace();
@@ -64,7 +64,6 @@
     }
 
     public Object run() {
-        filePostFix = ".cs";
         if (destDir == null) {
             destDir = new File(
                 targetDir+"/Commands");
@@ -75,7 +74,7 @@
 
     protected void generateClassFile() throws Exception {
 
-        File headerFile = new File(destDir, className + filePostFix);
+        File headerFile = new File(destDir, className + ".cs");
 
         CommandCodeGenerator generator = generatorsFactory.getCodeGenerator( className );
 
@@ -85,6 +84,7 @@
         generator.setClassName( getClassName() );
         generator.setBaseClassName( getBaseClass() );
         generator.setOpenWireOpCode( getOpenWireOpCode(getJclass()) );
+        generator.setComparable( className.endsWith("Id") );
 
         PrintWriter out = null;
         try {
@@ -99,8 +99,7 @@
         }
 
         // Use the FixCRLF Ant Task to make sure the file has consistent
-        // newlines
-        // so that SVN does not complain on checkin.
+        // newlines so that SVN does not complain on checkin.
         Project project = new Project();
         project.init();
         FixCRLF fixCRLF = new FixCRLF();

Added: activemq/activemq-dotnet/Apache.NMS.ActiveMQ.Openwire.Generator/src/main/java/org/apache/activemq/nms/openwire/tool/commands/ConnectionIdGenerator.java
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ActiveMQ.Openwire.Generator/src/main/java/org/apache/activemq/nms/openwire/tool/commands/ConnectionIdGenerator.java?rev=799021&view=auto
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.ActiveMQ.Openwire.Generator/src/main/java/org/apache/activemq/nms/openwire/tool/commands/ConnectionIdGenerator.java (added)
+++ activemq/activemq-dotnet/Apache.NMS.ActiveMQ.Openwire.Generator/src/main/java/org/apache/activemq/nms/openwire/tool/commands/ConnectionIdGenerator.java Wed Jul 29 19:11:11 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.nms.openwire.tool.commands;
+
+import java.io.PrintWriter;
+
+public class ConnectionIdGenerator extends CommandClassGenerator {
+
+    protected void generateConstructors( PrintWriter out ) {
+        out.println("        public "+getClassName()+"()");
+        out.println("        {");
+        out.println("        }");
+        out.println("");
+        out.println("        public "+getClassName()+"( SessionId sessionId )");
+        out.println("        {");
+        out.println("            this.value = sessionId.ConnectionId;");
+        out.println("        }");
+        out.println("");
+        out.println("        public "+getClassName()+"( ProducerId producerId )");
+        out.println("        {");
+        out.println("            this.value = producerId.ConnectionId;");
+        out.println("        }");
+        out.println("");
+        out.println("        public "+getClassName()+"( ConsumerId consumerId )");
+        out.println("        {");
+        out.println("            this.value = consumerId.ConnectionId;");
+        out.println("        }");
+        out.println("");
+
+        super.generateConstructors(out);
+    }
+}

Propchange: activemq/activemq-dotnet/Apache.NMS.ActiveMQ.Openwire.Generator/src/main/java/org/apache/activemq/nms/openwire/tool/commands/ConnectionIdGenerator.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: activemq/activemq-dotnet/Apache.NMS.ActiveMQ.Openwire.Generator/src/main/java/org/apache/activemq/nms/openwire/tool/commands/ConnectionInfoGenerator.java
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ActiveMQ.Openwire.Generator/src/main/java/org/apache/activemq/nms/openwire/tool/commands/ConnectionInfoGenerator.java?rev=799021&view=auto
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.ActiveMQ.Openwire.Generator/src/main/java/org/apache/activemq/nms/openwire/tool/commands/ConnectionInfoGenerator.java (added)
+++ activemq/activemq-dotnet/Apache.NMS.ActiveMQ.Openwire.Generator/src/main/java/org/apache/activemq/nms/openwire/tool/commands/ConnectionInfoGenerator.java Wed Jul 29 19:11:11 2009
@@ -0,0 +1,26 @@
+/**
+ * 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 ConnectionInfoGenerator extends CommandClassGenerator {
+
+    protected void generateVisitBody( PrintWriter out ) {
+        out.println("            return visitor.processAddConnection( this );");
+    }
+}

Propchange: activemq/activemq-dotnet/Apache.NMS.ActiveMQ.Openwire.Generator/src/main/java/org/apache/activemq/nms/openwire/tool/commands/ConnectionInfoGenerator.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: activemq/activemq-dotnet/Apache.NMS.ActiveMQ.Openwire.Generator/src/main/java/org/apache/activemq/nms/openwire/tool/commands/ConsumerIdGenerator.java
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ActiveMQ.Openwire.Generator/src/main/java/org/apache/activemq/nms/openwire/tool/commands/ConsumerIdGenerator.java?rev=799021&view=auto
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.ActiveMQ.Openwire.Generator/src/main/java/org/apache/activemq/nms/openwire/tool/commands/ConsumerIdGenerator.java (added)
+++ activemq/activemq-dotnet/Apache.NMS.ActiveMQ.Openwire.Generator/src/main/java/org/apache/activemq/nms/openwire/tool/commands/ConsumerIdGenerator.java Wed Jul 29 19:11:11 2009
@@ -0,0 +1,62 @@
+/**
+ * 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 ConsumerIdGenerator extends CommandClassGenerator {
+
+    protected void generateConstructors( PrintWriter out ) {
+
+        out.println("        public "+getClassName()+"() {");
+        out.println("        }");
+        out.println("");
+        out.println("        public "+getClassName()+"( SessionId sessionId, long consumerId ) {");
+        out.println("            this.connectionId = sessionId.ConnectionId;");
+        out.println("            this.sessionId = sessionId.Value;");
+        out.println("            this.value = consumerId;");
+        out.println("        }");
+        out.println("");
+
+        super.generateConstructors(out);
+    }
+
+    protected void generateProperties( PrintWriter out ) {
+
+        out.println("        private SessionId parentId = null;");
+        out.println("");
+
+        super.generateProperties(out);
+    }
+
+    protected void generateAdditonalMembers( PrintWriter out ) {
+        out.println("        public SessionId ParentId");
+        out.println("        {");
+        out.println("            get");
+        out.println("            {");
+        out.println("                 if( this.parentId == null ) {");
+        out.println("                     this.parentId = new SessionId( this );");
+        out.println("                 }");
+        out.println("                 return this.parentId;");
+        out.println("            }");
+        out.println("        }");
+        out.println("");
+
+        super.generateAdditonalMembers( out );
+    }
+
+}

Propchange: activemq/activemq-dotnet/Apache.NMS.ActiveMQ.Openwire.Generator/src/main/java/org/apache/activemq/nms/openwire/tool/commands/ConsumerIdGenerator.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: activemq/activemq-dotnet/Apache.NMS.ActiveMQ.Openwire.Generator/src/main/java/org/apache/activemq/nms/openwire/tool/commands/ConsumerInfoGenerator.java
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ActiveMQ.Openwire.Generator/src/main/java/org/apache/activemq/nms/openwire/tool/commands/ConsumerInfoGenerator.java?rev=799021&view=auto
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.ActiveMQ.Openwire.Generator/src/main/java/org/apache/activemq/nms/openwire/tool/commands/ConsumerInfoGenerator.java (added)
+++ activemq/activemq-dotnet/Apache.NMS.ActiveMQ.Openwire.Generator/src/main/java/org/apache/activemq/nms/openwire/tool/commands/ConsumerInfoGenerator.java Wed Jul 29 19:11:11 2009
@@ -0,0 +1,26 @@
+/**
+ * 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 ConsumerInfoGenerator extends CommandClassGenerator {
+
+    protected void generateVisitBody( PrintWriter out ) {
+        out.println("            return visitor.processAddConsumer( this );");
+    }
+}

Propchange: activemq/activemq-dotnet/Apache.NMS.ActiveMQ.Openwire.Generator/src/main/java/org/apache/activemq/nms/openwire/tool/commands/ConsumerInfoGenerator.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: activemq/activemq-dotnet/Apache.NMS.ActiveMQ.Openwire.Generator/src/main/java/org/apache/activemq/nms/openwire/tool/commands/DestinationInfoGenerator.java
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ActiveMQ.Openwire.Generator/src/main/java/org/apache/activemq/nms/openwire/tool/commands/DestinationInfoGenerator.java?rev=799021&view=auto
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.ActiveMQ.Openwire.Generator/src/main/java/org/apache/activemq/nms/openwire/tool/commands/DestinationInfoGenerator.java (added)
+++ activemq/activemq-dotnet/Apache.NMS.ActiveMQ.Openwire.Generator/src/main/java/org/apache/activemq/nms/openwire/tool/commands/DestinationInfoGenerator.java Wed Jul 29 19:11:11 2009
@@ -0,0 +1,66 @@
+/**
+ * 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 DestinationInfoGenerator extends CommandClassGenerator {
+
+    protected void generateVisitBody( PrintWriter out ) {
+
+        out.println("        if(IsAddOperation)");
+        out.println("        {");
+        out.println("            return visitor.processAddDestination(this);");
+        out.println("        }");
+        out.println("        else if(IsRemoveOperation)");
+        out.println("        {");
+        out.println("            return visitor.processRemoveDestination(this);");
+        out.println("        }");
+        out.println("        throw new IOException(\"Unknown operation type: \" + OperationType);");
+
+    }
+
+    protected void generateProperties( PrintWriter out ) {
+
+        out.println("        public const byte ADD_OPERATION_TYPE = 0;");
+        out.println("        public const byte REMOVE_OPERATION_TYPE = 1;");
+
+        super.generateProperties(out);
+    }
+
+    protected void generateAdditonalMembers( PrintWriter out ) {
+
+        out.println("        public bool IsAddOperation");
+        out.println("        {");
+        out.println("            get");
+        out.println("            {");
+        out.println("                return OperationType == ADD_OPERATION_TYPE;");
+        out.println("            }");
+        out.println("        }");
+        out.println("");
+        out.println("        public bool IsRemoveOperation");
+        out.println("        {");
+        out.println("            get");
+        out.println("            {");
+        out.println("                return OperationType == REMOVE_OPERATION_TYPE;");
+        out.println("            }");
+        out.println("        }");
+
+        super.generateAdditonalMembers(out);
+    }
+
+}

Propchange: activemq/activemq-dotnet/Apache.NMS.ActiveMQ.Openwire.Generator/src/main/java/org/apache/activemq/nms/openwire/tool/commands/DestinationInfoGenerator.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: activemq/activemq-dotnet/Apache.NMS.ActiveMQ.Openwire.Generator/src/main/java/org/apache/activemq/nms/openwire/tool/commands/MessageGenerator.java
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ActiveMQ.Openwire.Generator/src/main/java/org/apache/activemq/nms/openwire/tool/commands/MessageGenerator.java?rev=799021&view=auto
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.ActiveMQ.Openwire.Generator/src/main/java/org/apache/activemq/nms/openwire/tool/commands/MessageGenerator.java (added)
+++ activemq/activemq-dotnet/Apache.NMS.ActiveMQ.Openwire.Generator/src/main/java/org/apache/activemq/nms/openwire/tool/commands/MessageGenerator.java Wed Jul 29 19:11:11 2009
@@ -0,0 +1,54 @@
+/**
+ * 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 MessageGenerator extends CommandClassGenerator {
+
+    public MessageGenerator() {
+        super.setMarshalAware(true);
+        super.setCloneable(true);
+        super.addAdditionalBase("MessageReference");
+    }
+
+    protected void generateProperties( PrintWriter out ) {
+
+        super.generateProperties(out);
+    }
+
+    protected void generateAdditonalMembers( PrintWriter out ) {
+
+        super.generateAdditonalMembers( out );
+    }
+
+    protected void generateCloneBody( PrintWriter out ) {
+
+        out.println("            // Since we are a derived class use the base's Clone()");
+        out.println("            // to perform the shallow copy. Since it is shallow it");
+        out.println("            // will include our derived class. Since we are derived,");
+        out.println("            // this method is an override.");
+        out.println("            " + getClassName() + " o = (" + getClassName() + ") base.Clone();");
+        out.println("");
+        out.println("            if( this.messageId != null )");
+        out.println("            {");
+        out.println("                o.MessageId = (MessageId) this.messageId.Clone();");
+        out.println("            }");
+        out.println("");
+        out.println("            return o;");
+    }
+}

Propchange: activemq/activemq-dotnet/Apache.NMS.ActiveMQ.Openwire.Generator/src/main/java/org/apache/activemq/nms/openwire/tool/commands/MessageGenerator.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: activemq/activemq-dotnet/Apache.NMS.ActiveMQ.Openwire.Generator/src/main/java/org/apache/activemq/nms/openwire/tool/commands/ProducerIdGenerator.java
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ActiveMQ.Openwire.Generator/src/main/java/org/apache/activemq/nms/openwire/tool/commands/ProducerIdGenerator.java?rev=799021&view=auto
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.ActiveMQ.Openwire.Generator/src/main/java/org/apache/activemq/nms/openwire/tool/commands/ProducerIdGenerator.java (added)
+++ activemq/activemq-dotnet/Apache.NMS.ActiveMQ.Openwire.Generator/src/main/java/org/apache/activemq/nms/openwire/tool/commands/ProducerIdGenerator.java Wed Jul 29 19:11:11 2009
@@ -0,0 +1,62 @@
+/**
+ * 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 ProducerIdGenerator extends CommandClassGenerator {
+
+    protected void generateConstructors( PrintWriter out ) {
+
+        out.println("        public "+getClassName()+"() {");
+        out.println("        }");
+        out.println("");
+        out.println("        public "+getClassName()+"( SessionId sessionId, long consumerId ) {");
+        out.println("            this.connectionId = sessionId.ConnectionId;");
+        out.println("            this.sessionId = sessionId.Value;");
+        out.println("            this.value = consumerId;");
+        out.println("        }");
+        out.println("");
+
+        super.generateConstructors(out);
+    }
+
+    protected void generateProperties( PrintWriter out ) {
+
+        out.println("        private SessionId parentId;");
+        out.println("");
+
+        super.generateProperties(out);
+    }
+
+    protected void generateAdditonalMembers( PrintWriter out ) {
+        out.println("        public SessionId ParentId");
+        out.println("        {");
+        out.println("            get");
+        out.println("            {");
+        out.println("                 if( this.parentId == null ) {");
+        out.println("                     this.parentId = new SessionId( this );");
+        out.println("                 }");
+        out.println("                 return this.parentId;");
+        out.println("            }");
+        out.println("        }");
+        out.println("");
+
+        super.generateAdditonalMembers( out );
+    }
+
+}

Propchange: activemq/activemq-dotnet/Apache.NMS.ActiveMQ.Openwire.Generator/src/main/java/org/apache/activemq/nms/openwire/tool/commands/ProducerIdGenerator.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: activemq/activemq-dotnet/Apache.NMS.ActiveMQ.Openwire.Generator/src/main/java/org/apache/activemq/nms/openwire/tool/commands/ProducerInfoGenerator.java
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ActiveMQ.Openwire.Generator/src/main/java/org/apache/activemq/nms/openwire/tool/commands/ProducerInfoGenerator.java?rev=799021&view=auto
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.ActiveMQ.Openwire.Generator/src/main/java/org/apache/activemq/nms/openwire/tool/commands/ProducerInfoGenerator.java (added)
+++ activemq/activemq-dotnet/Apache.NMS.ActiveMQ.Openwire.Generator/src/main/java/org/apache/activemq/nms/openwire/tool/commands/ProducerInfoGenerator.java Wed Jul 29 19:11:11 2009
@@ -0,0 +1,26 @@
+/**
+ * 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 ProducerInfoGenerator extends CommandClassGenerator {
+
+    protected void generateVisitBody( PrintWriter out ) {
+        out.println("            return visitor.processAddProducer( this );");
+    }
+}

Propchange: activemq/activemq-dotnet/Apache.NMS.ActiveMQ.Openwire.Generator/src/main/java/org/apache/activemq/nms/openwire/tool/commands/ProducerInfoGenerator.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: activemq/activemq-dotnet/Apache.NMS.ActiveMQ.Openwire.Generator/src/main/java/org/apache/activemq/nms/openwire/tool/commands/RemoveInfoGenerator.java
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ActiveMQ.Openwire.Generator/src/main/java/org/apache/activemq/nms/openwire/tool/commands/RemoveInfoGenerator.java?rev=799021&view=auto
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.ActiveMQ.Openwire.Generator/src/main/java/org/apache/activemq/nms/openwire/tool/commands/RemoveInfoGenerator.java (added)
+++ activemq/activemq-dotnet/Apache.NMS.ActiveMQ.Openwire.Generator/src/main/java/org/apache/activemq/nms/openwire/tool/commands/RemoveInfoGenerator.java Wed Jul 29 19:11:11 2009
@@ -0,0 +1,39 @@
+/**
+ * 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 RemoveInfoGenerator extends CommandClassGenerator {
+
+    protected void generateVisitBody( PrintWriter out ) {
+
+        out.println("            switch(objectId.GetDataStructureType())");
+        out.println("            {");
+        out.println("                case ConnectionId.ID_CONNECTIONID:");
+        out.println("                    return visitor.processRemoveConnection((ConnectionId) objectId);");
+        out.println("                case SessionId.ID_SESSIONID:");
+        out.println("                    return visitor.processRemoveSession((SessionId) objectId);");
+        out.println("                case ConsumerId.ID_CONSUMERID:");
+        out.println("                    return visitor.processRemoveConsumer((ConsumerId) objectId);");
+        out.println("                case ProducerId.ID_PRODUCERID:");
+        out.println("                    return visitor.processRemoveProducer((ProducerId) objectId);");
+        out.println("                default:");
+        out.println("                    throw new IOException(\"Unknown remove command type: \" + objectId.GetDataStructureType());");
+        out.println("            }");
+    }
+}

Propchange: activemq/activemq-dotnet/Apache.NMS.ActiveMQ.Openwire.Generator/src/main/java/org/apache/activemq/nms/openwire/tool/commands/RemoveInfoGenerator.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: activemq/activemq-dotnet/Apache.NMS.ActiveMQ.Openwire.Generator/src/main/java/org/apache/activemq/nms/openwire/tool/commands/SessionIdGenerator.java
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ActiveMQ.Openwire.Generator/src/main/java/org/apache/activemq/nms/openwire/tool/commands/SessionIdGenerator.java?rev=799021&view=auto
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.ActiveMQ.Openwire.Generator/src/main/java/org/apache/activemq/nms/openwire/tool/commands/SessionIdGenerator.java (added)
+++ activemq/activemq-dotnet/Apache.NMS.ActiveMQ.Openwire.Generator/src/main/java/org/apache/activemq/nms/openwire/tool/commands/SessionIdGenerator.java Wed Jul 29 19:11:11 2009
@@ -0,0 +1,75 @@
+/**
+ * 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 SessionIdGenerator extends CommandClassGenerator {
+
+    protected void generateConstructors( PrintWriter out ) {
+
+        out.println("        public "+getClassName()+"()");
+        out.println("        {");
+        out.println("        }");
+        out.println("");
+        out.println("        public "+getClassName()+"( ConnectionId connectionId, long sessionId )");
+        out.println("        {");
+        out.println("            this.ConnectionId = connectionId.Value;");
+        out.println("            this.value = sessionId;");
+        out.println("        }");
+        out.println("");
+        out.println("        public "+getClassName()+"( ProducerId producerId )");
+        out.println("        {");
+        out.println("            this.ConnectionId = producerId.ConnectionId;");
+        out.println("            this.value = producerId.SessionId;");
+        out.println("        }");
+        out.println("");
+        out.println("        public "+getClassName()+"( ConsumerId consumerId )");
+        out.println("        {");
+        out.println("            this.ConnectionId = consumerId.ConnectionId;");
+        out.println("            this.value = consumerId.SessionId;");
+        out.println("        }");
+        out.println("");
+
+        super.generateConstructors(out);
+    }
+
+    protected void generateProperties( PrintWriter out ) {
+
+        out.println("        private ConnectionId parentId;");
+        out.println("");
+
+        super.generateProperties(out);
+    }
+
+    protected void generateAdditonalMembers( PrintWriter out ) {
+        out.println("        public ConnectionId getParentId");
+        out.println("        {");
+        out.println("            get");
+        out.println("            {");
+        out.println("                 if( this.parentId == null ) {");
+        out.println("                     this.parentId = new ConnectionId( this );");
+        out.println("                 }");
+        out.println("                 return this.parentId;");
+        out.println("            }");
+        out.println("        }");
+        out.println("");
+
+        super.generateAdditonalMembers( out );
+    }
+
+}

Propchange: activemq/activemq-dotnet/Apache.NMS.ActiveMQ.Openwire.Generator/src/main/java/org/apache/activemq/nms/openwire/tool/commands/SessionIdGenerator.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: activemq/activemq-dotnet/Apache.NMS.ActiveMQ.Openwire.Generator/src/main/java/org/apache/activemq/nms/openwire/tool/commands/SessionInfoGenerator.java
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ActiveMQ.Openwire.Generator/src/main/java/org/apache/activemq/nms/openwire/tool/commands/SessionInfoGenerator.java?rev=799021&view=auto
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.ActiveMQ.Openwire.Generator/src/main/java/org/apache/activemq/nms/openwire/tool/commands/SessionInfoGenerator.java (added)
+++ activemq/activemq-dotnet/Apache.NMS.ActiveMQ.Openwire.Generator/src/main/java/org/apache/activemq/nms/openwire/tool/commands/SessionInfoGenerator.java Wed Jul 29 19:11:11 2009
@@ -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.nms.openwire.tool.commands;
+
+import java.io.PrintWriter;
+
+public class SessionInfoGenerator extends CommandClassGenerator {
+
+    protected void generateVisitBody( PrintWriter out ) {
+        out.println("            return visitor.processAddSession( this );");
+    }
+
+    protected void generateConstructors( PrintWriter out ) {
+
+        out.println("        public "+getClassName()+"()");
+        out.println("        {");
+        out.println("        }");
+        out.println("");
+        out.println("        public "+getClassName()+"(ConnectionInfo connectionInfo, long sessionId)");
+        out.println("        {");
+        out.println("            this.sessionId = new SessionId(connectionInfo.ConnectionId, sessionId);");
+        out.println("        }");
+        out.println("");
+
+        super.generateConstructors(out);
+    }
+
+}

Propchange: activemq/activemq-dotnet/Apache.NMS.ActiveMQ.Openwire.Generator/src/main/java/org/apache/activemq/nms/openwire/tool/commands/SessionInfoGenerator.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: activemq/activemq-dotnet/Apache.NMS.ActiveMQ.Openwire.Generator/src/main/java/org/apache/activemq/nms/openwire/tool/commands/TransactionInfoGenerator.java
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ActiveMQ.Openwire.Generator/src/main/java/org/apache/activemq/nms/openwire/tool/commands/TransactionInfoGenerator.java?rev=799021&view=auto
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.ActiveMQ.Openwire.Generator/src/main/java/org/apache/activemq/nms/openwire/tool/commands/TransactionInfoGenerator.java (added)
+++ activemq/activemq-dotnet/Apache.NMS.ActiveMQ.Openwire.Generator/src/main/java/org/apache/activemq/nms/openwire/tool/commands/TransactionInfoGenerator.java Wed Jul 29 19:11:11 2009
@@ -0,0 +1,63 @@
+/**
+ * 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 TransactionInfoGenerator extends CommandClassGenerator {
+
+    protected void generateVisitBody( PrintWriter out ) {
+
+        out.println("            switch(type)");
+        out.println("            {");
+        out.println("                case TransactionInfo.BEGIN:");
+        out.println("                    return visitor.processBeginTransaction(this);");
+        out.println("                case TransactionInfo.END:");
+        out.println("                    return visitor.processEndTransaction(this);");
+        out.println("                case TransactionInfo.PREPARE:");
+        out.println("                    return visitor.processPrepareTransaction(this);");
+        out.println("                case TransactionInfo.COMMIT_ONE_PHASE:");
+        out.println("                    return visitor.processCommitTransactionOnePhase(this);");
+        out.println("                case TransactionInfo.COMMIT_TWO_PHASE:");
+        out.println("                    return visitor.processCommitTransactionTwoPhase(this);");
+        out.println("                case TransactionInfo.ROLLBACK:");
+        out.println("                    return visitor.processRollbackTransaction(this);");
+        out.println("                case TransactionInfo.RECOVER:");
+        out.println("                    return visitor.processRecoverTransactions(this);");
+        out.println("                case TransactionInfo.FORGET:");
+        out.println("                    return visitor.processForgetTransaction(this);");
+        out.println("                default:");
+        out.println("                    throw new IOException(\"Transaction info type unknown: \" + type);");
+        out.println("            }");
+    }
+
+    protected void generateProperties( PrintWriter out ) {
+
+        out.println("        public const byte BEGIN = 0;");
+        out.println("        public const byte PREPARE = 1;");
+        out.println("        public const byte COMMIT_ONE_PHASE = 2;");
+        out.println("        public const byte COMMIT_TWO_PHASE = 3;");
+        out.println("        public const byte ROLLBACK = 4;");
+        out.println("        public const byte RECOVER = 5;");
+        out.println("        public const byte FORGET = 6;");
+        out.println("        public const byte END = 7;");
+        out.println("");
+
+        super.generateProperties(out);
+    }
+
+}

Propchange: activemq/activemq-dotnet/Apache.NMS.ActiveMQ.Openwire.Generator/src/main/java/org/apache/activemq/nms/openwire/tool/commands/TransactionInfoGenerator.java
------------------------------------------------------------------------------
    svn:eol-style = native