cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ningji...@apache.org
Subject svn commit: r545115 [2/3] - in /incubator/cxf/trunk: common/schemas/src/main/resources/schemas/configuration/ parent/ rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ rt/transports/http-jetty/ rt/transports/http-jetty/src/main/java/org/...
Date Thu, 07 Jun 2007 09:05:35 GMT
Added: incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/ThreadingParameters.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/ThreadingParameters.java?view=auto&rev=545115
==============================================================================
--- incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/ThreadingParameters.java (added)
+++ incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/ThreadingParameters.java Thu Jun  7 02:05:23 2007
@@ -0,0 +1,55 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cxf.transport.http_jetty;
+
+/**
+ * This class holds a structure that contains parameters
+ * pertaining to the threading of a Jetty HTTP Server Engine.
+ */
+public class ThreadingParameters {
+
+    private int minThreads;
+    private int maxThreads;
+    private boolean minThreadsSet;
+    private boolean maxThreadsSet;
+    
+    public void setMinThreads(int number) {
+        minThreads = number;
+    }
+    
+    public void setMaxThreads(int number) {
+        maxThreads = number;
+    }
+    
+    public int getMinThreads() {
+        return minThreads;
+    }
+    
+    public int getMaxThreads() {
+        return maxThreads;
+    }
+    
+    public boolean isSetMaxThreads() {
+        return maxThreadsSet;
+    }
+    
+    public boolean isSetMinThreads() {
+        return minThreadsSet;
+    }
+}

Propchange: incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/ThreadingParameters.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/ThreadingParameters.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/spring/JettyHTTPServerEngineFactoryBeanDefinitionParser.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/spring/JettyHTTPServerEngineFactoryBeanDefinitionParser.java?view=auto&rev=545115
==============================================================================
--- incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/spring/JettyHTTPServerEngineFactoryBeanDefinitionParser.java (added)
+++ incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/spring/JettyHTTPServerEngineFactoryBeanDefinitionParser.java Thu Jun  7 02:05:23 2007
@@ -0,0 +1,79 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cxf.transport.http_jetty.spring;
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBElement;
+import javax.xml.bind.Unmarshaller;
+
+import org.w3c.dom.Element;
+
+import org.apache.cxf.configuration.spring.AbstractBeanDefinitionParser;
+import org.apache.cxf.transport.http_jetty.JettyHTTPServerEngineFactory;
+import org.apache.cxf.transports.http_jetty.configuration.JettyHTTPServerEngineFactoryConfigType;
+import org.springframework.beans.factory.support.BeanDefinitionBuilder;
+import org.springframework.beans.factory.xml.ParserContext;
+
+public class JettyHTTPServerEngineFactoryBeanDefinitionParser
+        extends AbstractBeanDefinitionParser {
+
+    @Override
+    public void doParse(Element engineFactory, ParserContext ctx, BeanDefinitionBuilder bean) {
+        // Unmarshal the JAXB Generated Type from Config 
+        JAXBContext context = null;
+        try {
+            context = JAXBContext.newInstance(
+                    JettyHTTPServerEngineFactoryConfigType.class.getPackage().getName(), 
+                    getClass().getClassLoader());
+            Unmarshaller u = context.createUnmarshaller();
+            
+            JAXBElement<JettyHTTPServerEngineFactoryConfigType> jaxb = 
+                u.unmarshal(engineFactory, 
+                        JettyHTTPServerEngineFactoryConfigType.class);
+            
+            JettyHTTPServerEngineFactoryConfigType params = jaxb.getValue();
+            
+            JettyHTTPServerEngineFactoryConfig config =
+                new JettyHTTPServerEngineFactoryConfig(params);
+            
+            bean.addPropertyValue("config", config);
+            bean.addPropertyReference("bus", params.getBus());
+            
+        } catch (Exception e) {
+            throw new RuntimeException("Could not process configuration.", e);
+        }
+    }
+    
+    /*
+     * We do not require an id from the configuration.
+     * 
+     * (non-Javadoc)
+     * @see org.springframework.beans.factory.xml.AbstractBeanDefinitionParser#shouldGenerateId()
+     */
+    @Override
+    protected boolean shouldGenerateId() {
+        return true;
+    }
+
+    @Override
+    protected Class getBeanClass(Element arg0) {
+        return JettyHTTPServerEngineFactory.class;
+    }
+
+}

Propchange: incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/spring/JettyHTTPServerEngineFactoryBeanDefinitionParser.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/spring/JettyHTTPServerEngineFactoryBeanDefinitionParser.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/spring/JettyHTTPServerEngineFactoryConfig.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/spring/JettyHTTPServerEngineFactoryConfig.java?view=auto&rev=545115
==============================================================================
--- incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/spring/JettyHTTPServerEngineFactoryConfig.java (added)
+++ incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/spring/JettyHTTPServerEngineFactoryConfig.java Thu Jun  7 02:05:23 2007
@@ -0,0 +1,135 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cxf.transport.http_jetty.spring;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.TreeMap;
+
+import org.apache.cxf.configuration.jsse.TLSServerParameters;
+import org.apache.cxf.configuration.jsse.spring.TLSServerParametersConfig;
+import org.apache.cxf.transport.http_jetty.JettyHTTPServerEngineFactory;
+import org.apache.cxf.transport.http_jetty.ThreadingParameters;
+import org.apache.cxf.transports.http_jetty.configuration.JettyHTTPServerEngineConfigType;
+import org.apache.cxf.transports.http_jetty.configuration.JettyHTTPServerEngineFactoryConfigType;
+import org.apache.cxf.transports.http_jetty.configuration.TLSServerParametersIdentifiedType;
+import org.apache.cxf.transports.http_jetty.configuration.ThreadingParametersIdentifiedType;
+import org.apache.cxf.transports.http_jetty.configuration.ThreadingParametersType;
+
+public class JettyHTTPServerEngineFactoryConfig {
+    Map<Integer, TLSServerParameters> tlsParametersMap =
+        new TreeMap<Integer, TLSServerParameters>();
+    Map<Integer, ThreadingParameters> threadingParametersMap =
+        new TreeMap<Integer, ThreadingParameters>();
+        
+    
+    JettyHTTPServerEngineFactoryConfig(
+        JettyHTTPServerEngineFactoryConfigType config
+    ) {
+        Map<String, TLSServerParameters> tlsMap =
+            new HashMap<String, TLSServerParameters>();
+        Map<String, ThreadingParameters> threadingMap =
+            new HashMap<String, ThreadingParameters>();
+        for (ThreadingParametersIdentifiedType t 
+                : config.getIdentifiedThreadingParameters()) {
+            if (threadingMap.get(t.getId()) != null) {
+                throw new RuntimeException("Threading Parameters " + t.getId()
+                        + " is configured more than once.");
+            }
+            threadingMap.put(t.getId(), 
+                    toThreadingParameters(t.getThreadingParameters()));
+        }
+        for (TLSServerParametersIdentifiedType t 
+                : config.getIdentifiedTLSServerParameters()) {
+            if (tlsMap.get(t.getId()) != null) {
+                throw new RuntimeException("TLS Server Parameters " + t.getId()
+                        + " is configured more than once.");
+            }
+            try {
+                TLSServerParametersConfig con = 
+                    new TLSServerParametersConfig(t.getTlsServerParameters());
+                tlsMap.put(t.getId(), con);
+            } catch (Exception e) {
+                throw new RuntimeException(
+                        "Could not configure TLS in " + t.getId(), e);
+            }
+        }
+        for (JettyHTTPServerEngineConfigType t : config.getEngine()) {
+            ThreadingParameters tparams = null;
+            if (t.getThreadingParametersRef() != null) {
+                String id = t.getThreadingParametersRef().getId();
+                tparams = threadingMap.get(id);
+                if (tparams == null) {
+                    throw new RuntimeException("Could not find \"" 
+                            + id + "\" as threading parameters");
+                }
+            } else if (t.getThreadingParameters() != null) {
+                tparams = toThreadingParameters(t.getThreadingParameters());
+            }
+            TLSServerParameters tlsParams = null;
+            if (t.getTlsServerParametersRef() != null) {
+                String id = t.getTlsServerParametersRef().getId();
+                tlsParams = tlsMap.get(id);
+                if (tlsParams == null) {
+                    throw new RuntimeException("Could not find \"" 
+                            + id + "\" as TLS Server Parameters");
+                }
+            } else if (t.getTlsServerParameters() != null) {
+                try {
+                    tlsParams = 
+                        new TLSServerParametersConfig(t.getTlsServerParameters());
+                } catch (Exception e) {
+                    throw new RuntimeException(
+                            "Could not configure TLS for port " + t.getPort(), e);
+                }
+            }
+            if (threadingParametersMap.get(t.getPort()) != null
+                || tlsParametersMap.get(t.getPort()) != null) {
+                throw new RuntimeException("Port " + t.getPort()
+                        + " is configured more than once");
+            }
+            if (tparams != null) {
+                threadingParametersMap.put(t.getPort(), tparams);
+            }
+            if (tlsParams != null) {
+                tlsParametersMap.put(t.getPort(), tlsParams);
+            }
+        }
+    }
+    
+    private ThreadingParameters toThreadingParameters(
+            ThreadingParametersType paramtype
+    ) {
+        ThreadingParameters params = new ThreadingParameters();
+        params.setMaxThreads(paramtype.getMaxThreads());
+        params.setMinThreads(paramtype.getMinThreads());
+        return params;
+    }
+
+    public void configureServerEngineFactory(JettyHTTPServerEngineFactory fac) {
+        for (int port : tlsParametersMap.keySet()) {
+            fac.setTLSServerParametersForPort(port, 
+                    tlsParametersMap.get(port));
+        }
+        for (int port : threadingParametersMap.keySet()) {
+            fac.setThreadingParametersForPort(port, 
+                    threadingParametersMap.get(port));
+        }
+    }
+}

