axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject svn commit: r526955 [4/7] - in /webservices/axis2/trunk/java: ./ modules/adb-codegen/ modules/adb/ modules/addressing/ modules/clustering/ modules/codegen/ modules/fastinfoset/ modules/integration/ modules/java2wsdl/ modules/jaxbri/ modules/jaxws-api/ ...
Date Mon, 09 Apr 2007 23:41:02 GMT
Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/server/AxisHttpService.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/server/AxisHttpService.java?view=diff&rev=526955&r1=526954&r2=526955
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/server/AxisHttpService.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/server/AxisHttpService.java Mon Apr  9 16:40:57 2007
@@ -27,93 +27,216 @@
 */
 package org.apache.axis2.transport.http.server;
 
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.net.SocketException;
+import java.util.HashMap;
+import java.util.Iterator;
+
+import org.apache.axis2.AxisFault;
 import org.apache.axis2.Constants;
 import org.apache.axis2.addressing.AddressingHelper;
+import org.apache.axis2.addressing.EndpointReference;
 import org.apache.axis2.context.ConfigurationContext;
 import org.apache.axis2.context.ContextFactory;
 import org.apache.axis2.context.MessageContext;
 import org.apache.axis2.description.TransportInDescription;
 import org.apache.axis2.description.TransportOutDescription;
 import org.apache.axis2.engine.AxisEngine;
+import org.apache.axis2.transport.RequestResponseTransport;
 import org.apache.axis2.transport.http.HTTPConstants;
 import org.apache.axis2.util.MessageContextBuilder;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.http.ConnectionReuseStrategy;
 import org.apache.http.Header;
+import org.apache.http.HttpEntityEnclosingRequest;
 import org.apache.http.HttpException;
 import org.apache.http.HttpInetConnection;
 import org.apache.http.HttpRequest;
 import org.apache.http.HttpResponse;
 import org.apache.http.HttpResponseFactory;
-import org.apache.http.HttpServerConnection;
+import org.apache.http.HttpStatus;
 import org.apache.http.HttpVersion;
-import org.apache.http.RequestLine;
+import org.apache.http.MethodNotSupportedException;
+import org.apache.http.ProtocolException;
 import org.apache.http.UnsupportedHttpVersionException;
-import org.apache.http.entity.StringEntity;
-import org.apache.http.message.BasicStatusLine;
+import org.apache.http.params.HttpParams;
 import org.apache.http.protocol.HttpContext;
 import org.apache.http.protocol.HttpProcessor;
-import org.apache.http.protocol.HttpService;
 
-import java.io.IOException;
-import java.net.InetAddress;
-import java.net.SocketException;
-import java.util.HashMap;
-import java.util.Iterator;
+import edu.emory.mathcs.backport.java.util.concurrent.CountDownLatch;
 
 /**
  * This class is an extension of the defaulf HTTP service responsible for
  * maintaining and polulating the {@link MessageContext} for incoming Axis
  * requests.
  */
