svn commit: r702704 - in /activemq/camel/trunk: ./ components/camel-jhc/src/main/java/org/apache/camel/component/jhc/

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r702704 - in /activemq/camel/trunk: ./ components/camel-jhc/src/main/java/org/apache/camel/component/jhc/

hadrian-3
Author: hadrian
Date: Tue Oct  7 22:44:52 2008
New Revision: 702704

URL: http://svn.apache.org/viewvc?rev=702704&view=rev
Log:
CAMEL-403

Removed:
    activemq/camel/trunk/components/camel-jhc/src/main/java/org/apache/camel/component/jhc/DefaultListeningIOReactor.java
Modified:
    activemq/camel/trunk/components/camel-jhc/src/main/java/org/apache/camel/component/jhc/AsyncBufferingHttpServiceHandler.java
    activemq/camel/trunk/components/camel-jhc/src/main/java/org/apache/camel/component/jhc/BufferingHttpServiceHandler.java
    activemq/camel/trunk/components/camel-jhc/src/main/java/org/apache/camel/component/jhc/JhcComponent.java
    activemq/camel/trunk/components/camel-jhc/src/main/java/org/apache/camel/component/jhc/JhcConsumer.java
    activemq/camel/trunk/components/camel-jhc/src/main/java/org/apache/camel/component/jhc/JhcEndpoint.java
    activemq/camel/trunk/components/camel-jhc/src/main/java/org/apache/camel/component/jhc/JhcProducer.java
    activemq/camel/trunk/components/camel-jhc/src/main/java/org/apache/camel/component/jhc/JhcServerEngine.java
    activemq/camel/trunk/pom.xml

Modified: activemq/camel/trunk/components/camel-jhc/src/main/java/org/apache/camel/component/jhc/AsyncBufferingHttpServiceHandler.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-jhc/src/main/java/org/apache/camel/component/jhc/AsyncBufferingHttpServiceHandler.java?rev=702704&r1=702703&r2=702704&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-jhc/src/main/java/org/apache/camel/component/jhc/AsyncBufferingHttpServiceHandler.java (original)
+++ activemq/camel/trunk/components/camel-jhc/src/main/java/org/apache/camel/component/jhc/AsyncBufferingHttpServiceHandler.java Tue Oct  7 22:44:52 2008
@@ -31,7 +31,6 @@
 import org.apache.http.nio.NHttpServerConnection;
 import org.apache.http.nio.util.ByteBufferAllocator;
 import org.apache.http.params.HttpParams;
-import org.apache.http.params.HttpParamsLinker;
 import org.apache.http.protocol.BasicHttpProcessor;
 import org.apache.http.protocol.ExecutionContext;
 import org.apache.http.protocol.HttpContext;
@@ -116,10 +115,8 @@
                                 AsyncBufferingHttpServiceHandler.this.sendResponse(conn, response);
                             } catch (HttpException ex) {
                                 response = AsyncBufferingHttpServiceHandler.this.responseFactory.newHttpResponse(
-                                            HttpVersion.HTTP_1_0,
-                                            HttpStatus.SC_INTERNAL_SERVER_ERROR,
-                                            conn.getContext());
-                                HttpParamsLinker.link(response, AsyncBufferingHttpServiceHandler.this.params);
+                                    HttpVersion.HTTP_1_0, HttpStatus.SC_INTERNAL_SERVER_ERROR, conn.getContext());
+                                response.setParams(AsyncBufferingHttpServiceHandler.this.params);
                                 AsyncBufferingHttpServiceHandler.this.handleException(ex, response);
                                 AsyncBufferingHttpServiceHandler.this.sendResponse(conn, response);
                             }
@@ -127,10 +124,8 @@
                     });
                 } else { // just hanlder the request with sync request handler
                     HttpResponse response = this.responseFactory.newHttpResponse(
-                                                                                 ver,
-                                                                                 HttpStatus.SC_OK,
-                                                                                 conn.getContext());
-                    HttpParamsLinker.link(response, this.params);
+                        ver, HttpStatus.SC_OK, conn.getContext());
+                    response.setParams(this.params);
                     context.setAttribute(ExecutionContext.HTTP_RESPONSE, response);
                     handler.handle(request, response, context);
                     sendResponse(conn, response);
