Skip to content
Permalink
Browse files
Update to add an attempt at the IsExpired method needed in Message
  • Loading branch information
Timothy A. Bish committed Oct 22, 2009
1 parent d746747 commit 6787e107d1ca90817dd9601118b53d7c6fa70975
Showing 2 changed files with 22 additions and 7 deletions.
@@ -27,13 +27,7 @@ public void generate( PrintWriter out ) {
// 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 @@ public void generate( PrintWriter out ) {
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()+" : " );

@@ -26,6 +26,12 @@ public MessageGenerator() {
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 @@ protected void generateAdditonalMembers( PrintWriter out ) {
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 ) {

0 comments on commit 6787e10

Please sign in to comment.