activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r817798 - /activemq/activemq-dotnet/Apache.NMS.ActiveMQ.Openwire.Generator/src/main/java/org/apache/activemq/nms/openwire/tool/commands/MessageGenerator.java
Date Tue, 22 Sep 2009 19:47:33 GMT
Author: tabish
Date: Tue Sep 22 19:47:31 2009
New Revision: 817798

URL: http://svn.apache.org/viewvc?rev=817798&view=rev
Log:
Adds some more local properties to the Message command.

Modified:
    activemq/activemq-dotnet/Apache.NMS.ActiveMQ.Openwire.Generator/src/main/java/org/apache/activemq/nms/openwire/tool/commands/MessageGenerator.java

Modified: 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=817798&r1=817797&r2=817798&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.ActiveMQ.Openwire.Generator/src/main/java/org/apache/activemq/nms/openwire/tool/commands/MessageGenerator.java
(original)
+++ activemq/activemq-dotnet/Apache.NMS.ActiveMQ.Openwire.Generator/src/main/java/org/apache/activemq/nms/openwire/tool/commands/MessageGenerator.java
Tue Sep 22 19:47:31 2009
@@ -29,11 +29,59 @@
     protected void generateProperties( PrintWriter out ) {
 
         super.generateProperties(out);
+
+        out.println("        protected bool readOnlyMsgProperties;");
+        out.println("        protected bool readOnlyMsgBody;");
+        out.println("");
+        out.println("        public const int DEFAULT_MINIMUM_MESSAGE_SIZE = 1024;");
+        out.println("");
+
+    }
+
+    protected void generatePropertyAccessors( PrintWriter out ) {
+
+        super.generatePropertyAccessors(out);
+
+        out.println("        public bool ReadOnlyProperties" );
+        out.println("        {");
+        out.println("            get { return readOnlyMsgProperties; }" );
+        out.println("            set { readOnlyMsgProperties = value; }");
+        out.println("        }");
+        out.println("");
+        out.println("        public bool ReadOnlyBody" );
+        out.println("        {");
+        out.println("            get { return readOnlyMsgBody; }" );
+        out.println("            set { readOnlyMsgBody = value; }");
+        out.println("        }");
+        out.println("");
     }
 
     protected void generateAdditonalMembers( PrintWriter out ) {
 
         super.generateAdditonalMembers( out );
+
+        out.println("        public int Size()" );
+        out.println("        {");
+        out.println("            int size = DEFAULT_MINIMUM_MESSAGE_SIZE;");
+        out.println("");
+        out.println("            if(marshalledProperties != null)");
+        out.println("            {");
+        out.println("                size += marshalledProperties.Length;");
+        out.println("            }");
+        out.println("            if(content != null)");
+        out.println("            {");
+        out.println("                size += content.Length;");
+        out.println("            }");
+        out.println("");
+        out.println("            return size;");
+        out.println("        }");
+        out.println("");
+        out.println("        public void OnSend()" );
+        out.println("        {");
+        out.println("            this.ReadOnlyProperties = true;" );
+        out.println("            this.ReadOnlyBody = true;");
+        out.println("        }");
+        out.println("");
     }
 
     protected void generateCloneBody( PrintWriter out ) {



Mime
View raw message