-public class AxisHttpService extends HttpService {
+public class AxisHttpService {
 
     private static final Log LOG = LogFactory.getLog(AxisHttpService.class);
 
+    private final HttpProcessor httpProcessor;
+    private final ConnectionReuseStrategy connStrategy;
+    private final HttpResponseFactory responseFactory;
     private final MessageContext msgContext;
     private final ConfigurationContext configurationContext;
-    private final SessionManager sessionManager;
     private final Worker worker;
 
+    private HttpParams params;
+
     public AxisHttpService(
             final HttpProcessor httpProcessor,
             final ConnectionReuseStrategy connStrategy,
             final HttpResponseFactory responseFactory,
             final ConfigurationContext configurationContext,
-            final SessionManager sessionManager,
             final Worker worker) {
-        super(httpProcessor, connStrategy, responseFactory);
+        super();
+        if (httpProcessor == null) {
+            throw new IllegalArgumentException("HTTP processor may not be null");
+        }
+        if (connStrategy == null) {
+            throw new IllegalArgumentException("Connection strategy may not be null");
+        }
+        if (responseFactory == null) {
+            throw new IllegalArgumentException("Response factory may not be null");
+        }
         if (worker == null) {
             throw new IllegalArgumentException("Worker may not be null");
         }
         if (configurationContext == null) {
             throw new IllegalArgumentException("Configuration context may not be null");
         }
-        if (sessionManager == null) {
-            throw new IllegalArgumentException("Session manager may not be null");
-        }
+        this.httpProcessor = httpProcessor;
+        this.connStrategy = connStrategy;
+        this.responseFactory = responseFactory;
         this.configurationContext = configurationContext;
-        this.sessionManager = sessionManager;
         this.worker = worker;
 
         this.msgContext = ContextFactory.createMessageContext(configurationContext);
         this.msgContext.setIncomingTransportName(Constants.TRANSPORT_HTTP);
     }
 
+    public HttpParams getParams() {
+        return this.params;
+    }
+    
+    public void setParams(final HttpParams params) {
+        this.params = params;
+    }
+    
+    public void handleRequest(final AxisHttpConnection conn, final HttpContext context) 
+            throws IOException, HttpException { 
+        
+        if (conn instanceof HttpInetConnection) {
+            HttpInetConnection inetconn = (HttpInetConnection) conn;
+            this.msgContext.setProperty(MessageContext.REMOTE_ADDR, 
+                    inetconn.getRemoteAddress().getHostAddress());
+            this.msgContext.setProperty(MessageContext.TRANSPORT_ADDR,
+                    inetconn.getLocalAddress().getHostAddress());
+
+            if (LOG.isDebugEnabled()) {
+                LOG.debug("Remote address of the connection : " + 
+                        inetconn.getRemoteAddress().getHostAddress());
+            }
+        }
+        
+        HttpResponse response;
+        try {
+            HttpRequest request = conn.receiveRequest(this.params);
+            HttpVersion ver = request.getRequestLine().getHttpVersion();
+            if (!ver.lessEquals(HttpVersion.HTTP_1_1)) {
+                // Downgrade protocol version if greater than HTTP/1.1 
+                ver = HttpVersion.HTTP_1_1;
+            }
+
+            response = this.responseFactory.newHttpResponse
+                (ver, HttpStatus.SC_OK, context);
+            response.getParams().setDefaults(this.params);
+            
+            if (request instanceof HttpEntityEnclosingRequest) {
+                if (((HttpEntityEnclosingRequest) request).expectContinue()) {
+                    HttpResponse ack = this.responseFactory.newHttpResponse
+                        (ver, HttpStatus.SC_CONTINUE, context);
+                    ack.getParams().setDefaults(this.params);
+                    conn.sendResponse(ack);
+                    conn.flush();
+                }
+            }
+            
+            // Create Axis request and response objects
+            AxisHttpRequestImpl axisreq = new AxisHttpRequestImpl(
+                    conn, 
+                    request, 
+                    this.httpProcessor, 
+                    context); 
+            AxisHttpResponseImpl axisres = new AxisHttpResponseImpl(
+                    conn, 
+                    response, 
+                    this.httpProcessor, 
+                    context); 
+
+            // Prepare HTTP request
+            axisreq.prepare();
+            
+            // Run the service
+            doService(axisreq, axisres, context);
+            
+            // Make sure the request content is fully consumed
+            InputStream instream = conn.getInputStream();
+            if (instream != null) {
+                instream.close();
+            }
+
+            // Commit response if not committed
+            if (!axisres.isCommitted()) {
+                axisres.commit();
+            }
+
+            // Make sure the response content is properly terminated
+            OutputStream outstream = conn.getOutputStream();
+            if (outstream != null) {
+                outstream.close();
+            }
+            
+        } catch (HttpException ex) {
+            response = this.responseFactory.newHttpResponse
+                (HttpVersion.HTTP_1_0, HttpStatus.SC_INTERNAL_SERVER_ERROR,
+                 context);
+            response.getParams().setDefaults(this.params);
+            handleException(ex, response);
+            this.httpProcessor.process(response, context);
+            conn.sendResponse(response);
+        }
+        
+        conn.flush();
+        if (!this.connStrategy.keepAlive(response, context)) {
+            conn.close();
+        } else {
+            conn.reset();
+        }
+    }    
+    
+    protected void handleException(final HttpException ex, final HttpResponse response) {
+        if (ex instanceof MethodNotSupportedException) {
+            response.setStatusCode(HttpStatus.SC_NOT_IMPLEMENTED);
+        } else if (ex instanceof UnsupportedHttpVersionException) {
+            response.setStatusCode(HttpStatus.SC_HTTP_VERSION_NOT_SUPPORTED);
+        } else if (ex instanceof ProtocolException) {
+            response.setStatusCode(HttpStatus.SC_BAD_REQUEST);
+        } else {
+            response.setStatusCode(HttpStatus.SC_INTERNAL_SERVER_ERROR);
+        }
+    }
+       
     protected void doService(
-            final HttpRequest request,
-            final HttpResponse response,
+            final AxisHttpRequest request, 
+            final AxisHttpResponse response,
             final HttpContext context) throws HttpException, IOException {
-        RequestLine reqline = request.getRequestLine();
         if (LOG.isDebugEnabled()) {
-            LOG.debug("Request method: " + reqline.getMethod());
-            LOG.debug("Target URI: " + reqline.getUri());
-        }
-
-        HttpVersion ver = reqline.getHttpVersion();
-        if (!ver.lessEquals(HttpVersion.HTTP_1_1)) {
-            throw new UnsupportedHttpVersionException("Unsupported HTTP version: " + ver);
+            LOG.debug("Request method: " + request.getMethod());
+            LOG.debug("Target URI: " + request.getRequestURI());
         }
 
         try {
@@ -127,7 +250,8 @@
             this.msgContext.setTransportOut(transportOut);
             this.msgContext.setServerSide(true);
             this.msgContext.setProperty(HTTPConstants.COOKIE_STRING, sessionKey);
-            this.msgContext.setProperty(Constants.Configuration.TRANSPORT_IN_URL, reqline.getUri());
+            this.msgContext.setProperty(Constants.Configuration.TRANSPORT_IN_URL, 
+                    request.getRequestURI());
 
             // set the transport Headers
             HashMap headerMap = new HashMap();
@@ -135,7 +259,19 @@
                 Header header = (Header) it.next();
                 headerMap.put(header.getName(), header.getValue());
             }
-            this.msgContext.setProperty(MessageContext.TRANSPORT_HEADERS, headerMap);
+            this.msgContext.setProperty(MessageContext.TRANSPORT_HEADERS, 
+                    headerMap);
+            this.msgContext.setProperty(Constants.Configuration.CONTENT_TYPE, 
+                    request.getContentType());
+            
+            this.msgContext.setProperty(MessageContext.TRANSPORT_OUT, 
+                    response.getOutputStream());
+            this.msgContext.setProperty(Constants.OUT_TRANSPORT_INFO, 
+                    response);
+            this.msgContext.setTo(new EndpointReference(request.getRequestURI()));
+            this.msgContext.setProperty(RequestResponseTransport.TRANSPORT_CONTROL,
+                                 new SimpleHTTPRequestResponseTransport());
+            
             this.worker.service(request, response, this.msgContext);
         } catch (SocketException ex) {
             // Socket is unreliable. 
@@ -144,59 +280,60 @@
             // HTTP protocol violation. Transport is unrelaible
             throw ex;
         } catch (Throwable e) {
-            try {
-                AxisEngine engine = new AxisEngine(this.configurationContext);
 
-                OutputBuffer outbuffer = new OutputBuffer();
-                this.msgContext
-                        .setProperty(MessageContext.TRANSPORT_OUT, outbuffer.getOutputStream());
-                this.msgContext.setProperty(Constants.OUT_TRANSPORT_INFO, outbuffer);
-
-                MessageContext faultContext =
-                        MessageContextBuilder.createFaultMessageContext(msgContext, e);
-                // If the fault is not going along the back channel we should be 202ing
-                if (AddressingHelper.isFaultRedirected(this.msgContext)) {
-                    response.setStatusLine(new BasicStatusLine(ver, 202, "Accepted"));
-                } else {
-                    response.setStatusLine(new BasicStatusLine(ver, 500, "Internal server error"));
-                }
-                engine.sendFault(faultContext);
-                response.setEntity(outbuffer);
-            } catch (Exception ex) {
-                if (AddressingHelper.isFaultRedirected(this.msgContext)) {
-                    response.setStatusLine(new BasicStatusLine(ver, 202, "Accepted"));
-                } else {
-                    // TODO: Why isn't this a SOAP fault?
-                    response.setStatusLine(new BasicStatusLine(ver, 500, "Internal server error"));
-                    String msg = ex.getMessage();
-                    StringEntity entity;
-                    if (msg != null && msg.trim().length() != 0) {
-                        entity = new StringEntity(msg);
-                    } else {
-                        entity = new StringEntity("Exception message unknown");
-                    }
-                    entity.setContentType("text/plain");
-                    response.setEntity(entity);
-                }
+            AxisEngine engine = new AxisEngine(this.configurationContext);
+
+            this.msgContext.setProperty(MessageContext.TRANSPORT_OUT, 
+                    response.getOutputStream());
+            this.msgContext.setProperty(Constants.OUT_TRANSPORT_INFO, 
+                    response);
+
+            MessageContext faultContext =
+                    MessageContextBuilder.createFaultMessageContext(msgContext, e);
+            // If the fault is not going along the back channel we should be 202ing
+            if (AddressingHelper.isFaultRedirected(this.msgContext)) {
+                response.setStatus(HttpStatus.SC_ACCEPTED);
+            } else {
+                response.sendError(HttpStatus.SC_INTERNAL_SERVER_ERROR, "Internal server error");
             }
+            engine.sendFault(faultContext);
         }
 
     }
 
-    public void handleRequest(final HttpServerConnection conn, final HttpContext context)
-            throws IOException, HttpException {
-        if (conn instanceof HttpInetConnection) {
-            HttpInetConnection inetconn = (HttpInetConnection) conn;
-            InetAddress address = inetconn.getRemoteAddress();
-            this.msgContext.setProperty(MessageContext.REMOTE_ADDR, address.getHostAddress());
+    class SimpleHTTPRequestResponseTransport implements RequestResponseTransport {
 
-            if (LOG.isDebugEnabled()) {
-                LOG.debug("Remote address of the connection : " + address);
-            }
+        private CountDownLatch responseReadySignal = new CountDownLatch(1);
+        RequestResponseTransportStatus status = RequestResponseTransportStatus.INITIAL;
+        AxisFault faultToBeThrownOut = null;
+
+        public void acknowledgeMessage(MessageContext msgContext) throws AxisFault {
+            //TODO: Once the core HTTP API allows us to return an ack before unwinding, then the should be fixed
+            signalResponseReady();
+        }
+
+        public void awaitResponse() throws InterruptedException, AxisFault {
+            status = RequestResponseTransportStatus.WAITING;
+            responseReadySignal.await();
+
+            if (faultToBeThrownOut != null)
+                throw faultToBeThrownOut;
         }
-        this.msgContext.setProperty(MessageContext.TRANSPORT_ADDR,
-                ((DefaultHttpConnectionFactory.Axis2HttpServerConnection)conn).getLocalIPAddress());
-        super.handleRequest(conn, context);
-    }
 
+        public void signalResponseReady() {
+            status = RequestResponseTransportStatus.SIGNALLED;
+            responseReadySignal.countDown();
+        }
+
+        public RequestResponseTransportStatus getStatus() {
+            return status;
+        }
+
+        public void signalFaultReady(AxisFault fault) {
+            faultToBeThrownOut = fault;
+            signalResponseReady();
+        }
+
+    }
+    
 }

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/server/DefaultConnectionListener.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/server/DefaultConnectionListener.java?view=diff&rev=526955&r1=526954&r2=526955
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/server/DefaultConnectionListener.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/server/DefaultConnectionListener.java Mon Apr  9 16:40:57 2007
@@ -31,7 +31,7 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.http.HttpServerConnection;
+import org.apache.http.params.HttpParams;
 
 import java.io.IOException;
 import java.net.ServerSocket;
@@ -44,40 +44,34 @@
     private volatile boolean destroyed = false;
 
     private final int port;
-    private final HttpConnectionFactory connfactory;
     private final HttpConnectionManager connmanager;
-    private ServerSocket serversocket = null;
     private final ConnectionListenerFailureHandler failureHandler;
+    private final HttpParams params;
 
-    /**
-     * Default constructor called by HttpFactory.  A custom HttpFactory subclass can call the other constructor to provide a custom ConnectionListenerErrorHandler
-     */
-    public DefaultConnectionListener(int port, HttpConnectionFactory connfactory,
-                                     HttpConnectionManager connmanager) throws IOException {
-        this(port, connfactory, connmanager, new DefaultConnectionListenerFailureHandler());
-    }
+    private ServerSocket serversocket = null;
 
     /**
      * Use this constructor to provide a custom ConnectionListenerFailureHandler, e.g. by subclassing DefaultConnectionListenerFailureHandler
      */
-    public DefaultConnectionListener(int port, HttpConnectionFactory connfactory,
-                                     HttpConnectionManager connmanager,
-                                     ConnectionListenerFailureHandler failureHandler)
-            throws IOException {
+    public DefaultConnectionListener(
+            int port,
+            final HttpConnectionManager connmanager,
+            final ConnectionListenerFailureHandler failureHandler,
+            final HttpParams params) throws IOException {
         super();
-        if (connfactory == null) {
-            throw new IllegalArgumentException("Connection factory may not be null");
-        }
         if (connmanager == null) {
             throw new IllegalArgumentException("Connection manager may not be null");
         }
         if (failureHandler == null) {
             throw new IllegalArgumentException("Failure handler may not be null");
         }
+        if (params == null) {
+            throw new IllegalArgumentException("HTTP parameters may not be null");
+        }
         this.port = port;
         this.connmanager = connmanager;
-        this.connfactory = connfactory;
         this.failureHandler = failureHandler;
+        this.params = params;
     }
 
     public void run() {
@@ -97,7 +91,7 @@
                         LOG.debug("Incoming HTTP connection from " +
                                 socket.getRemoteSocketAddress());
                     }
-                    HttpServerConnection conn = this.connfactory.newConnection(socket);
+                    AxisHttpConnection conn = new AxisHttpConnectionImpl(socket, this.params);
                     this.connmanager.process(conn);
                 } catch (Throwable ex) {
                     if (Thread.interrupted()) {

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/server/DefaultHttpConnectionManager.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/server/DefaultHttpConnectionManager.java?view=diff&rev=526955&r1=526954&r2=526955
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/server/DefaultHttpConnectionManager.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/server/DefaultHttpConnectionManager.java Mon Apr  9 16:40:57 2007
@@ -35,7 +35,6 @@
 import org.apache.commons.logging.LogFactory;
 import org.apache.http.ConnectionReuseStrategy;
 import org.apache.http.HttpResponseFactory;
-import org.apache.http.HttpServerConnection;
 import org.apache.http.impl.DefaultConnectionReuseStrategy;
 import org.apache.http.impl.DefaultHttpResponseFactory;
 import org.apache.http.params.HttpParams;
@@ -59,7 +58,6 @@
     private final WorkerFactory workerfactory;
     private final HttpParams params;
     private final List processors;
-    private final SessionManager sessionManager;
 
     private HttpFactory httpFactory = null;
 
@@ -82,7 +80,6 @@
             throw new IllegalArgumentException("HTTP parameters may not be null");
         }
         this.configurationContext = configurationContext;
-        this.sessionManager = new SessionManager();
         this.executor = executor;
         this.workerfactory = workerfactory;
         this.params = params;
@@ -123,7 +120,7 @@
         this.processors.remove(processor);
     }
 
-    public void process(final HttpServerConnection conn) {
+    public void process(final AxisHttpConnection conn) {
         if (conn == null) {
             throw new IllegalArgumentException("HTTP connection may not be null");
         }
@@ -147,7 +144,7 @@
             p.addInterceptor(new ResponseContent());
             p.addInterceptor(new ResponseConnControl());
             p.addInterceptor(new ResponseSessionCookie());
-            httpProcessor = new LoggingProcessorDecorator(p);
+            httpProcessor = p;
             connStrategy = new DefaultConnectionReuseStrategy();
             responseFactory = new DefaultHttpResponseFactory();
         }
@@ -157,7 +154,6 @@
                 connStrategy,
                 responseFactory,
                 this.configurationContext,
-                this.sessionManager,
                 this.workerfactory.newWorker());
         httpService.setParams(this.params);
 

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/server/HttpConnectionManager.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/server/HttpConnectionManager.java?view=diff&rev=526955&r1=526954&r2=526955
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/server/HttpConnectionManager.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/server/HttpConnectionManager.java Mon Apr  9 16:40:57 2007
@@ -29,11 +29,9 @@
 
 package org.apache.axis2.transport.http.server;
 
-import org.apache.http.HttpServerConnection;
-
 public interface HttpConnectionManager {
 
-    void process(HttpServerConnection incoming);
+    void process(AxisHttpConnection incoming);
 
     void shutdown();
 

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/server/HttpFactory.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/server/HttpFactory.java?view=diff&rev=526955&r1=526954&r2=526955
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/server/HttpFactory.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/server/HttpFactory.java Mon Apr  9 16:40:57 2007
@@ -29,11 +29,8 @@
 
 package org.apache.axis2.transport.http.server;
 
-import edu.emory.mathcs.backport.java.util.concurrent.BlockingQueue;
-import edu.emory.mathcs.backport.java.util.concurrent.ExecutorService;
-import edu.emory.mathcs.backport.java.util.concurrent.LinkedBlockingQueue;
-import edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor;
-import edu.emory.mathcs.backport.java.util.concurrent.TimeUnit;
+import java.io.IOException;
+
 import org.apache.axis2.AxisFault;
 import org.apache.axis2.Constants;
 import org.apache.axis2.context.ConfigurationContext;
@@ -44,8 +41,8 @@
 import org.apache.http.ConnectionReuseStrategy;
 import org.apache.http.HttpResponseFactory;
 import org.apache.http.impl.DefaultConnectionReuseStrategy;
-import org.apache.http.impl.DefaultHttpParams;
 import org.apache.http.impl.DefaultHttpResponseFactory;
+import org.apache.http.params.BasicHttpParams;
 import org.apache.http.params.HttpConnectionParams;
 import org.apache.http.params.HttpParams;
 import org.apache.http.params.HttpProtocolParams;
@@ -56,7 +53,11 @@
 import org.apache.http.protocol.ResponseDate;
 import org.apache.http.protocol.ResponseServer;
 
-import java.io.IOException;
+import edu.emory.mathcs.backport.java.util.concurrent.BlockingQueue;
+import edu.emory.mathcs.backport.java.util.concurrent.ExecutorService;
+import edu.emory.mathcs.backport.java.util.concurrent.LinkedBlockingQueue;
+import edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor;
+import edu.emory.mathcs.backport.java.util.concurrent.TimeUnit;
 
 /**
  * Factory used to configure and create the various instances required in http transports.
@@ -244,24 +245,22 @@
     /**
      * Create the listener for request connections
      */
-    public IOProcessor newRequestConnectionListener(HttpConnectionFactory factory,
-                                                    HttpConnectionManager manager, int port)
-            throws IOException {
-        return new DefaultConnectionListener(port, factory, manager);
-    }
-
-    /**
-     * Create a request connection
-     */
-    public HttpConnectionFactory newRequestConnectionFactory(HttpParams params) {
-        return new DefaultHttpConnectionFactory(params);
+    public IOProcessor newRequestConnectionListener(
+            int port,
+            final HttpConnectionManager manager, 
+            final HttpParams params) throws IOException {
+        return new DefaultConnectionListener(
+                port, 
+                manager, 
+                new DefaultConnectionListenerFailureHandler(), 
+                params);
     }
 
     /**
      * Create and set the parameters applied to incoming request connections
      */
     public HttpParams newRequestConnectionParams() {
-        HttpParams params = new DefaultHttpParams();
+        HttpParams params = new BasicHttpParams();
         params
                 .setIntParameter(HttpConnectionParams.SO_TIMEOUT, requestSocketTimeout)
                 .setBooleanParameter(HttpConnectionParams.TCP_NODELAY, requestTcpNoDelay)
@@ -320,7 +319,7 @@
         httpProcessor.addInterceptor(new ResponseContent());
         httpProcessor.addInterceptor(new ResponseConnControl());
         httpProcessor.addInterceptor(new ResponseSessionCookie());
-        return new LoggingProcessorDecorator(httpProcessor);
+        return httpProcessor;
     }
 
     public ConnectionReuseStrategy newConnStrategy() {

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/server/HttpServiceProcessor.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/server/HttpServiceProcessor.java?view=diff&rev=526955&r1=526954&r2=526955
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/server/HttpServiceProcessor.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/server/HttpServiceProcessor.java Mon Apr  9 16:40:57 2007
@@ -33,10 +33,8 @@
 import org.apache.commons.logging.LogFactory;
 import org.apache.http.ConnectionClosedException;
 import org.apache.http.HttpException;
-import org.apache.http.HttpServerConnection;
 import org.apache.http.protocol.HttpContext;
 import org.apache.http.protocol.HttpExecutionContext;
-import org.apache.http.protocol.HttpService;
 
 import java.io.IOException;
 import java.net.SocketException;
@@ -53,13 +51,13 @@
 
     private volatile boolean terminated;
 
-    private final HttpService httpservice;
-    private final HttpServerConnection conn;
+    private final AxisHttpService httpservice;
+    private final AxisHttpConnection conn;
     private final IOProcessorCallback callback;
 
     public HttpServiceProcessor(
-            final HttpService httpservice,
-            final HttpServerConnection conn,
+            final AxisHttpService httpservice,
+            final AxisHttpConnection conn,
             final IOProcessorCallback callback) {
         super();
         this.httpservice = httpservice;

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/server/HttpUtils.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/server/HttpUtils.java?view=diff&rev=526955&r1=526954&r2=526955
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/server/HttpUtils.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/server/HttpUtils.java Mon Apr  9 16:40:57 2007
@@ -29,7 +29,6 @@
 
 import org.apache.axis2.transport.http.HTTPConstants;
 import org.apache.http.Header;
-import org.apache.http.HttpRequest;
 
 import java.net.InetAddress;
 import java.net.NetworkInterface;
@@ -41,7 +40,7 @@
     private HttpUtils() {
     }
 
-    public static String getSoapAction(final HttpRequest request) {
+    public static String getSoapAction(final AxisHttpRequest request) {
         if (request == null) {
             return null;
         }

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/server/SimpleHttpServer.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/server/SimpleHttpServer.java?view=diff&rev=526955&r1=526954&r2=526955
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/server/SimpleHttpServer.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/server/SimpleHttpServer.java Mon Apr  9 16:40:57 2007
@@ -27,7 +27,6 @@
 *
 */
 
-
 package org.apache.axis2.transport.http.server;
 
 import edu.emory.mathcs.backport.java.util.concurrent.ExecutorService;
@@ -56,7 +55,6 @@
     private IOProcessor listener = null;
     private ExecutorService listenerExecutor = null;
     private HttpConnectionManager connmanager = null;
-    private HttpConnectionFactory connfactory = null;
     private ExecutorService requestExecutor = null;
 
     public SimpleHttpServer(ConfigurationContext configurationContext, WorkerFactory workerFactory,
@@ -77,8 +75,7 @@
         connmanager =
                 httpFactory.newRequestConnectionManager(requestExecutor, workerFactory, params);
         listenerExecutor = httpFactory.newListenerExecutor(port);
-        connfactory = httpFactory.newRequestConnectionFactory(params);
-        listener = httpFactory.newRequestConnectionListener(connfactory, connmanager, port);
+        listener = httpFactory.newRequestConnectionListener(port, connmanager, params);
     }
 
     public void destroy() throws IOException, InterruptedException {

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/server/Worker.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/server/Worker.java?view=diff&rev=526955&r1=526954&r2=526955
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/server/Worker.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/server/Worker.java Mon Apr  9 16:40:57 2007
@@ -29,14 +29,12 @@
 
 import org.apache.axis2.context.MessageContext;
 import org.apache.http.HttpException;
-import org.apache.http.HttpRequest;
-import org.apache.http.HttpResponse;
 
 import java.io.IOException;
 
 public interface Worker {
 
-    void service(HttpRequest request, HttpResponse response, MessageContext msgContext)
+    void service(AxisHttpRequest request, AxisHttpResponse response, MessageContext msgContext)
             throws HttpException, IOException;
 
 }

Modified: webservices/axis2/trunk/java/modules/metadata/pom.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/metadata/pom.xml?view=diff&rev=526955&r1=526954&r2=526955
==============================================================================
--- webservices/axis2/trunk/java/modules/metadata/pom.xml (original)
+++ webservices/axis2/trunk/java/modules/metadata/pom.xml Mon Apr  9 16:40:57 2007
@@ -15,9 +15,7 @@
 	! See the License for the specific language governing permissions and
 	! limitations under the License.
 	!-->
-<project xmlns="http://maven.apache.org/POM/4.0.0"
-	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
 	<modelVersion>4.0.0</modelVersion>
 	<parent>
 		<groupId>org.apache.axis2</groupId>
@@ -25,15 +23,9 @@
 		<version>SNAPSHOT</version>
 		<relativePath>../parent/pom.xml</relativePath>
 	</parent>
-
 	<artifactId>axis2-metadata</artifactId>
 	<name>Apache Axis 2.0 - Metadata</name>
 	<description>JSR-181 and JSR-224 Annotations Processing</description>
-  <scm>
-    <connection>scm:svn:http://svn.apache.org/repos/asf/webservices/axis2/trunk/java/modules/metadata</connection>
-    <developerConnection>scm:svn:https://svn.apache.org/repos/asf/webservices/axis2/trunk/java/modules/metadata</developerConnection>
-    <url>http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/metadata</url>
-  </scm>
 	<dependencies>
 		<dependency>
 			<groupId>org.apache.axis2</groupId>
@@ -41,148 +33,137 @@
 			<version>${version}</version>
 		</dependency>
 		<dependency>
-            <groupId>org.apache.axis2</groupId>
-            <artifactId>axis2-jaxws-api</artifactId>
+			<groupId>org.apache.axis2</groupId>
+			<artifactId>axis2-jaxws-api</artifactId>
 			<version>${version}</version>
-        </dependency>
+		</dependency>
 		<dependency>
-            <groupId>org.apache.axis2</groupId>
-            <artifactId>axis2-saaj</artifactId>
+			<groupId>org.apache.axis2</groupId>
+			<artifactId>axis2-saaj</artifactId>
 			<version>${version}</version>
-			<scope>test</scope>
-        </dependency>
-		 <dependency>
-            <groupId>com.sun.xml.bind</groupId>
-            <artifactId>jaxb-impl</artifactId>
-            <version>2.0.2</version>
-            <exclusions>
-            	<exclusion>
-            		<artifactId>jsr173</artifactId>
-            		<groupId>javax.xml</groupId>
-            	</exclusion>
-            </exclusions>
-        </dependency>
-        <dependency>
-            <groupId>com.sun.xml.bind</groupId>
-            <artifactId>jaxb-xjc</artifactId>
-            <version>2.0.2</version>
-        </dependency>
-        <dependency>
-            <groupId>log4j</groupId>
-            <artifactId>log4j</artifactId>
-            <version>1.2.13</version>
-        </dependency>
-
-        <dependency>
-            <groupId>javax.xml.bind</groupId>
-            <artifactId>jaxb-api</artifactId>
-            <version>2.0</version>
-            <exclusions>
-            	<exclusion>
-            		<artifactId>jsr173</artifactId>
-            		<groupId>javax.xml</groupId>
-            	</exclusion>
-            </exclusions>
-        </dependency>
+		</dependency>
+		<dependency>
+			<groupId>com.sun.xml.bind</groupId>
+			<artifactId>jaxb-impl</artifactId>
+			<exclusions>
+				<exclusion>
+					<artifactId>jsr173</artifactId>
+					<groupId>javax.xml</groupId>
+				</exclusion>
+			</exclusions>
+		</dependency>
+		<dependency>
+			<groupId>com.sun.xml.bind</groupId>
+			<artifactId>jaxb-xjc</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>log4j</groupId>
+			<artifactId>log4j</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>javax.xml.bind</groupId>
+			<artifactId>jaxb-api</artifactId>
+			<exclusions>
+				<exclusion>
+					<artifactId>jsr173</artifactId>
+					<groupId>javax.xml</groupId>
+				</exclusion>
+			</exclusions>
+		</dependency>
 	</dependencies>
-
-    <build>
-        <sourceDirectory>src</sourceDirectory>
-        <testSourceDirectory>test</testSourceDirectory>
-        <resources>
-        <resource>
-        <directory>src</directory>
-        <excludes><exclude>*.java</exclude></excludes>
-        </resource>
-        </resources>
-        <plugins>
-	      <plugin>
-	        <artifactId>maven-compiler-plugin</artifactId>
-	        <inherited>true</inherited>
-	        <configuration>
-	          <source>1.5</source>
-	          <target>1.5</target>
-	        </configuration>
-	      </plugin>
-        <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-antrun-plugin</artifactId>
-        <version>1.1</version>
-        <executions>
-        <execution>
-            <id>gen-ts</id>
-            <phase>generate-test-sources</phase>
-            <configuration>
-              <tasks>
-        <!-- Theres got to be a better way to do this -->
-        <property name="schema.source.dir" value="test-resources/xsd"/>
-    	<property name="wsdl.source.dir" value="test-resources/wsdl"/>
-        <property name="schema.output.base.dir" value="target/schema"/>
-        <property name="schema.generated.src.dir" value="${schema.output.base.dir}/src"/>
-        <property name="schema.generated.classes.dir" value="${schema.output.base.dir}/classes"/>
-        
-    	<!-- make the dirs -->
-        <mkdir dir="${schema.output.base.dir}"/>
-        <mkdir dir="${schema.generated.src.dir}"/>
-        <mkdir dir="${schema.generated.classes.dir}"/>
-
-    	<!-- Run JAXB schema compiler with designated schemas -->
-        <echo>Generating JAX-B classes from XSDs</echo>    
-
-    	<echo>Generating java from ProxyDocLitWrapped.wsdl</echo>
-    	<java classname="com.sun.tools.xjc.Driver" fork="true"> 
-    	    <classpath refid="maven.runtime.classpath"/>
-    	    <classpath location="${compiled.classes.dir}"/>
-    	    <arg line="-d ${schema.generated.src.dir} -quiet -p org.test.proxy.doclitwrapped -quiet -wsdl ${wsdl.source.dir}/ProxyDocLitWrapped.wsdl"/>
-    	</java>
-			  </tasks>
-            </configuration>
-            <goals>
-              <goal>run</goal>
-            </goals>
-          </execution>
-        </executions>
-        <dependencies>
-          <dependency>
-            <groupId>org.apache.ant</groupId>
-            <artifactId>ant-antlr</artifactId>
-            <version>1.7.0</version>
-          </dependency>
-          <dependency>
-            <groupId>antlr</groupId>
-            <artifactId>antlrall</artifactId>
-            <version>2.7.4</version>
-          </dependency>
-        </dependencies>
-      </plugin>
-      <plugin>
-        <groupId>org.codehaus.mojo</groupId>
-        <artifactId>build-helper-maven-plugin</artifactId>
-        <executions>
-          <execution>
-            <id>add-test-source</id>
-            <phase>process-test-resources</phase>
-            <goals>
-              <goal>add-test-source</goal>
-            </goals>
-            <configuration>
-              <sources>
-                <source>${basedir}/target/schema/src</source>
-              </sources>
-            </configuration>
-          </execution>
-        </executions>
-      </plugin>
-      <plugin>
-  		<artifactId>maven-surefire-plugin</artifactId>
-  		<inherited>true</inherited>
-  		<configuration>
-  			<skip>false</skip>
-  			<includes>
-           	 <include>**/*Tests.java</include>
-            </includes>
-  		</configuration>
-  	  </plugin>
-       </plugins>
-    </build>
+	<build>
+		<sourceDirectory>src</sourceDirectory>
+		<testSourceDirectory>test</testSourceDirectory>
+		<resources>
+			<resource>
+				<directory>src</directory>
+				<excludes>
+					<exclude>*.java</exclude>
+				</excludes>
+			</resource>
+		</resources>
+		<plugins>
+			<plugin>
+				<artifactId>maven-compiler-plugin</artifactId>
+				<inherited>true</inherited>
+				<configuration>
+					<source>1.5</source>
+					<target>1.5</target>
+				</configuration>
+			</plugin>
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-antrun-plugin</artifactId>
+				<executions>
+					<execution>
+						<id>gen-ts</id>
+						<phase>generate-test-sources</phase>
+						<configuration>
+							<tasks>
+								<!-- Theres got to be a better way to do this -->
+								<property name="schema.source.dir" value="test-resources/xsd"/>
+								<property name="wsdl.source.dir" value="test-resources/wsdl"/>
+								<property name="schema.output.base.dir" value="target/schema"/>
+								<property name="schema.generated.src.dir" value="${schema.output.base.dir}/src"/>
+								<property name="schema.generated.classes.dir" value="${schema.output.base.dir}/classes"/>
+								<!-- make the dirs -->
+								<mkdir dir="${schema.output.base.dir}"/>
+								<mkdir dir="${schema.generated.src.dir}"/>
+								<mkdir dir="${schema.generated.classes.dir}"/>
+								<!-- Run JAXB schema compiler with designated schemas -->
+								<echo>Generating JAX-B classes from XSDs</echo>
+								<echo>Generating java from ProxyDocLitWrapped.wsdl</echo>
+								<java classname="com.sun.tools.xjc.Driver" fork="true">
+									<classpath refid="maven.runtime.classpath"/>
+									<classpath location="${compiled.classes.dir}"/>
+									<arg line="-d ${schema.generated.src.dir} -quiet -p org.test.proxy.doclitwrapped -quiet -wsdl ${wsdl.source.dir}/ProxyDocLitWrapped.wsdl"/>
+								</java>
+							</tasks>
+						</configuration>
+						<goals>
+							<goal>run</goal>
+						</goals>
+					</execution>
+				</executions>
+				<dependencies>
+					<!--<dependency>
+						<groupId>org.apache.ant</groupId>
+						<artifactId>ant-antlr</artifactId>
+					</dependency>
+					<dependency>
+						<groupId>antlr</groupId>
+						<artifactId>antlrall</artifactId>
+					</dependency>-->
+				</dependencies>
+			</plugin>
+			<plugin>
+				<groupId>org.codehaus.mojo</groupId>
+				<artifactId>build-helper-maven-plugin</artifactId>
+				<executions>
+					<execution>
+						<id>add-test-source</id>
+						<phase>process-test-resources</phase>
+						<goals>
+							<goal>add-test-source</goal>
+						</goals>
+						<configuration>
+							<sources>
+								<source>${basedir}/target/schema/src</source>
+							</sources>
+						</configuration>
+					</execution>
+				</executions>
+			</plugin>
+			<plugin>
+				<artifactId>maven-surefire-plugin</artifactId>
+				<inherited>true</inherited>
+				<configuration>
+					<skip>false</skip>
+					<includes>
+						<include>**/*Tests.java</include>
+					</includes>
+				</configuration>
+			</plugin>
+		</plugins>
+	</build>
 </project>

Modified: webservices/axis2/trunk/java/modules/mtompolicy/pom.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/mtompolicy/pom.xml?view=diff&rev=526955&r1=526954&r2=526955
==============================================================================
--- webservices/axis2/trunk/java/modules/mtompolicy/pom.xml (original)
+++ webservices/axis2/trunk/java/modules/mtompolicy/pom.xml Mon Apr  9 16:40:57 2007
@@ -15,9 +15,7 @@
 	! See the License for the specific language governing permissions and
 	! limitations under the License.
 	!-->
-<project xmlns="http://maven.apache.org/POM/4.0.0"
-	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
 	<modelVersion>4.0.0</modelVersion>
 	<parent>
 		<groupId>org.apache.axis2</groupId>
@@ -25,15 +23,9 @@
 		<version>SNAPSHOT</version>
 		<relativePath>../parent/pom.xml</relativePath>
 	</parent>
-
 	<artifactId>axis2-mtompolicy</artifactId>
 	<name>Apache Axis 2.0 - MTOM Policy</name>
 	<description>Axis2 : MTOM Policy</description>
-  <scm>
-    <connection>scm:svn:http://svn.apache.org/repos/asf/webservices/axis2/trunk/java/modules/mtompolicy</connection>
-    <developerConnection>scm:svn:https://svn.apache.org/repos/asf/webservices/axis2/trunk/java/modules/mtompolicy</developerConnection>
-    <url>http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/mtompolicy</url>
-  </scm>
 	<dependencies>
 		<dependency>
 			<groupId>org.apache.axis2</groupId>
@@ -41,37 +33,34 @@
 			<version>${version}</version>
 		</dependency>
 		<dependency>
-            <groupId>org.apache.neethi</groupId>
-            <artifactId>neethi</artifactId>
-            <version>SNAPSHOT</version>
-        </dependency>
+			<groupId>org.apache.neethi</groupId>
+			<artifactId>neethi</artifactId>
+		</dependency>
 	</dependencies>
-
 	<build>
 		<sourceDirectory>src</sourceDirectory>
-	    <resources>
-	      <resource>
-	        <directory>src</directory>
-	        <excludes>
-	          <exclude>**/*.java</exclude>
-	        </excludes>
-	      </resource>
-	    </resources>
+		<resources>
+			<resource>
+				<directory>src</directory>
+				<excludes>
+					<exclude>**/*.java</exclude>
+				</excludes>
+			</resource>
+		</resources>
 		<testSourceDirectory>test</testSourceDirectory>
 		<testResources>
 			<testResource>
 				<directory>test-resources</directory>
 			</testResource>
 		</testResources>
-		    
 		<plugins>
-	  	  <plugin>
-	  		<artifactId>maven-surefire-plugin</artifactId>
-	  		<inherited>true</inherited>
-	  		<configuration>
-	  			<skip>false</skip>
-	  		</configuration>
-	  	  </plugin>
-	    </plugins>
+			<plugin>
+				<artifactId>maven-surefire-plugin</artifactId>
+				<inherited>true</inherited>
+				<configuration>
+					<skip>false</skip>
+				</configuration>
+			</plugin>
+		</plugins>
 	</build>
 </project>



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org


Mime
View raw message