camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From w...@apache.org
Subject svn commit: r743889 - in /camel/trunk/components/camel-jhc/src/main/java/org/apache/camel/component/jhc: JhcComponent.java JhcEndpoint.java
Date Thu, 12 Feb 2009 21:29:30 GMT
Author: wtam
Date: Thu Feb 12 21:29:30 2009
New Revision: 743889

URL: http://svn.apache.org/viewvc?rev=743889&view=rev
Log:
[CAMEL-1289] HeaderFilterStrategy - move from Component to Endpoint (for JHC component)

Modified:
    camel/trunk/components/camel-jhc/src/main/java/org/apache/camel/component/jhc/JhcComponent.java
    camel/trunk/components/camel-jhc/src/main/java/org/apache/camel/component/jhc/JhcEndpoint.java

Modified: camel/trunk/components/camel-jhc/src/main/java/org/apache/camel/component/jhc/JhcComponent.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jhc/src/main/java/org/apache/camel/component/jhc/JhcComponent.java?rev=743889&r1=743888&r2=743889&view=diff
==============================================================================
--- camel/trunk/components/camel-jhc/src/main/java/org/apache/camel/component/jhc/JhcComponent.java
(original)
+++ camel/trunk/components/camel-jhc/src/main/java/org/apache/camel/component/jhc/JhcComponent.java
Thu Feb 12 21:29:30 2009
@@ -20,21 +20,17 @@
 import java.util.Map;
 
 import org.apache.camel.Endpoint;
-import org.apache.camel.HeaderFilterStrategyAware;
 import org.apache.camel.impl.DefaultComponent;
-import org.apache.camel.spi.HeaderFilterStrategy;
 import org.apache.http.params.BasicHttpParams;
 import org.apache.http.params.HttpConnectionParams;
 import org.apache.http.params.HttpParams;
 import org.apache.http.params.HttpProtocolParams;
 
-public class JhcComponent extends DefaultComponent implements HeaderFilterStrategyAware {
+public class JhcComponent extends DefaultComponent {
 
     private HttpParams params;
-    private HeaderFilterStrategy headerFilterStrategy;
 
     public JhcComponent() {
-        setHeaderFilterStrategy(new JhcHeaderFilterStrategy());
         
         params = new BasicHttpParams()
             .setIntParameter(HttpConnectionParams.SO_TIMEOUT, 5000)
@@ -57,11 +53,4 @@
         return new JhcEndpoint(uri, this, new URI(uri.substring(uri.indexOf(':') + 1)));
     }
 
-    public HeaderFilterStrategy getHeaderFilterStrategy() {
-        return headerFilterStrategy;
-    }
-
-    public void setHeaderFilterStrategy(HeaderFilterStrategy strategy) {
-        headerFilterStrategy = strategy;
-    }
 }

Modified: camel/trunk/components/camel-jhc/src/main/java/org/apache/camel/component/jhc/JhcEndpoint.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jhc/src/main/java/org/apache/camel/component/jhc/JhcEndpoint.java?rev=743889&r1=743888&r2=743889&view=diff
==============================================================================
--- camel/trunk/components/camel-jhc/src/main/java/org/apache/camel/component/jhc/JhcEndpoint.java
(original)
+++ camel/trunk/components/camel-jhc/src/main/java/org/apache/camel/component/jhc/JhcEndpoint.java
Thu Feb 12 21:29:30 2009
@@ -19,7 +19,6 @@
 import java.net.URI;
 
 import org.apache.camel.Consumer;
-import org.apache.camel.HeaderFilterStrategyAware;
 import org.apache.camel.Processor;
 import org.apache.camel.Producer;
 import org.apache.camel.impl.DefaultEndpoint;
@@ -37,6 +36,7 @@
 
     private HttpParams params;
     private URI httpUri;
+    private HeaderFilterStrategy headerFilterStrategy;
 
     public JhcEndpoint(String endpointUri, JhcComponent component, URI httpUri) {
         super(endpointUri, component);
@@ -101,11 +101,12 @@
         return new JhcConsumer(this, processor);
     }
 
+    public void setHeaderFilterStrategy(HeaderFilterStrategy headerFilterStrategy) {
+        this.headerFilterStrategy = headerFilterStrategy;
+    }
+
     public HeaderFilterStrategy getHeaderFilterStrategy() {
-        if (getComponent() instanceof HeaderFilterStrategyAware) {
-            return ((HeaderFilterStrategyAware)getComponent()).getHeaderFilterStrategy();
-        } else {
-            return new JhcHeaderFilterStrategy();
-        }
+        return headerFilterStrategy;
     }
+    
 }



Mime
View raw message