activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jstrac...@apache.org
Subject svn commit: r521181 - in /activemq/camel/trunk/camel-core/src/main/java/org/apache/camel: Exchange.java builder/ExpressionBuilder.java builder/xpath/MessageVariableResolver.java impl/DefaultExchange.java
Date Thu, 22 Mar 2007 10:06:36 GMT
Author: jstrachan
Date: Thu Mar 22 03:06:30 2007
New Revision: 521181

URL: http://svn.apache.org/viewvc?view=rev&rev=521181
Log:
refactored the use of 'headers' on the Exchange to 'properties' as headers are usually protocol
dependent (e.g. strings in HTTP) whereas properties can be arbitrary things

Modified:
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/Exchange.java
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/ExpressionBuilder.java
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/xpath/MessageVariableResolver.java
    activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultExchange.java

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/Exchange.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/Exchange.java?view=diff&rev=521181&r1=521180&r2=521181
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/Exchange.java (original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/Exchange.java Thu Mar 22
03:06:30 2007
@@ -39,23 +39,23 @@
 
 
     /**
-     * Accesses a specific header on this exchange
+     * Returns a property associated with this exchange by name
      *
-     * @param name
-     * @return object header associated with the name
+     * @param name the name of the property
+     * @return the value of the given header or null if there is no property for the given
name
      */
-    Object getHeader(String name);
+    Object getProperty(String name);
 
     /**
-     * Sets a header on the exchange
+     * Sets a property on the exchange
      *
-     * @param name  of the header
+     * @param name of the property
      * @param value to associate with the name
      */
-    void setHeader(String name, Object value);
+    void setProperty(String name, Object value);
 
     /**
-     * Returns all of the headers associated with the exchange
+     * Returns all of the properties associated with the exchange
      *
      * @return all the headers in a Map
      */

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/ExpressionBuilder.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/ExpressionBuilder.java?view=diff&rev=521181&r1=521180&r2=521181
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/ExpressionBuilder.java
(original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/ExpressionBuilder.java
Thu Mar 22 03:06:30 2007
@@ -41,7 +41,7 @@
                 Object header = exchange.getIn().getHeader(headerName);
                 if (header == null) {
                     // lets try the exchange header
-                    header = exchange.getHeader(headerName);
+                    header = exchange.getProperty(headerName);
                 }
                 return header;
             }

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/xpath/MessageVariableResolver.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/xpath/MessageVariableResolver.java?view=diff&rev=521181&r1=521180&r2=521181
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/xpath/MessageVariableResolver.java
(original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/builder/xpath/MessageVariableResolver.java
Thu Mar 22 03:06:30 2007
@@ -56,7 +56,7 @@
                 answer = message.getHeader(localPart);
             }
             if (answer == null) {
-                answer = exchange.getHeader(localPart);
+                answer = exchange.getProperty(localPart);
             }
         }
         else if (uri.equals(SYSTEM_PROPERTIES_NAMESPACE)) {

Modified: activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultExchange.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultExchange.java?view=diff&rev=521181&r1=521180&r2=521181
==============================================================================
--- activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultExchange.java
(original)
+++ activemq/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultExchange.java
Thu Mar 22 03:06:30 2007
@@ -63,14 +63,14 @@
         return context;
     }
 
-    public Object getHeader(String name) {
+    public Object getProperty(String name) {
         if (headers != null) {
             return headers.get(name);
         }
         return null;
     }
 
-    public void setHeader(String name, Object value) {
+    public void setProperty(String name, Object value) {
         getHeaders().put(name, value);
     }
 



Mime
View raw message