Propchange: incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/spring/JettyHTTPServerEngineFactoryConfig.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/spring/JettyHTTPServerEngineFactoryConfig.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/spring/NamespaceHandler.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/spring/NamespaceHandler.java?view=diff&rev=545115&r1=545114&r2=545115
==============================================================================
--- incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/spring/NamespaceHandler.java (original)
+++ incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/spring/NamespaceHandler.java Thu Jun  7 02:05:23 2007
@@ -22,7 +22,7 @@
 
 public class NamespaceHandler extends NamespaceHandlerSupport {
     public void init() {
-        registerBeanDefinitionParser("listener", 
-                                     new ListenerBeanDefinitionParser());        
+        registerBeanDefinitionParser("engine-factory", 
+                new JettyHTTPServerEngineFactoryBeanDefinitionParser());
     }
 }

Modified: incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/https_jetty/CXFJettySslSocketConnector.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/https_jetty/CXFJettySslSocketConnector.java?view=diff&rev=545115&r1=545114&r2=545115
==============================================================================
--- incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/https_jetty/CXFJettySslSocketConnector.java (original)
+++ incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/https_jetty/CXFJettySslSocketConnector.java Thu Jun  7 02:05:23 2007
@@ -115,6 +115,7 @@
         context.init(keyManagers, trustManagers, secureRandom);
 
         SSLServerSocketFactory con = context.getServerSocketFactory();
