activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r828860 - in /activemq/activemq-dotnet/Apache.NMS.ActiveMQ.Openwire.Generator/src/main/java/org/apache/activemq/nms/openwire/tool/commands: CommandClassGenerator.java MessageGenerator.java
Date Thu, 22 Oct 2009 21:36:54 GMT
Author: tabish
Date: Thu Oct 22 21:36:53 2009
New Revision: 828860

URL: http://svn.apache.org/viewvc?rev=828860&view=rev
Log:
Update to add an attempt at the IsExpired method needed in Message

Modified:
    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/MessageGenerator.java

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=828860&r1=828859&r2=828860&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
Thu Oct 22 21:36:53 2009
@@ -27,13 +27,7 @@
         // Start with the license.
         generateLicence(out);
 
-        out.println("using System;");
-        out.println("using System.Collections;");
-
-        if( getBaseClassName().equals( "BaseCommand" ) ) {
-            out.println("");
-            out.println("using Apache.NMS.ActiveMQ.State;");
-        }
+        generateUsingDirectives(out);
 
         out.println("");
         out.println("namespace Apache.NMS.ActiveMQ.Commands");
@@ -156,6 +150,16 @@
         out.println("");
     }
 
+    protected void generateUsingDirectives( PrintWriter out ) {
+        out.println("using System;");
+        out.println("using System.Collections;");
+
+        if( getBaseClassName().equals( "BaseCommand" ) ) {
+            out.println("");
+            out.println("using Apache.NMS.ActiveMQ.State;");
+        }
+    }
+
     protected void generateClassDefinition( PrintWriter out ) {
         out.print("    public class "+getClassName()+" : " );
 

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=828860&r1=828859&r2=828860&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
Thu Oct 22 21:36:53 2009
@@ -26,6 +26,12 @@
         super.addAdditionalBase("MessageReference");
     }
 
+    protected void generateUsingDirectives( PrintWriter out ) {
+        super.generateUsingDirectives(out);
+
+        out.println("using Apache.NMS.Util;");
+    }
+
     protected void generateProperties( PrintWriter out ) {
 
         super.generateProperties(out);
@@ -82,6 +88,11 @@
         out.println("            this.ReadOnlyBody = true;");
         out.println("        }");
         out.println("");
+        out.println("        public bool IsExpired()");
+        out.println("        {");
+        out.println("            return this.expiration == 0 ? false : DateTime.UtcNow >
DateUtils.ToDateTimeUtc(this.expiration);");
+        out.println("        }");
+        out.println("");
     }
 
     protected void generateCloneBody( PrintWriter out ) {



Mime
View raw message