servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r534354 - /incubator/servicemix/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/messaging/MessageExchangeFactoryImpl.java
Date Wed, 02 May 2007 08:31:29 GMT
Author: gnodet
Date: Wed May  2 01:31:28 2007
New Revision: 534354

URL: http://svn.apache.org/viewvc?view=rev&rev=534354
Log:
SM-943: Use a Calendar that displays nicely for the MessageExchange timestamp property

Modified:
    incubator/servicemix/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/messaging/MessageExchangeFactoryImpl.java

Modified: incubator/servicemix/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/messaging/MessageExchangeFactoryImpl.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/messaging/MessageExchangeFactoryImpl.java?view=diff&rev=534354&r1=534353&r2=534354
==============================================================================
--- incubator/servicemix/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/messaging/MessageExchangeFactoryImpl.java
(original)
+++ incubator/servicemix/trunk/core/servicemix-core/src/main/java/org/apache/servicemix/jbi/messaging/MessageExchangeFactoryImpl.java
Wed May  2 01:31:28 2007
@@ -16,6 +16,7 @@
  */
 package org.apache.servicemix.jbi.messaging;
 
+import java.text.SimpleDateFormat;
 import java.util.concurrent.atomic.AtomicBoolean;
 
 import org.apache.servicemix.JbiConstants;
@@ -33,7 +34,7 @@
 import javax.xml.namespace.QName;
 
 import java.net.URI;
-import java.util.Calendar;
+import java.util.GregorianCalendar;
 
 /**
  * Resolver for URI patterns
@@ -267,6 +268,13 @@
                 exchange.setMarshaler(marshaler);
             }
         }
-        exchange.setProperty(JbiConstants.DATESTAMP_PROPERTY_NAME, Calendar.getInstance());
+        exchange.setProperty(JbiConstants.DATESTAMP_PROPERTY_NAME, new PrettyCalendar());
+    }
+
+    @SuppressWarnings("serial")
+    public static class PrettyCalendar extends GregorianCalendar {
+        public String toString() {
+            return new SimpleDateFormat().format(getTime());
+        }
     }
 }



Mime
View raw message