+
         
         String[] cs = 
             SSLUtils.getCiphersuites(

Modified: incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/https_jetty/JettySslConnectorFactory.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/https_jetty/JettySslConnectorFactory.java?view=diff&rev=545115&r1=545114&r2=545115
==============================================================================
--- incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/https_jetty/JettySslConnectorFactory.java (original)
+++ incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/https_jetty/JettySslConnectorFactory.java Thu Jun  7 02:05:23 2007
@@ -19,75 +19,36 @@
 
 package org.apache.cxf.transport.https_jetty;
 
-import java.util.logging.Handler;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import javax.net.ssl.KeyManager;
-import javax.net.ssl.SSLContext;
-import javax.net.ssl.TrustManager;
-
-import org.apache.cxf.common.logging.LogUtils;
 import org.apache.cxf.configuration.jsse.TLSServerParameters;
-import org.apache.cxf.configuration.security.SSLServerPolicy;
 import org.apache.cxf.transport.http_jetty.JettyConnectorFactory;
-import org.apache.cxf.transport.https.SSLUtils;
 import org.mortbay.jetty.AbstractConnector;
 
-
+/**
+ * This class wraps the JettyConnectorFactory and will create 
+ * TLS enabled acceptors.
+ */
 public final class JettySslConnectorFactory implements JettyConnectorFactory {
     private static final long serialVersionUID = 1L;
-    private static final Logger LOG = LogUtils.getL7dLogger(JettySslConnectorFactory.class);    
-    
-    @Deprecated
-    private static final String[] UNSUPPORTED =
-    {"SessionCaching", "SessionCacheKey", "MaxChainLength",
-     "CertValidator", "TrustStoreAlgorithm", "TrustStoreType"};
-
-    private static final String[] DERIVATIVE = {"CiphersuiteFilters"};
     
-    @Deprecated
-    SSLServerPolicy sslPolicy;
-        
     TLSServerParameters tlsServerParameters;
     
-    /**
-     * Constructor.
-     * 
-     * @param policy the applicable SSLServerPolicy (guaranteed non-null)
-     */
-    @Deprecated
-    public JettySslConnectorFactory(SSLServerPolicy policy) {
-        this.sslPolicy = policy;
-    }    
-    
     public JettySslConnectorFactory(TLSServerParameters params) {
         tlsServerParameters = params;
     }
     
     /**
-     * Create a SSL Connector.
+     * Create a TLS/SSL Connector.
      * 
-     * @param p the listen port
+     * @param port The network port on which to listen.
      */
     public AbstractConnector createConnector(int port) {
-        if (tlsServerParameters != null) {
-            CXFJettySslSocketConnector secureConnector = 
-                new CXFJettySslSocketConnector();
-            secureConnector.setPort(port);
-            decorateCXFJettySslSocketConnector(secureConnector);
-            return secureConnector;
-        }
-        if (sslPolicy != null) {
-            //SslSocketConnector secureConnector = new SslSocketConnector();
-            CXFJettySslSocketConnector secureConnector = 
-                new CXFJettySslSocketConnector();
-            secureConnector.setPort(port);
-            decorate(secureConnector);
-            return secureConnector;
-        }
-        assert false;
-        return null;
+        assert tlsServerParameters != null;
+        
+        CXFJettySslSocketConnector secureConnector = 
+            new CXFJettySslSocketConnector();
+        secureConnector.setPort(port);
+        decorateCXFJettySslSocketConnector(secureConnector);
+        return secureConnector;
     }
     
     /**
@@ -106,132 +67,6 @@
         con.setProvider(tlsServerParameters.getJsseProvider());
         con.setCipherSuites(tlsServerParameters.getCipherSuites());
         con.setCipherSuitesFilter(tlsServerParameters.getCipherSuitesFilter());
-    }
-    
-    /**
-     * Decorate listener with applicable SSL settings.
-     * This method will be deprecated after old SSL configuration is gone.
-     * This method has been modified to use the CXF extension 
-     * to the JettySslSocketConnector so that we may upgrade to 
-     * Jetty 6.1.3.
-     * 
-     * @param listener the secure listener
-     */
-    @Deprecated
-    public void decorate(CXFJettySslSocketConnector secureListener) {
-        
-        // This has been modified to work with Jetty 6.1.3 and our
-        // extended JettySslSocketConnector, because they have a bug
-        // in which processing the TrustStore throws a null pointer
-        // exception if the trust store doesn't have a password set.
-        
-        String keyStoreLocation =
-            SSLUtils.getKeystore(sslPolicy.getKeystore(), LOG);
-        //secureListener.setKeystore(keyStoreLocation);
-        String keyStoreType =
-            SSLUtils.getKeystoreType(sslPolicy.getKeystoreType(), LOG);
-        //secureListener.setKeystoreType(keyStoreType);
-        String keyStorePassword =
-            SSLUtils.getKeystorePassword(sslPolicy.getKeystorePassword(), LOG);
-        //secureListener.setPassword(keyStorePassword);
-        String keyPassword =
-            SSLUtils.getKeyPassword(sslPolicy.getKeyPassword(), LOG);
-        //secureListener.setKeyPassword(keyPassword);
-        String keyStoreMgrFactoryAlgorithm =
-            SSLUtils.getKeystoreAlgorithm(sslPolicy.getKeystoreAlgorithm(),
-                                          LOG);
-        //secureListener.setSslKeyManagerFactoryAlgorithm(keyStoreMgrFactoryAlgorithm);
-
-        String secureSocketProtocol =
-            SSLUtils.getSecureSocketProtocol(sslPolicy.getSecureSocketProtocol(),
-                                             LOG);
-        secureListener.setProtocol(secureSocketProtocol);
-        
-
-        secureListener.setWantClientAuth(
-            SSLUtils.getWantClientAuthentication(
-                                   sslPolicy.isSetWantClientAuthentication(),
-                                   sslPolicy.isWantClientAuthentication(),
-                                   LOG));
-        secureListener.setNeedClientAuth(
-            SSLUtils.getRequireClientAuthentication(
-                                sslPolicy.isSetRequireClientAuthentication(),
-                                sslPolicy.isRequireClientAuthentication(),
-                                LOG));
-        
-        String trustStoreType =
-            SSLUtils.getTrustStoreType(sslPolicy.getTrustStoreType(), LOG);
-        
-        String trustStoreLocation = 
-            SSLUtils.getTrustStore(sslPolicy.getTrustStore(), LOG);
-        
-        String trustStoreMgrFactoryAlgorithm =
-            SSLUtils.getTrustStoreAlgorithm(
-                    sslPolicy.getTrustStoreAlgorithm(), LOG);
-
-        //System.setProperty("javax.net.ssl.trustStore",
-        //                   SSLUtils.getTrustStore(sslPolicy.getTrustStore(),
-        //                                          LOG));
-        //need to Check it
-        try {
-            KeyManager[] keyManagers =
-                SSLUtils.getKeyStoreManagers(keyStoreLocation,
-                                     keyStoreType,
-                                     keyStorePassword,
-                                     keyPassword,
-                                     keyStoreMgrFactoryAlgorithm,
-                                     secureSocketProtocol,
-                                     LOG);
-            secureListener.setKeyManagers(keyManagers);
-            
-            // On the client side, it was strange that if you Keystore was 
-            // of type PCKS12, then your TrustStore location had to point to
-            // was a PEM encoded CA Certificate. However, in this code before
-            // modification, it didn't seem like the TrustSTore
-            // had to be a single PEM CA certificate if the Keystore was
-            // of type PKCS12. So, we use false here for pkcs12 parameter.
-            
-            TrustManager[] trustManagers =
-                SSLUtils.getTrustStoreManagers(
-                        false, 
-                        trustStoreType, trustStoreLocation, 
-                        trustStoreMgrFactoryAlgorithm, LOG);
-
-            secureListener.setTrustManagers(trustManagers);
-            
-            SSLContext ctx = SSLUtils.getSSLContext(
-                    secureSocketProtocol, keyManagers, trustManagers);
-                
-            secureListener.setExcludeCipherSuites(
-                SSLUtils.getCiphersuites(
-                        sslPolicy.getCiphersuites(),
-                        SSLUtils.getServerSupportedCipherSuites(ctx),
-                        sslPolicy.getCiphersuiteFilters(),
-                        LOG, true));
-            
-        } catch (Exception e) {
-            LogUtils.log(LOG, Level.SEVERE, "SSL_CONTEXT_INIT_FAILURE", e);
-        }
-
-        SSLUtils.logUnSupportedPolicies(sslPolicy,
-                                        false,
-                                        UNSUPPORTED,
-                                        LOG);
-    }
-
-    /* 
-     * For development & testing only
-     */
-    protected void addLogHandler(Handler handler) {
-        LOG.addHandler(handler);
-    }
-    
-    protected String[] getUnSupported() {
-        return UNSUPPORTED;
-    }
-    
-    protected String[] getDerivative() {
-        return DERIVATIVE;
     }
     
 }

Modified: incubator/cxf/trunk/rt/transports/http-jetty/src/main/resources/META-INF/spring.handlers
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/http-jetty/src/main/resources/META-INF/spring.handlers?view=diff&rev=545115&r1=545114&r2=545115
==============================================================================
--- incubator/cxf/trunk/rt/transports/http-jetty/src/main/resources/META-INF/spring.handlers (original)
+++ incubator/cxf/trunk/rt/transports/http-jetty/src/main/resources/META-INF/spring.handlers Thu Jun  7 02:05:23 2007
@@ -1 +1 @@
-http\://cxf.apache.org/transport/http/listener=org.apache.cxf.transport.http_jetty.spring.NamespaceHandler
+http\://cxf.apache.org/transports/http-jetty/configuration=org.apache.cxf.transport.http_jetty.spring.NamespaceHandler

Added: incubator/cxf/trunk/rt/transports/http-jetty/src/main/resources/META-INF/spring.schemas
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/http-jetty/src/main/resources/META-INF/spring.schemas?view=auto&rev=545115
==============================================================================
--- incubator/cxf/trunk/rt/transports/http-jetty/src/main/resources/META-INF/spring.schemas (added)
+++ incubator/cxf/trunk/rt/transports/http-jetty/src/main/resources/META-INF/spring.schemas Thu Jun  7 02:05:23 2007
@@ -0,0 +1 @@
+http\://cxf.apache.org/schemas/configuration/http-jetty.xsd=schemas/configuration/http-jetty.xsd

Added: incubator/cxf/trunk/rt/transports/http-jetty/src/main/resources/catalog.cat
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/http-jetty/src/main/resources/catalog.cat?view=auto&rev=545115
==============================================================================
--- incubator/cxf/trunk/rt/transports/http-jetty/src/main/resources/catalog.cat (added)
+++ incubator/cxf/trunk/rt/transports/http-jetty/src/main/resources/catalog.cat Thu Jun  7 02:05:23 2007
@@ -0,0 +1,24 @@
+--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+ 
+  http://www.apache.org/licenses/LICENSE-2.0
+ 
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+--
+
+
+SYSTEM "http://schemas.xmlsoap.org/wsdl/" "../../../../../../common/schemas/src/main/resources/schemas/wsdl/wsdl.xsd"
+SYSTEM "http://cxf.apache.org/schemas/configuration/security.xsd" "../../../../../../common/schemas/src/main/resources/schemas/configuration/security.xsd"
+SYSTEM "http://cxf.apache.org/schemas/wsdl/http-conf.xsd"         "../../../../../../rt/transports/http/src/main/resources/schemas/wsdl/http-conf.xsd"
+SYSTEM "http://cxf.apache.org/schemas/configuration/http-jetty.xsd" "schemas/configuration/http-jetty.xsd"

Propchange: incubator/cxf/trunk/rt/transports/http-jetty/src/main/resources/catalog.cat
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/rt/transports/http-jetty/src/main/resources/catalog.cat
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: incubator/cxf/trunk/rt/transports/http-jetty/src/main/resources/schemas/configuration/http-jetty.xsd
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/http-jetty/src/main/resources/schemas/configuration/http-jetty.xsd?view=auto&rev=545115
==============================================================================
--- incubator/cxf/trunk/rt/transports/http-jetty/src/main/resources/schemas/configuration/http-jetty.xsd (added)
+++ incubator/cxf/trunk/rt/transports/http-jetty/src/main/resources/schemas/configuration/http-jetty.xsd Thu Jun  7 02:05:23 2007
@@ -0,0 +1,100 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+ 
+  http://www.apache.org/licenses/LICENSE-2.0
+ 
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+
+<xs:schema targetNamespace="http://cxf.apache.org/transports/http-jetty/configuration" 
+           xmlns:tns="http://cxf.apache.org/transports/http-jetty/configuration" 
+           xmlns:xs="http://www.w3.org/2001/XMLSchema" 
+           xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
+           xmlns:http-conf="http://cxf.apache.org/transports/http/configuration" 
+           xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" 
+           xmlns:sec="http://cxf.apache.org/configuration/security"
+  		   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  		   xsi:schemaLocation="
+  		     http://www.springframework.org/schema/beans
+  		       http://www.springframework.org/schema/beans/spring-beans-2.0.xsd"
+           elementFormDefault="qualified" 
+           attributeFormDefault="unqualified"
+           xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
+           jaxb:version="2.0">
+
+    <xs:import namespace="http://cxf.apache.org/configuration/security"
+               schemaLocation="http://cxf.apache.org/schemas/configuration/security.xsd"/>
+    
+    
+    <!-- Is this really supposed to be supperceeded by http-conf:HTTPListenerPolicy? -->
+    <xs:complexType name="ThreadingParametersType">
+       <xs:attribute name="minThreads" type="xs:unsignedShort"/>
+       <xs:attribute name="maxThreads" type="xs:unsignedShort"/>
+    </xs:complexType>
+    
+    <xs:complexType name="ThreadingParametersIdentifiedType">
+       <xs:sequence>
+         <xs:element name="threadingParameters" type="tns:ThreadingParametersType"/>
+       </xs:sequence>
+         <xs:attribute name="id" type="xs:string"/>
+    </xs:complexType>
+    
+    <xs:complexType name="TLSServerParametersIdentifiedType">
+       <xs:sequence>
+          <xs:element name="tlsServerParameters" type="sec:TLSServerParametersType"/>
+       </xs:sequence>
+          <xs:attribute name="id" type="xs:string"/>
+    </xs:complexType>
+    
+    <xs:complexType name="ParametersRefType">
+       <xs:attribute name="id" type="xs:string" use="required"/>
+    </xs:complexType>
+    
+    <xs:complexType name="JettyHTTPServerEngineConfigType">
+       <xs:sequence>
+         <xs:choice minOccurs="0" maxOccurs="1">
+          <xs:element name="tlsServerParameters" 
+                      type="sec:TLSServerParametersType"/>
+          <xs:element name="tlsServerParametersRef"
+                      type="tns:ParametersRefType"/>
+         </xs:choice>
+         <xs:choice minOccurs="0" maxOccurs="1">
+          <xs:element name="threadingParameters" 
+                      type="tns:ThreadingParametersType"/>
+          <xs:element name="threadingParametersRef"
+                      type="tns:ParametersRefType"/>
+         </xs:choice>
+       </xs:sequence>
+          <xs:attribute name="port" type="xs:int" use="required"/>
+    </xs:complexType>
+    
+    <xs:complexType name="JettyHTTPServerEngineFactoryConfigType">
+       <xs:sequence>
+           <xs:element name="identifiedTLSServerParameters" 
+                       type="tns:TLSServerParametersIdentifiedType"
+                       minOccurs="0" maxOccurs="unbounded"/>
+           <xs:element name="identifiedThreadingParameters"
+                       type="tns:ThreadingParametersIdentifiedType"
+                       minOccurs="0" maxOccurs="unbounded"/>
+           <xs:element name="engine" 
+                       type="tns:JettyHTTPServerEngineConfigType" 
+                       minOccurs="0" maxOccurs="unbounded"/>
+       </xs:sequence>
+         <xs:attribute name="bus" type="xs:string" use="required"/>
+    </xs:complexType>
+    
+    <xs:element name="engine-factory" 
+                type="tns:JettyHTTPServerEngineFactoryConfigType"/>
+ </xs:schema>

Propchange: incubator/cxf/trunk/rt/transports/http-jetty/src/main/resources/schemas/configuration/http-jetty.xsd
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/rt/transports/http-jetty/src/main/resources/schemas/configuration/http-jetty.xsd
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: incubator/cxf/trunk/rt/transports/http-jetty/src/main/resources/schemas/configuration/http-jetty.xsd
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Modified: incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/JettyHTTPDestinationTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/JettyHTTPDestinationTest.java?view=diff&rev=545115&r1=545114&r2=545115
==============================================================================
--- incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/JettyHTTPDestinationTest.java (original)
+++ incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/JettyHTTPDestinationTest.java Thu Jun  7 02:05:23 2007
@@ -38,7 +38,6 @@
 import org.apache.cxf.common.util.Base64Utility;
 import org.apache.cxf.common.util.StringUtils;
 import org.apache.cxf.configuration.security.AuthorizationPolicy;
-import org.apache.cxf.configuration.security.SSLServerPolicy;
 import org.apache.cxf.endpoint.EndpointResolverRegistry;
 import org.apache.cxf.helpers.CastUtils;
 import org.apache.cxf.io.AbstractCachedOutputStream;
@@ -330,13 +329,13 @@
         bus = new CXFBusImpl();
         
         transportFactory = new JettyHTTPTransportFactory();
+        transportFactory.setBus(bus);
         
         ServiceInfo serviceInfo = new ServiceInfo();
         serviceInfo.setName(new QName("bla", "Service"));        
         endpointInfo = new EndpointInfo(serviceInfo, "");
         endpointInfo.setName(new QName("bla", "Port"));
-        endpointInfo.addExtensor(policy); 
-        endpointInfo.addExtensor(new SSLServerPolicy()); 
+        endpointInfo.addExtensor(policy);
         
         engine = EasyMock.createMock(JettyHTTPServerEngine.class);
         EasyMock.replay();
@@ -422,6 +421,24 @@
         throws Exception {
         policy = new HTTPServerPolicy();
         address = getEPR("bar/foo");
+        
+
+        transportFactory = new JettyHTTPTransportFactory() {
+            @Override
+            public JettyHTTPServerEngineFactory getJettyHTTPServerEngineFactory() {
+                if (serverEngineFactory == null) {
+                    serverEngineFactory = new JettyHTTPServerEngineFactory();
+                }
+                return serverEngineFactory;   
+            }
+            
+            @Override
+            public Conduit getConduit(EndpointInfo epi,
+                                      EndpointReferenceType target) throws IOException {
+                return decoupledBackChannel;
+            }
+        };
+        
         if (!mockedBus) {
             bus = new CXFBusImpl();
         } else {
@@ -433,15 +450,6 @@
             EasyMock.replay(bus);
         }
         
-        transportFactory = new JettyHTTPTransportFactory() {
-            @Override
-            public Conduit getConduit(EndpointInfo epi,
-                                      EndpointReferenceType target) throws IOException {
-                return decoupledBackChannel;
-            }
-        };
-        transportFactory.setBus(bus);
-        
         engine = EasyMock.createMock(JettyHTTPServerEngine.class);
         ServiceInfo serviceInfo = new ServiceInfo();
         serviceInfo.setName(new QName("bla", "Service"));        
@@ -450,8 +458,6 @@
         endpointInfo.setAddress(NOWHERE + "bar/foo");
        
         endpointInfo.addExtensor(policy);
-        endpointInfo.getExtensor(SSLServerPolicy.class);
-        endpointInfo.addExtensor(new SSLServerPolicy());
         engine.addServant(EasyMock.eq(new URL(NOWHERE + "bar/foo")),
                           EasyMock.isA(JettyHTTPHandler.class));
         EasyMock.expectLastCall();

Modified: incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngineTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngineTest.java?view=diff&rev=545115&r1=545114&r2=545115
==============================================================================
--- incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngineTest.java (original)
+++ incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngineTest.java Thu Jun  7 02:05:23 2007
@@ -22,7 +22,7 @@
 
 import org.apache.cxf.Bus;
 import org.apache.cxf.configuration.Configurer;
-import org.apache.cxf.configuration.security.SSLServerPolicy;
+import org.apache.cxf.configuration.jsse.TLSServerParameters;
 import org.apache.cxf.configuration.spring.ConfigurerImpl;
 import org.easymock.classextension.EasyMock;
 import org.easymock.classextension.IMocksControl;
@@ -40,7 +40,8 @@
     public void setUp() throws Exception {
         control = EasyMock.createNiceControl();
         bus = control.createMock(Bus.class);
-        factory = new JettyHTTPServerEngineFactory(bus);
+        factory = new JettyHTTPServerEngineFactory();
+        factory.setBus(bus);
         
         Configurer configurer = new ConfigurerImpl(); 
         
@@ -50,44 +51,35 @@
     }
     
     @Test
-    public void testEngineEquality() {
-        JettyHTTPServerEngine engine = factory.getForPort("http", 1234);
-        assertTrue("Engine references for the same port should point to the same instance",
-                   engine == factory.getForPort("http", 1234));
-        assertFalse("Engine references for the different ports should point to diff instances",
-                   engine == factory.getForPort("http", 1235));    
+    public void testEngineRetrieval() throws Exception {
+        JettyHTTPServerEngine engine = 
+            factory.createJettyHTTPServerEngine(1234);
+        
+        assertTrue(
+            "Engine references for the same port should point to the same instance",
+            engine == factory.retrieveJettyHTTPServerEngine(1234));
+        
         factory.destroyForPort(1234);
-        factory.destroyForPort(1235);
     }
     
     @Test
-    public void testNoSSLServerPolicySet() {
-        JettyHTTPServerEngine engine = factory.getForPort("http", 1234);
-        assertFalse("SSLServerPolicy must not be set", engine.isSetSslServer());
-        engine = factory.getForPort("http", 1235, (SSLServerPolicy) null);
-        assertFalse("SSLServerPolicy must not be set", engine.isSetSslServer());
-        JettyHTTPServerEngine engine2 = factory.getForPort("http", 1234, 
-                                                   new SSLServerPolicy());
-        assertFalse("SSLServerPolicy must not be set for already intialized engine", 
-                    engine2.isSetSslServer());
+    public void testHttpAndHttps() throws Exception {
+        JettyHTTPServerEngine engine = 
+            factory.createJettyHTTPServerEngine(1234);
+        
+        assertTrue("Protocol must be http", 
+                "http".equals(engine.getProtocol()));
+        
+        factory.setTLSServerParametersForPort(1235, new TLSServerParameters());
+        
+        engine = factory.createJettyHTTPSServerEngine(1235);
+        
+        assertTrue("Protocol must be https", 
+                "https".equals(engine.getProtocol()));
+        
+        factory.removeTLSServerParametersForPort(1235);
         factory.destroyForPort(1234);
         factory.destroyForPort(1235);
     }
     
-    @Test
-    public void testDestinationSSLServerPolicy() {
-        SSLServerPolicy policy = new SSLServerPolicy();
-        JettyHTTPServerEngine engine = factory.getForPort("http", 1234, 
-                                                                        policy);
-        assertTrue("SSLServerPolicy must be set", engine.getSslServer() == policy);
-        JettyHTTPServerEngine engine2 = factory.getForPort("http", 1234, 
-                                                   new SSLServerPolicy());
-        assertTrue("Engine references for the same port should point to the same instance",
-                   engine == engine2);
-        assertTrue("SSLServerPolicy must not be set for already intialized engine", 
-                    engine.getSslServer() == policy);
-        
-        factory.destroyForPort(1234);
-    }
-
 }

Modified: incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/spring/ApplicationContextTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/spring/ApplicationContextTest.java?view=diff&rev=545115&r1=545114&r2=545115
==============================================================================
--- incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/spring/ApplicationContextTest.java (original)
+++ incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/spring/ApplicationContextTest.java Thu Jun  7 02:05:23 2007
@@ -64,6 +64,10 @@
         }
     }
     
+    // This test fails because I think it is trying to read the http-conf.xsd
+    // twice, failing on a duplicate name for 
+    //http://cxf.apache.org/transports/http/configuration,authorization
+    
     @Test
     public void testContext() throws Exception {
         String s4 = getClass()
@@ -93,7 +97,7 @@
         assertEquals("foobar", jd.getServer().getContentEncoding());   
         
         JettyHTTPServerEngine engine = (JettyHTTPServerEngine)jd.getEngine();
-        assertEquals(111, engine.getListener().getMinThreads());
+        assertEquals(111, engine.getThreadingParameters().getMinThreads());
         
         ConduitInitiatorManager cim = bus.getExtension(ConduitInitiatorManager.class);
         ConduitInitiator ci = cim.getConduitInitiator("http://schemas.xmlsoap.org/soap/http");

Modified: incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/spring/BeanDefinitionParsersTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/spring/BeanDefinitionParsersTest.java?view=diff&rev=545115&r1=545114&r2=545115
==============================================================================
--- incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/spring/BeanDefinitionParsersTest.java (original)
+++ incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/spring/BeanDefinitionParsersTest.java Thu Jun  7 02:05:23 2007
@@ -24,7 +24,6 @@
 import org.apache.cxf.transport.http.spring.HttpConduitBeanDefinitionParser;
 import org.apache.cxf.transport.http.spring.HttpDestinationBeanDefinitionParser;
 import org.apache.cxf.transports.http.configuration.HTTPClientPolicy;
-import org.apache.cxf.transports.http.configuration.HTTPListenerPolicy;
 import org.apache.cxf.transports.http.configuration.HTTPServerPolicy;
 import org.junit.Assert;
 import org.junit.Test;
@@ -62,16 +61,36 @@
     }
     
     @Test
-    public void testHttpListener()throws Exception {
+    public void testJettyHTTPServerEngineFactory()throws Exception {
         BeanDefinitionBuilder bd = BeanDefinitionBuilder.childBeanDefinition("child");
         
-        ListenerBeanDefinitionParser parser = new ListenerBeanDefinitionParser();
+        JettyHTTPServerEngineFactoryBeanDefinitionParser parser = 
+            new JettyHTTPServerEngineFactoryBeanDefinitionParser();
 
-        Document d = DOMUtils.readXml(getClass().getResourceAsStream("listener.xml"));
+        Document d = DOMUtils.readXml(getClass().getResourceAsStream("serverenginefactory.xml"));
         parser.doParse(d.getDocumentElement(), null, bd);
         
-        PropertyValue[] pvs = bd.getRawBeanDefinition().getPropertyValues().getPropertyValues();
-        assertEquals(1, pvs.length);
-        assertEquals(111, ((HTTPListenerPolicy) pvs[0].getValue()).getMinThreads());
+        PropertyValue[] pvs = bd.getRawBeanDefinition()
+            .getPropertyValues().getPropertyValues();
+        
+        // First is config, Second is the bus.
+        assertEquals(2, pvs.length);
+        
+        JettyHTTPServerEngineFactoryConfig con =
+            (JettyHTTPServerEngineFactoryConfig) pvs[0].getValue();
+        
+        assertEquals(1, con.threadingParametersMap.get(9000).getMinThreads());
+        assertEquals(2, con.threadingParametersMap.get(9000).getMaxThreads());
+        assertNotNull(con.tlsParametersMap.get(9000));
+        assertNotNull(con.tlsParametersMap.get(9000).getClientAuthentication());
+        assertFalse(con.tlsParametersMap.get(9000).getClientAuthentication().isWant());
+        assertFalse(con.tlsParametersMap.get(9000).getClientAuthentication().isRequired());
+
+        assertNotNull(con.tlsParametersMap.get(9001));
+        assertNotNull(con.tlsParametersMap.get(9001).getClientAuthentication());
+        assertEquals(11, con.threadingParametersMap.get(9001).getMinThreads());
+        assertEquals(12, con.threadingParametersMap.get(9001).getMaxThreads());
+        assertTrue(con.tlsParametersMap.get(9001).getClientAuthentication().isWant());
+        assertTrue(con.tlsParametersMap.get(9001).getClientAuthentication().isRequired());
     }
 }

Modified: incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/spring/beans.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/spring/beans.xml?view=diff&rev=545115&r1=545114&r2=545115
==============================================================================
--- incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/spring/beans.xml (original)
+++ incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/spring/beans.xml Thu Jun  7 02:05:23 2007
@@ -21,13 +21,17 @@
        xmlns:beans="http://www.springframework.org/schema/beans"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns:h="http://cxf.apache.org/transports/http/configuration"
-       xmlns:l="http://cxf.apache.org/transport/http/listener"
+       xmlns:hj="http://cxf.apache.org/transports/http-jetty/configuration"
        xmlns:sec="http://cxf.apache.org/configuration/security"
        xsi:schemaLocation="
-http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
-http://cxf.apache.org/configuration/security http://cxf.apache.org/schemas/configuration/security.xsd
-http://cxf.apache.org/transport/http/listener http://cxf.apache.org/schemas/configuration/http-listener.xsd
-http://cxf.apache.org/transports/http/configuration http://cxf.apache.org/schemas/configuration/http-conf.xsd"
+		http://www.springframework.org/schema/beans 
+		    http://www.springframework.org/schema/beans/spring-beans.xsd
+		http://cxf.apache.org/configuration/security 
+		    http://cxf.apache.org/schemas/configuration/security.xsd
+		http://cxf.apache.org/transports/http/configuration 
+		    http://cxf.apache.org/schemas/configuration/http-conf.xsd
+		http://cxf.apache.org/transports/http-jetty/configuration 
+		    http://cxf.apache.org/schemas/configuration/http-jetty.xsd"
 >
 
     <h:destination name="{urn:test:ns}Foo.http-destination">
@@ -37,19 +41,19 @@
     <h:conduit name="{urn:test:ns}Foo.http-conduit">
       <h:client ConnectionTimeout="97"/>
     </h:conduit>
-    
+
     <h:conduit name="*Bar.http-conduit">
       <h:client ConnectionTimeout="79"/>
     </h:conduit>
-    
-    <l:listener id="org.apache.cxf.transport.http_jetty.JettyHTTPServerEngine.9000">     
-      <l:listener>
-        <h:MinThreads>111</h:MinThreads> 
-      </l:listener> 
-      <l:sslServer>
-        <sec:WantClientAuthentication>true</sec:WantClientAuthentication>
-      </l:sslServer>
-    </l:listener>
-    
 
+    <hj:engine-factory bus="cxf">
+	   <hj:identifiedThreadingParameters id="sampleThreading1">
+	      <hj:threadingParameters minThreads="111" maxThreads="120"/>
+	   </hj:identifiedThreadingParameters>
+	   
+	   <hj:engine port="9000">
+	      <hj:threadingParametersRef id="sampleThreading1"/>
+	   </hj:engine>
+	   
+	</hj:engine-factory>
 </beans>

Added: incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/spring/serverenginefactory.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/spring/serverenginefactory.xml?view=auto&rev=545115
==============================================================================
--- incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/spring/serverenginefactory.xml (added)
+++ incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/spring/serverenginefactory.xml Thu Jun  7 02:05:23 2007
@@ -0,0 +1,29 @@
+<hj:engine-factory
+       xmlns:hj="http://cxf.apache.org/transports/http-jetty/configuration"
+       xmlns:sec="http://cxf.apache.org/configuration/security"
+   bus="cxf">
+   
+   <hj:identifiedTLSServerParameters id="sample1">
+      <hj:tlsServerParameters jsseProvider="SUN" secureSocketProtocol="TLS">
+        <sec:clientAuthentication want="false" required="false"/>
+      </hj:tlsServerParameters>
+   </hj:identifiedTLSServerParameters>
+   
+   <hj:identifiedThreadingParameters id="sampleThreading1">
+      <hj:threadingParameters minThreads="11" maxThreads="12"/>
+   </hj:identifiedThreadingParameters>
+   
+   <hj:engine port="9000">
+      <hj:tlsServerParametersRef id="sample1"/>
+      <hj:threadingParameters minThreads="1" maxThreads="2"/>
+   </hj:engine>
+   
+   <hj:engine port="9001">
+      <hj:tlsServerParameters>
+        <sec:clientAuthentication want="true" required="true"/>
+      </hj:tlsServerParameters>
+      <hj:threadingParametersRef id="sampleThreading1"/>
+   </hj:engine>
+   
+</hj:engine-factory>
+         

Propchange: incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/spring/serverenginefactory.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/spring/serverenginefactory.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/spring/serverenginefactory.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Modified: incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/configuration/jsse/spring/TLSClientParametersConfig.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/configuration/jsse/spring/TLSClientParametersConfig.java?view=diff&rev=545115&r1=545114&r2=545115
==============================================================================
--- incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/configuration/jsse/spring/TLSClientParametersConfig.java (original)
+++ incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/configuration/jsse/spring/TLSClientParametersConfig.java Thu Jun  7 02:05:23 2007
@@ -37,20 +37,30 @@
     public TLSClientParametersConfig(TLSClientParametersType params) 
         throws GeneralSecurityException,
                IOException {
-        
-        this.setCipherSuitesFilter(params.getCipherSuitesFilter());
+
+        if (params.isSetCipherSuitesFilter()) {
+            this.setCipherSuitesFilter(params.getCipherSuitesFilter());
+        }
         if (params.isSetCipherSuites()) {
             this.setCipherSuites(params.getCipherSuites().getCipherSuite());
         }
-        this.setJsseProvider(params.getJsseProvider());
-        this.setSecureSocketProtocol(params.getSecureSocketProtocol());
-        this.setSecureRandom(
+        if (params.isSetJsseProvider()) {
+            this.setJsseProvider(params.getJsseProvider());
+        }
+        if (params.isSetSecureRandomParameters()) {
+            this.setSecureRandom(
                 TLSParameterJaxBUtils.getSecureRandom(
                         params.getSecureRandomParameters()));
-        this.setKeyManagers(
+        }
+        if (params.isSetKeyManagers()) {
+            this.setKeyManagers(
                 TLSParameterJaxBUtils.getKeyManagers(params.getKeyManagers()));
-        this.setTrustManagers(
-                TLSParameterJaxBUtils.getTrustManagers(params.getTrustManagers()));
+        }
+        if (params.isSetTrustManagers()) {
+            this.setTrustManagers(
+                TLSParameterJaxBUtils.getTrustManagers(
+                        params.getTrustManagers()));
+        }
     }
 
 }

Modified: incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/configuration/jsse/spring/TLSParameterJaxBUtils.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/configuration/jsse/spring/TLSParameterJaxBUtils.java?view=diff&rev=545115&r1=545114&r2=545115
==============================================================================
--- incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/configuration/jsse/spring/TLSParameterJaxBUtils.java (original)
+++ incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/configuration/jsse/spring/TLSParameterJaxBUtils.java Thu Jun  7 02:05:23 2007
@@ -81,6 +81,10 @@
         throws GeneralSecurityException,
                IOException {
         
+        if (kst == null) {
+            return null;
+        }
+        
         String type = kst.isSetType()
                     ? kst.getType()
                     : KeyStore.getDefaultType();

Modified: incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/configuration/jsse/spring/TLSServerParametersConfig.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/configuration/jsse/spring/TLSServerParametersConfig.java?view=diff&rev=545115&r1=545114&r2=545115
==============================================================================
--- incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/configuration/jsse/spring/TLSServerParametersConfig.java (original)
+++ incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/configuration/jsse/spring/TLSServerParametersConfig.java Thu Jun  7 02:05:23 2007
@@ -36,18 +36,31 @@
         throws GeneralSecurityException,
                IOException {
         
-        this.setCipherSuitesFilter(params.getCipherSuitesFilter());
+        if (params.isSetCipherSuitesFilter()) {
+            this.setCipherSuitesFilter(params.getCipherSuitesFilter());
+        }
         if (params.isSetCipherSuites()) {
             this.setCipherSuites(params.getCipherSuites().getCipherSuite());
         }
-        this.setJsseProvider(params.getJsseProvider());
-        this.setSecureRandom(
+        if (params.isSetJsseProvider()) {
+            this.setJsseProvider(params.getJsseProvider());
+        }
+        if (params.isSetSecureRandomParameters()) {
+            this.setSecureRandom(
                 TLSParameterJaxBUtils.getSecureRandom(
                         params.getSecureRandomParameters()));
-        this.setClientAuthentication(params.getClientAuthentication());
-        this.setKeyManagers(
+        }
+        if (params.isSetClientAuthentication()) {
+            this.setClientAuthentication(params.getClientAuthentication());
+        }
+        if (params.isSetKeyManagers()) {
+            this.setKeyManagers(
                 TLSParameterJaxBUtils.getKeyManagers(params.getKeyManagers()));
-        this.setTrustManagers(
-                TLSParameterJaxBUtils.getTrustManagers(params.getTrustManagers()));
+        }
+        if (params.isSetTrustManagers()) {
+            this.setTrustManagers(
+                TLSParameterJaxBUtils.getTrustManagers(
+                        params.getTrustManagers()));
+        }
     }
 }

Modified: incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/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/AbstractHTTPDestination.java?view=diff&rev=545115&r1=545114&r2=545115
==============================================================================
--- incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPDestination.java (original)
+++ incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPDestination.java Thu Jun  7 02:05:23 2007
@@ -42,9 +42,7 @@
 import org.apache.cxf.common.util.Base64Utility;
 import org.apache.cxf.common.util.StringUtils;
 import org.apache.cxf.configuration.Configurable;
-import org.apache.cxf.configuration.jsse.TLSServerParameters;
 import org.apache.cxf.configuration.security.AuthorizationPolicy;
-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;
@@ -81,18 +79,11 @@
 
     // Configuration values
     protected HTTPServerPolicy server;
-    protected AuthorizationPolicy authorization;
-    protected SSLServerPolicy sslServer;
     protected String contextMatchStrategy = "stem";
     protected boolean fixedParameterOrder;
     protected boolean multiplexWithAddress;
     
     /**
-     *  This field holds the TLS Server Parameters for this Destination.
-     */
-    protected TLSServerParameters tlsServerParameters;
-
-    /**
      * Constructor
      * 
      * @param b the associated Bus
@@ -260,13 +251,14 @@
     private void initConfig() {
         PolicyEngine engine = bus.getExtension(PolicyEngine.class);
         // for a decoupled endpoint there is no service info
-        if (null != engine && engine.isEnabled() && null != endpointInfo.getService()) {
+        if (null != engine && engine.isEnabled() 
+            && null != endpointInfo.getService()) {
             server = PolicyUtils.getServer(engine, endpointInfo, this);
         }
         if (null == server) {
-            server = endpointInfo.getTraversedExtensor(new HTTPServerPolicy(), HTTPServerPolicy.class);
+            server = endpointInfo.getTraversedExtensor(
+                    new HTTPServerPolicy(), HTTPServerPolicy.class);
         }
-        this.sslServer = endpointInfo.getTraversedExtensor(null, SSLServerPolicy.class);
     }
 
     void setPolicies(Map<String, List<String>> headers) {
@@ -480,14 +472,6 @@
         return id;
     }
 
-    public AuthorizationPolicy getAuthorization() {
-        return authorization;
-    }
-
-    public void setAuthorization(AuthorizationPolicy authorization) {
-        this.authorization = authorization;
-    }
-
     public String getContextMatchStrategy() {
         return contextMatchStrategy;
     }
@@ -520,24 +504,6 @@
         this.server = server;
     }
     
-    @Deprecated
-    public SSLServerPolicy getSslServer() {
-        return sslServer;
-    }
-
-    @Deprecated
-    public void setSslServer(SSLServerPolicy sslServer) {
-        this.sslServer = sslServer;
-    }
-    
-    public void setTlsServerParameters(TLSServerParameters params) {
-        this.tlsServerParameters = params;
-    }
-
-    public TLSServerParameters getTlsServerParameters() {
-        return this.tlsServerParameters;
-    }
-    
     public void assertMessage(Message message) {
         PolicyUtils.assertServerPolicy(message, server); 
     }
@@ -545,8 +511,5 @@
     public boolean canAssert(QName type) {
         return PolicyUtils.HTTPSERVERPOLICY_ASSERTION_QNAME.equals(type); 
     }
-    
-    
-    
     
 }

Modified: incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPTransportFactory.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPTransportFactory.java?view=diff&rev=545115&r1=545114&r2=545115
==============================================================================
--- incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPTransportFactory.java (original)
+++ incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPTransportFactory.java Thu Jun  7 02:05:23 2007
@@ -243,10 +243,6 @@
         if (configuredConduit.getTlsClientParameters() != null) {
             fac = new HttpsURLConnectionFactory(
                              configuredConduit.getTlsClientParameters());
-        // TODO: remove when old SSL config is gone
-        } else if (configuredConduit.getSslClient() != null) {
-            fac = new HttpsURLConnectionFactory(
-                             configuredConduit.getSslClient());
         } else {
             fac = new HttpURLConnectionFactoryImpl();
         }

Modified: incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/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=545115&r1=545114&r2=545115
==============================================================================
--- incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java (original)
+++ incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java Thu Jun  7 02:05:23 2007
@@ -47,7 +47,6 @@
 import org.apache.cxf.configuration.jsse.TLSClientParameters;
 import org.apache.cxf.configuration.security.AuthorizationPolicy;
 import org.apache.cxf.configuration.security.ProxyAuthorizationPolicy;
-import org.apache.cxf.configuration.security.SSLClientPolicy;
 import org.apache.cxf.helpers.CastUtils;
 import org.apache.cxf.helpers.HttpHeaderHelper;
 import org.apache.cxf.io.AbstractWrappedOutputStream;
@@ -222,13 +221,6 @@
      * on the conduit name.
      */
     private ProxyAuthorizationPolicy proxyAuthorizationPolicy;
-    
-    /**
-     * This field holds the configuration TLS configuration which is
-     * "injected" by spring based on the conduit name.
-     */
-    @Deprecated
-    private SSLClientPolicy sslClientSidePolicy;
 
     /**
      * This field holds the configuration TLS configuration which
@@ -353,11 +345,6 @@
                     new ProxyAuthorizationPolicy(), ProxyAuthorizationPolicy.class);
            
         }
-        // TODO: remove once old SSL configuration is gone
-        if (this.sslClientSidePolicy == null) {
-            sslClientSidePolicy = endpointInfo.getTraversedExtensor(
-                    null, SSLClientPolicy.class);
-        }
         if (this.tlsClientParameters == null) {
             tlsClientParameters = endpointInfo.getTraversedExtensor(
                     null, TLSClientParameters.class);
@@ -371,14 +358,14 @@
                     null, HttpBasicAuthSupplier.class);
         }
         if (trustDecider == null) {
-            if (LOG.isLoggable(Level.INFO)) {
-                LOG.log(Level.INFO,
+            if (LOG.isLoggable(Level.FINE)) {
+                LOG.log(Level.FINE,
                     "No Trust Decider configured for Conduit '"
                     + getConduitName() + "'");
             }
         } else {
-            if (LOG.isLoggable(Level.INFO)) {
-                LOG.log(Level.INFO, "Message Trust Decider of class '" 
+            if (LOG.isLoggable(Level.FINE)) {
+                LOG.log(Level.FINE, "Message Trust Decider of class '" 
                     + trustDecider.getClass().getName()
                     + "' with logical name of '"
                     + trustDecider.getLogicalName()
@@ -388,14 +375,14 @@
             }
         }
         if (basicAuthSupplier == null) {
-            if (LOG.isLoggable(Level.INFO)) {
-                LOG.log(Level.INFO,
+            if (LOG.isLoggable(Level.FINE)) {
+                LOG.log(Level.FINE,
                     "No Basic Auth Supplier configured for Conduit '"
                     + getConduitName() + "'");
             }
         } else {
-            if (LOG.isLoggable(Level.INFO)) {
-                LOG.log(Level.INFO, "HttpBasicAuthSupplier of class '" 
+            if (LOG.isLoggable(Level.FINE)) {
+                LOG.log(Level.FINE, "HttpBasicAuthSupplier of class '" 
                     + basicAuthSupplier.getClass().getName()
                     + "' with logical name of '"
                     + basicAuthSupplier.getLogicalName()
@@ -404,6 +391,20 @@
                     + "'");
             }
         }
+        if (this.tlsClientParameters != null) {
+            if (LOG.isLoggable(Level.FINE)) {
+                LOG.log(Level.FINE, "Conduit '" + getConduitName()
+                    + "' has been configured for TLS "
+                    + "keyManagers " + tlsClientParameters.getKeyManagers()
+                    + "trustManagers " + tlsClientParameters.getTrustManagers()
+                    + "secureRandom " + tlsClientParameters.getSecureRandom());
+            }
+        } else {
+            if (LOG.isLoggable(Level.FINE)) {
+                LOG.log(Level.FINE, "Conduit '" + getConduitName()
+                    + "' has been configured for plain http.");
+            }
+        }
 
         // Get the correct URLConnection factory based on the 
         // configuration.
@@ -1149,33 +1150,6 @@
     }
 
     /**
-     * This method returns the SSL Client Side Policy that is set/configured
-     * for this HTTPConduit.
-     */
-    @Deprecated
-    public SSLClientPolicy getSslClient() {
-        return sslClientSidePolicy;
-    }
-
-    /**
-     * This method sets the SSL Client Side Policy for this HTTPConduit.
-     * Using this method overrides any SSL Client Side Policy that is configured
-     * for this HTTPConduit.
-     */
-    @Deprecated
-    @Resource
-    public void setSslClient(SSLClientPolicy sslClientPolicy) {
-        LOG.info("The setSslClient method is deprecated. Please use setTlsClientParameters.");
-        
-        this.sslClientSidePolicy = sslClientPolicy;
-        // If this is called after the HTTPTransportFactory called 
-        // finalizeConfig, we need to update the connection factory.
-        if (configFinalized) {
-            retrieveConnectionFactory();
-        }
-    }
-
-    /**
      * This method returns the TLS Client Parameters that is set/configured
      * for this HTTPConduit.
      */
@@ -1191,6 +1165,20 @@
     @Resource
     public void setTlsClientParameters(TLSClientParameters params) {
         this.tlsClientParameters = params;
+        if (this.tlsClientParameters != null) {
+            if (LOG.isLoggable(Level.FINE)) {
+                LOG.log(Level.FINE, "Conduit '" + getConduitName()
+                    + "' has been (re) configured for TLS "
+                    + "keyManagers " + tlsClientParameters.getKeyManagers()
+                    + "trustManagers " + tlsClientParameters.getTrustManagers()
+                    + "secureRandom " + tlsClientParameters.getSecureRandom());
+            }
+        } else {
+            if (LOG.isLoggable(Level.FINE)) {
+                LOG.log(Level.FINE, "Conduit '" + getConduitName()
+                    + "' has been (re)configured for plain http.");
+            }
+        }
         // If this is called after the HTTPTransportFactory called 
         // finalizeConfig, we need to update the connection factory.
         if (configFinalized) {
@@ -1877,4 +1865,5 @@
     }
     
 }
+
 

Modified: incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/spring/HttpConduitBeanDefinitionParser.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/spring/HttpConduitBeanDefinitionParser.java?view=diff&rev=545115&r1=545114&r2=545115
==============================================================================
--- incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/spring/HttpConduitBeanDefinitionParser.java (original)
+++ incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/spring/HttpConduitBeanDefinitionParser.java Thu Jun  7 02:05:23 2007
@@ -32,7 +32,6 @@
 import org.apache.cxf.configuration.jsse.spring.TLSClientParametersConfig;
 import org.apache.cxf.configuration.security.AuthorizationPolicy;
 import org.apache.cxf.configuration.security.ProxyAuthorizationPolicy;
-import org.apache.cxf.configuration.security.SSLClientPolicy;
 import org.apache.cxf.configuration.security.TLSClientParametersType;
 import org.apache.cxf.configuration.spring.AbstractBeanDefinitionParser;
 import org.apache.cxf.transport.http.HTTPConduit;
@@ -61,11 +60,6 @@
         mapElementToJaxbProperty(element, bean, 
                 new QName(HTTP_NS, "authorization"), "authorization", 
                 AuthorizationPolicy.class);
-        
-       // DEPRECATED: This element is deprecated in favor of tlsClientParameters
-        mapElementToJaxbProperty(element, bean, 
-                new QName(HTTP_NS, "sslClient"), "sslClient", 
-                SSLClientPolicy.class);
         
         mapSpecificElements(element, bean);
     }

Modified: incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/spring/HttpDestinationBeanDefinitionParser.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/spring/HttpDestinationBeanDefinitionParser.java?view=diff&rev=545115&r1=545114&r2=545115
==============================================================================
--- incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/spring/HttpDestinationBeanDefinitionParser.java (original)
+++ incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/spring/HttpDestinationBeanDefinitionParser.java Thu Jun  7 02:05:23 2007
@@ -18,101 +18,39 @@
  */
 package org.apache.cxf.transport.http.spring;
 
-import javax.xml.bind.DatatypeConverter;
-import javax.xml.bind.JAXBContext;
-import javax.xml.bind.JAXBElement;
-import javax.xml.bind.Unmarshaller;
 import javax.xml.namespace.QName;
 
 import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
 
-import org.apache.cxf.configuration.jsse.TLSServerParameters;
-import org.apache.cxf.configuration.jsse.spring.TLSServerParametersConfig;
-import org.apache.cxf.configuration.security.AuthorizationPolicy;
-import org.apache.cxf.configuration.security.SSLServerPolicy;
-import org.apache.cxf.configuration.security.TLSServerParametersType;
 import org.apache.cxf.configuration.spring.AbstractBeanDefinitionParser;
 import org.apache.cxf.transport.http.AbstractHTTPDestination;
-import org.apache.cxf.transports.http.configuration.HTTPServerPolicy;
 import org.springframework.beans.factory.support.BeanDefinitionBuilder;
 import org.springframework.beans.factory.xml.ParserContext;
 
-public class HttpDestinationBeanDefinitionParser extends AbstractBeanDefinitionParser {
+public class HttpDestinationBeanDefinitionParser 
+    extends AbstractBeanDefinitionParser {
 
-    private static final String HTTP_NS = "http://cxf.apache.org/transports/http/configuration";
+    private static final String HTTP_NS = 
+        "http://cxf.apache.org/transports/http/configuration";
 
     @Override
-    public void doParse(Element element, ParserContext ctx, BeanDefinitionBuilder bean) {
+    public void doParse(Element element, ParserContext ctc, BeanDefinitionBuilder bean) {
         bean.setAbstract(true);
-        mapElementToJaxbProperty(element, bean, new QName(HTTP_NS, "server"), "server", 
-                                 HTTPServerPolicy.class);
-        
-        // DEPRECATED: This element is deprecated in favor of tlsServerParameters.
-        mapElementToJaxbProperty(element, bean, new QName(HTTP_NS, "sslServer"), "sslServer", 
-                                 SSLServerPolicy.class);
-        
-        mapElementToJaxbProperty(element, bean, new QName(HTTP_NS, "authorization"), "authorization", 
-                                 AuthorizationPolicy.class);
-        
-        mapSpecificElements(element, bean);
+        mapElementToJaxbProperty(element, bean, 
+                new QName(HTTP_NS, "server"), "server");
+        mapElementToJaxbProperty(element, bean, 
+                new QName(HTTP_NS, "fixedParameterOrder"),
+                                   "fixedParameterOrder");
+        mapElementToJaxbProperty(element, bean, 
+                new QName(HTTP_NS, "contextMatchStrategy"),
+                                   "contextMatchStrategy");
     }
-
-    /**
-     * This method specifically maps the "tlsServerParameters" on the 
-     * HTTPDestination.
-     * 
-     * @param parent This should represent "destination".
-     * @param bean   The bean parser.
-     */
-    private void mapSpecificElements(
-        Element               parent, 
-        BeanDefinitionBuilder bean
-    ) {
-        NodeList nl = parent.getChildNodes();
-        for (int i = 0; i < nl.getLength(); i++) {
-            Node n = nl.item(i);
-            if (Node.ELEMENT_NODE != n.getNodeType() 
-                || !HTTP_NS.equals(n.getNamespaceURI())) {
-                continue;
-            }
-            Element elem = (Element)n;
-            String elementName = n.getLocalName(); 
-            if ("tlsServerParameters".equals(elementName)) {
-                this.mapTLSServerParameters(n, bean);
-            } else if ("contextMatchStrategy".equals(elementName)) {
-                bean.addPropertyValue(elementName, DatatypeConverter.parseString(elem.getTextContent()));
-            } else if ("fixedParameterOrder".equals(elementName)) {
-                bean.addPropertyValue(elementName, DatatypeConverter.parseBoolean(elem.getTextContent()));
-            }
-        }
-    }
-
-    /**
-     * Inject the "setTlsServerParameters" method with
-     * a TLSServerParametersConfig object initialized with the JAXB
-     * generated type unmarshalled from the selected node.
-     */
-    public void mapTLSServerParameters(Node n, BeanDefinitionBuilder bean) {
-
-        // Unmarshal the JAXB Generated Type from Config and inject
-        // the configured TLSClientParameters into the HTTPDestination.
-        JAXBContext context = null;
-        try {
-            context = JAXBContext.newInstance(TLSServerParametersType.class.getPackage().getName(), 
-                                  getClass().getClassLoader());
-            Unmarshaller u = context.createUnmarshaller();
-            JAXBElement<TLSServerParametersType> jaxb = 
-                u.unmarshal(n, TLSServerParametersType.class);
-            TLSServerParameters params = 
-                new TLSServerParametersConfig(jaxb.getValue());
-            bean.addPropertyValue("tlsServerParameters", params);
-        } catch (Exception e) {
-            throw new RuntimeException("Could not process configuration.", e);
-        }
+    
+    @Override
+    protected String getJaxbPackage() {
+        return "org.apache.cxf.transports.http.configuration";
     }
-
+    
     @Override
     protected Class getBeanClass(Element arg0) {
         return AbstractHTTPDestination.class;

Modified: incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/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/HttpsURLConnectionFactory.java?view=diff&rev=545115&r1=545114&r2=545115
==============================================================================
--- incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/https/HttpsURLConnectionFactory.java (original)
+++ incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/https/HttpsURLConnectionFactory.java Thu Jun  7 02:05:23 2007
@@ -27,7 +27,6 @@
 import java.security.NoSuchAlgorithmException;
 import java.security.NoSuchProviderException;
 import java.util.logging.Handler;
-import java.util.logging.Level;
 import java.util.logging.Logger;
 
 import javax.imageio.IIOException;
@@ -38,7 +37,6 @@
 
 import org.apache.cxf.common.logging.LogUtils;
 import org.apache.cxf.configuration.jsse.TLSClientParameters;
-import org.apache.cxf.configuration.security.SSLClientPolicy;
 import org.apache.cxf.transport.http.HTTPConduit;
 import org.apache.cxf.transport.http.HttpURLConnectionFactory;
 import org.apache.cxf.transport.http.HttpURLConnectionInfo;
@@ -80,29 +78,10 @@
     HTTPConduit conduit;
     
     /**
-     * This field contains the TLS configuration for URLs created
-     * by this factory.
-     */
-    @Deprecated
-    SSLClientPolicy sslPolicy;
-    
-    /**
      * This field contains the TLS configuration for the URLs created by
      * this factory.
      */
     TLSClientParameters tlsClientParameters;
-    
-    /**
-     * This constructor initialized the factory with the configured SSL Client
-     * Side Policy for the HTTPConduit for which this factory is used.
-     * 
-     * @param policy The SSL Client Side Policy. This parameter is guaranteed 
-     *               to be non-null.
-     */
-    @Deprecated
-    public HttpsURLConnectionFactory(SSLClientPolicy policy) {
-        sslPolicy        = policy;
-    }
 
     /**
      * This constructor initialized the factory with the configured TLS
@@ -157,8 +136,6 @@
                     throw new IIOException("Error while initializing secure socket", ex);
                 }
             }
-        } else if (sslPolicy != null) {
-            decorate(connection);
         } else {
             assert false;
         }
@@ -189,82 +166,6 @@
         }
 
     }
-
-    /**
-     * Decorate connection with applicable SSL settings.
-     * 
-     * @param secureConnection the secure connection
-     */
-    @Deprecated
-    protected void decorate(HttpsURLConnection secureConnection) {
-        String keyStoreLocation =
-            SSLUtils.getKeystore(sslPolicy.getKeystore(), LOG);
-        String keyStoreType =
-            SSLUtils.getKeystoreType(sslPolicy.getKeystoreType(), LOG);
-        String keyStorePassword =
-            SSLUtils.getKeystorePassword(sslPolicy.getKeystorePassword(), LOG);
-        String keyPassword =
-            SSLUtils.getKeyPassword(sslPolicy.getKeyPassword(), LOG);
-        String keyStoreMgrFactoryAlgorithm =
-            SSLUtils.getKeystoreAlgorithm(
-                    sslPolicy.getKeystoreAlgorithm(), LOG);
-        String trustStoreMgrFactoryAlgorithm =
-            SSLUtils.getTrustStoreAlgorithm(
-                    sslPolicy.getTrustStoreAlgorithm(), LOG);
-        String trustStoreLocation =
-            SSLUtils.getTrustStore(sslPolicy.getTrustStore(), LOG);
-        String trustStoreType =
-            SSLUtils.getTrustStoreType(sslPolicy.getTrustStoreType(), LOG);
-        String secureSocketProtocol =
-            SSLUtils.getSecureSocketProtocol(
-                    sslPolicy.getSecureSocketProtocol(), LOG);
-        
-        secureConnection.setHostnameVerifier(
-                    new AlwaysTrueHostnameVerifier());
-        
-        try {
-            // There is something special about the keystore being a pkcs12
-            // that governs the trust store. I don't know what that is.
-            
-            boolean pkcs12 =
-                keyStoreType.equalsIgnoreCase(SSLUtils.PKCS12_TYPE);
-            SSLContext ctx = SSLUtils.getSSLContext(
-                secureSocketProtocol,
-                SSLUtils.getKeyStoreManagers(keyStoreLocation,
-                                             keyStoreType,
-                                             keyStorePassword,
-                                             keyPassword,
-                                             keyStoreMgrFactoryAlgorithm,
-                                             secureSocketProtocol,
-                                             LOG),
-                SSLUtils.getTrustStoreManagers(pkcs12,
-                                               trustStoreType,
-                                               trustStoreLocation,
-                                               trustStoreMgrFactoryAlgorithm,
-                                               LOG));
-            
-            String[] cipherSuites =
-                SSLUtils.getCiphersuites(sslPolicy.getCiphersuites(),
-                                         SSLUtils.getSupportedCipherSuites(ctx),
-                                         sslPolicy.getCiphersuiteFilters(),
-                                         LOG, false);
-            
-            // The SSLSocketFactoryWrapper enables certain cipher suites
-            // from the policy.
-            secureConnection.setSSLSocketFactory(
-                new SSLSocketFactoryWrapper(ctx.getSocketFactory(),
-                                            cipherSuites));
-            
-           
-        } catch (Exception e) {
-            LogUtils.log(LOG, Level.SEVERE, "SSL_CONTEXT_INIT_FAILURE", e);
-        }
-        
-        SSLUtils.logUnSupportedPolicies(sslPolicy,
-                                        true,
-                                        UNSUPPORTED,
-                                        LOG);
-    }
     
     /**
      * This method assigns the various TLS parameters on the HttpsURLConnection
@@ -283,7 +184,7 @@
         SSLContext ctx = provider == null
                   ? SSLContext.getInstance(protocol)
                   : SSLContext.getInstance(protocol, provider);
-                  
+        
         ctx.init(
             tlsClientParameters.getKeyManagers(), 
             tlsClientParameters.getTrustManagers(), 
@@ -305,6 +206,7 @@
             new SSLSocketFactoryWrapper(ctx.getSocketFactory(),
                                         cipherSuites));
         
+        
     }
     /*
      *  For development and testing only
@@ -337,4 +239,5 @@
         return new HttpsURLConnectionInfo((HttpsURLConnection)connection);
     }
 }
+
 

Modified: incubator/cxf/trunk/rt/transports/http/src/main/resources/META-INF/spring.schemas
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/http/src/main/resources/META-INF/spring.schemas?view=diff&rev=545115&r1=545114&r2=545115
==============================================================================
--- incubator/cxf/trunk/rt/transports/http/src/main/resources/META-INF/spring.schemas (original)
+++ incubator/cxf/trunk/rt/transports/http/src/main/resources/META-INF/spring.schemas Thu Jun  7 02:05:23 2007
@@ -1,3 +1,2 @@
 http\://cxf.apache.org/schemas/wsdl/http-conf.xsd=schemas/wsdl/http-conf.xsd
 http\://cxf.apache.org/schemas/configuration/http-conf.xsd=schemas/configuration/http-conf.xsd
-http\://cxf.apache.org/schemas/configuration/http-listener.xsd=schemas/configuration/http-listener.xsd



Mime
View raw message