cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Glynn, Eoghan" <eoghan.gl...@iona.com>
Subject RE: svn commit: r518627 [1/2] [http2 switch-over]
Date Thu, 15 Mar 2007 15:13:13 GMT


Willem,

Earlier in the week I requested you reapply the Jetty5->Jetty6 changes
to the HTTP code, so as to not to lose the history and also not to lose
any modifications made to the http code after the fork.

Instead you've done this in such a way as to cause both of these issues
to occur :(

For example:

1. you've removed JettySslListener.java and replaced it with
JettySslConnectorFactory.java, thus losing the history

2. more importantly, you've also just overwritten
HttpsURLConnectionFactory and its unit test with the versions from
http2, thus losing the ciphersuite filtering feature. Similarly you've
just overwritten http SSLUtils.java with the version from http2. 

I've haven't checked any of the other changes, but there may well be
other examples.

So I'd suggest that you back out this commit ASAP.

/Eoghan
 

> -----Original Message-----
> From: ningjiang@apache.org [mailto:ningjiang@apache.org] 
> Sent: 15 March 2007 13:45
> To: cxf-commits@incubator.apache.org
> Subject: svn commit: r518627 [1/2] - in /incubator/cxf/trunk: 
> integration/jca/ rt/ rt/bindings/http/ rt/databinding/aegis/ 
> rt/transports/http/ rt/transports/http/src/java/ 
> rt/transports/http/src/main/java/org/apache/cxf/transport/http
> / rt/transports/http/src/ma...
> 
> Author: ningjiang
> Date: Thu Mar 15 06:44:47 2007
> New Revision: 518627
> 
> URL: http://svn.apache.org/viewvc?view=rev&rev=518627
> Log:
> [CXF-462] Replaced http module with http2
> 
> Added:
>     
> incubator/cxf/trunk/rt/transports/http/src/main/java/org/apach
> e/cxf/transport/http/JettyConnectorFactory.java
>       - copied unchanged from r518538, 
> incubator/cxf/trunk/rt/transports/http2/src/main/java/org/apac
> he/cxf/transport/http/JettyConnectorFactory.java
>     
> incubator/cxf/trunk/rt/transports/http/src/main/java/org/apach
> e/cxf/transport/https/JettySslConnectorFactory.java
>       - copied unchanged from r518538, 
> incubator/cxf/trunk/rt/transports/http2/src/main/java/org/apac
> he/cxf/transport/https/JettySslConnectorFactory.java
>     
> incubator/cxf/trunk/rt/transports/http/src/test/java/org/apach
> e/cxf/transport/https/JettySslConnectorFactoryTest.java
>       - copied unchanged from r518538, 
> incubator/cxf/trunk/rt/transports/http2/src/test/java/org/apac
> he/cxf/transport/https/JettySslConnectorFactoryTest.java
> Removed:
>     incubator/cxf/trunk/rt/transports/http/src/java/
>     
> incubator/cxf/trunk/rt/transports/http/src/main/java/org/apach
> e/cxf/transport/http/JettyListenerFactory.java
>     
> incubator/cxf/trunk/rt/transports/http/src/main/java/org/apach
> e/cxf/transport/https/JettySslListenerFactory.java
>     
> incubator/cxf/trunk/rt/transports/http/src/test/java/org/apach
> e/cxf/transport/http/TestHttpRequest.java
>     
> incubator/cxf/trunk/rt/transports/http/src/test/java/org/apach
> e/cxf/transport/http/TestHttpResponse.java
>     
> incubator/cxf/trunk/rt/transports/http/src/test/java/org/apach
> e/cxf/transport/https/JettySslListenerFactoryTest.java
> Modified:
>     incubator/cxf/trunk/integration/jca/pom.xml
>     incubator/cxf/trunk/rt/bindings/http/pom.xml
>     incubator/cxf/trunk/rt/databinding/aegis/pom.xml
>     incubator/cxf/trunk/rt/pom.xml
>     incubator/cxf/trunk/rt/transports/http/pom.xml
>     
> incubator/cxf/trunk/rt/transports/http/src/main/java/org/apach
> e/cxf/transport/http/AbstractHTTPDestination.java
>     
> incubator/cxf/trunk/rt/transports/http/src/main/java/org/apach
> e/cxf/transport/http/HTTPConduit.java
>     
> incubator/cxf/trunk/rt/transports/http/src/main/java/org/apach
> e/cxf/transport/http/HTTPTransportFactory.java
>     
> incubator/cxf/trunk/rt/transports/http/src/main/java/org/apach
> e/cxf/transport/http/JettyContextInspector.java
>     
> incubator/cxf/trunk/rt/transports/http/src/main/java/org/apach
> e/cxf/transport/http/JettyHTTPDestination.java
>     
> incubator/cxf/trunk/rt/transports/http/src/main/java/org/apach
> e/cxf/transport/http/JettyHTTPServerEngine.java
>     
> incubator/cxf/trunk/rt/transports/http/src/main/java/org/apach
> e/cxf/transport/http/ServerEngine.java
>     
> incubator/cxf/trunk/rt/transports/http/src/main/java/org/apach
> e/cxf/transport/https/HttpsURLConnectionFactory.java
>     
> incubator/cxf/trunk/rt/transports/http/src/main/java/org/apach
> e/cxf/transport/https/Messages.properties
>     
> incubator/cxf/trunk/rt/transports/http/src/main/java/org/apach
> e/cxf/transport/https/SSLSocketFactoryWrapper.java
>     
> incubator/cxf/trunk/rt/transports/http/src/main/java/org/apach
> e/cxf/transport/https/SSLUtils.java
>     
> incubator/cxf/trunk/rt/transports/http/src/main/java/org/apach
> e/cxf/transport/servlet/CXFServlet.java
>     
> incubator/cxf/trunk/rt/transports/http/src/main/java/org/apach
> e/cxf/transport/servlet/ServletController.java
>     
> incubator/cxf/trunk/rt/transports/http/src/main/java/org/apach
> e/cxf/transport/servlet/ServletDestination.java
>     
> incubator/cxf/trunk/rt/transports/http/src/test/java/org/apach
> e/cxf/transport/http/HTTPConduitTest.java
>     
> incubator/cxf/trunk/rt/transports/http/src/test/java/org/apach
> e/cxf/transport/http/JettyContextInspectorTest.java
>     
> incubator/cxf/trunk/rt/transports/http/src/test/java/org/apach
> e/cxf/transport/http/JettyHTTPDestinationTest.java
>     
> incubator/cxf/trunk/rt/transports/http/src/test/java/org/apach
> e/cxf/transport/https/HttpsURLConnectionFactoryTest.java
>     incubator/cxf/trunk/systests/pom.xml
> 
> Modified: incubator/cxf/trunk/integration/jca/pom.xml
> URL: 
> http://svn.apache.org/viewvc/incubator/cxf/trunk/integration/j
> ca/pom.xml?view=diff&rev=518627&r1=518626&r2=518627
> ==============================================================
> ================
> --- incubator/cxf/trunk/integration/jca/pom.xml (original)
> +++ incubator/cxf/trunk/integration/jca/pom.xml Thu Mar 15 
> 06:44:47 2007
> @@ -88,7 +88,7 @@
>  
>          <dependency>
>              <groupId>org.apache.cxf</groupId>
> -            <artifactId>cxf-rt-transports-http2</artifactId>
> +            <artifactId>cxf-rt-transports-http</artifactId>
>              <version>${project.version}</version>
>          </dependency>
>  
> 
> Modified: incubator/cxf/trunk/rt/bindings/http/pom.xml
> URL: 
> http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/h
> ttp/pom.xml?view=diff&rev=518627&r1=518626&r2=518627
> ==============================================================
> ================
> --- incubator/cxf/trunk/rt/bindings/http/pom.xml (original)
> +++ incubator/cxf/trunk/rt/bindings/http/pom.xml Thu Mar 15 
> 06:44:47 2007
> @@ -55,7 +55,7 @@
>          </dependency>
>          <dependency>
>              <groupId>org.apache.cxf</groupId>
> -            <artifactId>cxf-rt-transports-http2</artifactId>
> +            <artifactId>cxf-rt-transports-http</artifactId>
>              <version>${project.version}</version>
>          </dependency>
>          <dependency>
> 
> Modified: incubator/cxf/trunk/rt/databinding/aegis/pom.xml
> URL: 
> http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/databindin
> g/aegis/pom.xml?view=diff&rev=518627&r1=518626&r2=518627
> ==============================================================
> ================
> --- incubator/cxf/trunk/rt/databinding/aegis/pom.xml (original)
> +++ incubator/cxf/trunk/rt/databinding/aegis/pom.xml Thu Mar 
> 15 06:44:47 2007
> @@ -52,7 +52,7 @@
>      </dependency>
>      <dependency>
>        <groupId>org.apache.cxf</groupId>
> -      <artifactId>cxf-rt-transports-http2</artifactId>
> +      <artifactId>cxf-rt-transports-http</artifactId>
>        <version>${project.version}</version>
>        <scope>test</scope>
>      </dependency>
> 
> Modified: incubator/cxf/trunk/rt/pom.xml
> URL: 
> http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/pom.xml?vi
> ew=diff&rev=518627&r1=518626&r2=518627
> ==============================================================
> ================
> --- incubator/cxf/trunk/rt/pom.xml (original)
> +++ incubator/cxf/trunk/rt/pom.xml Thu Mar 15 06:44:47 2007
> @@ -40,7 +40,7 @@
>          <module>frontend/simple</module>
>          <module>frontend/jaxws</module>
>          <module>frontend/js</module>
> -        <module>transports/http2</module>
> +        <module>transports/http</module>
>          <module>transports/jms</module>
>          <module>ws/policy</module>
>          <module>ws/addr</module>
> 
> Modified: incubator/cxf/trunk/rt/transports/http/pom.xml
> URL: 
> http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports
> /http/pom.xml?view=diff&rev=518627&r1=518626&r2=518627
> ==============================================================
> ================
> --- incubator/cxf/trunk/rt/transports/http/pom.xml (original)
> +++ incubator/cxf/trunk/rt/transports/http/pom.xml Thu Mar 15 
> 06:44:47 2007
> @@ -19,10 +19,10 @@
>  <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>
>      <groupId>org.apache.cxf</groupId>
> -    <artifactId>cxf-rt-transports-http</artifactId>
> +    <artifactId>cxf-rt-transports-http2</artifactId>
>      <packaging>jar</packaging>
>      <version>2.0-incubator-RC-SNAPSHOT</version>
> -    <name>Apache CXF Runtime HTTP transport</name>
> +    <name>Apache CXF Runtime HTTP transport (version2)</name>
>      <url>http://cwiki.apache.org/CXF</url>
>  
>      <parent>
> @@ -50,28 +50,35 @@
>          </dependency>
>          <dependency>
>              <groupId>org.apache.cxf</groupId>
> -            <artifactId>cxf-tools2-common</artifactId>
> +            <artifactId>cxf-rt-core</artifactId>
>              <version>${project.version}</version>
>          </dependency>
>          <dependency>
>              <groupId>org.apache.cxf</groupId>
> -            <artifactId>cxf-rt-core</artifactId>
> +            <artifactId>cxf-tools2-common</artifactId>
>              <version>${project.version}</version>
>          </dependency>
>          <dependency>
> +            <groupId>org.springframework</groupId>
> +            <artifactId>spring-web</artifactId>
> +        </dependency>
> +        <dependency>
>              <groupId>org.apache.cxf</groupId>
>              <artifactId>cxf-testutils</artifactId>
>              <version>${project.version}</version>
>              <scope>test</scope>
>          </dependency>
>          <dependency>
> -            <groupId>jetty</groupId>
> -            <artifactId>org.mortbay.jetty</artifactId>
> +            <groupId>org.mortbay.jetty</groupId>
> +            <artifactId>jetty</artifactId>
> +            <version>6.1.2rc0</version>
>          </dependency>
>          <dependency>
> -            <groupId>org.springframework</groupId>
> -            <artifactId>spring-web</artifactId>
> +            <groupId>org.mortbay.jetty</groupId>
> +            <artifactId>jetty-sslengine</artifactId>
> +            <version>6.1.2rc0</version>
>          </dependency>
> +
>          <dependency>
>              <groupId>org.apache.geronimo.specs</groupId>
>              <artifactId>geronimo-servlet_2.5_spec</artifactId>
> @@ -97,7 +104,7 @@
>                                      <deleteDirs>
>                                          
> <deleteDir>${basedir}/target/generated/src/main/java/org/apach
> e/cxf/wsdl</deleteDir>
>                                      </deleteDirs>
> -                                </xsdOption>
> +                                </xsdOption>                 
>               
>                                  <xsdOption>
>                                      
> <xsd>${basedir}/src/main/resources/schemas/configuration/http-
> listener.xsd</xsd>
>                                      
> <bindingFile>${basedir}/src/main/resources/schemas/wsdl/http-c
> onf.xjb</bindingFile>
> @@ -134,9 +141,10 @@
>      </build>
>  
>  
> +
>      <scm>
> -        
> <connection>scm:svn:http://svn.apache.org/repos/asf/incubator/
> cxf/trunk/rt/transports/http</connection>
> -        
> <developerConnection>scm:svn:https://svn.apache.org/repos/asf/
> incubator/cxf/trunk/rt/transports/http</developerConnection>
> +        
> <connection>scm:svn:http://svn.apache.org/repos/asf/incubator/
> cxf/trunk/rt/transports/http2</connection>
> +        
> <developerConnection>scm:svn:https://svn.apache.org/repos/asf/
> incubator/cxf/trunk/rt/transports/http2</developerConnection>
>      </scm>
>  
>  </project>
> 
> Modified: 
> incubator/cxf/trunk/rt/transports/http/src/main/java/org/apach
> e/cxf/transport/http/AbstractHTTPDestination.java
> URL: 
> http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports
> /http/src/main/java/org/apache/cxf/transport/http/AbstractHTTP
> Destination.java?view=diff&rev=518627&r1=518626&r2=518627
> ==============================================================
> ================
> --- 
> incubator/cxf/trunk/rt/transports/http/src/main/java/org/apach
> e/cxf/transport/http/AbstractHTTPDestination.java (original)
> +++ 
> incubator/cxf/trunk/rt/transports/http/src/main/java/org/apach
> e/cxf/transport/http/AbstractHTTPDestination.java Thu Mar 15 
> 06:44:47 2007
> @@ -20,14 +20,24 @@
>  package org.apache.cxf.transport.http;
>  
>  import java.io.IOException;
> +import java.io.OutputStream;
>  import java.net.HttpURLConnection;
>  import java.net.URL;
> +import java.util.ArrayList;
>  import java.util.Arrays;
> +import java.util.Enumeration;
>  import java.util.HashMap;
> +import java.util.Iterator;
>  import java.util.List;
>  import java.util.Map;
> +import java.util.logging.Level;
> +import java.util.logging.Logger;
> +
> +import javax.servlet.http.HttpServletRequest;
> +import javax.servlet.http.HttpServletResponse;
>  
>  import org.apache.cxf.Bus;
> +import org.apache.cxf.common.logging.LogUtils;
>  import org.apache.cxf.common.util.Base64Exception;
>  import org.apache.cxf.common.util.Base64Utility;
>  import org.apache.cxf.common.util.StringUtils;
> @@ -36,9 +46,11 @@
>  import org.apache.cxf.configuration.security.SSLServerPolicy;
>  import org.apache.cxf.helpers.CastUtils;
>  import org.apache.cxf.helpers.HttpHeaderHelper;
> +import org.apache.cxf.io.AbstractWrappedOutputStream;
>  import org.apache.cxf.message.Message;
>  import org.apache.cxf.service.model.EndpointInfo;
>  import org.apache.cxf.transport.AbstractDestination;
> +import org.apache.cxf.transport.Conduit;
>  import org.apache.cxf.transport.ConduitInitiator;
>  import org.apache.cxf.transports.http.configuration.HTTPServerPolicy;
>  import org.apache.cxf.ws.addressing.EndpointReferenceType;
> @@ -48,6 +60,11 @@
>   */
>  public abstract class AbstractHTTPDestination extends 
> AbstractDestination implements Configurable {
>      
> +    public static final String HTTP_REQUEST = "HTTP.REQUEST";
> +    public static final String HTTP_RESPONSE = "HTTP.RESPONSE";
> +    
> +    private static final Logger LOG = 
> LogUtils.getL7dLogger(JettyHTTPDestination.class);
> +    
>      private static final long serialVersionUID = 1L;
>  
>      protected final Bus bus;
> @@ -147,9 +164,51 @@
>       * @param message the current message
>       * @param headers the current set of headers
>       */
> -    protected abstract void copyRequestHeaders(Message message,
> -                                               Map<String, 
> List<String>> headers);
> +    protected void copyRequestHeaders(Message message, 
> Map<String, List<String>> headers) {
> +        HttpServletRequest req = 
> (HttpServletRequest)message.get(HTTP_REQUEST);
> +        //TODO how to deal with the fields        
> +        for (Enumeration e = req.getHeaderNames(); 
> e.hasMoreElements();) {
> +            String fname = (String)e.nextElement();
> +            List<String> values;
> +            if (headers.containsKey(fname)) {
> +                values = headers.get(fname);
> +            } else {
> +                values = new ArrayList<String>();
> +                
> headers.put(HttpHeaderHelper.getHeaderKey(fname), values);
> +            }
> +            for (Enumeration e2 = req.getHeaders(fname); 
> e2.hasMoreElements();) {
> +                String val = (String)e2.nextElement();
> +                values.add(val);
> +            }
> +        }
> +    }
>  
> +    /**
> +     * Copy the response headers into the response.
> +     * 
> +     * @param message the current message
> +     * @param headers the current set of headers
> +     */
> +    protected void copyResponseHeaders(Message message, 
> HttpServletResponse response) {
> +        Map<?, ?> headers = (Map<?, 
> ?>)message.get(Message.PROTOCOL_HEADERS);
> +        if (null != headers) {
> +            
> +            if (!headers.containsKey(Message.CONTENT_TYPE)) {
> +                response.setContentType((String) 
> message.get(Message.CONTENT_TYPE));
> +            }
> +            
> +            for (Iterator<?> iter = 
> headers.keySet().iterator(); iter.hasNext();) {
> +                String header = (String)iter.next();
> +                List<?> headerList = (List<?>)headers.get(header);
> +                for (Object value : headerList) {
> +                    response.addHeader(header, (String)value);
> +                }
> +            }
> +        } else {
> +            response.setContentType((String) 
> message.get(Message.CONTENT_TYPE));
> +        }
> +    }
> +    
>      protected static EndpointInfo 
> getAddressValue(EndpointInfo ei) {       
>          return getAddressValue(ei, true);
>      } 
> @@ -157,9 +216,18 @@
>      protected static EndpointInfo 
> getAddressValue(EndpointInfo ei, boolean dp) {       
>          if (dp) {
>              
> ei.setAddress(StringUtils.addDefaultPortIfMissing(ei.getAddress()));
> -        }
> +        } 
>          return ei;
> -    }  
> +    }
> +    
> +    /**
> +     * @param inMessage the incoming message
> +     * @return the inbuilt backchannel
> +     */
> +    protected Conduit getInbuiltBackChannel(Message inMessage) {
> +        HttpServletResponse response = 
> (HttpServletResponse)inMessage.get(HTTP_RESPONSE);
> +        return new BackChannelConduit(response);
> +    }
>      
>      /**
>       * Mark message as a partial message.
> @@ -208,11 +276,119 @@
>                          Arrays.asList(new String[] {"close"}));
>          }
>          
> +    
> +        
>      /*
>       * TODO - hook up these policies
>      <xs:attribute name="SuppressClientSendErrors" 
> type="xs:boolean" use="optional" default="false">
>      <xs:attribute name="SuppressClientReceiveErrors" 
> type="xs:boolean" use="optional" default="false">
>      */
> +    }
> +  
> +   
> +    protected OutputStream flushHeaders(Message outMessage) 
> throws IOException {
> +        updateResponseHeaders(outMessage);
> +        Object responseObj = outMessage.get(HTTP_RESPONSE);
> +        OutputStream responseStream = null;
> +        if (responseObj instanceof HttpServletResponse) {
> +            HttpServletResponse response = 
> (HttpServletResponse)responseObj;
> +
> +            Integer i = 
> (Integer)outMessage.get(Message.RESPONSE_CODE);
> +            if (i != null) {
> +                int status = i.intValue();               
> +                response.setStatus(status);
> +            } else {
> +                response.setStatus(HttpURLConnection.HTTP_OK);
> +            }
> +
> +            copyResponseHeaders(outMessage, response);
> +            responseStream = response.getOutputStream();
> +
> +            if (isOneWay(outMessage)) {
> +                response.flushBuffer();
> +            }
> +        } else if (null != responseObj) {
> +            String m = (new 
> org.apache.cxf.common.i18n.Message("UNEXPECTED_RESPONSE_TYPE_MSG",
> +                LOG, responseObj.getClass())).toString();
> +            LOG.log(Level.WARNING, m);
> +            throw new IOException(m);   
> +        } else {
> +            String m = (new 
> org.apache.cxf.common.i18n.Message("NULL_RESPONSE_MSG", 
> LOG)).toString();
> +            LOG.log(Level.WARNING, m);
> +            throw new IOException(m);
> +        }
> +
> +        if (isOneWay(outMessage)) {
> +            outMessage.remove(HTTP_RESPONSE);
> +        }
> +        return responseStream;
> +    }
> +    
> +    /**
> +     * Backchannel conduit.
> +     */
> +    protected class BackChannelConduit
> +        extends AbstractDestination.AbstractBackChannelConduit {
> +
> +        protected HttpServletResponse response;
> +
> +        BackChannelConduit(HttpServletResponse resp) {
> +            response = resp;
> +        }
> +
> +        /**
> +         * Send an outbound message, assumed to contain all 
> the name-value
> +         * mappings of the corresponding input message (if any). 
> +         * 
> +         * @param message the message to be sent.
> +         */
> +        public void send(Message message) throws IOException {
> +            message.put(HTTP_RESPONSE, response);
> +            message.setContent(OutputStream.class, new 
> WrappedOutputStream(message, response));
> +        }
> +    }
> +
> +    /**
> +     * Wrapper stream responsible for flushing headers and 
> committing outgoing
> +     * HTTP-level response.
> +     */
> +    private class WrappedOutputStream extends 
> AbstractWrappedOutputStream {
> +
> +        protected HttpServletResponse response;
> +
> +        WrappedOutputStream(Message m, HttpServletResponse resp) {
> +            super(m);
> +            response = resp;
> +        }
> +
> +        /**
> +         * Perform any actions required on stream flush 
> (freeze headers,
> +         * reset output stream ... etc.)
> +         */
> +        protected void doFlush() throws IOException {
> +            OutputStream responseStream = flushHeaders(outMessage);
> +            if (null != responseStream && !alreadyFlushed()) {
> +                resetOut(responseStream, true);
> +            }
> +        }
> +
> +        /**
> +         * Perform any actions required on stream closure 
> (handle response etc.)
> +         */
> +        protected void doClose() {
> +            commitResponse();
> +        }
> +
> +        protected void onWrite() throws IOException {
> +        }
> +
> +        private void commitResponse() {
> +            try {
> +                response.flushBuffer();
> +            } catch (IOException e) {
> +                e.printStackTrace();
> +            }
> +        }
>      }
>  
>      boolean contextMatchOnExact() {
> 
> Modified: 
> incubator/cxf/trunk/rt/transports/http/src/main/java/org/apach
> e/cxf/transport/http/HTTPConduit.java
> URL: 
> http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports
> /http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.
> java?view=diff&rev=518627&r1=518626&r2=518627
> ==============================================================
> ================
> --- 
> incubator/cxf/trunk/rt/transports/http/src/main/java/org/apach
> e/cxf/transport/http/HTTPConduit.java (original)
> +++ 
> incubator/cxf/trunk/rt/transports/http/src/main/java/org/apach
> e/cxf/transport/http/HTTPConduit.java Thu Mar 15 06:44:47 2007
> @@ -60,16 +60,15 @@
>  
>  import static 
> org.apache.cxf.message.Message.DECOUPLED_CHANNEL_MESSAGE;
>  
> +
>  /**
>   * HTTP Conduit implementation.
>   */
> -public class HTTPConduit extends AbstractConduit implements 
> Configurable {
> -    public static final String HTTP_REQUEST = 
> "org.apache.cxf.transport.http.JettyHTTPDestination.REQUEST";
> -    public static final String HTTP_RESPONSE = 
> "org.apache.cxf.transport.http.JettyHTTPDestination.RESPONSE";
> +public class HTTPConduit extends AbstractConduit implements 
> Configurable {   
>      public static final String HTTP_CONNECTION = "http.connection";
>      private static final Logger LOG = 
> LogUtils.getL7dLogger(HTTPConduit.class);
>      
> -    private final Bus bus;
> +    private final Bus bus;    
>      private final URLConnectionFactory alternateConnectionFactory;
>      private URLConnectionFactory connectionFactory;
>      private URL url;
> @@ -84,7 +83,7 @@
>      private AuthorizationPolicy authorization;
>      private AuthorizationPolicy proxyAuthorization;
>      private SSLClientPolicy sslClient;
> -
> +    
>  
>      /**
>       * Constructor
> @@ -98,7 +97,7 @@
>               ei,
>               null);
>      }
> -    
> +
>      /**
>       * Constructor
>       * 
> @@ -140,21 +139,18 @@
>                : new URL(t.getAddress().getValue());
>      }
>  
> +
>      protected Logger getLogger() {
>          return LOG;
>      }
> -
>      
> -    /**
> -     * Post-configure retreival of connection factory.
> -     */
>      protected void retrieveConnectionFactory() {
>          connectionFactory = alternateConnectionFactory != null
>                              ? alternateConnectionFactory
>                              : 
> HTTPTransportFactory.getConnectionFactory(
> -                                  getSslClient());
> +                                getSslClient());
>      }
> -        
> +   
>      /**
>       * Send an outbound message.
>       * 
> @@ -162,7 +158,7 @@
>       */
>      public void send(Message message) throws IOException {
>          Map<String, List<String>> headers = setHeaders(message);
> -        URL currentURL = setupURL(message);
> +        URL currentURL = setupURL(message);        
>          URLConnection connection = 
>              connectionFactory.createConnection(getProxy(), 
> currentURL);
>          connection.setDoOutput(true);        
> @@ -186,7 +182,7 @@
>              } else {
>                  hc.setInstanceFollowRedirects(false);
>                  if (!hc.getRequestMethod().equals("GET")
> -                        && getClient().isAllowChunking()) {
> +                    && getClient().isAllowChunking()) {
>                      hc.setChunkedStreamingMode(2048);
>                  }
>              }
> @@ -220,15 +216,14 @@
>       * @return the backchannel Destination (or null if the 
> backchannel is
>       * built-in)
>       */
> -    @Override
>      public synchronized Destination getBackChannel() {
>          if (decoupledDestination == null
> -            && getClient().getDecoupledEndpoint() != null) {
> +            &&  getClient().getDecoupledEndpoint() != null) {
>              setUpDecoupledDestination(); 
>          }
>          return decoupledDestination;
>      }
> -    
> +
>      /**
>       * Close the conduit
>       */
> @@ -402,7 +397,7 @@
>      }
>  
>      private void initConfig() {
> -        // Initialize some default values for the configuration
> +        //Initialize some default values for the configuration
>          client = endpointInfo.getTraversedExtensor(new 
> HTTPClientPolicy(), HTTPClientPolicy.class);
>          authorization = 
> endpointInfo.getTraversedExtensor(new AuthorizationPolicy(),
>                                                            
> AuthorizationPolicy.class);
> @@ -632,7 +627,7 @@
>              incomingObserver.onMessage(inMessage);
>          }
>      }
> -       
> +    
>      /**
>       * Used to set appropriate message properties, exchange etc.
>       * as required for an incoming decoupled response (as opposed
> @@ -655,11 +650,12 @@
>              inMessage.put(Message.RESPONSE_CODE, 
> HttpURLConnection.HTTP_OK);
>  
>              // remove server-specific properties
> -            inMessage.remove(HTTP_REQUEST);
> -            inMessage.remove(HTTP_RESPONSE);
> +            inMessage.remove(AbstractHTTPDestination.HTTP_REQUEST);
> +            inMessage.remove(AbstractHTTPDestination.HTTP_RESPONSE);
>              inMessage.remove(Message.ASYNC_POST_RESPONSE_DISPATCH);
>  
>              incomingObserver.onMessage(inMessage);
>          }
>      }
> +    
>  }
> 
> Modified: 
> incubator/cxf/trunk/rt/transports/http/src/main/java/org/apach
> e/cxf/transport/http/HTTPTransportFactory.java
> URL: 
> http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports
> /http/src/main/java/org/apache/cxf/transport/http/HTTPTranspor
> tFactory.java?view=diff&rev=518627&r1=518626&r2=518627
> ==============================================================
> ================
> --- 
> incubator/cxf/trunk/rt/transports/http/src/main/java/org/apach
> e/cxf/transport/http/HTTPTransportFactory.java (original)
> +++ 
> incubator/cxf/trunk/rt/transports/http/src/main/java/org/apach
> e/cxf/transport/http/HTTPTransportFactory.java Thu Mar 15 
> 06:44:47 2007
> @@ -50,11 +50,12 @@
>  import org.apache.cxf.transport.DestinationFactory;
>  import org.apache.cxf.transport.DestinationFactoryManager;
>  import org.apache.cxf.transport.https.HttpsURLConnectionFactory;
> -import org.apache.cxf.transport.https.JettySslListenerFactory;
> +import org.apache.cxf.transport.https.JettySslConnectorFactory;
>  import org.apache.cxf.ws.addressing.EndpointReferenceType;
>  import org.apache.cxf.wsdl11.WSDLEndpointFactory;
> -import org.mortbay.http.SocketListener;
> -import org.mortbay.util.InetAddrPort;
> +import org.mortbay.jetty.AbstractConnector;
> +//import org.mortbay.jetty.bio.SocketConnector;
> +import org.mortbay.jetty.nio.SelectChannelConnector;
>  import org.xmlsoap.schemas.wsdl.http.AddressType;
>  
>  public class HTTPTransportFactory extends 
> AbstractTransportFactory implements ConduitInitiator,
> @@ -99,8 +100,7 @@
>              for (String ns : activationNamespaces) {
>                  dfm.registerDestinationFactory(ns, this);
>              }
> -        }       
> -       
> +        }
>      }
>  
>      public Conduit getConduit(EndpointInfo endpointInfo) 
> throws IOException {
> @@ -118,7 +118,7 @@
>      public Destination getDestination(EndpointInfo 
> endpointInfo) throws IOException {
>          JettyHTTPDestination destination = new 
> JettyHTTPDestination(bus, this, endpointInfo);
>          configure(destination);
> -        destination.retrieveEngine();
> +        destination.retrieveEngine();        
>          return destination;
>      }
>  
> @@ -165,21 +165,24 @@
>                 ? new URLConnectionFactory() {
>                         public URLConnection 
> createConnection(Proxy proxy, URL u)
>                             throws IOException {
> -                           return proxy != null
> +                           return proxy != null 
>                                    ? u.openConnection(proxy)
>                                    : u.openConnection();
>                         }
>                     }
>                 : new HttpsURLConnectionFactory(policy);
>      }
> -
> -    protected static JettyListenerFactory 
> getListenerFactory(SSLServerPolicy policy) {
> +    
> +    protected static JettyConnectorFactory 
> getConnectorFactory(SSLServerPolicy policy) {
>          return policy == null
> -               ? new JettyListenerFactory() {
> -                       public SocketListener 
> createListener(int port) {
> -                           return new SocketListener(new 
> InetAddrPort(port));
> -                       }
> +               ? new JettyConnectorFactory() {                     
> +                   public AbstractConnector 
> createConnector(int port) {
> +                       SelectChannelConnector result = new 
> SelectChannelConnector();
> +                       //SocketConnector result = new 
> SocketConnector();
> +                       result.setPort(port);
> +                       return result;
>                     }
> -               : new JettySslListenerFactory(policy);
> +               }
> +               : new JettySslConnectorFactory(policy);
>      }
>  }
> 
> Modified: 
> incubator/cxf/trunk/rt/transports/http/src/main/java/org/apach
> e/cxf/transport/http/JettyContextInspector.java
> URL: 
> http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports
> /http/src/main/java/org/apache/cxf/transport/http/JettyContext
> Inspector.java?view=diff&rev=518627&r1=518626&r2=518627
> ==============================================================
> ================
> --- 
> incubator/cxf/trunk/rt/transports/http/src/main/java/org/apach
> e/cxf/transport/http/JettyContextInspector.java (original)
> +++ 
> incubator/cxf/trunk/rt/transports/http/src/main/java/org/apach
> e/cxf/transport/http/JettyContextInspector.java Thu Mar 15 
> 06:44:47 2007
> @@ -20,13 +20,13 @@
>  package org.apache.cxf.transport.http;
>  
>  import org.apache.cxf.endpoint.ContextInspector;
> -import org.mortbay.http.HttpContext;
> +import org.mortbay.jetty.handler.ContextHandler;
>  
>  public class JettyContextInspector implements ContextInspector {
>      
>      public String getAddress(Object serverContext) {
> -        if 
> (HttpContext.class.isAssignableFrom(serverContext.getClass())) {
> -            return ((HttpContext)serverContext).getContextPath();
> +        if 
> (ContextHandler.class.isAssignableFrom(serverContext.getClass())) {
> +            return ((ContextHandler)serverContext).getContextPath();
>          } else {
>              return null;
>          }
> 
> Modified: 
> incubator/cxf/trunk/rt/transports/http/src/main/java/org/apach
> e/cxf/transport/http/JettyHTTPDestination.java
> URL: 
> http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports
> /http/src/main/java/org/apache/cxf/transport/http/JettyHTTPDes
> tination.java?view=diff&rev=518627&r1=518626&r2=518627
> ==============================================================
> ================
> --- 
> incubator/cxf/trunk/rt/transports/http/src/main/java/org/apach
> e/cxf/transport/http/JettyHTTPDestination.java (original)
> +++ 
> incubator/cxf/trunk/rt/transports/http/src/main/java/org/apach
> e/cxf/transport/http/JettyHTTPDestination.java Thu Mar 15 
> 06:44:47 2007
> @@ -21,42 +21,34 @@
>  
>  import java.io.IOException;
>  import java.io.InputStream;
> -import java.io.OutputStream;
> -import java.net.HttpURLConnection;
>  import java.net.URL;
> -import java.util.ArrayList;
> -import java.util.Enumeration;
> -import java.util.Iterator;
> -import java.util.List;
> -import java.util.Map;
> +
>  import java.util.logging.Level;
>  import java.util.logging.Logger;
>  
> +import javax.servlet.http.HttpServletRequest;
> +import javax.servlet.http.HttpServletResponse;
> +
>  import org.apache.cxf.Bus;
>  import org.apache.cxf.common.logging.LogUtils;
>  import org.apache.cxf.common.util.StringUtils;
> -import org.apache.cxf.helpers.HttpHeaderHelper;
> -import org.apache.cxf.io.AbstractWrappedOutputStream;
>  import org.apache.cxf.message.Message;
>  import org.apache.cxf.message.MessageImpl;
>  import org.apache.cxf.service.model.EndpointInfo;
> -import org.apache.cxf.transport.AbstractDestination;
> -import org.apache.cxf.transport.Conduit;
>  import org.apache.cxf.transport.ConduitInitiator;
>  import org.apache.cxf.transport.https.SSLUtils;
>  import org.apache.cxf.transports.http.QueryHandler;
>  import org.apache.cxf.transports.http.QueryHandlerRegistry;
> -import org.mortbay.http.HttpRequest;
> -import org.mortbay.http.HttpResponse;
> -import org.mortbay.http.handler.AbstractHttpHandler;
> -
> -public class JettyHTTPDestination extends AbstractHTTPDestination {
> -   
> -    public static final String HTTP_REQUEST = 
> JettyHTTPDestination.class.getName() + ".REQUEST";
> -    public static final String HTTP_RESPONSE = 
> JettyHTTPDestination.class.getName() + ".RESPONSE";
> +import org.mortbay.jetty.HttpConnection;
> +import org.mortbay.jetty.Request;
> +import org.mortbay.jetty.handler.AbstractHandler;
> +
> +
> +public class JettyHTTPDestination extends 
> AbstractHTTPDestination {    
>      
> -    private static final Logger LOG = 
> LogUtils.getL7dLogger(JettyHTTPDestination.class);
>  
> +    private static final Logger LOG = 
> LogUtils.getL7dLogger(JettyHTTPDestination.class);
> +    
>      protected ServerEngine engine;
>      protected ServerEngine alternateEngine;
>  
> @@ -83,7 +75,6 @@
>       */
>      public JettyHTTPDestination(Bus b, ConduitInitiator ci, 
> EndpointInfo endpointInfo, ServerEngine eng)
>          throws IOException {
> -        //Add the defualt port if the address is missing it
>          super(b, ci, endpointInfo, true);
>          alternateEngine = eng;
>      }
> @@ -103,7 +94,8 @@
>                                                      nurl.getPort(),
>                                                      getSslServer());
>      }
> -    
> +
> +      
>      /**
>       * Activate receipt of incoming messages.
>       */
> @@ -111,48 +103,43 @@
>          LOG.log(Level.FINE, "Activating receipt of incoming 
> messages");
>          try {
>              URL url = new URL(endpointInfo.getAddress());
> +            //The handler is bind with the context, 
> +            //TODO we need to set the things on on context
>              if (contextMatchOnExact()) {
> -                engine.addServant(url, new AbstractHttpHandler() {
> -                    public void handle(String pathInContext, 
> String pathParams, HttpRequest req,
> -                                       HttpResponse resp) 
> throws IOException {
> -                        if (pathInContext.equals(getName())) {
> -                            doService(req, resp);
> -                        }
> +                engine.addServant(url, new AbstractHandler() {
> +                    public void handle(String target, 
> HttpServletRequest req,
> +                                       HttpServletResponse 
> resp, int dispatch) throws IOException {
> +                        //if (target.equals(getName())) {
> +                        doService(req, resp);
> +                        //}
>                      }
>                  });
>              } else {
> -                engine.addServant(url, new AbstractHttpHandler() {
> -                    public void handle(String pathInContext, 
> String pathParams, HttpRequest req,
> -                                       HttpResponse resp) 
> throws IOException {                            
> -                        if (pathInContext.startsWith(getName())) {
> -                            doService(req, resp);
> -                        }
> -                    }
> +                engine.addServant(url, new AbstractHandler() {
> +                    public void handle(String target,  
> HttpServletRequest req,
> +                                       HttpServletResponse 
> resp, int dispatch) throws IOException {
> +                        //if (target.startsWith(getName())) {
> +                        doService(req, resp);
> +                        //}
> +                    }                        
>                  });
>              }
>          } catch (Exception e) {
>              LOG.log(Level.WARNING, "URL creation failed: ", e);
>          }
> +    
>      }
>  
>      /**
>       * Deactivate receipt of incoming messages.
>       */
>      protected void deactivate() {
> -        LOG.log(Level.FINE, "Deactivating receipt of 
> incoming messages");
> -        engine.removeServant(nurl);   
> -    }
> -    
> -    /**
> -     * @param inMessage the incoming message
> -     * @return the inbuilt backchannel
> -     */
> -    protected Conduit getInbuiltBackChannel(Message inMessage) {
> -        HttpResponse response = 
> (HttpResponse)inMessage.get(HTTP_RESPONSE);
> -        return new BackChannelConduit(response);
> +        LOG.log(Level.INFO, "Deactivating receipt of 
> incoming messages");
> +        engine.removeServant(nurl);        
>      }
> -   
> + 
>  
> +    
>      /**
>       * @return the associated conduit initiator
>       */
> @@ -160,75 +147,27 @@
>          return conduitInitiator;
>      }
>  
> -    /**
> -     * Copy the request headers into the message.
> -     * 
> -     * @param message the current message
> -     * @param headers the current set of headers
> -     */
> -    protected void copyRequestHeaders(Message message, 
> Map<String, List<String>> headers) {
> -        HttpRequest req = (HttpRequest)message.get(HTTP_REQUEST);
> -        for (Enumeration e = req.getFieldNames(); 
> e.hasMoreElements();) {
> -            String fname = (String)e.nextElement();
> -            List<String> values;
> -            if (headers.containsKey(fname)) {
> -                values = headers.get(fname);
> -            } else {
> -                values = new ArrayList<String>();
> -                
> headers.put(HttpHeaderHelper.getHeaderKey(fname), values);
> -            }
> -            for (Enumeration e2 = req.getFieldValues(fname); 
> e2.hasMoreElements();) {
> -                String val = (String)e2.nextElement();
> -                values.add(val);
> -            }
> -        }
> -    }
> -
> -    /**
> -     * Copy the response headers into the response.
> -     * 
> -     * @param message the current message
> -     * @param headers the current set of headers
> -     */
> -    protected void copyResponseHeaders(Message message, 
> HttpResponse response) {
> -        Map<?, ?> headers = (Map<?, 
> ?>)message.get(Message.PROTOCOL_HEADERS);
> -        if (null != headers) {
> -            
> -            if (!headers.containsKey(Message.CONTENT_TYPE)) {
> -                response.setContentType((String) 
> message.get(Message.CONTENT_TYPE));
> -            }
> -            
> -            for (Iterator<?> iter = 
> headers.keySet().iterator(); iter.hasNext();) {
> -                String header = (String)iter.next();
> -                List<?> headerList = (List<?>)headers.get(header);
> -                for (Object value : headerList) {
> -                    response.addField(header, (String)value);
> -                }
> -            }
> -        } else {
> -            response.setContentType((String) 
> message.get(Message.CONTENT_TYPE));
> -        }
> -    }
> -
> -    protected void doService(HttpRequest req, HttpResponse 
> resp) throws IOException {
> +    
> +    protected void doService(HttpServletRequest req, 
> HttpServletResponse resp) throws IOException {
> +        Request baseRequest = (req instanceof Request) 
> +            ? (Request)req : 
> HttpConnection.getCurrentConnection().getRequest();
> +        
>          if (getServer().isSetRedirectURL()) {
>              resp.sendRedirect(getServer().getRedirectURL());
> -            resp.commit();
> -            req.setHandled(true);
> +            resp.flushBuffer();
> +            baseRequest.setHandled(true);
>              return;
>          }
> +        
>          QueryHandlerRegistry queryHandlerRegistry = 
> bus.getExtension(QueryHandlerRegistry.class);
>          if (queryHandlerRegistry != null) { 
>              for (QueryHandler qh : 
> queryHandlerRegistry.getHandlers()) {
> -                if 
> (qh.isRecognizedQuery(req.getURI().toString(), endpointInfo)) {
> -                    if 
> (resp.getField(HttpHeaderHelper.CONTENT_TYPE) == null) {
> -                        resp.addField(HttpHeaderHelper.CONTENT_TYPE, 
> -                                      
> qh.getResponseContentType(req.getURI().toString()));
> -                    }
> -                    
> qh.writeResponse(req.getURI().toString(), endpointInfo, 
> resp.getOutputStream());
> -                    resp.getOutputStream().flush(); 
> -                    resp.commit();
> -                    req.setHandled(true);
> +                String requestURL = req.getPathInfo() + "?" 
> + req.getQueryString();
> +                if (qh.isRecognizedQuery(requestURL, endpointInfo)) {
> +                    
> resp.setContentType(qh.getResponseContentType(requestURL));
> +                    qh.writeResponse(requestURL, 
> endpointInfo, resp.getOutputStream());
> +                    resp.getOutputStream().flush();          
>            
> +                    baseRequest.setHandled(true);
>                      return;
>                  }
>              }
> @@ -238,26 +177,29 @@
>          serviceRequest(req, resp);
>      }
>  
> -    protected void serviceRequest(final HttpRequest req, 
> final HttpResponse resp)
> +    protected void serviceRequest(HttpServletRequest req, 
> HttpServletResponse resp)
>          throws IOException {
> +        Request baseRequest = (req instanceof Request) 
> +            ? (Request)req : 
> HttpConnection.getCurrentConnection().getRequest();
>          try {
>              if (LOG.isLoggable(Level.FINE)) {
>                  LOG.fine("Service http request on thread: " 
> + Thread.currentThread());
>              }
>  
> -            MessageImpl inMessage = new MessageImpl();
> -            inMessage.setContent(InputStream.class, 
> req.getInputStream());
> +            MessageImpl inMessage = new MessageImpl();            
>              inMessage.put(HTTP_REQUEST, req);
> -            inMessage.put(HTTP_RESPONSE, resp);
> +            inMessage.put(HTTP_RESPONSE, resp);            
>              inMessage.put(Message.HTTP_REQUEST_METHOD, 
> req.getMethod());
> -            inMessage.put(Message.PATH_INFO, req.getPath());
> -            inMessage.put(Message.QUERY_STRING, req.getQuery());
> +            inMessage.put(Message.PATH_INFO, 
> req.getContextPath() + req.getPathInfo());            
> +            inMessage.put(Message.QUERY_STRING, 
> req.getQueryString());
>              inMessage.put(Message.CONTENT_TYPE, 
> req.getContentType());
> +            inMessage.setContent(InputStream.class, 
> req.getInputStream());
>              if (!StringUtils.isEmpty(endpointInfo.getAddress())) {
>                  inMessage.put(Message.BASE_PATH, new 
> URL(endpointInfo.getAddress()).getPath());
>              }
>              inMessage.put(Message.FIXED_PARAMETER_ORDER, 
> isFixedParameterOrder());
> -            
> inMessage.put(Message.ASYNC_POST_RESPONSE_DISPATCH, Boolean.TRUE);
> +            
> inMessage.put(Message.ASYNC_POST_RESPONSE_DISPATCH, Boolean.TRUE); 
> +            
>              setHeaders(inMessage);
>              inMessage.setDestination(this);
>              
> @@ -265,126 +207,12 @@
>  
>              incomingObserver.onMessage(inMessage);
>  
> -            resp.commit();
> -            req.setHandled(true);
> +            resp.flushBuffer();
> +            baseRequest.setHandled(true);
>          } finally {
>              if (LOG.isLoggable(Level.FINE)) {
>                  LOG.fine("Finished servicing http request on 
> thread: " + Thread.currentThread());
>              }
>          }
> -    }
> -
> -    protected OutputStream flushHeaders(Message outMessage) 
> throws IOException {
> -        updateResponseHeaders(outMessage);
> -        Object responseObj = outMessage.get(HTTP_RESPONSE);
> -        OutputStream responseStream = null;
> -        if (responseObj instanceof HttpResponse) {
> -            HttpResponse response = (HttpResponse)responseObj;
> -
> -            Integer i = 
> (Integer)outMessage.get(Message.RESPONSE_CODE);
> -            if (i != null) {
> -                int status = i.intValue();
> -                /*if (status == 
> HttpURLConnection.HTTP_INTERNAL_ERROR) {
> -                    response.setStatus(status, "Fault Occurred");
> -                } else if (status == 
> HttpURLConnection.HTTP_ACCEPTED) {
> -                    response.setStatus(status, "Accepted");
> -                } else {
> -                    response.setStatus(status);
> -                }*/
> -                response.setStatus(status);
> -            } else {
> -                response.setStatus(HttpURLConnection.HTTP_OK);
> -            }
> -
> -            copyResponseHeaders(outMessage, response);
> -            responseStream = response.getOutputStream();
> -
> -            if (isOneWay(outMessage)) {
> -                response.commit();
> -            }
> -        } else if (null != responseObj) {
> -            String m = (new 
> org.apache.cxf.common.i18n.Message("UNEXPECTED_RESPONSE_TYPE_MSG",
> -                LOG, responseObj.getClass())).toString();
> -            LOG.log(Level.WARNING, m);
> -            throw new IOException(m);   
> -        } else {
> -            String m = (new 
> org.apache.cxf.common.i18n.Message("NULL_RESPONSE_MSG", 
> LOG)).toString();
> -            LOG.log(Level.WARNING, m);
> -            throw new IOException(m);            
> -        }
> -
> -        if (isOneWay(outMessage)) {
> -            outMessage.remove(HTTP_RESPONSE);
> -        }
> -        return responseStream;
> -    }
> -
> -    /**
> -     * Backchannel conduit.
> -     */
> -    protected class BackChannelConduit 
> -        extends AbstractDestination.AbstractBackChannelConduit {
> -
> -        protected HttpResponse response;
> -
> -        BackChannelConduit(HttpResponse resp) {
> -            response = resp;
> -        }
> -
> -        /**
> -         * Send an outbound message, assumed to contain all 
> the name-value
> -         * mappings of the corresponding input message (if any). 
> -         * 
> -         * @param message the message to be sent.
> -         */
> -        public void send(Message message) throws IOException {
> -            message.put(HTTP_RESPONSE, response);
> -            message.setContent(OutputStream.class, new 
> WrappedOutputStream(message, response));
> -        }
> -    }
> -
> -    /**
> -     * Wrapper stream responsible for flushing headers and 
> committing outgoing
> -     * HTTP-level response.
> -     */
> -    private class WrappedOutputStream extends 
> AbstractWrappedOutputStream {
> -
> -        protected HttpResponse response;
> -
> -        WrappedOutputStream(Message m, HttpResponse resp) {
> -            super(m);
> -            response = resp;
> -        }
> -
> -        /**
> -         * Perform any actions required on stream flush 
> (freeze headers,
> -         * reset output stream ... etc.)
> -         */
> -        protected void doFlush() throws IOException {
> -            if (!alreadyFlushed()) {
> -                OutputStream responseStream = 
> flushHeaders(outMessage);
> -                if (null != responseStream) {
> -                    resetOut(responseStream, true);
> -                }
> -            }
> -        }
> -
> -        /**
> -         * Perform any actions required on stream closure 
> (handle response etc.)
> -         */
> -        protected void doClose() {
> -            commitResponse();
> -        }
> -
> -        protected void onWrite() throws IOException {
> -        }
> -
> -        private void commitResponse() {
> -            try {
> -                response.commit();
> -            } catch (IOException e) {
> -                e.printStackTrace();
> -            }
> -        }
> -    }
> +    } 
>  }
> 
> Modified: 
> incubator/cxf/trunk/rt/transports/http/src/main/java/org/apach
> e/cxf/transport/http/JettyHTTPServerEngine.java
> URL: 
> http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports
> /http/src/main/java/org/apache/cxf/transport/http/JettyHTTPSer
> verEngine.java?view=diff&rev=518627&r1=518626&r2=518627
> ==============================================================
> ================
> --- 
> incubator/cxf/trunk/rt/transports/http/src/main/java/org/apach
> e/cxf/transport/http/JettyHTTPServerEngine.java (original)
> +++ 
> incubator/cxf/trunk/rt/transports/http/src/main/java/org/apach
> e/cxf/transport/http/JettyHTTPServerEngine.java Thu Mar 15 
> 06:44:47 2007
> @@ -25,29 +25,35 @@
>  import java.util.Map;
>  
>  import org.apache.cxf.Bus;
> +import org.apache.cxf.configuration.Configurable;
>  import org.apache.cxf.configuration.Configurer;
>  import org.apache.cxf.configuration.security.SSLServerPolicy;
>  import org.apache.cxf.transport.HttpUriMapper;
>  import org.apache.cxf.transport.http.listener.HTTPListenerConfigBean;
>  import 
> org.apache.cxf.transports.http.configuration.HTTPListenerPolicy;
> -import org.mortbay.http.HttpContext;
> -import org.mortbay.http.HttpHandler;
> -import org.mortbay.http.HttpServer;
> -import org.mortbay.http.SocketListener;
> -import org.mortbay.http.handler.AbstractHttpHandler;
> +import org.mortbay.jetty.AbstractConnector;
> +import org.mortbay.jetty.Handler;
> +import org.mortbay.jetty.Server;
> +import org.mortbay.jetty.handler.AbstractHandler;
> +import org.mortbay.jetty.handler.ContextHandler;
> +import org.mortbay.jetty.handler.ContextHandlerCollection;
>  
>  
>  
> -public final class JettyHTTPServerEngine extends 
> HTTPListenerConfigBean implements ServerEngine {
> +
> +
> +public final class JettyHTTPServerEngine extends 
> HTTPListenerConfigBean 
> +    implements ServerEngine, Configurable {
>      private static final long serialVersionUID = 1L;
>      
>      private static Map<Integer, JettyHTTPServerEngine> portMap =
>          new HashMap<Integer, JettyHTTPServerEngine>();
>     
>      private int servantCount;
> -    private HttpServer server;
> -    private SocketListener listener;
> -    private JettyListenerFactory listenerFactory;
> +    private Server server;
> +    private AbstractConnector connector;
> +    private JettyConnectorFactory connectorFactory;
> +    private ContextHandlerCollection contexts;
>      private final int port;
>      
>      JettyHTTPServerEngine(Bus bus, String protocol, int p) {
> @@ -81,15 +87,16 @@
>          JettyHTTPServerEngine ref = portMap.remove(p);
>          if (ref != null && ref.server != null) {
>              try {
> -                ref.listener.getServerSocket().close();
> -                ref.server.stop(true);
> +                //NEED to check again
> +                ref.connector.close();
> +                ref.server.stop();
>                  ref.server.destroy();
>                  ref.server = null;
>                  ref.listener = null;
> -            } catch (InterruptedException ex) {
> -                ex.printStackTrace();
>              } catch (IOException ex) {
>                  ex.printStackTrace();
> +            } catch (Exception ex) {
> +                ex.printStackTrace();
>              }
>              
>          }
> @@ -101,62 +108,56 @@
>       * @param url the URL associated with the servant
>       * @param handler notified on incoming HTTP requests
>       */
> -    public synchronized void addServant(URL url, 
> AbstractHttpHandler handler) {
> +    public synchronized void addServant(URL url, 
> AbstractHandler handler) {
>          if (server == null) {
> -            server = new HttpServer();
> -            
> -            listener = listenerFactory.createListener(port);
> -           
> +            server = new Server();            
> +            connector = connectorFactory.createConnector(port);
> +            //TODO Get the detail configuration 
> +            /* set up the connector's paraments
>              if (getListener().isSetMinThreads()) {
> -                
> listener.setMinThreads(getListener().getMinThreads());
> +                
> connector.getThreadPool()..setMinThreads(getListener().getMinT
> hreads());
>              }
>              if (getListener().isSetMaxThreads()) {
> -                
> listener.setMaxThreads(getListener().getMaxThreads());            
> +                
> connector.setMaxThreads(getListener().getMaxThreads());            
>              }
>              if (getListener().isSetMaxIdleTimeMs()) {
> -                
> listener.setMaxIdleTimeMs(getListener().getMaxIdleTimeMs().int
> Value());
> +                
> connector.setMaxIdleTimeMs(getListener().getMaxIdleTimeMs().in
> tValue());
>              }
>              if (getListener().isSetLowResourcePersistTimeMs()) {
>                  int lowResourcePersistTime = 
>                      
> getListener().getLowResourcePersistTimeMs().intValue();
> -                
> listener.setLowResourcePersistTimeMs(lowResourcePersistTime);
> -            }
> -
> -            server.addListener(listener);
> +                
> connector.setLowResourcePersistTimeMs(lowResourcePersistTime);
> +            }*/
> +            server.addConnector(connector);
> +            contexts = new ContextHandlerCollection();
> +            server.addHandler(contexts);
>              try {
>                  server.start();
>              } catch (Exception e) {
>                  e.printStackTrace();
>                  //problem starting server
>                  try {
> -                    server.stop(true);
> +                    server.stop();
>                      server.destroy();
> -                } catch (InterruptedException ex) {
> +                } catch (Exception ex) {
>                      ex.printStackTrace();
>                  }    
>              }
>          }
> +        String contextName = 
> HttpUriMapper.getContextName(url.getPath());       
>          
> -        String contextName = 
> HttpUriMapper.getContextName(url.getPath());
> -        final String smap = 
> HttpUriMapper.getResourceBase(url.getPath());
> -        
> -        HttpContext context = server.getContext(contextName);
> -        try {
> -            context.start();
> -        } catch (Exception e1) {
> -            // TODO Auto-generated catch block
> -            e1.printStackTrace();
> +        ContextHandler context = new ContextHandler();
> +        context.setContextPath(contextName);
> +        context.setHandler(handler);
> +        contexts.addHandler(context);
> +        if (contexts.isStarted()) {           
> +            try {                
> +                context.start();
> +            } catch (Exception e1) {
> +                e1.printStackTrace();
> +            }
>          }
>          
> -        handler.setName(smap);        
> -        context.addHandler(handler);
> -        
> -        try {
> -            handler.start();
> -        } catch (Exception e) {
> -            // TODO Auto-generated catch block
> -            e.printStackTrace();
> -        }
>          ++servantCount;
>      }
>      
> @@ -165,25 +166,27 @@
>       * 
>       * @param url the URL the servant was registered against.
>       */
> -    public synchronized void removeServant(URL url) {        
> -        
> +    public synchronized void removeServant(URL url) {
>          String contextName = 
> HttpUriMapper.getContextName(url.getPath());
> -        final String smap = 
> HttpUriMapper.getResourceBase(url.getPath());
> -
> +        
>          boolean found = false;
>          // REVISIT: how come server can be null?
> -        if (server != null) {
> -            HttpContext context = server.getContext(contextName);
> -            for (HttpHandler handler : context.getHandlers()) {
> -                if (smap.equals(handler.getName())) {
> -                    try {
> -                        handler.stop();
> -                    } catch (InterruptedException e) {
> -                        // TODO Auto-generated catch block
> -                        e.printStackTrace();
> +        if (server != null) {            
> +            for (Handler handler : 
> contexts.getChildHandlersByClass(ContextHandler.class)) {
> +                ContextHandler contextHandler = null;                
> +                if (handler instanceof ContextHandler) {
> +                    contextHandler = (ContextHandler) handler;
> +                    if 
> (contextName.equals(contextHandler.getContextPath())) {
> +                        try {
> +                            contexts.removeHandler(handler);
> +                            handler.stop();
> +                            handler.destroy();
> +                        } catch (Exception e) {
> +                            // TODO Auto-generated catch block
> +                            e.printStackTrace();
> +                        }                                    
>             
> +                        found = true;
>                      }
> -                    context.removeHandler(handler);
> -                    found = true;
>                  }
>              }
>          }
> @@ -206,18 +209,20 @@
>       * @param url the associated URL
>       * @return the HttpHandler if registered
>       */
> -    public synchronized HttpHandler getServant(URL url)  {
> +    public synchronized Handler getServant(URL url)  {
>          String contextName = 
> HttpUriMapper.getContextName(url.getPath());
> -        final String smap = 
> HttpUriMapper.getResourceBase(url.getPath());
>          
> -        HttpHandler ret = null;
> +        Handler ret = null;
>          // REVISIT: how come server can be null?
>          if (server != null) {
> -            HttpContext context = server.getContext(contextName);
> -            for (HttpHandler handler : context.getHandlers()) {
> -                if (smap.equals(handler.getName())) {
> -                    ret = handler;
> -                    break;
> +            for (Handler handler : 
> server.getChildHandlersByClass(ContextHandler.class)) {
> +                ContextHandler contextHandler = null;
> +                if (handler instanceof ContextHandler) {
> +                    contextHandler = (ContextHandler) handler;
> +                    if 
> (contextName.equals(contextHandler.getContextPath())) {           
> +                        ret = contextHandler.getHandler();
> +                        break;
> +                    }    
>                  }
>              }
>          }
> @@ -232,7 +237,7 @@
>      }
>  
>      private void retrieveListenerFactory() {
> -        listenerFactory = 
> HTTPTransportFactory.getListenerFactory(getSslServer());
> +        connectorFactory = 
> HTTPTransportFactory.getConnectorFactory(getSslServer());
>      }
>      
>      private void init(SSLServerPolicy sslServerPolicy) {
> 
> Modified: 
> incubator/cxf/trunk/rt/transports/http/src/main/java/org/apach
> e/cxf/transport/http/ServerEngine.java
> URL: 
> http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports
> /http/src/main/java/org/apache/cxf/transport/http/ServerEngine
> .java?view=diff&rev=518627&r1=518626&r2=518627
> ==============================================================
> ================
> --- 
> incubator/cxf/trunk/rt/transports/http/src/main/java/org/apach
> e/cxf/transport/http/ServerEngine.java (original)
> +++ 
> incubator/cxf/trunk/rt/transports/http/src/main/java/org/apach
> e/cxf/transport/http/ServerEngine.java Thu Mar 15 06:44:47 2007
> @@ -21,8 +21,8 @@
>  
>  import java.net.URL;
>  
> -import org.mortbay.http.HttpHandler;
> -import org.mortbay.http.handler.AbstractHttpHandler;
> +import org.mortbay.jetty.Handler;
> +import org.mortbay.jetty.handler.AbstractHandler;
>  
>  public interface ServerEngine {
>      /**
> @@ -31,7 +31,7 @@
>       * @param url the URL associated with the servant
>       * @param handler notified on incoming HTTP requests
>       */
> -    void addServant(URL url, AbstractHttpHandler handler);
> +    void addServant(URL url, AbstractHandler handler);
>      
>      /**
>       * Remove a previously registered servant.
> @@ -46,5 +46,5 @@
>       * @param url the associated URL
>       * @return the HttpHandler if registered
>       */
> -    HttpHandler getServant(URL url);
> +    Handler getServant(URL url);
>  }
> 
> Modified: 
> incubator/cxf/trunk/rt/transports/http/src/main/java/org/apach
> e/cxf/transport/https/HttpsURLConnectionFactory.java
> URL: 
> http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports
> /http/src/main/java/org/apache/cxf/transport/https/HttpsURLCon
> nectionFactory.java?view=diff&rev=518627&r1=518626&r2=518627
> ==============================================================
> ================
> --- 
> incubator/cxf/trunk/rt/transports/http/src/main/java/org/apach
> e/cxf/transport/https/HttpsURLConnectionFactory.java (original)
> +++ 
> incubator/cxf/trunk/rt/transports/http/src/main/java/org/apach
> e/cxf/transport/https/HttpsURLConnectionFactory.java Thu Mar 
> 15 06:44:47 2007
> @@ -95,6 +95,8 @@
>          String trustStoreMgrFactoryAlgorithm =
>              
> SSLUtils.getTrustStoreAlgorithm(sslPolicy.getTrustStoreAlgorithm(),
>                                              LOG);
> +        String[] cipherSuites =
> +            
> SSLUtils.getCiphersuites(sslPolicy.getCiphersuites(), LOG);
>          String trustStoreLocation =
>              SSLUtils.getTrustStore(sslPolicy.getTrustStore(), LOG);
>          String trustStoreType =
> @@ -104,10 +106,10 @@
>                                               LOG);
>          
>          try {
> +            SSLContext sslctx = 
> SSLContext.getInstance(secureSocketProtocol);
>              boolean pkcs12 =
>                  keyStoreType.equalsIgnoreCase(SSLUtils.PKCS12_TYPE);
> -            SSLContext ctx = SSLUtils.getSSLContext(
> -                secureSocketProtocol,
> +            sslctx.init(
>                  SSLUtils.getKeyStoreManagers(keyStoreLocation,
>                                               keyStoreType,
>                                               keyStorePassword,
> @@ -119,15 +121,10 @@
>                                                 trustStoreType,
>                                                 trustStoreLocation,
>                                                 
> trustStoreMgrFactoryAlgorithm,
> -                                               LOG));
> -            
> -            String[] cipherSuites =
> -                SSLUtils.getCiphersuites(sslPolicy.getCiphersuites(),
> -                                         
> SSLUtils.getSupportedCipherSuites(ctx),
> -                                         
> sslPolicy.getCiphersuiteFilters(),
> -                                         LOG);
> +                                               LOG),
> +                null);
>              secureConnection.setSSLSocketFactory(
> -                new SSLSocketFactoryWrapper(ctx.getSocketFactory(),
> +                new 
> SSLSocketFactoryWrapper(sslctx.getSocketFactory(),
>                                              cipherSuites));
>          } catch (Exception e) {
>              LogUtils.log(LOG, Level.SEVERE, 
> "SSL_CONTEXT_INIT_FAILURE", e);
> 
> Modified: 
> incubator/cxf/trunk/rt/transports/http/src/main/java/org/apach
> e/cxf/transport/https/Messages.properties
> URL: 
> http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports
> /http/src/main/java/org/apache/cxf/transport/https/Messages.pr
> operties?view=diff&rev=518627&r1=518626&r2=518627
> ==============================================================
> ================
> --- 
> incubator/cxf/trunk/rt/transports/http/src/main/java/org/apach
> e/cxf/transport/https/Messages.properties (original)
> +++ 
> incubator/cxf/trunk/rt/transports/http/src/main/java/org/apach
> e/cxf/transport/https/Messages.properties Thu Mar 15 06:44:47 2007
> @@ -51,15 +51,8 @@
>  WANT_CLIENT_AUTHENTICATION_NOT_SET = Want client 
> authentication has not been set explicitly in configuration 
> so defaulting to false.
>  WANT_CLIENT_AUTHENTICATION_SET = Want client authentication 
> is set to {0}.
>  KEY_PASSWORD_NOT_SAME_KEYSTORE_PASSWORD = The value 
> specified for the keystore password is different to the key 
> password. Currently limitations in JSSE requires that they 
> should be the same. The keystore password value will be used only.
> -CIPHERSUITES_SET = The cipher suites have been set to {0}.  
> -CIPHERSUITES_NOT_SET = The cipher suites have not been 
> configured, falling back to cipher suite filters.
> -CIPHERSUITE_FILTERS_NOT_SET = The cipher suite filters have 
> not been configured, falling back to default filters.
> -CIPHERSUITE_FILTER = Ciphersuite filter: 
> -CIPHERSUITE_INCLUDED = The {0} cipher suite is included by 
> the filter.
> -CIPHERSUITE_EXCLUDED = The {0} cipher suite is excluded by 
> the filter.
> -CIPHERSUITE_INCLUDE_FILTER = Ciphersuite include filter: {0}
> -CIPHERSUITE_EXCLUDE_FILTER = Ciphersuite exclude filter: {0}
> -CIPHERSUITES_FILTERED = The enabled cipher suites have been 
> filtered down to {0}.  
> +CIPHERSUITE_SET = The cipher suite has been set to {0}.  
> +CIPHERSUITE_NOT_SET = The cipher suite has not been set, 
> default values will be used.
>  SUCCESS_INVOKING_SECURITY_CONFIGURER = The custom security 
> configurer {0} configure method was called successfully.
>  ERROR_INVOKING_SECURITY_CONFIGURER = Failure invoking on 
> custom security configurer {0}, exception reported is {1}.
>  KEY_STORE_ALGORITHM_NOT_SET = The keystore key manager 
> factory algorithm has not been set in configuration so the 
> default value {0} will be used.
> 
> Modified: 
> incubator/cxf/trunk/rt/transports/http/src/main/java/org/apach
> e/cxf/transport/https/SSLSocketFactoryWrapper.java
> URL: 
> http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports
> /http/src/main/java/org/apache/cxf/transport/https/SSLSocketFa
> ctoryWrapper.java?view=diff&rev=518627&r1=518626&r2=518627
> ==============================================================
> ================
> --- 
> incubator/cxf/trunk/rt/transports/http/src/main/java/org/apach
> e/cxf/transport/https/SSLSocketFactoryWrapper.java (original)
> +++ 
> incubator/cxf/trunk/rt/transports/http/src/main/java/org/apach
> e/cxf/transport/https/SSLSocketFactoryWrapper.java Thu Mar 15 
> 06:44:47 2007
> @@ -55,45 +55,76 @@
>      
>      public Socket createSocket(Socket s, String host, int 
> port, boolean autoClose)
>          throws IOException, UnknownHostException  {
> -        return 
> enableCipherSuites(sslSocketFactory.createSocket(s, host, 
> port, autoClose),
> -                                  new Object[]{host, port});
> +        
> +        SSLSocket socket = null;
> +        socket = (SSLSocket)sslSocketFactory.createSocket(s, 
> host, port, autoClose);
> +        if ((socket != null) && (ciphers != null)) {
> +            socket.setEnabledCipherSuites(ciphers);
> +        }
> +
> +        return socket; 
>      }
>  
>      public Socket createSocket(String host, int port) throws 
> IOException, UnknownHostException {
> -        return 
> enableCipherSuites(sslSocketFactory.createSocket(host, port),
> -                                  new Object[]{host, port});
> +        SSLSocket socket = null;
> +        socket = 
> (SSLSocket)sslSocketFactory.createSocket(host, port);
> +        if ((socket != null) && (ciphers != null)) {
> +            socket.setEnabledCipherSuites(ciphers);
> +        }
> +        if (socket == null) {
> +            LogUtils.log(LOG, Level.SEVERE, 
> "PROBLEM_CREATING_OUTBOUND_REQUEST_SOCKET", 
> +                         new Object[]{host, port});
> +        }
> +        return socket; 
>      }
>  
> +
>      public Socket createSocket(String host, int port, 
> InetAddress localHost, int localPort) 
>          throws IOException, UnknownHostException {
> -        return 
> enableCipherSuites(sslSocketFactory.createSocket(host, port, 
> localHost, localPort),
> -                                  new Object[]{host, port});
> +        SSLSocket socket = null;
> +        socket = 
> (SSLSocket)sslSocketFactory.createSocket(host, port, 
> localHost, localPort);
> +        if ((socket != null) && (ciphers != null)) {
> +            socket.setEnabledCipherSuites(ciphers);
> +        }
> +
> +        if (socket == null) {
> +            LogUtils.log(LOG, Level.SEVERE, 
> "PROBLEM_CREATING_OUTBOUND_REQUEST_SOCKET", 
> +                         new Object[]{host, port});
> +        }
> +        return socket;
>      }
>  
> +
>      public Socket createSocket(InetAddress host, int port) 
> throws IOException {
> -        return 
> enableCipherSuites(sslSocketFactory.createSocket(host, port),
> -                                  new Object[]{host, port});
> +        SSLSocket socket = null;
> +        socket = 
> (SSLSocket)sslSocketFactory.createSocket(host, port);
> +        if ((socket != null) && (ciphers != null)) {
> +            socket.setEnabledCipherSuites(ciphers);
> +        }
> +
> +        if (socket == null) {
> +            LogUtils.log(LOG, Level.SEVERE, 
> "PROBLEM_CREATING_OUTBOUND_REQUEST_SOCKET", 
> +                         new Object[]{host, port});
> +        }
> +        return socket;
>      }
>  
> +
>      public Socket createSocket(InetAddress address, int 
> port, InetAddress localAddress, int localPort) 
>          throws IOException {
> -        return 
> enableCipherSuites(sslSocketFactory.createSocket(address, 
> port, localAddress, localPort),
> -                                  new Object[]{address, port});
> -    }
> -    
> -    private Socket enableCipherSuites(Socket s, Object[] logParams) {
> -        SSLSocket socket = (SSLSocket)s;
> +        SSLSocket socket = null;
> +        socket = 
> (SSLSocket)sslSocketFactory.createSocket(address, port, 
> localAddress, localPort);
>          if ((socket != null) && (ciphers != null)) {
>              socket.setEnabledCipherSuites(ciphers);
>          }
>  
>          if (socket == null) {
> -            LogUtils.log(LOG, Level.SEVERE,
> -                         "PROBLEM_CREATING_OUTBOUND_REQUEST_SOCKET", 
> -                         logParams);
> +            LogUtils.log(LOG, Level.SEVERE, 
> "PROBLEM_CREATING_OUTBOUND_REQUEST_SOCKET", 
> +                         new Object[]{address, port});
>          }
> -        return socket;        
> +        return socket;
>      }
> +    
>      /*
>       * For testing only
>       */
> 
> Modified: 
> incubator/cxf/trunk/rt/transports/http/src/main/java/org/apach
> e/cxf/transport/https/SSLUtils.java
> URL: 
> http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports
> /http/src/main/java/org/apache/cxf/transport/https/SSLUtils.ja
> va?view=diff&rev=518627&r1=518626&r2=518627
> ==============================================================
> ================
> --- 
> incubator/cxf/trunk/rt/transports/http/src/main/java/org/apach
> e/cxf/transport/https/SSLUtils.java (original)
> +++ 
> incubator/cxf/trunk/rt/transports/http/src/main/java/org/apach
> e/cxf/transport/https/SSLUtils.java Thu Mar 15 06:44:47 2007
> @@ -25,36 +25,25 @@
>  import java.io.FileInputStream;
>  import java.io.IOException;
>  import java.lang.reflect.Method;
> -import java.security.KeyManagementException;
>  import java.security.KeyStore;
> -import java.security.NoSuchAlgorithmException;
>  import java.security.cert.Certificate;
>  import java.security.cert.CertificateFactory;
>  import java.security.cert.X509Certificate;
> -import java.util.ArrayList;
> -import java.util.Arrays;
>  import java.util.List;
>  import java.util.logging.Level;
>  import java.util.logging.Logger;
> -import java.util.regex.Matcher;
> -import java.util.regex.Pattern;
>  
>  import javax.net.ssl.KeyManager;
>  import javax.net.ssl.KeyManagerFactory;
> -import javax.net.ssl.SSLContext;
>  import javax.net.ssl.SSLPeerUnverifiedException;
>  import javax.net.ssl.SSLSession;
> -import javax.net.ssl.SSLSocket;
>  import javax.net.ssl.TrustManager;
>  import javax.net.ssl.TrustManagerFactory;
>  import javax.servlet.http.HttpServletRequest;
>  
>  import org.apache.cxf.common.logging.LogUtils;
> -import org.apache.cxf.configuration.security.FiltersType;
>  import org.apache.cxf.message.Message;
>  import org.apache.cxf.security.transport.TLSSessionInfo;
> -import org.mortbay.http.HttpConnection;
> -import org.mortbay.http.HttpRequest;
>  
>  /**
>   * Holder for utility methods related to manipulating SSL 
> settings, common
> @@ -69,19 +58,10 @@
>      private static final String 
> DEFAULT_SECURE_SOCKET_PROTOCOL = "TLSv1";
>      private static final String CERTIFICATE_FACTORY_TYPE = "X.509";
>      private static final String 
> SERVLET_SSL_SESSION_ATTRIBUTE = "javax.net.ssl.session";
> -    
> +
>      private static final boolean 
> DEFAULT_REQUIRE_CLIENT_AUTHENTICATION = false;
>      private static final boolean 
> DEFAULT_WANT_CLIENT_AUTHENTICATION = true;
>      
> -    /**
> -     * By default, only include export-compatible ciphersuites.
> -     */
> -    private static final List<String> 
> DEFAULT_CIPHERSUITE_FILTERS_INCLUDE =
> -        Arrays.asList(new String[] {".*_EXPORT_.*",
> -                                    ".*_EXPORT1024_.*",
> -                                    ".*_WITH_DES_.*",
> -                                    ".*_WITH_NULL_.*"});
> -
>  
>      private SSLUtils() {
>      }    
> @@ -140,7 +120,7 @@
>          if ((keyStorePassword == null) && (keyStoreLocation 
> != null)) {
>              LogUtils.log(log, Level.WARNING,
>                           "FAILED_TO_LOAD_KEYSTORE_NULL_PASSWORD", 
> -                         keyStoreLocation);
> +                         new Object[]{keyStoreLocation});
>          }
>          return keystoreManagers;
>      }
> @@ -159,7 +139,7 @@
>              LogUtils.log(log,
>                           Level.INFO,
>                           "LOADED_KEYSTORE",
> -                         keyStoreLocation);
> +                         new Object[]{keyStoreLocation});
>          } catch (Exception e) {
>              LogUtils.log(log,
>                           Level.WARNING,
> @@ -206,7 +186,10 @@
>          TrustManagerFactory tmf  = 
>              
> TrustManagerFactory.getInstance(trustStoreMgrFactoryAlgorithm);
>          tmf.init(trustedCertStore);
> -        LogUtils.log(log, Level.INFO, "LOADED_TRUST_STORE", 
> trustStoreLocation);
> +        LogUtils.log(log,
> +                     Level.INFO,
> +                     "LOADED_TRUST_STORE",
> +                     new Object[]{trustStoreLocation});
>          trustStoreManagers = tmf.getTrustManagers();
>  
>          return trustStoreManagers;
> @@ -259,7 +242,7 @@
>                  logMsg = "KEY_STORE_NOT_SET";
>              }
>          }
> -        LogUtils.log(log, Level.INFO, logMsg, keyStoreLocation);
> +        LogUtils.log(log, Level.INFO, logMsg, new 
> Object[]{keyStoreLocation});
>          return keyStoreLocation;
>      }
>      
> @@ -271,7 +254,7 @@
>              keyStoreType = DEFAULT_KEYSTORE_TYPE;
>              logMsg = "KEY_STORE_TYPE_NOT_SET";
>          }
> -        LogUtils.log(log, Level.INFO, logMsg, keyStoreType);
> +        LogUtils.log(log, Level.INFO, logMsg, new 
> Object[]{keyStoreType});
>          return keyStoreType;
>      }  
>      
> @@ -317,7 +300,8 @@
>                  KeyManagerFactory.getDefaultAlgorithm();
>              logMsg = "KEY_STORE_ALGORITHM_NOT_SET";
>          }
> -        LogUtils.log(log, Level.INFO, logMsg, 
> keyStoreMgrFactoryAlgorithm);
> +        LogUtils.log(log, Level.INFO, logMsg, 
> +                     new Object[] {keyStoreMgrFactoryAlgorithm});
>          return keyStoreMgrFactoryAlgorithm;
>      } 
>      
> @@ -332,118 +316,32 @@
>                  TrustManagerFactory.getDefaultAlgorithm();
>              logMsg = "TRUST_STORE_ALGORITHM_NOT_SET";
>          }
> -        LogUtils.log(log, Level.INFO, logMsg, 
> trustStoreMgrFactoryAlgorithm);
> +        LogUtils.log(log, Level.INFO, logMsg, 
> +                     new Object[] {trustStoreMgrFactoryAlgorithm});
>          return trustStoreMgrFactoryAlgorithm;
>      }    
>      
> -    public static SSLContext getSSLContext(String protocol,
> -                                           KeyManager[] 
> keyStoreManagers,
> -                                           TrustManager[] 
> trustStoreManagers)
> -        throws NoSuchAlgorithmException, KeyManagementException {
> -        SSLContext ctx = SSLContext.getInstance(protocol);
> -        ctx.init(keyStoreManagers, trustStoreManagers, null);
> -        return ctx;
> -    }
> -    
> -    public static String[] 
> getSupportedCipherSuites(SSLContext context) {
> -        return context.getSocketFactory().getSupportedCipherSuites();
> -    }
> -
> -    public static String[] 
> getServerSupportedCipherSuites(SSLContext context) {
> -        return 
> context.getServerSocketFactory().getSupportedCipherSuites();
> -    }
> -
>      public static String[] getCiphersuites(List<String> 
> cipherSuitesList,
> -                                           String[] 
> supportedCipherSuites,
> -                                           FiltersType filters,
>                                             Logger log) {
>          String[] cipherSuites = null;
>          if (!(cipherSuitesList == null || 
> cipherSuitesList.isEmpty())) {
> -            cipherSuites = getCiphersFromList(cipherSuitesList, log);
> -        } else {
> -            LogUtils.log(log, Level.INFO, "CIPHERSUITES_NOT_SET");
> -            if (filters == null) {
> -                LogUtils.log(log, Level.INFO, 
> "CIPHERSUITE_FILTERS_NOT_SET");                
> -            }
> -            List<String> filteredCipherSuites = new 
> ArrayList<String>();
> -            List<Pattern> includes =
> -                filters != null
> -                ? compileRegexPatterns(filters.getInclude(), 
> true, log)
> -                : 
> compileRegexPatterns(DEFAULT_CIPHERSUITE_FILTERS_INCLUDE, true, log);
> -            List<Pattern> excludes =
> -                filters != null
> -                ? compileRegexPatterns(filters.getExclude(), 
> false, log)
> -                : null;
> -            for (int i = 0; i < supportedCipherSuites.length; i++) {
> -                if (matchesOneOf(supportedCipherSuites[i], includes)
> -                    && 
> !matchesOneOf(supportedCipherSuites[i], excludes)) {
> -                    LogUtils.log(log,
> -                                 Level.INFO,
> -                                 "CIPHERSUITE_INCLUDED",
> -                                 supportedCipherSuites[i]);
> -                    
> filteredCipherSuites.add(supportedCipherSuites[i]);
> +            int numCipherSuites = cipherSuitesList.size();
> +            cipherSuites = new String[numCipherSuites];
> +            String ciphsStr = null;
> +            for (int i = 0; i < numCipherSuites; i++) {
> +                cipherSuites[i] = cipherSuitesList.get(i);
> +                if (ciphsStr == null) {
> +                    ciphsStr = cipherSuites[i];
>                  } else {
> -                    LogUtils.log(log,
> -                                 Level.INFO,
> -                                 "CIPHERSUITE_EXCLUDED",
> -                                 supportedCipherSuites[i]);
> -                }
> -            }
> -            LogUtils.log(log,
> -                         Level.INFO,
> -                         "CIPHERSUITES_FILTERED",
> -                         filteredCipherSuites);
> -            cipherSuites = 
> getCiphersFromList(filteredCipherSuites, log);
> -        } 
> -        return cipherSuites;
> -    }         
> -    
> -    private static List<Pattern> 
> compileRegexPatterns(List<String> regexes,
> -                                                      
> boolean include,
> -                                                      Logger log) {
> -        List<Pattern> patterns = new ArrayList<Pattern>();
> -        if (regexes != null) {
> -            String msg = include
> -                         ? "CIPHERSUITE_INCLUDE_FILTER"
> -                         : "CIPHERSUITE_EXCLUDE_FILTER";
> -            for (String s : regexes) {
> -                LogUtils.log(log, Level.INFO, msg, s);
> -                patterns.add(Pattern.compile(s));
> -            }
> -        }
> -        return patterns;
> -    }
> -    
> -    private static boolean matchesOneOf(String s, 
> List<Pattern> patterns) {
> -        boolean matches = false;
> -        if (patterns != null) {
> -            for (Pattern pattern : patterns) {
> -                Matcher matcher = pattern.matcher(s);
> -                if (matcher.matches()) {
> -                    matches = true;
> -                    break;
> +                    ciphsStr += ", " + cipherSuites[i];
>                  }
>              }
> +            LogUtils.log(log, Level.INFO, "CIPHERSUITE_SET", 
> new Object[]{ciphsStr});
> +        } else {
> +            LogUtils.log(log, Level.INFO, "CIPHERSUITE_NOT_SET");
>          }
> -        return matches;
> -    }
> -    
> -    private static String[] getCiphersFromList(List<String> 
> cipherSuitesList,
> -                                               Logger log) {
> -        int numCipherSuites = cipherSuitesList.size();
> -        String[] cipherSuites = new String[numCipherSuites];
> -        String ciphsStr = null;
> -        for (int i = 0; i < numCipherSuites; i++) {
> -            cipherSuites[i] = cipherSuitesList.get(i);
> -            if (ciphsStr == null) {
> -                ciphsStr = cipherSuites[i];
> -            } else {
> -                ciphsStr += ", " + cipherSuites[i];
> -            }
> -        }
> -        LogUtils.log(log, Level.INFO, "CIPHERSUITES_SET", ciphsStr);
>          return cipherSuites;
> -    }
> +    }         
>      
>      public static String getTrustStore(String 
> trustStoreLocation, Logger log) {
>          String logMsg = null;
> @@ -459,7 +357,7 @@
>                  logMsg = "TRUST_STORE_NOT_SET";
>              }
>          }
> -        LogUtils.log(log, Level.INFO, logMsg, trustStoreLocation);
> +        LogUtils.log(log, Level.INFO, logMsg, new 
> Object[]{trustStoreLocation});
>          return trustStoreLocation;
>      }
>      
> @@ -472,7 +370,7 @@
>              trustStoreType = DEFAULT_TRUST_STORE_TYPE;
>              logMsg = "TRUST_STORE_TYPE_NOT_SET";
>          }
> -        LogUtils.log(log, Level.INFO, logMsg, trustStoreType);
> +        LogUtils.log(log, Level.INFO, logMsg, new 
> Object[]{trustStoreType});
>          return trustStoreType;
>      }
>      
> @@ -482,7 +380,7 @@
>              LogUtils.log(log,
>                           Level.INFO,
>                           "SECURE_SOCKET_PROTOCOL_SET",
> -                         secureSocketProtocol);
> +                         new Object[] {secureSocketProtocol});
>          } else {
>              LogUtils.log(log, Level.INFO, 
> "SECURE_SOCKET_PROTOCOL_NOT_SET");
>              secureSocketProtocol = DEFAULT_SECURE_SOCKET_PROTOCOL;
> @@ -502,7 +400,7 @@
>              LogUtils.log(log,
>                           Level.INFO,
>                           "REQUIRE_CLIENT_AUTHENTICATION_SET", 
> -                         requireClientAuthentication);
> +                         new Object[]{requireClientAuthentication});
>          } else {
>              LogUtils.log(log,
>                           Level.WARNING,
> @@ -523,7 +421,7 @@
>              LogUtils.log(log,
>                           Level.INFO,
>                           "WANT_CLIENT_AUTHENTICATION_SET", 
> -                         wantClientAuthentication);
> +                         new Object[]{wantClientAuthentication});
>          } else {
>              LogUtils.log(log,
>                           Level.WARNING,
> @@ -539,28 +437,24 @@
>       * @param req the Jetty request
>       * @param message the Message
>       */
> -    public static void propogateSecureSession(HttpRequest req,
> -                                              Message message) {
> -        final HttpConnection httpCon = req.getHttpConnection();
> -        if (httpCon != null) {
> -            final Object connection = httpCon.getConnection();
> -            if (connection instanceof SSLSocket) {
> -                final SSLSocket socket = (SSLSocket) connection;
> -                final SSLSession session = socket.getSession();
> -                Certificate[] certs = null;
> -                try {
> -                    certs = session.getPeerCertificates();
> -                } catch (final SSLPeerUnverifiedException e) {
> -                    // peer has not been verified
> -                }
> -                message.put(TLSSessionInfo.class,
> -                            new 
> TLSSessionInfo(session.getCipherSuite(),
> -                                               session,
> -                                               certs));
> +    public static void 
> propogateSecureSession(HttpServletRequest request,
> +                                              Message message) {    
> +        SSLSession session = 
> +            (SSLSession) 
> request.getAttribute("javax.net.ssl.session");
> +        if (session != null) {
> +            Certificate[] certs = null;
> +            try {
> +                certs = session.getPeerCertificates();
> +            } catch (final SSLPeerUnverifiedException e) {
> +                // peer has not been verified
>              }
> +            message.put(TLSSessionInfo.class,
> +                        new TLSSessionInfo(session.getCipherSuite(),
> +                                           session,
> +                                           certs));
>          }
>      }
> -
> +    
>      /**
>       * Propogate in the message a TLSSessionInfo instance 
> representative  
>       * of the TLS-specific information in the HTTP request.
> @@ -612,7 +506,7 @@
>                           client
>                           ? "UNSUPPORTED_SSL_CLIENT_POLICY_DATA"
>                           : "UNSUPPORTED_SSL_SERVER_POLICY_DATA",
> -                         policy);
> +                         new Object[]{policy});
>          }    
>      }
>      
> 
> Modified: 
> incubator/cxf/trunk/rt/transports/http/src/main/java/org/apach
> e/cxf/transport/servlet/CXFServlet.java
> URL: 
> http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports
> /http/src/main/java/org/apache/cxf/transport/servlet/CXFServle
> t.java?view=diff&rev=518627&r1=518626&r2=518627
> ==============================================================
> ================
> --- 
> incubator/cxf/trunk/rt/transports/http/src/main/java/org/apach
> e/cxf/transport/servlet/CXFServlet.java (original)
> +++ 
> incubator/cxf/trunk/rt/transports/http/src/main/java/org/apach
> e/cxf/transport/servlet/CXFServlet.java Thu Mar 15 06:44:47 2007
> @@ -85,7 +85,7 @@
>  
>      public void init(ServletConfig servletConfig) throws 
> ServletException {
>          super.init(servletConfig);
> -        
> +
>          String busid = servletConfig.getInitParameter("bus.id");
>          if (null != busid) {
>              WeakReference<Bus> ref = BUS_MAP.get(busid);
> @@ -97,7 +97,6 @@
>              // try to pull an existing ApplicationContext out of the
>              // ServletContext
>              ServletContext svCtx = getServletContext();
> -
>              
>              // Spring 1.x
>              ApplicationContext ctx = (ApplicationContext)svCtx
> 
> Modified: 
> incubator/cxf/trunk/rt/transports/http/src/main/java/org/apach
> e/cxf/transport/servlet/ServletController.java
> URL: 
> http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports
> /http/src/main/java/org/apache/cxf/transport/servlet/ServletCo
> ntroller.java?view=diff&rev=518627&r1=518626&r2=518627
> ==============================================================
> ================
> --- 
> incubator/cxf/trunk/rt/transports/http/src/main/java/org/apach
> e/cxf/transport/servlet/ServletController.java (original)
> +++ 
> incubator/cxf/trunk/rt/transports/http/src/main/java/org/apach
> e/cxf/transport/servlet/ServletController.java Thu Mar 15 
> 06:44:47 2007
> @@ -51,16 +51,14 @@
>  import org.apache.cxf.service.model.EndpointInfo;
>  import org.apache.cxf.tools.common.extensions.soap.SoapAddress;
>  import org.apache.cxf.tools.util.SOAPBindingUtil;
> +import org.apache.cxf.transport.http.AbstractHTTPDestination;
>  import org.apache.cxf.transport.https.SSLUtils;
>  import org.apache.cxf.transports.http.QueryHandler;
>  import org.apache.cxf.transports.http.QueryHandlerRegistry;
>  import org.apache.cxf.wsdl11.ServiceWSDLBuilder;
>  import org.xmlsoap.schemas.wsdl.http.AddressType;
>  
> -public class ServletController {
> -
> -    static final String HTTP_REQUEST = "HTTP_SERVLET_REQUEST";
> -    static final String HTTP_RESPONSE = "HTTP_SERVLET_RESPONSE";
> +public class ServletController {   
>  
>      private static final Logger LOG = 
> Logger.getLogger(ServletController.class.getName());
>  
> @@ -68,7 +66,7 @@
>      private ServletContext servletContext;
>      private CXFServlet cxfServlet;
>      private URL wsdlLocation;
> -
> +    
>      public ServletController(ServletTransportFactory df, 
> ServletContext servCont, CXFServlet servlet) {
>          this.transport = df;
>          this.servletContext = servCont;
> @@ -118,7 +116,7 @@
>      
>      public void setWsdlLocation(URL location) {
>          this.wsdlLocation = location;
> -    }
> +    }   
>      
>      private void generateServiceList(HttpServletRequest 
> request, HttpServletResponse response)
>          throws IOException {
> @@ -147,6 +145,7 @@
>          response.setHeader(HttpHeaderHelper.CONTENT_TYPE, 
> "text/xml");
>          try {
>              OutputStream os = response.getOutputStream();
> +                 
>              ExtendedURIResolver resolver = new ExtendedURIResolver();
>              Source source = null;
>              if (wsdlLocation != null) {
> @@ -156,6 +155,7 @@
>              } else {
>                  source = new 
> StreamSource(servletContext.getResourceAsStream("/WEB-INF/wsdl
> /" + xsdName));
>              }
> +            
>              Result result = new StreamResult(os);
>              
> TransformerFactory.newInstance().newTransformer().transform(so
> urce, result);
>              response.getOutputStream().flush();
> @@ -179,8 +179,8 @@
>          try {
>              MessageImpl inMessage = new MessageImpl();
>              inMessage.setContent(InputStream.class, 
> request.getInputStream());
> -            inMessage.put(HTTP_REQUEST, request);
> -            inMessage.put(HTTP_RESPONSE, response);
> +            
> inMessage.put(AbstractHTTPDestination.HTTP_REQUEST, request);
> +            
> inMessage.put(AbstractHTTPDestination.HTTP_RESPONSE, response);
>              inMessage.put(Message.HTTP_REQUEST_METHOD, 
> request.getMethod());
>              inMessage.put(Message.PATH_INFO, request.getPathInfo());
>              inMessage.put(Message.QUERY_STRING, 
> request.getQueryString());
> 
> 
> 

Mime
View raw message