@@ -138,23 +133,15 @@
             } else {
                 // add the default handler here
                 HttpResponse response = this.responseFactory.newHttpResponse(
-                                                                             ver,
-                                                                             HttpStatus.SC_OK,
-                                                                             conn.getContext());
+                    ver, HttpStatus.SC_OK, conn.getContext());
                 response.setStatusCode(HttpStatus.SC_NOT_IMPLEMENTED);
-
             }
-
         } catch (HttpException ex) {
             HttpResponse response = this.responseFactory.newHttpResponse(
-                        HttpVersion.HTTP_1_0,
-                        HttpStatus.SC_INTERNAL_SERVER_ERROR,
-                    context);
-            HttpParamsLinker.link(response, this.params);
+                HttpVersion.HTTP_1_0, HttpStatus.SC_INTERNAL_SERVER_ERROR, context);
+            response.setParams(this.params);
             handleException(ex, response);
             sendResponse(conn, response);
         }
-
     }
-
 }

Modified: activemq/camel/trunk/components/camel-jhc/src/main/java/org/apache/camel/component/jhc/BufferingHttpServiceHandler.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-jhc/src/main/java/org/apache/camel/component/jhc/BufferingHttpServiceHandler.java?rev=702704&r1=702703&r2=702704&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-jhc/src/main/java/org/apache/camel/component/jhc/BufferingHttpServiceHandler.java (original)
+++ activemq/camel/trunk/components/camel-jhc/src/main/java/org/apache/camel/component/jhc/BufferingHttpServiceHandler.java Tue Oct  7 22:44:52 2008
@@ -48,7 +48,6 @@
 import org.apache.http.nio.util.SimpleInputBuffer;
 import org.apache.http.nio.util.SimpleOutputBuffer;
 import org.apache.http.params.HttpParams;
-import org.apache.http.params.HttpParamsLinker;
 import org.apache.http.protocol.ExecutionContext;
 import org.apache.http.protocol.HttpContext;
 import org.apache.http.protocol.HttpProcessor;
@@ -101,7 +100,7 @@
         HttpContext context = conn.getContext();
 
         HttpRequest request = conn.getHttpRequest();
-        HttpParamsLinker.link(request, this.params);
+        request.setParams(this.params);
 
         ServerConnState connState = (ServerConnState) context.getAttribute(CONN_STATE);
 
@@ -123,8 +122,8 @@
             if (request instanceof HttpEntityEnclosingRequest) {
                 if (((HttpEntityEnclosingRequest) request).expectContinue()) {
                     response = this.responseFactory.newHttpResponse(
-                            ver, HttpStatus.SC_CONTINUE, context);
-                    HttpParamsLinker.link(response, this.params);
+                        ver, HttpStatus.SC_CONTINUE, context);
+                    request.setParams(this.params);
 
                     if (this.expectationVerifier != null) {
                         try {
@@ -134,7 +133,7 @@
                                     HttpVersion.HTTP_1_0,
                                     HttpStatus.SC_INTERNAL_SERVER_ERROR,
                                     context);
-                            HttpParamsLinker.link(response, this.params);
+                            request.setParams(this.params);
                             handleException(ex, response);
                         }
                     }
@@ -170,7 +169,6 @@
                 this.eventListener.fatalProtocolException(ex, conn);
             }
         }
-
     }
 
     public void closed(final NHttpServerConnection conn) {
@@ -183,8 +181,8 @@
         HttpContext context = conn.getContext();
         try {
             HttpResponse response = this.responseFactory.newHttpResponse(
-                    HttpVersion.HTTP_1_0, HttpStatus.SC_INTERNAL_SERVER_ERROR, context);
-            HttpParamsLinker.link(response, this.params);
+                HttpVersion.HTTP_1_0, HttpStatus.SC_INTERNAL_SERVER_ERROR, context);
+            response.setParams(this.params);
             handleException(httpex, response);
             response.setEntity(null);
             sendResponse(conn, response);
@@ -307,10 +305,8 @@
         }
 
         HttpResponse response = this.responseFactory.newHttpResponse(
-                ver,
-                HttpStatus.SC_OK,
-                conn.getContext());
-        HttpParamsLinker.link(response, this.params);
+            ver, HttpStatus.SC_OK, conn.getContext());
+        request.setParams(this.params);
 
         context.setAttribute(ExecutionContext.HTTP_REQUEST, request);
         context.setAttribute(ExecutionContext.HTTP_CONNECTION, conn);
