camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r1055550 - /camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultExchange.java
Date Wed, 05 Jan 2011 17:39:02 GMT
Author: davsclaus
Date: Wed Jan  5 17:39:02 2011
New Revision: 1055550

URL: http://svn.apache.org/viewvc?rev=1055550&view=rev
Log:
CAMEL-3500: Headers on message and properties on Exchange is now using string interning for
Camel keys, to reduce memory consumption.

Modified:
    camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultExchange.java

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultExchange.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultExchange.java?rev=1055550&r1=1055549&r2=1055550&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultExchange.java (original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultExchange.java Wed Jan
 5 17:39:02 2011
@@ -69,7 +69,7 @@ public final class DefaultExchange imple
     public DefaultExchange(Endpoint fromEndpoint) {
         this(fromEndpoint, ExchangePattern.InOnly);
     }
-    
+
     public DefaultExchange(Endpoint fromEndpoint, ExchangePattern pattern) {
         this(fromEndpoint.getCamelContext(), pattern);
         this.fromEndpoint = fromEndpoint;
@@ -113,6 +113,8 @@ public final class DefaultExchange imple
 
     public Object getProperty(String name) {
         if (hasProperties()) {
+            // use intern String for properties which is Camel* properties
+            // this reduces memory allocations needed for those common properties
             if (name.startsWith("Camel")) {
                 name = name.intern();
             }



Mime
View raw message