cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ningji...@apache.org
Subject svn commit: r545115 [1/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
Author: ningjiang
Date: Thu Jun  7 02:05:23 2007
New Revision: 545115

URL: http://svn.apache.org/viewvc?view=rev&rev=545115
Log:
CXF-706 applied Polar's patch for https configuration

Added:
    incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/ThreadingParameters.java   (with props)
    incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/spring/JettyHTTPServerEngineFactoryBeanDefinitionParser.java   (with props)
    incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/spring/JettyHTTPServerEngineFactoryConfig.java   (with props)
    incubator/cxf/trunk/rt/transports/http-jetty/src/main/resources/META-INF/spring.schemas
    incubator/cxf/trunk/rt/transports/http-jetty/src/main/resources/catalog.cat   (with props)
    incubator/cxf/trunk/rt/transports/http-jetty/src/main/resources/schemas/
    incubator/cxf/trunk/rt/transports/http-jetty/src/main/resources/schemas/configuration/
    incubator/cxf/trunk/rt/transports/http-jetty/src/main/resources/schemas/configuration/http-jetty.xsd   (with props)
    incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/spring/serverenginefactory.xml   (with props)
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/http/resources/BethalClientConfig.cxf
Removed:
    incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/spring/ListenerBeanDefinitionParser.java
    incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/spring/listener.xml
    incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/https_jetty/JettySslConnectorFactoryTest.java
    incubator/cxf/trunk/rt/transports/http/src/test/java/org/apache/cxf/transport/https/HttpsURLConnectionFactoryTest.java
    incubator/cxf/trunk/rt/transports/http/src/test/java/org/apache/cxf/transport/https/TestHttpsURLConnection.java
    incubator/cxf/trunk/rt/transports/http/src/test/java/org/apache/cxf/transport/https/TestLogHandler.java
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/http/HTTPConduit2Test.java
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/http/resources/Abost-2.cxf
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/http/resources/Bethal-2.cxf
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/http/resources/Gordy-2.cxf
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/http/resources/Http2HttpLoopRedirectFail-2.cxf
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/http/resources/Http2HttpRedirect-2.cxf
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/http/resources/Hurlon-2.cxf
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/http/resources/Morpit-2.cxf
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/http/resources/Mortimer-2.cxf
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/http/resources/Poltim-2.cxf
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/http/resources/Rethwel-2.cxf
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/http/resources/Tarpin-2.cxf
Modified:
    incubator/cxf/trunk/common/schemas/src/main/resources/schemas/configuration/security.xsd
    incubator/cxf/trunk/parent/pom.xml
    incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
    incubator/cxf/trunk/rt/transports/http-jetty/pom.xml
    incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPDestination.java
    incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngine.java
    incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngineFactory.java
    incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPTransportFactory.java
    incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/spring/NamespaceHandler.java
    incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/https_jetty/CXFJettySslSocketConnector.java
    incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/https_jetty/JettySslConnectorFactory.java
    incubator/cxf/trunk/rt/transports/http-jetty/src/main/resources/META-INF/spring.handlers
    incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/JettyHTTPDestinationTest.java
    incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngineTest.java
    incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/spring/ApplicationContextTest.java
    incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/spring/BeanDefinitionParsersTest.java
    incubator/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/spring/beans.xml
    incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/configuration/jsse/spring/TLSClientParametersConfig.java
    incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/configuration/jsse/spring/TLSParameterJaxBUtils.java
    incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/configuration/jsse/spring/TLSServerParametersConfig.java
    incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPDestination.java
    incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPTransportFactory.java
    incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java
    incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/spring/HttpConduitBeanDefinitionParser.java
    incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/spring/HttpDestinationBeanDefinitionParser.java
    incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/https/HttpsURLConnectionFactory.java
    incubator/cxf/trunk/rt/transports/http/src/main/resources/META-INF/spring.schemas
    incubator/cxf/trunk/rt/transports/http/src/main/resources/schemas/configuration/http-conf.xsd
    incubator/cxf/trunk/rt/transports/http/src/main/resources/schemas/configuration/http-listener.xsd
    incubator/cxf/trunk/rt/transports/http/src/main/resources/schemas/wsdl/http-conf.xsd
    incubator/cxf/trunk/rt/transports/http/src/test/java/org/apache/cxf/transport/http/HTTPConduitURLConnectionTest.java
    incubator/cxf/trunk/rt/transports/http/src/test/java/org/apache/cxf/transport/https/resources/abigcompany_ca.pem
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/http/HTTPConduitTest.java
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/http/resources/Abost.cxf
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/http/resources/Bethal.cxf
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/http/resources/Gordy.cxf
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/http/resources/Http2HttpLoopRedirectFail.cxf
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/http/resources/Http2HttpRedirect.cxf
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/http/resources/Hurlon.cxf
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/http/resources/Morpit.cxf
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/http/resources/Mortimer.cxf
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/http/resources/Poltim.cxf
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/http/resources/Rethwel.cxf
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/http/resources/Tarpin.cxf
    incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/http/resources/client1.xml
    incubator/cxf/trunk/tools/wsdlto/test/pom.xml

Modified: incubator/cxf/trunk/common/schemas/src/main/resources/schemas/configuration/security.xsd
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/common/schemas/src/main/resources/schemas/configuration/security.xsd?view=diff&rev=545115&r1=545114&r2=545115
==============================================================================
--- incubator/cxf/trunk/common/schemas/src/main/resources/schemas/configuration/security.xsd (original)
+++ incubator/cxf/trunk/common/schemas/src/main/resources/schemas/configuration/security.xsd Thu Jun  7 02:05:23 2007
@@ -36,7 +36,8 @@
     <xs:complexType name="AuthorizationPolicy">
         <xs:annotation>
             <xs:documentation>
-            Policies for controlling basic authentication
+            This structure holds parameters that may govern authentication
+            that use a User Password strategy.
             </xs:documentation>
         </xs:annotation>
 
@@ -98,43 +99,177 @@
     </xs:complexType>
     
     <xs:complexType name="ClientAuthentication">
-        <xs:attribute name="want"     type="xs:boolean"/>
-        <xs:attribute name="required" type="xs:boolean"/>
+        <xs:attribute name="want"     type="xs:boolean">
+          <xs:annotation>
+            <xs:documentation>
+            This attribute specifies if client authentication should be requested.
+            </xs:documentation>
+          </xs:annotation>
+        </xs:attribute>
+        <xs:attribute name="required" type="xs:boolean">
+          <xs:annotation>
+            <xs:documentation>
+            This attribute specifies if client authentication should be required.
+            </xs:documentation>
+          </xs:annotation>
+        </xs:attribute>
     </xs:complexType>
     
     <xs:complexType name="KeyStoreType">
-        <xs:attribute name="type"     type="xs:string"/>
-        <xs:attribute name="password" type="xs:string"/>
-        <xs:attribute name="provider" type="xs:string"/>
-        <xs:attribute name="url"      type="xs:string"/>
-        <xs:attribute name="file"     type="xs:string"/>
-        <xs:attribute name="resource" type="xs:string"/>
+        <xs:attribute name="type"     type="xs:string">
+          <xs:annotation>
+            <xs:documentation>
+            This attribute specifies the type of the keystore. 
+            It is highly correlated to the provider. Most common examples
+            are "jks" "pkcs12".
+            </xs:documentation>
+          </xs:annotation>
+        </xs:attribute>
+        <xs:attribute name="password" type="xs:string">
+          <xs:annotation>
+            <xs:documentation>
+            This attribute specifes the integrity password for the keystore.
+            This is not the password that unlock keys within the keystore.
+            </xs:documentation>
+          </xs:annotation>
+        </xs:attribute>
+        <xs:attribute name="provider" type="xs:string">
+          <xs:annotation>
+            <xs:documentation>
+            This attribute specifies the keystore implementation provider.
+            Most common examples are "SUN".
+            </xs:documentation>
+          </xs:annotation>
+        </xs:attribute>
+        <xs:attribute name="url"      type="xs:string">
+          <xs:annotation>
+            <xs:documentation>
+            This attribute specifies the URL location of the keystore.
+            This element should be a properly accessible URL, such as
+            "http://..." "file:///...", etc. Only one attribute of
+            "url", "file", or "resource" is allowed.
+            </xs:documentation>
+          </xs:annotation>
+        </xs:attribute>
+        <xs:attribute name="file"     type="xs:string">
+          <xs:annotation>
+            <xs:documentation>
+            This attribute specifies the File location of the keystore.
+            This element should be a properly accessible file from the
+            working directory. Only one attribute of
+            "url", "file", or "resource" is allowed.
+            </xs:documentation>
+          </xs:annotation>
+        </xs:attribute>
+        <xs:attribute name="resource" type="xs:string">
+          <xs:annotation>
+            <xs:documentation>
+            This attribute specifies the Resource location of the keystore.
+            This element should be a properly accessible on the classpath.
+            Only one attribute of
+            "url", "file", or "resource" is allowed.
+            </xs:documentation>
+          </xs:annotation>
+        </xs:attribute>
     </xs:complexType>
     
     <xs:complexType name="KeyManagersType">
+      <xs:annotation>
+        <xs:documentation>
+        This structure specifies the JSSE based KeyManagers for a single
+        Keystore.
+        </xs:documentation>
+      </xs:annotation>
+      
          <xs:sequence>
-            <xs:element name="keyStore"          type="tns:KeyStoreType" minOccurs="0"/>
+            <xs:element name="keyStore" type="tns:KeyStoreType" minOccurs="0">
+	          <xs:annotation>
+	            <xs:documentation>
+	            This element specified the Keystore for these JSSE KeyManagers.
+	            </xs:documentation>
+	          </xs:annotation>
+	        </xs:element>
          </xs:sequence>
-            <xs:attribute name="keyPassword"       type="xs:string"/>
-            <xs:attribute name="provider"          type="xs:string"/>
-            <xs:attribute name="factoryAlgorithm"  type="xs:string"/>
+            <xs:attribute name="keyPassword" type="xs:string">
+	          <xs:annotation>
+	            <xs:documentation>
+	            This attribute contains the password that unlocks the keys
+	            within the keystore.
+	            </xs:documentation>
+	          </xs:annotation>
+	        </xs:attribute>
+            <xs:attribute name="provider" type="xs:string">
+	          <xs:annotation>
+	            <xs:documentation>
+	            This attribute contains the KeyManagers provider name.
+	            </xs:documentation>
+	          </xs:annotation>
+	        </xs:attribute>
+            <xs:attribute name="factoryAlgorithm"  type="xs:string">
+	          <xs:annotation>
+	            <xs:documentation>
+	            This attribute contains the algorithm the KeyManagers Factory
+	            will use in creating the KeyManagers from the KeyStore. Most
+	            common examples are "PKIX".
+	            </xs:documentation>
+	          </xs:annotation>
+	        </xs:attribute>
     </xs:complexType>
     
     <xs:complexType name="TrustManagersType">
+      <xs:annotation>
+        <xs:documentation>
+        This structure contains the specification of JSSE TrustManagers for
+        a single Keystore used for trusted certificates.
+        </xs:documentation>
+      </xs:annotation>
          <xs:sequence>
-            <xs:element name="keyStore"          type="tns:KeyStoreType" minOccurs="0"/>
+            <xs:element name="keyStore" type="tns:KeyStoreType" minOccurs="0">
+	          <xs:annotation>
+	            <xs:documentation>
+	            This element contains the KeyStore used as a trust store.
+	            </xs:documentation>
+	          </xs:annotation>
+	        </xs:element>
          </xs:sequence>
-            <xs:attribute name="provider"          type="xs:string"/>
-            <xs:attribute name="factoryAlgorithm"  type="xs:string"/>
+            <xs:attribute name="provider" type="xs:string">
+	          <xs:annotation>
+	            <xs:documentation>
+	            This attribute contains the KeyManagers provider name.
+	            </xs:documentation>
+	          </xs:annotation>
+	        </xs:attribute>
+            <xs:attribute name="factoryAlgorithm"  type="xs:string">
+	          <xs:annotation>
+	            <xs:documentation>
+	            This attribute contains the algorithm the KeyManagers Factory
+	            will use in creating the KeyManagers from the KeyStore. Most
+	            common examples are "PKIX".
+	            </xs:documentation>
+	          </xs:annotation>
+	        </xs:attribute>
     </xs:complexType>
     
     <xs:complexType name="CipherSuites">
+      <xs:annotation>
+        <xs:documentation>
+        This structure holds a list of ciphersuite names that are to be
+        supported. Note: that does not mean that they will be available.
+        That depends on the JSSE and Crypto providers.
+        </xs:documentation>
+      </xs:annotation>
         <xs:sequence>
            <xs:element name="cipherSuite" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
         </xs:sequence>
     </xs:complexType>
     
     <xs:complexType name="SecureRandomParameters">
+      <xs:annotation>
+        <xs:documentation>
+        This structure holds the parameters for the Secure Random Number
+        generator used in the JSSE.
+        </xs:documentation>
+      </xs:annotation>
         <xs:attribute name="algorithm"/>
         <xs:attribute name="provider"/>
     </xs:complexType>
@@ -145,359 +280,123 @@
       -->
     <xs:complexType name="TLSClientParametersType">
         <xs:all>
-           <xs:element name="keyManagers"           type="tns:KeyManagersType"     minOccurs="0"/>
-           <xs:element name="trustManagers"         type="tns:TrustManagersType"   minOccurs="0"/>
-           <xs:element name="cipherSuites"          type="tns:CipherSuites"        minOccurs="0"/>
-           <xs:element name="cipherSuitesFilter"    type="tns:FiltersType"         minOccurs="0"/>
-           <xs:element name="secureRandomParameters" type="tns:SecureRandomParameters" minOccurs="0"/>
+           <xs:element name="keyManagers" type="tns:KeyManagersType" minOccurs="0">
+	          <xs:annotation>
+	            <xs:documentation>
+	            This element contains the KeyManagers specification.
+	            </xs:documentation>
+	          </xs:annotation>
+	       </xs:element>
+           <xs:element name="trustManagers" type="tns:TrustManagersType" minOccurs="0">
+	          <xs:annotation>
+	            <xs:documentation>
+	            This element contains the TrustManagers specification.
+	            </xs:documentation>
+	          </xs:annotation>
+	       </xs:element>
+           <xs:element name="cipherSuites" type="tns:CipherSuites" minOccurs="0">
+	          <xs:annotation>
+	            <xs:documentation>
+	            This element contains the the CipherSuites that will be supported.
+	            </xs:documentation>
+	          </xs:annotation>
+	       </xs:element>
+           <xs:element name="cipherSuitesFilter" type="tns:FiltersType" minOccurs="0">
+	          <xs:annotation>
+	            <xs:documentation>
+	            This element contains the filters of the supported CipherSuites
+	            that will be supported and used if available.
+	            </xs:documentation>
+	          </xs:annotation>
+	       </xs:element>
+           <xs:element name="secureRandomParameters" 
+                       type="tns:SecureRandomParameters" minOccurs="0">
+	          <xs:annotation>
+	            <xs:documentation>
+	            This element contains SecureRandom specification.
+	            </xs:documentation>
+	          </xs:annotation>
+	       </xs:element>
         </xs:all>
-           <xs:attribute name="jsseProvider"          type="xs:string"/>
-           <xs:attribute name="secureSocketProtocol"  type="xs:string"/>
+           <xs:attribute name="jsseProvider"          type="xs:string">
+	          <xs:annotation>
+	            <xs:documentation>
+	            This attribute contains the JSSE provider name.
+	            </xs:documentation>
+	          </xs:annotation>
+	       </xs:attribute>
+           <xs:attribute name="secureSocketProtocol"  type="xs:string">
+	          <xs:annotation>
+	            <xs:documentation>
+	            This attribute contains the Protocol Name. Most common
+	            example is "SSL", "TLS" or "TLSv1".
+	            </xs:documentation>
+	          </xs:annotation>
+	       </xs:attribute>
     </xs:complexType>
     
     <xs:complexType name="TLSServerParametersType">
         <xs:all>
-           <xs:element name="keyManagers"           type="tns:KeyManagersType"     minOccurs="0"/>
-           <xs:element name="trustManagers"         type="tns:TrustManagersType"   minOccurs="0"/>
-           <xs:element name="cipherSuites"          type="tns:CipherSuites"        minOccurs="0"/>
-           <xs:element name="cipherSuitesFilter"    type="tns:FiltersType"         minOccurs="0"/>
-           <xs:element name="secureRandomParameters" type="tns:SecureRandomParameters" minOccurs="0"/>
-           <xs:element name="clientAuthentication"  type="tns:ClientAuthentication" minOccurs="0"/>
+           <xs:element name="keyManagers" type="tns:KeyManagersType" minOccurs="0">
+	          <xs:annotation>
+	            <xs:documentation>
+	            This element contains the KeyManagers specification.
+	            </xs:documentation>
+	          </xs:annotation>
+	       </xs:element>
+           <xs:element name="trustManagers" type="tns:TrustManagersType" minOccurs="0">
+	          <xs:annotation>
+	            <xs:documentation>
+	            This element contains the TrustManagers specification.
+	            </xs:documentation>
+	          </xs:annotation>
+	       </xs:element>
+           <xs:element name="cipherSuites" type="tns:CipherSuites" minOccurs="0">
+	          <xs:annotation>
+	            <xs:documentation>
+	            This element contains the the CipherSuites that will be supported.
+	            </xs:documentation>
+	          </xs:annotation>
+	       </xs:element>
+           <xs:element name="cipherSuitesFilter" type="tns:FiltersType" minOccurs="0">
+	          <xs:annotation>
+	            <xs:documentation>
+	            This element contains the filters of the supported CipherSuites
+	            that will be supported and used if available.
+	            </xs:documentation>
+	          </xs:annotation>
+	       </xs:element>
+           <xs:element name="secureRandomParameters" 
+                       type="tns:SecureRandomParameters" minOccurs="0">
+	          <xs:annotation>
+	            <xs:documentation>
+	            This element contains SecureRandom specification.
+	            </xs:documentation>
+	          </xs:annotation>
+	       </xs:element>
+           <xs:element name="clientAuthentication" 
+                       type="tns:ClientAuthentication" minOccurs="0">
+	          <xs:annotation>
+	            <xs:documentation>
+	            This element contains Client Authentication specification.
+	            </xs:documentation>
+	          </xs:annotation>
+	       </xs:element>
         </xs:all>
-           <xs:attribute name="jsseProvider"          type="xs:string"/>
-           <xs:attribute name="secureSocketProtocol"  type="xs:string"/>
-    </xs:complexType>
-    
-    <xs:complexType name="SSLServerPolicy">
-        <xs:annotation>
-            <xs:documentation>
-            New policies for controlling SSL encryption
-            </xs:documentation>
-        </xs:annotation>
-
-    	<xs:sequence>
-    		<!--SSL related elements-->
-
-	    <xs:element name="Keystore" type="xs:string" minOccurs="0" maxOccurs="1">
-                <xs:annotation>
-                    <xs:documentation>
-                    Location of the Keystore, defaults to users home directory
-                    </xs:documentation>
-                </xs:annotation>      
-            </xs:element>
-
-	    <xs:element name="KeystoreType" type="xs:string" minOccurs="0" maxOccurs="1">
-                <xs:annotation>
-                    <xs:documentation>
-                    Keystore algorithm
-                    </xs:documentation>
-                </xs:annotation>      
-            </xs:element>
-
-            <xs:element name="KeystorePassword" type="xs:string" minOccurs="0" maxOccurs="1">
-                <xs:annotation>
-                    <xs:documentation>
-                    Password for accessing data in the keystore.
-                    </xs:documentation>
-                </xs:annotation>      
-            </xs:element>
-
-            <xs:element name="KeyPassword" type="xs:string" minOccurs="0" maxOccurs="1">
-                <xs:annotation>
-                    <xs:documentation>
-                    Key password for accessing first entry in the keystore.
-                    </xs:documentation>
-                </xs:annotation>      
-            </xs:element>
-
-	    <xs:element name="WantClientAuthentication" type="xs:boolean" minOccurs="0" maxOccurs="1">
-                <xs:annotation>
-                    <xs:documentation>
-                    If https client authentication want, set to true. Defaults to false, so no client authentication.
-                    </xs:documentation>
-                </xs:annotation>      
-            </xs:element>
-
-	    <xs:element name="RequireClientAuthentication" type="xs:boolean" minOccurs="0" maxOccurs="1">
-                <xs:annotation>
-                    <xs:documentation>
-                    If https client authentication required, set to true. Defaults to false, so no client authentication.
-                    </xs:documentation>
-                </xs:annotation>      
-            </xs:element>
-
-	    <xs:element name="KeystoreAlgorithm" type="xs:string" minOccurs="0" maxOccurs="1">
-                <xs:annotation>
-                    <xs:documentation>
-                     Specify the algorithm used by the key manager factory for the keystore
-                    </xs:documentation>
-                </xs:annotation>      
-            </xs:element>
-
-	    <xs:element name="Ciphersuites" type="xs:string" minOccurs="0" maxOccurs="unbounded">
-                <xs:annotation>
-                    <xs:documentation>
-                    Ciphersuites supported.
-                    </xs:documentation>
-                </xs:annotation>      
-            </xs:element>
-
-            <xs:element name="CiphersuiteFilters" type="tns:FiltersType" minOccurs="0" maxOccurs="1">
-                <xs:annotation>
-                    <xs:documentation>
-                    As an alternative to configuring an explicit list of ciphesuites
-                    via the Ciphersuites element, a set of filters may be specified
-                    instead. These are interpreted as a sequence of regular expressions,
-                    indicating which ciphersuites to include or exclude. The default set 
-                    of ciphersuites provided by the underlying SSL engine are then pruned,
-                    so that only those matching at least one include, and not matching
-                    an exclude, remain enabled.
-                    The default is to include the following:
-                        ".*_EXPORT_.*",
-                        ".*_EXPORT1024_.*",
-                        ".*_WITH_DES_.*",
-                        ".*_WITH_NULL_.*"
-                    Note that these defaults must be hard-coded as JAXB does not
-                    support these being encoded in the schema.
-                    </xs:documentation>
-                </xs:annotation>
-            </xs:element>
-            
-            <xs:element name="TrustStore" type="xs:string" minOccurs="0" maxOccurs="1">
-                <xs:annotation>
-                    <xs:documentation>
-                    Location of truststore, defaults to $JREHOME/lib/security/cacerts
-                    </xs:documentation>
-                </xs:annotation>      
-            </xs:element>
-
-            <xs:element name="TrustStoreType" type="xs:string" minOccurs="0" maxOccurs="1">
-                <xs:annotation>
-                    <xs:documentation>
-                    TrustStore type, defaults to JKS
-                    </xs:documentation>
-                </xs:annotation>      
-            </xs:element>
-
-	    <xs:element name="TrustStoreAlgorithm" type="xs:string" minOccurs="0" maxOccurs="1">
-                <xs:annotation>
-                    <xs:documentation>
-                     Specify the algorithm used by the key manager factory for the truststore, not supported yet.
-                    </xs:documentation>
-                </xs:annotation>      
-            </xs:element>
-
-	    <xs:element name="SecureSocketProtocol" type="xs:string" minOccurs="0" maxOccurs="1">
-                <xs:annotation>
-                    <xs:documentation>
-                    Secure socket protocol used, defaults to TLSv1.
-                    </xs:documentation>
-                </xs:annotation>      
-            </xs:element>
-
-	    <xs:element name="SessionCaching" type="xs:boolean" minOccurs="0" maxOccurs="1">
-                <xs:annotation>
-                    <xs:documentation>
-                    Whether TLS session caching should be used. Currently not supported, so no caching.
-                    </xs:documentation>
-                </xs:annotation>      
-            </xs:element>
-
-	    <xs:element name="SessionCacheKey" type="xs:string" minOccurs="0" maxOccurs="1">
-                <xs:annotation>
-                    <xs:documentation>
-                    Key used to lookup session cache. Currently not supported.
-                    </xs:documentation>
-                </xs:annotation>      
-            </xs:element>
-
-	    <xs:element name="MaxChainLength" type="xs:long" minOccurs="0" maxOccurs="1">
-                <xs:annotation>
-                    <xs:documentation>
-                    Limits the maximum length of the chain accepted by the server. Currently not supported.
-                    </xs:documentation>
-                </xs:annotation>      
-            </xs:element>
-
-	    <xs:element name="CertValidator" type="xs:string" minOccurs="0" maxOccurs="1">
-                <xs:annotation>
-                    <xs:documentation>
-                    Mechanism for performing extra checks on certificate accepted by the server. Currently not supported.
-                    </xs:documentation>
-                </xs:annotation>      
-            </xs:element>
-
-
-    	</xs:sequence>
-    </xs:complexType>
-    <xs:element name="sslServer" type="tns:SSLServerPolicy"/>
-
-
-
-    <xs:complexType name="SSLClientPolicy">
-        <xs:annotation>
-            <xs:documentation>
-            New policies for controlling SSL encryption
-            </xs:documentation>
-        </xs:annotation>
-
-    	<xs:sequence>
-    		<!--SSL related elements-->
-
-	    <xs:element name="Keystore" type="xs:string" minOccurs="0" maxOccurs="1">
-                <xs:annotation>
-                    <xs:documentation>
-                    Location of the Keystore, defaults to users home directory
-                    </xs:documentation>
-                </xs:annotation>      
-            </xs:element>
-
-	    <xs:element name="KeystoreType" type="xs:string" minOccurs="0" maxOccurs="1">
-                <xs:annotation>
-                    <xs:documentation>
-                    Keystore type, defaults to JKS
-                    </xs:documentation>
-                </xs:annotation>      
-            </xs:element>
-
-            <xs:element name="KeystorePassword" type="xs:string" minOccurs="0" maxOccurs="1">
-                <xs:annotation>
-                    <xs:documentation>
-                    Password for accessing data in the keystore.
-                    </xs:documentation>
-                </xs:annotation>      
-            </xs:element>
-
-            <xs:element name="KeyPassword" type="xs:string" minOccurs="0" maxOccurs="1">
-                <xs:annotation>
-                    <xs:documentation>
-                    Key password for accessing first entry in the keystore.
-                    </xs:documentation>
-                </xs:annotation>      
-            </xs:element>
-
-	    <xs:element name="KeystoreAlgorithm" type="xs:string" minOccurs="0" maxOccurs="1">
-                <xs:annotation>
-                    <xs:documentation>
-                     Specify the algorithm used by the key manager factory for the keystore
-                    </xs:documentation>
-                </xs:annotation>      
-            </xs:element>
-
-
-	    <xs:element name="Ciphersuites" type="xs:string" minOccurs="0" maxOccurs="unbounded">
-                <xs:annotation>
-                    <xs:documentation>
-                    Ciphersuites supported.
-                    </xs:documentation>
-                </xs:annotation>      
-            </xs:element>
-
-            <xs:element name="CiphersuiteFilters" type="tns:FiltersType" minOccurs="0" maxOccurs="1">
-                <xs:annotation>
-                    <xs:documentation>
-                    As an alternative to configuring an explicit list of ciphesuites
-                    via the Ciphersuites element, a set of filters may be specified
-                    instead. These are interpreted as a sequence of regular expressions,
-                    indicating which ciphersuites to include or exclude. The default set 
-                    of ciphersuites provided by the underlying SSL engine are then pruned,
-                    so that only those matching at least one include, and not matching
-                    an exclude, remain enabled.
-                    The default is to include the following:
-                        ".*_EXPORT_.*",
-                        ".*_EXPORT1024_.*",
-                        ".*_WITH_DES_.*",
-                        ".*_WITH_NULL_.*"
-                    Note that these defaults must be hard-coded as JAXB does not
-                    support these being encoded in the schema.
-                    </xs:documentation>
-                </xs:annotation>
-            </xs:element>
-            
-
-            <xs:element name="TrustStore" type="xs:string" minOccurs="0" maxOccurs="1">
-                <xs:annotation>
-                    <xs:documentation>
-                    Location of truststore, defaults to $JREHOME/lib/security/cacerts
-                    </xs:documentation>
-                </xs:annotation>      
-            </xs:element>
-
-            <xs:element name="TrustStoreType" type="xs:string" minOccurs="0" maxOccurs="1">
-                <xs:annotation>
-                    <xs:documentation>
-                    TrustStore type, defaults to JKS
-                    </xs:documentation>
-                </xs:annotation>      
-            </xs:element>
-
-
-	    <xs:element name="TrustStoreAlgorithm" type="xs:string" minOccurs="0" maxOccurs="1">
-                <xs:annotation>
-                    <xs:documentation>
-                     Specify the algorithm used by the key manager factory for the truststore, not supported yet.
-                    </xs:documentation>
-                </xs:annotation>      
-            </xs:element>
-
-	    <xs:element name="SecureSocketProtocol" type="xs:string" minOccurs="0" maxOccurs="1">
-                <xs:annotation>
-                    <xs:documentation>
-                    Secure socket protocol used, defaults to TLSv1.
-                    </xs:documentation>
-                </xs:annotation>      
-            </xs:element>
-
-	    <xs:element name="SessionCaching" type="xs:boolean" minOccurs="0" maxOccurs="1">
-                <xs:annotation>
-                    <xs:documentation>
-                    Whether TLS session caching should be used. Currently not supported, so no caching.
-                    </xs:documentation>
-                </xs:annotation>      
-            </xs:element>
-
-	    <xs:element name="SessionCacheKey" type="xs:string" minOccurs="0" maxOccurs="1">
-                <xs:annotation>
-                    <xs:documentation>
-                    Key used to lookup session cache. Currently not supported.
-                    </xs:documentation>
-                </xs:annotation>      
-            </xs:element>
-
-	    <xs:element name="MaxChainLength" type="xs:long" minOccurs="0" maxOccurs="1">
-                <xs:annotation>
-                    <xs:documentation>
-                    Limits the maximum length of the chain accepted by the client. Currently not supported.
-                    </xs:documentation>
-                </xs:annotation>      
-            </xs:element>
-
-	    <xs:element name="CertValidator" type="xs:string" minOccurs="0" maxOccurs="1">
-                <xs:annotation>
-                    <xs:documentation>
-                    Mechanism for performing extra checks on certificate accepted by the client. Currently not supported.
-                    </xs:documentation>
-                </xs:annotation>      
-            </xs:element>
-	    
-	    <xs:element name="ProxyHost" type="xs:string" minOccurs="0" maxOccurs="1">
-                <xs:annotation>
-                    <xs:documentation>
-                    For URL access through a proxy server, currently not supported
-                    </xs:documentation>
-                </xs:annotation>      
-            </xs:element>
-
-	    <xs:element name="ProxyPort" type="xs:long" minOccurs="0" maxOccurs="1">
-                <xs:annotation>
-                    <xs:documentation>
-                    For URL access through a proxy server, currently not supported
-                    </xs:documentation>
-                </xs:annotation>      
-            </xs:element>
-
-    	</xs:sequence>
+           <xs:attribute name="jsseProvider"          type="xs:string">
+	          <xs:annotation>
+	            <xs:documentation>
+	            This attribute contains the JSSE provider name.
+	            </xs:documentation>
+	          </xs:annotation>
+	       </xs:attribute>
+           <xs:attribute name="secureSocketProtocol"  type="xs:string">
+	          <xs:annotation>
+	            <xs:documentation>
+	            This attribute contains the Protocol Name. Most common
+	            example is "SSL", "TLS" or "TLSv1".
+	            </xs:documentation>
+	          </xs:annotation>
+	       </xs:attribute>
     </xs:complexType>
-    <xs:element name="sslClient" type="tns:SSLClientPolicy"/>
-
 </xs:schema>

Modified: incubator/cxf/trunk/parent/pom.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/parent/pom.xml?view=diff&rev=545115&r1=545114&r2=545115
==============================================================================
--- incubator/cxf/trunk/parent/pom.xml (original)
+++ incubator/cxf/trunk/parent/pom.xml Thu Jun  7 02:05:23 2007
@@ -47,7 +47,7 @@
         <jaxb.impl.version>2.0.5</jaxb.impl.version>
         <jaxb.xjc.version>2.0</jaxb.xjc.version>
         <jaxws.version>2.0</jaxws.version>
-        <jetty.version>5.1.11</jetty.version>
+        <jetty.version>6.1.3</jetty.version>
         <saaj.version>1.3</saaj.version>
         <saaj.impl.version>1.3</saaj.impl.version>
         <spring.version>2.0.4</spring.version>
@@ -910,4 +910,5 @@
   </scm>
 
 </project>
+
 

Modified: incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java?view=diff&rev=545115&r1=545114&r2=545115
==============================================================================
--- incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java (original)
+++ incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java Thu Jun  7 02:05:23 2007
@@ -543,7 +543,7 @@
                 serviceInfo.addSchema(schemaInfo);
             } else {
                 schema = schemaInfo.getSchema();
-                if (schema.getElementByName(qname) != null) {
+                if (schema != null && schema.getElementByName(qname) != null) {
                     mpi.setElement(true);
                     mpi.setElementQName(qname);
                     paraNumber++;

Modified: incubator/cxf/trunk/rt/transports/http-jetty/pom.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/http-jetty/pom.xml?view=diff&rev=545115&r1=545114&r2=545115
==============================================================================
--- incubator/cxf/trunk/rt/transports/http-jetty/pom.xml (original)
+++ incubator/cxf/trunk/rt/transports/http-jetty/pom.xml Thu Jun  7 02:05:23 2007
@@ -77,7 +77,7 @@
         <dependency>
             <groupId>org.mortbay.jetty</groupId>
             <artifactId>jetty</artifactId>
-            <version>6.1.3</version>
+            <version>${jetty.version}</version>
         </dependency>       
         <dependency>
             <groupId>org.slf4j</groupId>
@@ -91,6 +91,51 @@
             <artifactId>geronimo-servlet_2.5_spec</artifactId>
         </dependency>
     </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.cxf</groupId>
+                <artifactId>cxf-common-xsd</artifactId>
+                <version>${project.version}</version>
+                <executions>
+                    <execution>
+                        <id>generate-sources</id>
+                        <phase>generate-sources</phase>
+                        <configuration>
+                            <sourceRoot>${basedir}/target/generated/src/main/java</sourceRoot>
+                            <xsdOptions>
+                                <xsdOption>
+                                    <xsd>${basedir}/src/main/resources/schemas/configuration/http-jetty.xsd</xsd>
+                                    <catalog>${basedir}/src/main/resources/catalog.cat</catalog>
+                                    <deleteDirs>
+                                        <deleteDir>${basedir}/target/generated/src/main/java/org/apache/cxf/wsdl</deleteDir>
+                                        <deleteDir>${basedir}/target/generated/src/main/java/org/apache/cxf/configuration/security</deleteDir>
+                                        <deleteDir>${basedir}/target/generated/src/main/java/org/apache/cxf/transports/http/configuration</deleteDir>
+                                    </deleteDirs>
+                                </xsdOption>
+                            </xsdOptions>
+                        </configuration>
+                        <goals>
+                            <goal>xsdtojava</goal>
+                        </goals>
+                    </execution>
+                </executions>
+                <dependencies>
+                    <dependency>
+                        <groupId>org.apache.cxf</groupId>
+                        <artifactId>cxf-xjc-dv</artifactId>
+                        <version>${project.version}</version>
+                    </dependency>
+                    <dependency>
+                        <groupId>org.apache.cxf</groupId>
+                        <artifactId>cxf-common-utilities</artifactId>
+                        <version>${project.version}</version>
+                    </dependency>
+                </dependencies>
+            </plugin>
+        </plugins>
+    </build>
 
 
     <scm>

Modified: incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPDestination.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPDestination.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/JettyHTTPDestination.java (original)
+++ incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPDestination.java Thu Jun  7 02:05:23 2007
@@ -22,6 +22,7 @@
 import java.io.InputStream;
 import java.net.MalformedURLException;
 import java.net.URL;
+import java.security.GeneralSecurityException;
 import java.security.Principal;
 import java.util.logging.Level;
 import java.util.logging.Logger;
@@ -32,8 +33,6 @@
 import org.apache.cxf.Bus;
 import org.apache.cxf.common.logging.LogUtils;
 import org.apache.cxf.common.util.StringUtils;
-import org.apache.cxf.configuration.jsse.TLSServerParameters;
-import org.apache.cxf.configuration.security.SSLServerPolicy;
 import org.apache.cxf.message.Message;
 import org.apache.cxf.message.MessageImpl;
 import org.apache.cxf.security.SecurityContext;
@@ -92,58 +91,31 @@
     /**
      * Post-configure retreival of server engine.
      */
-    protected void retrieveEngine() {
-        if (this.getTlsServerParameters() != null) {
-            if (!"https".equals(nurl.getProtocol())) {
-                throw new RuntimeException(
-                        "Wrong protocol for TLS configuration: proto: " 
-                        + nurl.getProtocol());
-            }
-            // If the previous engine was "https", we have to shut it down as
-            // it cannot be reconfigured.
-            if (engine != null 
-                && "https".equals(engine.getProtocol())
-                && nurl.getPort() == engine.getPort()) {
-                engine.shutdown();
-            }
-            engine = serverEngineFactory.getForPort(
-                                 nurl.getProtocol(),
-                                 nurl.getPort(),
-                                 getTlsServerParameters());
-        // TODO: Remove when old SSL config is gone
-        } else if (this.getSslServer() != null) {
-            if (!"https".equals(nurl.getProtocol())) {
-                throw new RuntimeException(
-                        "Wrong protocol for TLS configuration: proto: " 
-                        + nurl.getProtocol());
-            }
-            // If the previous engine was "https", we have to shut it down as
-            // it cannot be reconfigured.
-            if (engine != null 
-                && "https".equals(engine.getProtocol())
-                && nurl.getPort() == engine.getPort()) {
-                engine.shutdown();
-            }
-            engine = serverEngineFactory.getForPort(nurl.getProtocol(),
-                                                nurl.getPort(),
-                                                getSslServer());
-        } else {
-            // We may still have "https", but we might still get the configuration from
-            // http-listener.
-
-            // If the previous engine was "https", we have to shut it down as
-            // it cannot be reconfigured.
-            if (engine != null && "https".equals(nurl.getPort())
-                && "https".equals(engine.getProtocol())
-                && nurl.getPort() == engine.getPort()) {
-                engine.shutdown();
-            }
-            // This should throw an exception if TLS is not configured 
-            // for http-listener and the protocol is "https".
-            engine = serverEngineFactory.getForPort(nurl.getProtocol(),
-                                                nurl.getPort());
+    protected void retrieveEngine()
+        throws GeneralSecurityException, 
+               IOException {
+        
+        engine = 
+            serverEngineFactory.retrieveJettyHTTPServerEngine(nurl.getPort());
+        if (engine == null) {
+            engine = "https".equals(nurl.getProtocol())
+                // https
+                ? serverEngineFactory.createJettyHTTPSServerEngine(nurl.getPort())
+                // http
+                : serverEngineFactory.createJettyHTTPServerEngine(nurl.getPort());
         }
+        
         assert engine != null;
+        
+        // When configuring for "http", however, it is still possible that
+        // Spring configuration has configured the port for https. 
+        if (!nurl.getProtocol().equals(engine.getProtocol())) {
+            throw new IllegalStateException(
+                "Port " + engine.getPort() 
+                + " is configured with wrong protocol \"" 
+                + engine.getProtocol()
+                + "\" for \"" + nurl + "\"");
+        }
     }
     
     /**
@@ -151,49 +123,17 @@
      * after the configuration items have been set.
      *
      */
-    public void finalizeConfig() {
+    public void finalizeConfig() 
+        throws GeneralSecurityException,
+               IOException {
+        
+        assert !configFinalized;
+        
         retrieveEngine();
         configFinalized = true;
     }
     
     /**
-     * This method sets the SSLServerPolicy for this destination. Changing
-     * the SSLServerPolicy object internally will not affect this destination.
-     * This method must be called to reconfigure the Destination.
-     * 
-     * @param policy
-     */
-    @Deprecated
-    @Override
-    public void setSslServer(SSLServerPolicy policy) {
-        super.setSslServer(policy);
-        if (configFinalized) {
-            deactivate();
-            engine.shutdown();
-            engine = null;
-            retrieveEngine();
-        }
-    }
-
-    /**
-     * This method sets the TLS Server Parameters for this destination. 
-     * Changing the TLSServerParameters object internally will not affect this 
-     * destination.
-     * This method must be called to reconfigure the Destination.
-     * 
-     * @param params
-     */
-    @Override
-    public void setTlsServerParameters(TLSServerParameters params) {
-        super.setTlsServerParameters(params);
-        if (configFinalized) {
-            deactivate();
-            engine.shutdown();
-            engine = null;
-            retrieveEngine();
-        }
-    }
-    /**
      * Activate receipt of incoming messages.
      */
     protected void activate() {
@@ -323,7 +263,7 @@
 
     @Override
     public void shutdown() {
-        transportFactory.destinations.remove(endpointInfo.getAddress());
+        transportFactory.removeDestination(endpointInfo);
         
         super.shutdown();
     }

Modified: incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngine.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngine.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/JettyHTTPServerEngine.java (original)
+++ incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngine.java Thu Jun  7 02:05:23 2007
@@ -22,45 +22,65 @@
 import java.io.IOException;
 import java.net.URL;
 import java.security.GeneralSecurityException;
+import java.util.logging.Logger;
 
 import org.apache.cxf.Bus;
+import org.apache.cxf.common.logging.LogUtils;
 import org.apache.cxf.configuration.jsse.TLSServerParameters;
-import org.apache.cxf.configuration.jsse.spring.TLSServerParametersConfig;
-import org.apache.cxf.configuration.security.SSLServerPolicy;
-import org.apache.cxf.configuration.security.TLSServerParametersType;
 import org.apache.cxf.transport.HttpUriMapper;
-import org.apache.cxf.transports.http.configuration.HTTPListenerPolicy;
+import org.apache.cxf.transport.https_jetty.JettySslConnectorFactory;
 import org.mortbay.jetty.AbstractConnector;
 import org.mortbay.jetty.Handler;
 import org.mortbay.jetty.Server;
 import org.mortbay.jetty.handler.ContextHandler;
 import org.mortbay.jetty.handler.ContextHandlerCollection;
+import org.mortbay.jetty.nio.SelectChannelConnector;
 import org.mortbay.thread.BoundedThreadPool;
 
 
-
+/**
+ * This class is the Jetty HTTP Server Engine that is configured to
+ * work off of a designated port. The port will be enabled for 
+ * "http" or "https" depending upon its successful configuration.
+ */
 public class JettyHTTPServerEngine
     implements ServerEngine {
     private static final long serialVersionUID = 1L;
-   
-    private int servantCount;
-    private Server server;
-    private AbstractConnector connector;
-    private JettyConnectorFactory connectorFactory;
-    private ContextHandlerCollection contexts;
     
-    private HTTPListenerPolicy listener;
-    private SSLServerPolicy sslServer;
-    private TLSServerParametersType tlsServerParameters;
+    private static final Logger LOG =
+        LogUtils.getL7dLogger(JettyHTTPServerEngine.class);
+   
+
+    /**
+     * The bus.
+     */
+    private final Bus bus;
     
     /**
-     * This field holds the protocol this engine is for. "http" or "https".
+     * This is the Jetty HTTP Server Engine Factory. This factory caches some 
+     * engines based on port numbers.
      */
-    private final String protocol;
+    private final JettyHTTPServerEngineFactory factory;
     
+    
+    /**
+     * This is the network port for which this engine is allocated.
+     */
     private final int port;
     
     /**
+     * This field holds the protocol for which this engine is 
+     * enabled, i.e. "http" or "https".
+     */
+    private String protocol;
+    
+    private int servantCount;
+    private Server server;
+    private AbstractConnector connector;
+    private JettyConnectorFactory connectorFactory;
+    private ContextHandlerCollection contexts;
+    
+    /**
      * This field holds the TLS ServerParameters that are programatically
      * configured. The tlsServerParamers (due to JAXB) holds the struct
      * placed by SpringConfig.
@@ -68,46 +88,35 @@
     private TLSServerParameters tlsProgrammaticServerParameters;
     
     /**
+     * This field hold the threading parameters for this particular engine.
+     */
+    private ThreadingParameters threadingParameters;
+    
+    /**
      * This boolean signfies that SpringConfig is over. finalizeConfig
      * has been called.
      */
     private boolean configFinalized;
     
     /**
-     * This is the Server Engine Factory. This factory caches some 
-     * engines based on port numbers.
+     * This constructor is solely called by the JettyHTTPServerEngineFactory.
      */
-    private JettyHTTPServerEngineFactory factory;
-    
-    JettyHTTPServerEngine(JettyHTTPServerEngineFactory fac, Bus bus,
-            String proto, int p) {
-        factory = fac;
-        protocol = proto;
-        port = p;
-    }
-
-    // TODO: remove when old SSL config is gone.
-    @Deprecated
-    JettyHTTPServerEngine(JettyHTTPServerEngineFactory fac, Bus bus,
-            String proto, int p, SSLServerPolicy policy) {
-        factory = fac;
-        sslServer = policy;
-        protocol = proto;
-        port = p;
-    }
-
-    JettyHTTPServerEngine(JettyHTTPServerEngineFactory fac, Bus bus,
-            String proto, int p, TLSServerParameters params) {
-        factory = fac;
-        tlsProgrammaticServerParameters = params;
-        protocol = proto;
-        port = p;
+    JettyHTTPServerEngine(
+        JettyHTTPServerEngineFactory fac, 
+        Bus bus,
+        int port) {
+        this.bus     = bus;
+        this.factory = fac;
+        this.port    = port;
     }
     
-    public String getBeanName() {
-        return JettyHTTPServerEngine.class.getName() + "." + port;
+    /**
+     * The bus.
+     */
+    public Bus getBus() {
+        return bus;
     }
-
+    
     /**
      * Returns the protocol "http" or "https" for which this engine
      * was configured.
@@ -160,13 +169,13 @@
             try {
                 server.start();
                 if (connector.getThreadPool() instanceof BoundedThreadPool
-                    && isSetListener()) {
+                    && isSetThreadingParameters()) {
                     BoundedThreadPool pool = (BoundedThreadPool)connector.getThreadPool();
-                    if (getListener().isSetMinThreads()) {
-                        pool.setMinThreads(getListener().getMinThreads());
+                    if (getThreadingParameters().isSetMinThreads()) {
+                        pool.setMinThreads(getThreadingParameters().getMinThreads());
                     }
-                    if (getListener().isSetMaxThreads()) {
-                        pool.setMaxThreads(getListener().getMaxThreads());
+                    if (getThreadingParameters().isSetMaxThreads()) {
+                        pool.setMaxThreads(getThreadingParameters().getMaxThreads());
                     }
                 }
             } catch (Exception e) {
@@ -210,7 +219,9 @@
         //final String smap = HttpUriMapper.getResourceBase(url.getPath());
 
         boolean found = false;
-        // REVISIT: how come server can be null?
+        // REVISIT:After a stop(), the server is null, and therefore this 
+        // operation shouldn't find a handler, but then below, why do we
+        // print a message to Std Error?
         if (server != null) {
             for (Handler handler : contexts.getChildHandlersByClass(ContextHandler.class)) {
                 ContextHandler contextHandler = null;
@@ -245,7 +256,7 @@
             }
         }
         if (!found) {
-            System.err.println("Not able to remove the handler");
+            LOG.warning("Not able to remove the handler");
         }
         
         --servantCount;
@@ -268,7 +279,8 @@
         //final String smap = HttpUriMapper.getResourceBase(url.getPath());
         
         Handler ret = null;
-        // REVISIT: how come server can be null?
+        // After a stop(), the server is null, and therefore this 
+        // operation should return null.
         if (server != null) {           
             for (Handler handler : server.getChildHandlersByClass(ContextHandler.class)) {
                 ContextHandler contextHandler = null;
@@ -286,134 +298,56 @@
 
     protected void retrieveListenerFactory() {
         if (tlsProgrammaticServerParameters != null) {
-            connectorFactory = JettyHTTPTransportFactory
-                    .getConnectorFactory(tlsProgrammaticServerParameters);
-        // TODO: remove when old SSL Config is gone.
-        } else if (isSetSslServer()) {
-            connectorFactory = JettyHTTPTransportFactory
-                    .getConnectorFactory(getSslServer());
+            connectorFactory = 
+                getHTTPSConnectorFactory(tlsProgrammaticServerParameters);
+            protocol = "https";
         } else {
-            connectorFactory = JettyHTTPTransportFactory
-                    .getConnectorFactory((TLSServerParameters) null);
+            connectorFactory = getHTTPConnectorFactory();
+            protocol = "http";
         }
+        LOG.fine("Configured port " + port + " for \"" + protocol + "\".");
     }
-    
-    /**
-     * This method is called after configure on this object.
-     */
-    protected void finalizeConfig() throws GeneralSecurityException,
-            IOException {
 
-        // If the listener was spring configured, convert those structs
-        // to real configuration with KeyManagers and TrustManagers.
-        if (this.tlsProgrammaticServerParameters == null
-                && isSetTlsServerParameters()) {
-            tlsProgrammaticServerParameters = 
-                new TLSServerParametersConfig(getTlsServerParameters());
-        }
-        if (!isSetListener()) {
-            setListener(new HTTPListenerPolicy());
-        }
-        if ("https".equals(protocol)
-                && tlsProgrammaticServerParameters == null 
-                && !isSetSslServer()) {
-            throw new RuntimeException(
-                    "Protocol is \"https\" without suitable "
-                            + "programmatic or spring configuration.");
-        }
-        retrieveListenerFactory();
-        this.configFinalized = true;
-    }
-    
-    @Deprecated
-    protected void init(SSLServerPolicy sslServerPolicy) {
-        if (!isSetSslServer()) {
-            setSslServer(sslServerPolicy);
-        }
-        if (!isSetListener()) {
-            setListener(new HTTPListenerPolicy());
-        }
+    /**
+     * This method creates a connector factory. If there are TLS parameters
+     * then it creates a TLS enabled one.
+     */
+    protected JettyConnectorFactory getHTTPConnectorFactory() {
+        return new JettyConnectorFactory() {                     
+            public AbstractConnector createConnector(int porto) {
+                SelectChannelConnector result = 
+                    new SelectChannelConnector();
+                
+                // Regardless the port has to equal the one
+                // we are configured for.
+                assert porto == port;
+                
+                //SocketConnector result = new SocketConnector();
+                result.setPort(porto);
+                return result;
+            }
+        };
     }
     
-    @Deprecated
-    public void setSslServer(SSLServerPolicy policy) {
-        this.sslServer = policy;
-        if (this.configFinalized) {
-            this.retrieveListenerFactory();
-        }
-    }
     /**
-     * This method is called to possibly reconfigure a listener. 
+     * This method creates a connector factory enabled with the JSSE
      */
-    protected void reconfigure(String proto, TLSServerParameters tlsParams) {
-        if (!getProtocol().equals(proto)) {
-            throw new RuntimeException(
-                    "Cannot reconfigure an allocated server port with "
-                    + "different protocol."
-                    + " Port: " + port + " to Protocol " + proto);
-        }
-        if ("https".equals(proto)) {
-            // TLS/SSL Parameters have not yet been set.
-            if (tlsProgrammaticServerParameters == null) {
-                if (!isSetSslServer()) {
-                    try {
-                        setProgrammaticTlsServerParameters(tlsParams);
-                    } catch (Exception e) {
-                        throw new RuntimeException(
-                                "Could not initialize configuration of "
-                                + getBeanName() + ".", e);
-                    }
-                } else {
-                    throw new RuntimeException(
-                        "Cannot reconfigure an allocated TLS server port. "
-                        + "Port = " + port);
-                }
-            } else if (tlsProgrammaticServerParameters != tlsParams) {
-                throw new RuntimeException(
-                    "Cannot reconfigure an allocated TLS server port. "
-                    + "Port = " + port);
-            }
-        }
-        
+    protected JettyConnectorFactory getHTTPSConnectorFactory(
+            TLSServerParameters tlsParams
+    ) {
+        return new JettySslConnectorFactory(tlsParams);
     }
-
+    
     /**
-     * This method is called to possibly reconfigure a listener. 
-     * @param proto
-     * @param policy
-     */
-    @Deprecated
-    protected void reconfigure(String proto, SSLServerPolicy policy) {
-        if (!getProtocol().equals(proto)) {
-            throw new RuntimeException(
-                    "Cannot reconfigure an allocated server port with "
-                    + "different protocol."
-                    + " Port: " + port + " to Protocol " + proto);
-        }
-        if ("https".equals(proto)) {
-            // TLS/SSL Parameters have not yet been set.
-            if (!isSetSslServer()) {
-                if (tlsProgrammaticServerParameters == null) {
-                    try {
-                        setSslServer(policy);
-                    } catch (Exception e) {
-                        throw new RuntimeException(
-                                "Could not initialize configuration of "
-                                + getBeanName() + ".", e);
-                    }
-                } else {
-                    throw new RuntimeException(
-                            "Cannot reconfigure an allocated TLS server port. "
-                            + "Port = " + port);
-                }
-            } else if (getSslServer() != policy) {
-                throw new RuntimeException(
-                    "Cannot reconfigure an allocated TLS server port. Port = " 
-                    + port);
-            }
-        }
+     * This method is called after configure on this object.
+     */
+    protected void finalizeConfig() 
+        throws GeneralSecurityException,
+               IOException {
+        retrieveListenerFactory();
+        this.configFinalized = true;
     }
-
+    
     /**
      * This method is called by the ServerEngine Factory to destroy the 
      * listener.
@@ -425,15 +359,14 @@
             server.stop();
             server.destroy();
             server   = null;
-            listener = null;
         }
     }
     
     /**
      * This method is used to programmatically set the TLSServerParameters.
-     * This method must be used to dynamically configure the http-listener.
+     * This method may only be called by the factory.
      */
-    public void setProgrammaticTlsServerParameters(TLSServerParameters params) {
+    protected void setProgrammaticTlsServerParameters(TLSServerParameters params) {
         tlsProgrammaticServerParameters = params;
         if (this.configFinalized) {
             this.retrieveListenerFactory();
@@ -446,61 +379,33 @@
      * in SpringConfiguration.
      * @return
      */
-    public TLSServerParameters getProgrammaticTlsServerParameters() {
+    protected TLSServerParameters getProgrammaticTlsServerParameters() {
         return tlsProgrammaticServerParameters;
     } 
 
     /**
-     * Returns the listener policy
-     *  @return the listener policy.
+     * This method sets the threading parameters for this particular 
+     * server engine.
+     * This method may only be called by the factory.
      */
-    public HTTPListenerPolicy getListener() {
-        return listener;
+    public void setThreadingParameters(ThreadingParameters params) {
+        threadingParameters = params;
     }
-
+    
     /**
-     * Sets the listener policy.
-     * @param listener The listener policy to set.
-     */
-    public void setListener(HTTPListenerPolicy listener) {
-        this.listener = listener;
-    }
-
-    /** 
-     * Returns the tlsServerParameters.
-     * @return the tlsServerParameters.
+     * This method returns whether the threading parameters are set.
      */
-    public TLSServerParametersType getTlsServerParameters() {
-        return tlsServerParameters;
+    public boolean isSetThreadingParameters() {
+        return threadingParameters != null;
     }
-
+    
     /**
-     * Sets the tlsServerParameters.
-     * @param tlsServerParameters The tlsServerParameters to set.
-     */
-    public void setTlsServerParameters(TLSServerParametersType tlsServerParameters) {
-        this.tlsServerParameters = tlsServerParameters;
-    }
-
-    /** 
-     * Returns the sslServer policy.
-     * @return the sslServer policy.
+     * This method returns the threading parameters that have been set.
+     * This method may return null, if the threading parameters have not
+     * been set.
      */
-    public SSLServerPolicy getSslServer() {
-        return sslServer;
-    }
-    
-    public boolean isSetListener() {
-        return null != listener;
+    public ThreadingParameters getThreadingParameters() {
+        return threadingParameters;
     }
-    
-    public boolean isSetSslServer() {
-        return null != sslServer;
-    }
-    
-    public boolean isSetTlsServerParameters() {
-        return null != tlsServerParameters; 
-    }
-    
     
 }

Modified: incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngineFactory.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngineFactory.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/JettyHTTPServerEngineFactory.java (original)
+++ incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngineFactory.java Thu Jun  7 02:05:23 2007
@@ -18,29 +18,42 @@
  */
 package org.apache.cxf.transport.http_jetty;
 
+import java.io.IOException;
+import java.security.GeneralSecurityException;
 import java.util.HashMap;
 import java.util.Map;
+import java.util.TreeMap;
+import java.util.logging.Logger;
+
+import javax.annotation.PostConstruct;
+import javax.annotation.Resource;
 
 import org.apache.cxf.Bus;
-import org.apache.cxf.configuration.Configurer;
+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.spring.JettyHTTPServerEngineFactoryConfig;
 
+/**
+ * This Bus Extension handles the configuration of network port
+ * numbers for use with "http" or "https". This factory 
+ * caches the JettyHTTPServerEngines so that they may be 
+ * retrieved if already previously configured.
+ */
 public class JettyHTTPServerEngineFactory {
+    private static final Logger LOG =
+        LogUtils.getL7dLogger(JettyHTTPServerEngineFactory.class);
+
 
     /**
      * This map holds references for allocated ports.
      */
-    // HACK!!! All system tests do not shut down bus correct,
+    // All system tests do not shut down bus correctly,
     // or the bus does not shutdown all endpoints correctly,
-    // so that these are shared amongst busses. Which is
-    // hogwash!! This was static before I changed it, and I
-    // tried to make it local.  Now, we get address in use
-    // Bind exceptions because these server engines aren't
-    // shared!! What hog wash. Propper shutdowns people!
+    // so that these server endings are actuall shared amongst busses
+    // within the same JVM.
     
-    // We will keep it static until
-    // we can resolve the problems in the System tests.
+    // We will keep it static until we can resolve the problems 
+    // in the System tests.
     // TODO: Fix the System Tests so that they shutdown the 
     // buses that they are using and that the buses actually
     // shutdown the destinations and their server engines
@@ -50,89 +63,190 @@
     // shared accross buses, right?
     private static Map<Integer, JettyHTTPServerEngine> portMap =
         new HashMap<Integer, JettyHTTPServerEngine>();
+   
+    
+    /**
+     * This map holds the threading parameters that are to be applied
+     * to new Engines when bound to a specified port.
+     */
+    private Map<Integer, ThreadingParameters> threadingParametersMap =
+        new TreeMap<Integer, ThreadingParameters>();
+    
+    /**
+     * This map holds TLS Server Parameters that are to be used to
+     * configure a subsequently created JettyHTTPServerEngine.
+     */
+    private Map<Integer, TLSServerParameters> tlsParametersMap =
+        new TreeMap<Integer, TLSServerParameters>();
     
     /**
      * The bus.
      */
     private Bus bus;
     
-    protected JettyHTTPServerEngineFactory(Bus b) {
-        bus = b;
+    private JettyHTTPServerEngineFactoryConfig factorySpringConfig;
+    
+    public JettyHTTPServerEngineFactory() {
+        // Empty
     }
     
     /**
-     * Allocate a JettyServer engine for a particular port. This call is allows 
-     * the Spring configuration of the engine. If the protocol is "https" it 
-     * must find a suitable configuration or this call will throw an error.
-     */
-    synchronized JettyHTTPServerEngine getForPort(String protocol, int p) {
-
-        return getForPort(protocol, p, (TLSServerParameters) null);
+     * This call is used to set the bus. It should only be called once.
+     * @param bus
+     */
+    @Resource(name = "bus")
+    public void setBus(Bus bus) {
+        assert this.bus == null;
+        this.bus = bus;
+    }
+    
+    @Resource
+    public void setConfig(JettyHTTPServerEngineFactoryConfig config) {
+        factorySpringConfig = config;
+    }
+    
+    @PostConstruct
+    public void registerWithBus() {
+        bus.setExtension(this, JettyHTTPServerEngineFactory.class);
+    }
+    
+    @PostConstruct
+    public void configureSpring() {
+        if (factorySpringConfig != null) {
+            factorySpringConfig.configureServerEngineFactory(this);
+        }
+    }
+    
+    /**
+     * This call sets TLSServerParameters for a JettyHTTPServerEngine
+     * that will be subsequently created. It will not alter an engine
+     * that has already been created for that network port.
+     * @param port       The network port number to bind to the engine.
+     * @param tlsParams  The tls server parameters. Cannot be null.
+     */
+    public void setTLSServerParametersForPort(
+        int port, 
+        TLSServerParameters tlsParams) {
+        if (tlsParams == null) {
+            throw new IllegalArgumentException("tlsParams cannot be null");
+        }
+        tlsParametersMap.put(port, tlsParams);
     }
 
     /**
-     * Allocate a Jetty server engine for a particular port, and an ssl 
-     * server policy.
-     * This call in order to remain consistent with previous implemenation 
-     * does NOT override any spring configuration. That may be a bug. 
-     * This method is deprecated in favor of using TLSServerParameters.
-     */
-    @Deprecated
-    synchronized JettyHTTPServerEngine getForPort(
-            String protocol,
-            int p,
-            SSLServerPolicy sslServerPolicy
-    ) {
-        JettyHTTPServerEngine ref = portMap.get(p);
-        if (ref == null) {
-            ref = new JettyHTTPServerEngine(this, bus, protocol, p);
-            configure(ref);
-            // This previous incantaion says programatic configuration does not 
-            // override because init tests to see if sslServer is already set 
-            // and if so, ignores this sslServerPolicy. 
-            // This situation has been fixed with tlsServerParameters.
-            ref.init(sslServerPolicy);
-            ref.retrieveListenerFactory();
-            portMap.put(p, ref);
-        } else {
-            // This will throw an exception if the reference cannot be 
-            // reconfigured
-            ref.reconfigure(protocol, sslServerPolicy);
+     * This call removes any TLSParameters that have been placed
+     * on the port arguments. This call will not affect a server engine
+     * already in existence for that port. 
+     * @param port
+     */
+    public void removeTLSServerParametersForPort(int port) {
+        tlsParametersMap.remove(port);
+    }
+    
+    /**
+     * This call sets the ThreadingParameters for a JettyHTTPServerEngine
+     * that will be subsequently created. It will not alter an
+     * engine that has already ben creatd for that network port.
+     * @param port            The network port number to bind to the engine.
+     * @param threadingParams The threading parameters. Cannot be null.
+     */
+    public void setThreadingParametersForPort(
+        int port,
+        ThreadingParameters threadingParams) {
+        if (threadingParams == null) {
+            throw new IllegalArgumentException(
+                    "threadingParameters cannot be null");
         }
-        return ref;
+        threadingParametersMap.put(port, threadingParams);
     }
     
     /**
-     * Allocate a Jetty server engine for a particular port with TLS parameters.
-     * If tlsParams is not null, it overrides any spring configuration of TLS 
-     * parameters.
-     */
-    synchronized JettyHTTPServerEngine getForPort(
-            String protocol,
-            int p,
-            TLSServerParameters tlsParams
-    ) {
-        JettyHTTPServerEngine ref = portMap.get(p);
-        if (ref == null) {
-            ref = new JettyHTTPServerEngine(this, bus, protocol, p);
-            configure(ref);
-            // Programatic configuration overrides Spring configuration.
-            if (tlsParams != null) {
-                ref.setProgrammaticTlsServerParameters(tlsParams);
-            }
-            try { 
-                ref.finalizeConfig();
-            } catch (Exception e) {
-                throw new RuntimeException(
-                        "Could not initialize configuration of "
-                        + ref.getBeanName() + ".", e);
-            }
-            portMap.put(p, ref);
+     * This call removes any ThreadingParameters that have been placed
+     * on the port arguments. This call will not affect a server engine
+     * already in existence for that port. 
+     * @param port
+     */
+    public void removeThreadingParametersForPort(int port) {
+        threadingParametersMap.remove(port);
+    }
+    
+    /**
+     * This call retrieves a previously configured JettyHTTPServerEngine for the
+     * given port. If none exists, this call returns null.
+     */
+    synchronized JettyHTTPServerEngine retrieveJettyHTTPServerEngine(int port) {
+        return portMap.get(port);
+    }
+
+    /**
+     * This call creates a new JettyHTTPServerEngine initialized for "http"
+     * or "https" on the given port. The determination of "http" or "https"
+     * will depend on configuration of the engine's bean name.
+     * 
+     * If an JettyHTTPEngine already exists, or the port
+     * is already in use, a BindIOException will be thrown. If the 
+     * engine is being Spring configured for TLS a GeneralSecurityException
+     * may be thrown.
+     */
+    synchronized JettyHTTPServerEngine createJettyHTTPServerEngine(int port)
+        throws GeneralSecurityException, IOException {
+        
+        TLSServerParameters tlsParams = tlsParametersMap.get(port);
+
+        if (tlsParams != null) {
+            throw new RuntimeException("Port " 
+                    + port + " is configured for TLS");
+        }
+        
+        JettyHTTPServerEngine ref = 
+            new JettyHTTPServerEngine(this, bus, port);
+
+        ref.setProgrammaticTlsServerParameters(tlsParams);
+        
+        ThreadingParameters tparams = threadingParametersMap.get(port);
+        if (tparams != null) {
+            ref.setThreadingParameters(tparams);
+        }
+        
+        ref.finalizeConfig();
+        portMap.put(port, ref);
+        return ref;
+    }
+
+    /**
+     * This call creates a new JettyHTTPServerEngine initialized for "https"
+     * on the given port. The configuration for "https"
+     * will depend on configuration of the engine's bean name, then default,
+     * then parameter map.
+     * 
+     * If an JettyHTTPEngine already exists, or the port
+     * is already in use, a BindIOException will be thrown. If the 
+     * engine is being Spring configured for TLS a GeneralSecurityException
+     * may be thrown.
+     */
+    synchronized JettyHTTPServerEngine createJettyHTTPSServerEngine(int port)
+        throws GeneralSecurityException, IOException {
+
+        LOG.fine("Creating Jetty HTTP Server Engine for port " + port + ".");
+        
+        JettyHTTPServerEngine ref = 
+            new JettyHTTPServerEngine(this, bus, port);
+        
+        // Configuration of the Factory 
+        TLSServerParameters tlsParams = tlsParametersMap.get(port);
+        if (tlsParams != null) {
+            ref.setProgrammaticTlsServerParameters(tlsParams);
         } else {
-            // This call will throw an exception if the engine cannot be 
-            // reconfigured.
-            ref.reconfigure(protocol, tlsParams);
+            throw new RuntimeException("Port " 
+                    + port + " is not configured for TLS");
+        }
+        
+        ThreadingParameters threadingParams = threadingParametersMap.get(port);
+        if (threadingParams != null) {
+            ref.setThreadingParameters(threadingParams);
         }
+        ref.finalizeConfig();
+        portMap.put(port, ref);
         return ref;
     }
     
@@ -142,6 +256,7 @@
     public synchronized void destroyForPort(int port) {
         JettyHTTPServerEngine ref = portMap.remove(port);
         if (ref != null) {
+            LOG.fine("Stopping Jetty HTTP Server Engine for port " + port + ".");
             try {
                 ref.stop();
             } catch (Exception e) {
@@ -151,16 +266,9 @@
         }
     }
 
-    /**
-     * This call configures the Server Engine as Spring Bean.
-     * @param bean
-     */
-    protected void configure(JettyHTTPServerEngine bean) {
-        Configurer configurer = bus.getExtension(Configurer.class);
-        if (null != configurer) {
-            configurer.configureBean(bean);
-        }
+    @PostConstruct
+    public void finalizeConfig() {
+        registerWithBus();
     }
-
     
 }

Modified: incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPTransportFactory.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPTransportFactory.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/JettyHTTPTransportFactory.java (original)
+++ incubator/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPTransportFactory.java Thu Jun  7 02:05:23 2007
@@ -19,31 +19,29 @@
 package org.apache.cxf.transport.http_jetty;
 
 import java.io.IOException;
+import java.security.GeneralSecurityException;
 import java.util.HashMap;
 import java.util.Map;
 
+import javax.annotation.PostConstruct;
 import javax.annotation.Resource;
+import javax.imageio.IIOException;
 
 import org.apache.cxf.Bus;
-import org.apache.cxf.configuration.jsse.TLSServerParameters;
-import org.apache.cxf.configuration.security.SSLServerPolicy;
 import org.apache.cxf.service.model.EndpointInfo;
 import org.apache.cxf.transport.Destination;
 import org.apache.cxf.transport.http.AbstractHTTPTransportFactory;
-import org.apache.cxf.transport.https_jetty.JettySslConnectorFactory;
-import org.mortbay.jetty.AbstractConnector;
-import org.mortbay.jetty.nio.SelectChannelConnector;
-
 
 public class JettyHTTPTransportFactory extends AbstractHTTPTransportFactory {
-    Map<String, JettyHTTPDestination> destinations = 
-        new HashMap<String, JettyHTTPDestination>();
-    
+
     /**
      * This field contains the JettyHTTPServerEngineFactory.
      * It holds a cache of engines that may be used for particular ports.
      */
-    private JettyHTTPServerEngineFactory serverEngineFactory;
+    protected JettyHTTPServerEngineFactory serverEngineFactory;
+    
+    private Map<String, JettyHTTPDestination> destinations = 
+        new HashMap<String, JettyHTTPDestination>();
     
     public JettyHTTPTransportFactory() {
         super();
@@ -52,21 +50,33 @@
     @Resource(name = "bus")
     public void setBus(Bus b) {
         super.setBus(b);
-        // This cannot be called twice;
-        assert serverEngineFactory == null;
-        
-        serverEngineFactory = new JettyHTTPServerEngineFactory(b);
     }
 
+    @PostConstruct
+    public void finalizeConfig() {
+        // empty
+    }
+    
     /**
      * This method returns the Jetty HTTP Server Engine Factory.
      */
     protected JettyHTTPServerEngineFactory getJettyHTTPServerEngineFactory() {
+        if (this.serverEngineFactory == null) {
+            serverEngineFactory =
+                getBus().getExtension(JettyHTTPServerEngineFactory.class);
+        }
+        if (this.serverEngineFactory == null) {
+            serverEngineFactory = new JettyHTTPServerEngineFactory();
+            serverEngineFactory.setBus(getBus());
+            serverEngineFactory.finalizeConfig();
+        }
         return serverEngineFactory;
     }
     
     @Override
-    public Destination getDestination(EndpointInfo endpointInfo) throws IOException {
+    public Destination getDestination(EndpointInfo endpointInfo) 
+        throws IOException {
+        
         String addr = endpointInfo.getAddress();
         JettyHTTPDestination destination = destinations.get(addr);
         if (destination == null) {
@@ -76,55 +86,32 @@
         return destination;
     }
     
-    private synchronized JettyHTTPDestination createDestination(EndpointInfo endpointInfo) 
-        throws IOException {
-        // Cached Destinations could potentially use an "https" destination 
-        // created by somebody else that will not be able to be reconfigured. 
-        // As a result of trying would shutdown the server engine that may
-        // be in use.
+    private synchronized JettyHTTPDestination createDestination(
+        EndpointInfo endpointInfo
+    ) throws IOException {
         
-        JettyHTTPDestination destination = destinations.get(endpointInfo.getAddress());
+        JettyHTTPDestination destination = 
+            destinations.get(endpointInfo.getAddress());
         if (destination == null) {
-            destination = new JettyHTTPDestination(getBus(), this, endpointInfo);
+            destination = 
+                new JettyHTTPDestination(getBus(), this, endpointInfo);
             
             destinations.put(endpointInfo.getAddress(), destination);
             
             configure(destination);
-            destination.finalizeConfig(); 
+            try {
+                destination.finalizeConfig();
+            } catch (GeneralSecurityException ex) {
+                throw new IIOException("JSSE Security Exception ", ex);
+            }
         }
         return destination;
     }
-
-    @Deprecated
-    protected static JettyConnectorFactory getConnectorFactory(SSLServerPolicy policy) {
-        return policy == null
-               ? new JettyConnectorFactory() {                     
-                   public AbstractConnector createConnector(int port) {
-                       SelectChannelConnector result = new SelectChannelConnector();
-                       //SocketConnector result = new SocketConnector();
-                       result.setPort(port);
-                       return result;
-                   }
-               }
-               : new JettySslConnectorFactory(policy);
-    }
     
     /**
-     * This method creates a connector factory. If there are TLS parameters
-     * then it creates a TLS enabled one.
+     * This function removes the destination for a particular endpoint.
      */
-    protected static JettyConnectorFactory getConnectorFactory(
-            TLSServerParameters tlsParams
-    ) {
-        return tlsParams == null
-               ? new JettyConnectorFactory() {                     
-                   public AbstractConnector createConnector(int port) {
-                       SelectChannelConnector result = new SelectChannelConnector();
-                       //SocketConnector result = new SocketConnector();
-                       result.setPort(port);
-                       return result;
-                   }
-               }
-               : new JettySslConnectorFactory(tlsParams);
+    void removeDestination(EndpointInfo ei) {
+        destinations.remove(ei.getAddress());
     }
 }



Mime
View raw message