@@ -333,8 +329,8 @@
 
         } catch (HttpException ex) {
             response = this.responseFactory.newHttpResponse(HttpVersion.HTTP_1_0,
-                    HttpStatus.SC_INTERNAL_SERVER_ERROR, context);
-            HttpParamsLinker.link(response, this.params);
+                HttpStatus.SC_INTERNAL_SERVER_ERROR, context);
+            request.setParams(this.params);
             handleException(ex, response);
         }
 

Modified: activemq/camel/trunk/components/camel-jhc/src/main/java/org/apache/camel/component/jhc/JhcComponent.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-jhc/src/main/java/org/apache/camel/component/jhc/JhcComponent.java?rev=702704&r1=702703&r2=702704&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-jhc/src/main/java/org/apache/camel/component/jhc/JhcComponent.java (original)
+++ activemq/camel/trunk/components/camel-jhc/src/main/java/org/apache/camel/component/jhc/JhcComponent.java Tue Oct  7 22:44:52 2008
@@ -43,7 +43,7 @@
     
         setHeaderFilterStrategy(new JhcHeaderFilterStrategy());
         
-        params = new BasicHttpParams(null)
+        params = new BasicHttpParams()
             .setIntParameter(HttpConnectionParams.SO_TIMEOUT, 5000)
             .setIntParameter(HttpConnectionParams.CONNECTION_TIMEOUT, 10000)
             .setIntParameter(HttpConnectionParams.SOCKET_BUFFER_SIZE, 8 * 1024)

Modified: activemq/camel/trunk/components/camel-jhc/src/main/java/org/apache/camel/component/jhc/JhcConsumer.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-jhc/src/main/java/org/apache/camel/component/jhc/JhcConsumer.java?rev=702704&r1=702703&r2=702704&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-jhc/src/main/java/org/apache/camel/component/jhc/JhcConsumer.java (original)
+++ activemq/camel/trunk/components/camel-jhc/src/main/java/org/apache/camel/component/jhc/JhcConsumer.java Tue Oct  7 22:44:52 2008
@@ -37,7 +37,6 @@
 import org.apache.http.nio.NHttpConnection;
 import org.apache.http.nio.protocol.EventListener;
 import org.apache.http.params.HttpParams;
-import org.apache.http.params.HttpParamsLinker;
 import org.apache.http.protocol.HttpContext;
 import org.apache.http.protocol.HttpRequestHandler;
 
@@ -153,9 +152,9 @@
                     // create the default response to this request
                     ProtocolVersion httpVersion = (HttpVersion)request.getRequestLine().getProtocolVersion();
 
-                    HttpResponse response = responseFactory.newHttpResponse(httpVersion, HttpStatus.SC_OK,
-                                                                            context);
-                    HttpParamsLinker.link(response, params);
+                    HttpResponse response = responseFactory.newHttpResponse(
+                        httpVersion, HttpStatus.SC_OK, context);
+                    response.setParams(params);
                     HttpEntity entity = exchange.getOut().getBody(HttpEntity.class);
                     response.setEntity(entity);
                     response.setParams(getEndpoint().getParams());
@@ -166,14 +165,11 @@
                     }
                 }
             });
-
         }
 
         public void handle(HttpRequest request, HttpResponse response, HttpContext context)
             throws HttpException, IOException {
             // now we just handler the requset async, do nothing here
-
         }
     }
-
 }

Modified: activemq/camel/trunk/components/camel-jhc/src/main/java/org/apache/camel/component/jhc/JhcEndpoint.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-jhc/src/main/java/org/apache/camel/component/jhc/JhcEndpoint.java?rev=702704&r1=702703&r2=702704&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-jhc/src/main/java/org/apache/camel/component/jhc/JhcEndpoint.java (original)
+++ activemq/camel/trunk/components/camel-jhc/src/main/java/org/apache/camel/component/jhc/JhcEndpoint.java Tue Oct  7 22:44:52 2008
@@ -41,7 +41,7 @@
 
     public JhcEndpoint(String endpointUri, JhcComponent component, URI httpUri) {
         super(endpointUri, component);
-        params = new BasicHttpParams(component.getParams());
+        params = component.getParams().copy();
         this.httpUri = httpUri;
     }
 

Modified: activemq/camel/trunk/components/camel-jhc/src/main/java/org/apache/camel/component/jhc/JhcProducer.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-jhc/src/main/java/org/apache/camel/component/jhc/JhcProducer.java?rev=702704&r1=702703&r2=702704&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-jhc/src/main/java/org/apache/camel/component/jhc/JhcProducer.java (original)
+++ activemq/camel/trunk/components/camel-jhc/src/main/java/org/apache/camel/component/jhc/JhcProducer.java Tue Oct  7 22:44:52 2008
@@ -24,6 +24,7 @@
 import java.util.HashSet;
 import java.util.Iterator;
 import java.util.Set;
+import java.util.concurrent.ThreadFactory;
 
 import org.apache.camel.AsyncCallback;
 import org.apache.camel.AsyncProcessor;
@@ -61,7 +62,6 @@
 import org.apache.http.protocol.RequestExpectContinue;
 import org.apache.http.protocol.RequestTargetHost;
 import org.apache.http.protocol.RequestUserAgent;
-import org.apache.http.util.concurrent.ThreadFactory;
 
 public class JhcProducer extends DefaultProducer<JhcExchange> implements AsyncProcessor {
 

Modified: activemq/camel/trunk/components/camel-jhc/src/main/java/org/apache/camel/component/jhc/JhcServerEngine.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-jhc/src/main/java/org/apache/camel/component/jhc/JhcServerEngine.java?rev=702704&r1=702703&r2=702704&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-jhc/src/main/java/org/apache/camel/component/jhc/JhcServerEngine.java (original)
+++ activemq/camel/trunk/components/camel-jhc/src/main/java/org/apache/camel/component/jhc/JhcServerEngine.java Tue Oct  7 22:44:52 2008
@@ -20,10 +20,10 @@
 import java.io.InterruptedIOException;
 import java.net.InetSocketAddress;
 import java.net.SocketAddress;
+import java.util.concurrent.ThreadFactory;
 
 import javax.net.ssl.SSLContext;
 
-import org.apache.camel.component.jhc.JhcConsumer.MyHandler;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.http.impl.nio.DefaultServerIOEventDispatch;
@@ -31,11 +31,9 @@
 import org.apache.http.nio.reactor.IOEventDispatch;
 import org.apache.http.nio.reactor.IOReactorException;
 import org.apache.http.nio.reactor.ListeningIOReactor;
+import org.apache.http.impl.nio.reactor.DefaultListeningIOReactor;
 import org.apache.http.params.HttpParams;
-import org.apache.http.protocol.HttpRequestHandler;
 import org.apache.http.protocol.HttpRequestHandlerRegistry;
-import org.apache.http.protocol.HttpRequestHandlerResolver;
-import org.apache.http.util.concurrent.ThreadFactory;
 
 public class JhcServerEngine {
     private static final Log LOG = LogFactory.getLog(JhcServerEngine.class);

Modified: activemq/camel/trunk/pom.xml
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/pom.xml?rev=702704&r1=702703&r2=702704&view=diff
==============================================================================
--- activemq/camel/trunk/pom.xml (original)
+++ activemq/camel/trunk/pom.xml Tue Oct  7 22:44:52 2008
@@ -45,7 +45,8 @@
     <cxf-version>2.1.2</cxf-version>
     <felix-version>1.4.1</felix-version>
     <felix-osgi-version>1.2.0</felix-osgi-version>
-    <httpcore-version>4.0-alpha6</httpcore-version>
+    <httpcore-version>4.0-beta2</httpcore-version>
+    <httpcore-niossl-version>4.0-alpha6</httpcore-niossl-version>
     <jetty-version>6.1.11</jetty-version>
     <slf4j-version>1.5.2</slf4j-version>
     <openjpa-version>1.2.0</openjpa-version>
@@ -757,7 +758,7 @@
       <dependency>
         <groupId>org.apache.httpcomponents</groupId>
         <artifactId>httpcore-niossl</artifactId>
-        <version>${httpcore-version}</version>
+        <version>${httpcore-niossl-version}</version>
       </dependency>
 
       <!-- optional scripting support -->