You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by ff...@apache.org on 2016/02/26 04:50:51 UTC

[1/6] cxf git commit: [CXF-6800]add http-undertow transport

Repository: cxf
Updated Branches:
  refs/heads/master 4fd123701 -> e61a83d4a


http://git-wip-us.apache.org/repos/asf/cxf/blob/e61a83d4/systests/transport-undertow/src/test/resources/org/apache/cxf/systest/http_undertow/continuations/test.wsdl
----------------------------------------------------------------------
diff --git a/systests/transport-undertow/src/test/resources/org/apache/cxf/systest/http_undertow/continuations/test.wsdl b/systests/transport-undertow/src/test/resources/org/apache/cxf/systest/http_undertow/continuations/test.wsdl
new file mode 100644
index 0000000..ef98bea
--- /dev/null
+++ b/systests/transport-undertow/src/test/resources/org/apache/cxf/systest/http_undertow/continuations/test.wsdl
@@ -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.
+-->
+<wsdl:definitions xmlns:ns1="http://schemas.xmlsoap.org/soap/http" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://cxf.apache.org/systest/jaxws" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="HelloContinuationService" targetNamespace="http://cxf.apache.org/systest/jaxws">
+    <wsdl:message name="isRequestSuspended">
+        <wsdl:part name="arg0" type="xsd:string">
+    </wsdl:part>
+    </wsdl:message>
+    <wsdl:message name="sayHiResponse">
+        <wsdl:part name="return" type="xsd:string">
+    </wsdl:part>
+    </wsdl:message>
+    <wsdl:message name="sayHi">
+        <wsdl:part name="arg0" type="xsd:string">
+    </wsdl:part>
+        <wsdl:part name="arg1" type="xsd:string">
+    </wsdl:part>
+    </wsdl:message>
+    <wsdl:message name="resumeRequestResponse">
+  </wsdl:message>
+    <wsdl:message name="isRequestSuspendedResponse">
+        <wsdl:part name="return" type="xsd:boolean">
+    </wsdl:part>
+    </wsdl:message>
+    <wsdl:message name="resumeRequest">
+        <wsdl:part name="arg0" type="xsd:string">
+    </wsdl:part>
+    </wsdl:message>
+    <wsdl:portType name="HelloContinuation">
+        <wsdl:operation name="isRequestSuspended">
+            <wsdl:input message="tns:isRequestSuspended" name="isRequestSuspended">
+    </wsdl:input>
+            <wsdl:output message="tns:isRequestSuspendedResponse" name="isRequestSuspendedResponse">
+    </wsdl:output>
+        </wsdl:operation>
+        <wsdl:operation name="resumeRequest">
+            <wsdl:input message="tns:resumeRequest" name="resumeRequest">
+    </wsdl:input>
+            <wsdl:output message="tns:resumeRequestResponse" name="resumeRequestResponse">
+    </wsdl:output>
+        </wsdl:operation>
+        <wsdl:operation name="sayHi">
+            <wsdl:input message="tns:sayHi" name="sayHi">
+    </wsdl:input>
+            <wsdl:output message="tns:sayHiResponse" name="sayHiResponse">
+    </wsdl:output>
+        </wsdl:operation>
+    </wsdl:portType>
+    <wsdl:binding name="HelloContinuationServiceSoapBinding" type="tns:HelloContinuation">
+        <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
+        <wsdl:operation name="isRequestSuspended">
+            <soap:operation soapAction="" style="rpc"/>
+            <wsdl:input name="isRequestSuspended">
+                <soap:body namespace="http://cxf.apache.org/systest/jaxws" use="literal"/>
+            </wsdl:input>
+            <wsdl:output name="isRequestSuspendedResponse">
+                <soap:body namespace="http://cxf.apache.org/systest/jaxws" use="literal"/>
+            </wsdl:output>
+        </wsdl:operation>
+        <wsdl:operation name="resumeRequest">
+            <soap:operation soapAction="" style="rpc"/>
+            <wsdl:input name="resumeRequest">
+                <soap:body namespace="http://cxf.apache.org/systest/jaxws" use="literal"/>
+            </wsdl:input>
+            <wsdl:output name="resumeRequestResponse">
+                <soap:body namespace="http://cxf.apache.org/systest/jaxws" use="literal"/>
+            </wsdl:output>
+        </wsdl:operation>
+        <wsdl:operation name="sayHi">
+            <soap:operation soapAction="" style="rpc"/>
+            <wsdl:input name="sayHi">
+                <soap:body namespace="http://cxf.apache.org/systest/jaxws" use="literal"/>
+            </wsdl:input>
+            <wsdl:output name="sayHiResponse">
+                <soap:body namespace="http://cxf.apache.org/systest/jaxws" use="literal"/>
+            </wsdl:output>
+        </wsdl:operation>
+    </wsdl:binding>
+    <wsdl:service name="HelloContinuationService">
+        <wsdl:port binding="tns:HelloContinuationServiceSoapBinding" name="HelloContinuationPort">
+            <soap:address location="https://localhost:9091/hellocontinuation"/>
+        </wsdl:port>
+    </wsdl:service>
+</wsdl:definitions>

http://git-wip-us.apache.org/repos/asf/cxf/blob/e61a83d4/systests/transport-undertow/src/test/resources/org/apache/cxf/systest/http_undertow/cxf.xml
----------------------------------------------------------------------
diff --git a/systests/transport-undertow/src/test/resources/org/apache/cxf/systest/http_undertow/cxf.xml b/systests/transport-undertow/src/test/resources/org/apache/cxf/systest/http_undertow/cxf.xml
new file mode 100644
index 0000000..ae0701b
--- /dev/null
+++ b/systests/transport-undertow/src/test/resources/org/apache/cxf/systest/http_undertow/cxf.xml
@@ -0,0 +1,24 @@
+<?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.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:http="http://cxf.apache.org/transports/http/configuration" xsi:schemaLocation=" 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:conduit name="*.http-conduit">
+        <http:client AllowChunking="false" Connection="close"/>
+    </http:conduit>
+</beans>

http://git-wip-us.apache.org/repos/asf/cxf/blob/e61a83d4/systests/transport-undertow/src/test/resources/org/apache/cxf/systest/http_undertow/server-lifecycle-beans.xml
----------------------------------------------------------------------
diff --git a/systests/transport-undertow/src/test/resources/org/apache/cxf/systest/http_undertow/server-lifecycle-beans.xml b/systests/transport-undertow/src/test/resources/org/apache/cxf/systest/http_undertow/server-lifecycle-beans.xml
new file mode 100644
index 0000000..c3174f2
--- /dev/null
+++ b/systests/transport-undertow/src/test/resources/org/apache/cxf/systest/http_undertow/server-lifecycle-beans.xml
@@ -0,0 +1,47 @@
+<?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. -->
+<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:http="http://cxf.apache.org/transports/http/configuration" xmlns:httpu="http://cxf.apache.org/transports/http-undertow/configuration" xmlns:jaxws="http://cxf.apache.org/jaxws" xsi:schemaLocation="         http://www.springframework.org/schema/beans                 http://www.springframework.org/schema/beans/spring-beans.xsd         http://cxf.apache.org/jaxws                                 http://cxf.apache.org/schemas/jaxws.xsd         http://cxf.apache.org/transports/http/configuration         http://cxf.apache.org/schemas/configuration/http-conf.xsd         http://cxf.apache.org/transports/http-undertow/configuration   http://cxf.apache.org/schemas/configuration/http-undertow.xsd  ">
+    <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
+    <bean id="aegisBean" class="org.apache.cxf.aegis.databinding.AegisDatabinding" scope="prototype">
+        <property name="configuration">
+            <bean class="org.apache.cxf.aegis.type.TypeCreationOptions">
+                <property name="defaultMinOccurs" value="1"/>
+                <property name="defaultNillable" value="false"/>
+            </bean>
+        </property>
+    </bean>
+    <!-- define a service factory that supports both JAX-WS annotations and 
+                also Aegis files. -->
+    <bean id="jaxws-and-aegis-service-factory" class="org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean" scope="prototype">
+        <property name="dataBinding" ref="aegisBean"/>
+    </bean>
+    <jaxws:endpoint id="dummy-service-endpoint" implementor="org.apache.cxf.systest.http_undertow.Dummy" address="http://localhost:${testutil.ports.EngineLifecycleTest.2}/Dummy">
+        <jaxws:serviceFactory>
+            <ref bean="jaxws-and-aegis-service-factory"/>
+        </jaxws:serviceFactory>
+    </jaxws:endpoint>
+    <jaxws:endpoint id="dummy-8801-service-endpoint" implementor="org.apache.cxf.systest.http_undertow.Dummy" address="http://localhost:${testutil.ports.EngineLifecycleTest.1}/Dummy">
+        <jaxws:serviceFactory>
+            <ref bean="jaxws-and-aegis-service-factory"/>
+        </jaxws:serviceFactory>
+    </jaxws:endpoint>
+    <bean id="dummy-client" class="org.apache.cxf.systest.http_undertow.DummyInterface" factory-bean="clientFactory" factory-method="create"/>
+    <bean id="clientFactory" class="org.apache.cxf.jaxws.JaxWsProxyFactoryBean">
+        <property name="serviceClass" value="org.apache.cxf.systest.http_undertow.DummyInterface"/>
+        <property name="address" value="http://localhost:${testutil.ports.EngineLifecycleTest.2}/Dummy"/>
+    </bean>
+    <bean id="dummy-client-8801" class="org.apache.cxf.systest.http_undertow.DummyInterface" factory-bean="clientFactory-8801" factory-method="create"/>
+    <bean id="clientFactory-8801" class="org.apache.cxf.jaxws.JaxWsProxyFactoryBean">
+        <property name="serviceClass" value="org.apache.cxf.systest.http_undertow.DummyInterface"/>
+        <property name="address" value="http://localhost:${testutil.ports.EngineLifecycleTest.1}/Dummy"/>
+    </bean>
+</beans>

http://git-wip-us.apache.org/repos/asf/cxf/blob/e61a83d4/systests/transport-undertow/src/test/resources/org/apache/cxf/systest/http_undertow/server.xml
----------------------------------------------------------------------
diff --git a/systests/transport-undertow/src/test/resources/org/apache/cxf/systest/http_undertow/server.xml b/systests/transport-undertow/src/test/resources/org/apache/cxf/systest/http_undertow/server.xml
new file mode 100644
index 0000000..de86a64
--- /dev/null
+++ b/systests/transport-undertow/src/test/resources/org/apache/cxf/systest/http_undertow/server.xml
@@ -0,0 +1,27 @@
+<?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.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:http-undertow="http://cxf.apache.org/transports/http-undertow/configuration" xsi:schemaLocation=" http://cxf.apache.org/transports/http-undertow/configuration http://cxf.apache.org/schemas/configuration/http-undertow.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
+    <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
+    <http-undertow:engine-factory bus="cxf">
+        <http-undertow:engine port="${testutil.ports.org.apache.cxf.systest.http_undertow.Server}">
+            <http-undertow:threadingParameters minThreads="1" maxThreads="2"/>
+        </http-undertow:engine>
+    </http-undertow:engine-factory>
+</beans>

http://git-wip-us.apache.org/repos/asf/cxf/blob/e61a83d4/systests/transport-undertow/src/test/resources/org/apache/cxf/systest/http_undertow/test.html
----------------------------------------------------------------------
diff --git a/systests/transport-undertow/src/test/resources/org/apache/cxf/systest/http_undertow/test.html b/systests/transport-undertow/src/test/resources/org/apache/cxf/systest/http_undertow/test.html
new file mode 100644
index 0000000..63d3de2
--- /dev/null
+++ b/systests/transport-undertow/src/test/resources/org/apache/cxf/systest/http_undertow/test.html
@@ -0,0 +1,23 @@
+<html>
+<!--
+  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.
+-->
+<body>
+Test
+</body>
+</html>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cxf/blob/e61a83d4/systests/transport-undertow/src/test/resources/org/apache/cxf/systest/http_undertow/undertow-engine.xml
----------------------------------------------------------------------
diff --git a/systests/transport-undertow/src/test/resources/org/apache/cxf/systest/http_undertow/undertow-engine.xml b/systests/transport-undertow/src/test/resources/org/apache/cxf/systest/http_undertow/undertow-engine.xml
new file mode 100644
index 0000000..6a5f814
--- /dev/null
+++ b/systests/transport-undertow/src/test/resources/org/apache/cxf/systest/http_undertow/undertow-engine.xml
@@ -0,0 +1,45 @@
+<?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.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:sec="http://cxf.apache.org/configuration/security" xmlns:http="http://cxf.apache.org/transports/http/configuration" xmlns:httpu="http://cxf.apache.org/transports/http-undertow/configuration" xmlns:jaxws="http://java.sun.com/xml/ns/jaxws" xsi:schemaLocation="                    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-undertow/configuration               http://cxf.apache.org/schemas/configuration/http-undertow.xsd            http://www.springframework.org/schema/beans               http://www.springframework.org/schema/beans/spring-beans.xsd">
+    <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
+    <httpu:engine-factory bus="cxf">
+        <httpu:engine port="${testutil.ports.EngineLifecycleTest.2}">
+            <!--httpu:handlers>
+                <bean class="org.eclipse.undertow.webapp.WebAppContext">
+                    <constructor-arg value="."/>
+                    <constructor-arg value="/jsunit"/>
+                </bean>
+                <bean class="org.eclipse.undertow.server.handler.ContextHandler">
+                    <property name="contextPath" value="/"/>
+                    <property name="handler">
+                        <bean class="org.eclipse.undertow.server.handler.ResourceHandler">
+                            <property name="baseResource">
+                                <bean class="org.eclipse.undertow.util.resource.FileResource">
+                                    <constructor-arg value="${staticResourceURL}"/>
+                                </bean>
+                            </property>
+                        </bean>
+                    </property>
+                </bean>
+                <bean class="org.eclipse.undertow.server.handler.DefaultHandler"/>
+            </httpu:handlers-->
+        </httpu:engine>
+    </httpu:engine-factory>
+</beans>

http://git-wip-us.apache.org/repos/asf/cxf/blob/e61a83d4/systests/transport-undertow/src/test/resources/org/apache/cxf/systest/http_undertow/undertowBasicAuthServer.xml
----------------------------------------------------------------------
diff --git a/systests/transport-undertow/src/test/resources/org/apache/cxf/systest/http_undertow/undertowBasicAuthServer.xml b/systests/transport-undertow/src/test/resources/org/apache/cxf/systest/http_undertow/undertowBasicAuthServer.xml
new file mode 100644
index 0000000..e6e5ac1
--- /dev/null
+++ b/systests/transport-undertow/src/test/resources/org/apache/cxf/systest/http_undertow/undertowBasicAuthServer.xml
@@ -0,0 +1,29 @@
+<?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.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:httpu="http://cxf.apache.org/transports/http-undertow/configuration" xsi:schemaLocation=" http://cxf.apache.org/transports/http-undertow/configuration http://cxf.apache.org/schemas/configuration/http-undertow.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
+    <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
+    <httpu:engine-factory bus="cxf">
+        <httpu:engine port="${testutil.ports.UndertowBasicAuthServer}">
+            <httpu:handlers>
+                <bean class="org.apache.cxf.systest.http_undertow.UndertowBasicAuthHandler"/>
+            </httpu:handlers>
+        </httpu:engine>
+    </httpu:engine-factory>
+</beans>

http://git-wip-us.apache.org/repos/asf/cxf/blob/e61a83d4/systests/transport-undertow/src/test/resources/org/apache/cxf/systest/http_undertow/undertowDigestServer.xml
----------------------------------------------------------------------
diff --git a/systests/transport-undertow/src/test/resources/org/apache/cxf/systest/http_undertow/undertowDigestServer.xml b/systests/transport-undertow/src/test/resources/org/apache/cxf/systest/http_undertow/undertowDigestServer.xml
new file mode 100644
index 0000000..2e6646f
--- /dev/null
+++ b/systests/transport-undertow/src/test/resources/org/apache/cxf/systest/http_undertow/undertowDigestServer.xml
@@ -0,0 +1,29 @@
+<?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.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:httpu="http://cxf.apache.org/transports/http-undertow/configuration" xsi:schemaLocation=" http://cxf.apache.org/transports/http-undertow/configuration http://cxf.apache.org/schemas/configuration/http-undertow.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
+    <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
+    <httpu:engine-factory bus="cxf">
+        <httpu:engine port="${testutil.ports.UndertowDigestAuthTest}">
+            <httpu:handlers>
+                <bean class="org.apache.cxf.systest.http_undertow.UndertowDigestAuthHandler"/>
+            </httpu:handlers>
+        </httpu:engine>
+    </httpu:engine-factory>
+</beans>


[3/6] cxf git commit: [CXF-6800]add http-undertow transport

Posted by ff...@apache.org.
http://git-wip-us.apache.org/repos/asf/cxf/blob/e61a83d4/rt/transports/http-undertow/src/test/java/org/apache/cxf/transport/http_undertow/spring/ApplicationContextTest.java
----------------------------------------------------------------------
diff --git a/rt/transports/http-undertow/src/test/java/org/apache/cxf/transport/http_undertow/spring/ApplicationContextTest.java b/rt/transports/http-undertow/src/test/java/org/apache/cxf/transport/http_undertow/spring/ApplicationContextTest.java
new file mode 100644
index 0000000..f3bae9f
--- /dev/null
+++ b/rt/transports/http-undertow/src/test/java/org/apache/cxf/transport/http_undertow/spring/ApplicationContextTest.java
@@ -0,0 +1,184 @@
+/**
+ * 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_undertow.spring;
+
+import javax.xml.namespace.QName;
+
+import org.xml.sax.SAXParseException;
+
+import org.apache.cxf.Bus;
+import org.apache.cxf.BusFactory;
+import org.apache.cxf.configuration.Configurer;
+import org.apache.cxf.configuration.spring.ConfigurerImpl;
+import org.apache.cxf.service.model.EndpointInfo;
+import org.apache.cxf.service.model.ServiceInfo;
+import org.apache.cxf.test.TestApplicationContext;
+import org.apache.cxf.transport.ConduitInitiator;
+import org.apache.cxf.transport.ConduitInitiatorManager;
+import org.apache.cxf.transport.Destination;
+import org.apache.cxf.transport.DestinationFactory;
+import org.apache.cxf.transport.DestinationFactoryManager;
+import org.apache.cxf.transport.http.HTTPConduit;
+import org.apache.cxf.transport.http_undertow.UndertowHTTPDestination;
+import org.apache.cxf.transport.http_undertow.UndertowHTTPServerEngine;
+
+import org.junit.After;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+import org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException;
+
+
+public class ApplicationContextTest extends Assert {
+    
+    private static final String S1 = 
+        ApplicationContextTest.class.getResource("/META-INF/cxf/cxf.xml").toString();
+    
+    @Before
+    public void setUp() {
+        BusFactory.setDefaultBus(null);
+    }
+    
+    @After
+    public void clearBus() {
+        BusFactory.setDefaultBus(null);
+    }
+    
+ 
+    @Test
+    public void testInvalid() throws Exception {
+        String s4 = getClass()
+            .getResource("/org/apache/cxf/transport/http_undertow/spring/invalid-beans.xml").toString();
+    
+        try {
+            new TestApplicationContext(new String[] {S1, s4}).close();
+            fail("Expected XmlBeanDefinitionStoreException not thrown.");
+        } catch (XmlBeanDefinitionStoreException ex) {
+            assertTrue(ex.getCause() instanceof SAXParseException);
+        }
+    }
+    
+    @Test
+    public void testContext() throws Exception {
+        String s4 = getClass()
+            .getResource("/org/apache/cxf/transport/http_undertow/spring/beans.xml").toString();
+        
+        TestApplicationContext ctx = new TestApplicationContext(
+            new String[] {S1, s4});
+        
+
+        checkContext(ctx);
+        ctx.close();
+        ctx.destroy();
+    }
+    @Test
+    public void testContextWithProperties() throws Exception {
+        String s4 = getClass()
+            .getResource("/org/apache/cxf/transport/http_undertow/spring/beans-props.xml").toString();
+        
+        TestApplicationContext ctx = new TestApplicationContext(
+            new String[] {S1, s4});
+        checkContext(ctx);
+        ctx.close();
+        ctx.destroy();
+    }
+    private void checkContext(TestApplicationContext ctx) throws Exception {
+        ConfigurerImpl cfg = new ConfigurerImpl(ctx);
+        
+        EndpointInfo info = getEndpointInfo("bla", "Foo", "http://localhost:9000");
+        
+        Bus bus = (Bus) ctx.getBean(Bus.DEFAULT_BUS_ID);
+        bus.setExtension(cfg, Configurer.class);
+        
+        DestinationFactoryManager dfm = bus.getExtension(DestinationFactoryManager.class);
+        DestinationFactory factory = dfm.getDestinationFactory("http://cxf.apache.org/transports/http");
+        Destination d = factory.getDestination(info, bus);
+        assertTrue(d instanceof UndertowHTTPDestination);
+        UndertowHTTPDestination jd = (UndertowHTTPDestination) d;        
+        assertEquals("foobar", jd.getServer().getContentEncoding());   
+        
+        UndertowHTTPServerEngine engine = (UndertowHTTPServerEngine)jd.getEngine();
+        assertEquals(111, engine.getThreadingParameters().getMinThreads());
+        assertEquals(120, engine.getThreadingParameters().getMaxThreads());
+        
+        
+        ConduitInitiatorManager cim = bus.getExtension(ConduitInitiatorManager.class);
+        ConduitInitiator ci = cim.getConduitInitiator("http://cxf.apache.org/transports/http");
+        HTTPConduit conduit = (HTTPConduit) ci.getConduit(info, bus);
+        assertEquals(97, conduit.getClient().getConnectionTimeout());
+        
+        info.setName(new QName("urn:test:ns", "Bar"));
+        conduit = (HTTPConduit) ci.getConduit(info, bus);
+        assertEquals(79, conduit.getClient().getConnectionTimeout());
+
+        UndertowHTTPDestination jd2 = 
+            (UndertowHTTPDestination)factory.getDestination(
+                getEndpointInfo("foo", "bar", "http://localhost:9001"), bus);
+        
+        engine = (UndertowHTTPServerEngine)jd2.getEngine();
+        assertEquals(40000, engine.getMaxIdleTime());
+        assertEquals(99, engine.getThreadingParameters().getMinThreads());
+        assertEquals(777, engine.getThreadingParameters().getMaxThreads());
+                
+        assertNotNull("The handlers should not be null", engine.getHandlers());
+        assertEquals(1, engine.getHandlers().size());
+        
+        UndertowHTTPDestination jd3 = 
+            (UndertowHTTPDestination)factory.getDestination(
+                getEndpointInfo("sna", "foo", "https://localhost:9002"), bus);
+        
+        engine = (UndertowHTTPServerEngine)jd3.getEngine();
+        assertEquals(111, engine.getThreadingParameters().getMinThreads());
+        assertEquals(120, engine.getThreadingParameters().getMaxThreads());
+        
+        assertEquals(engine.getTlsServerParameters().getClientAuthentication().isWant(), true);
+        assertEquals(engine.getTlsServerParameters().getClientAuthentication().isRequired(), true);
+        
+        UndertowHTTPDestination jd4 = 
+            (UndertowHTTPDestination)factory.getDestination(
+                getEndpointInfo("sna", "foo2", "https://localhost:9003"), bus);
+        
+        engine = (UndertowHTTPServerEngine)jd4.getEngine();
+        assertEquals(engine.getTlsServerParameters().getClientAuthentication().isWant(), false);
+        assertEquals(engine.getTlsServerParameters().getClientAuthentication().isRequired(), false);
+
+        UndertowHTTPDestination jd5 = 
+            (UndertowHTTPDestination)factory.getDestination(
+                getEndpointInfo("sna", "foo", "http://localhost:9100"), bus);
+        
+        engine = (UndertowHTTPServerEngine)jd5.getEngine();
+        String r = "expected fallback thread parameters configured for port 0";
+        assertNotNull(r, engine.getThreadingParameters());
+        assertEquals(r, 21, engine.getThreadingParameters().getMinThreads());
+        assertEquals(r, 389, engine.getThreadingParameters().getMaxThreads());
+    }
+    
+    private EndpointInfo getEndpointInfo(String serviceNS, 
+                                         String endpointLocal, 
+                                         String address) {
+        ServiceInfo serviceInfo2 = new ServiceInfo();
+        serviceInfo2.setName(new QName(serviceNS, "Service"));        
+        EndpointInfo info2 = new EndpointInfo(serviceInfo2, "");
+        info2.setName(new QName("urn:test:ns", endpointLocal));
+        info2.setAddress(address);
+        return info2;
+    }
+
+
+}

http://git-wip-us.apache.org/repos/asf/cxf/blob/e61a83d4/rt/transports/http-undertow/src/test/java/org/apache/cxf/transport/http_undertow/spring/TestDummyHandler.java
----------------------------------------------------------------------
diff --git a/rt/transports/http-undertow/src/test/java/org/apache/cxf/transport/http_undertow/spring/TestDummyHandler.java b/rt/transports/http-undertow/src/test/java/org/apache/cxf/transport/http_undertow/spring/TestDummyHandler.java
new file mode 100644
index 0000000..6c256c6
--- /dev/null
+++ b/rt/transports/http-undertow/src/test/java/org/apache/cxf/transport/http_undertow/spring/TestDummyHandler.java
@@ -0,0 +1,41 @@
+/**
+ * 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_undertow.spring;
+
+import org.apache.cxf.transport.http_undertow.CXFUndertowHttpHandler;
+
+import io.undertow.server.HttpHandler;
+import io.undertow.server.HttpServerExchange;
+
+public class TestDummyHandler implements CXFUndertowHttpHandler {
+
+    private HttpHandler handler;
+    
+    @Override
+    public void handleRequest(HttpServerExchange exchange) throws Exception {
+        handler.handleRequest(exchange);
+    }
+
+    @Override
+    public void setNext(HttpHandler nextHandler) {
+        this.handler = nextHandler;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/cxf/blob/e61a83d4/rt/transports/http-undertow/src/test/java/org/apache/cxf/transport/http_undertow/spring/bean.properties
----------------------------------------------------------------------
diff --git a/rt/transports/http-undertow/src/test/java/org/apache/cxf/transport/http_undertow/spring/bean.properties b/rt/transports/http-undertow/src/test/java/org/apache/cxf/transport/http_undertow/spring/bean.properties
new file mode 100644
index 0000000..f92e1fc
--- /dev/null
+++ b/rt/transports/http-undertow/src/test/java/org/apache/cxf/transport/http_undertow/spring/bean.properties
@@ -0,0 +1,30 @@
+#  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.
+bar.connection.timeout=79
+foo.connection.timeout=97
+engine.port.zero=0
+engine.port.nine.zero=9000
+engine.port.nine.one=9001
+engine.port.nine.two=9002
+engine.port.nine.three=9003
+
+engine.port.zero.minThreads=21
+engine.port.zero.maxThreads=389
+engine.port.nine.one.minThreads=99
+engine.port.nine.one.maxThreads=777
+engine.port.nine.one.threadNamePrefix=AnotherPrefix
+engine.port.nine.one.maxIdle=40000

http://git-wip-us.apache.org/repos/asf/cxf/blob/e61a83d4/rt/transports/http-undertow/src/test/java/org/apache/cxf/transport/http_undertow/spring/beans-props.xml
----------------------------------------------------------------------
diff --git a/rt/transports/http-undertow/src/test/java/org/apache/cxf/transport/http_undertow/spring/beans-props.xml b/rt/transports/http-undertow/src/test/java/org/apache/cxf/transport/http_undertow/spring/beans-props.xml
new file mode 100644
index 0000000..7273cf5
--- /dev/null
+++ b/rt/transports/http-undertow/src/test/java/org/apache/cxf/transport/http_undertow/spring/beans-props.xml
@@ -0,0 +1,74 @@
+<?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.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans" 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:hj="http://cxf.apache.org/transports/http-undertow/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/transports/http/configuration                      http://cxf.apache.org/schemas/configuration/http-conf.xsd                 http://cxf.apache.org/transports/http-undertow/configuration                      http://cxf.apache.org/schemas/configuration/http-undertow.xsd">
+    <bean id="placeholderConfig" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
+        <property name="location" value="org/apache/cxf/transport/http_undertow/spring/bean.properties"/>
+    </bean>
+    <bean id="placeholderConfig2" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
+        <property name="location" value="org/apache/cxf/transport/http_undertow/spring/bean.properties"/>
+        <property name="placeholderPrefix" value="$("/>
+        <property name="placeholderSuffix" value=")"/>
+    </bean>
+    <bean id="placeholderConfig3" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
+        <property name="location" value="org/apache/cxf/transport/http_undertow/spring/bean.properties"/>
+        <property name="placeholderPrefix" value="#["/>
+        <property name="placeholderSuffix" value="]"/>
+    </bean>
+    <h:destination name="{urn:test:ns}Foo.http-destination">
+        <h:server ContentEncoding="foobar"/>
+    </h:destination>
+    <h:conduit name="{urn:test:ns}Foo.http-conduit">
+        <h:client ConnectionTimeout="${foo.connection.timeout}"/>
+    </h:conduit>
+    <h:conduit name="*Bar.http-conduit">
+        <h:client ConnectionTimeout="${bar.connection.timeout}"/>
+    </h:conduit>
+    <hj:engine-factory 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="111" maxThreads="120" workerIOThreads="8"/>
+        </hj:identifiedThreadingParameters>
+        <hj:engine port="${engine.port.nine.zero}">
+            <hj:threadingParametersRef id="sampleThreading1"/>
+        </hj:engine>
+        <hj:engine port="#[engine.port.zero]">
+            <hj:threadingParameters minThreads="${engine.port.zero.minThreads}" maxThreads="${engine.port.zero.maxThreads}" workerIOThreads="8"/>
+        </hj:engine>
+        <hj:engine port="$(engine.port.nine.one)" maxIdleTime="$(engine.port.nine.one.maxIdle)">
+            <hj:threadingParameters minThreads="${engine.port.nine.one.minThreads}" maxThreads="${engine.port.nine.one.maxThreads}" workerIOThreads="8"/>
+            <hj:handlers>
+                <beans:bean class="org.apache.cxf.transport.http_undertow.spring.TestDummyHandler"/>
+            </hj:handlers>
+        </hj:engine>
+        <hj:engine port="${engine.port.nine.two}">
+            <hj:tlsServerParameters>
+                <sec:clientAuthentication want="true" required="true"/>
+            </hj:tlsServerParameters>
+            <hj:threadingParametersRef id="sampleThreading1"/>
+        </hj:engine>
+        <hj:engine port="${engine.port.nine.three}">
+            <hj:tlsServerParametersRef id="sample1"/>
+        </hj:engine>
+    </hj:engine-factory>
+</beans>

http://git-wip-us.apache.org/repos/asf/cxf/blob/e61a83d4/rt/transports/http-undertow/src/test/java/org/apache/cxf/transport/http_undertow/spring/beans.xml
----------------------------------------------------------------------
diff --git a/rt/transports/http-undertow/src/test/java/org/apache/cxf/transport/http_undertow/spring/beans.xml b/rt/transports/http-undertow/src/test/java/org/apache/cxf/transport/http_undertow/spring/beans.xml
new file mode 100644
index 0000000..0676794
--- /dev/null
+++ b/rt/transports/http-undertow/src/test/java/org/apache/cxf/transport/http_undertow/spring/beans.xml
@@ -0,0 +1,61 @@
+<?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.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans" 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:hj="http://cxf.apache.org/transports/http-undertow/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/transports/http/configuration                      http://cxf.apache.org/schemas/configuration/http-conf.xsd                 http://cxf.apache.org/transports/http-undertow/configuration                      http://cxf.apache.org/schemas/configuration/http-undertow.xsd">
+    <h:destination name="{urn:test:ns}Foo.http-destination">
+        <h:server ContentEncoding="foobar"/>
+    </h:destination>
+    <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>
+    <hj:engine-factory 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="111" maxThreads="120" workerIOThreads="8"/>
+        </hj:identifiedThreadingParameters>
+        <hj:engine port="9000" maxIdleTime="30000">
+            <hj:threadingParametersRef id="sampleThreading1"/>
+        </hj:engine>
+        <hj:engine port="0">
+            <hj:threadingParameters minThreads="21" maxThreads="389" workerIOThreads="8"/>
+        </hj:engine>
+        <hj:engine port="9001" maxIdleTime="40000">
+            <hj:threadingParameters minThreads="99" maxThreads="777" workerIOThreads="8"/>
+            <hj:handlers>
+                <beans:bean class="org.apache.cxf.transport.http_undertow.spring.TestDummyHandler"/>
+            </hj:handlers>
+        </hj:engine>
+        <hj:engine port="9002">
+            <hj:tlsServerParameters>
+                <sec:clientAuthentication want="true" required="true"/>
+            </hj:tlsServerParameters>
+            <hj:threadingParametersRef id="sampleThreading1"/>
+        </hj:engine>
+        <hj:engine port="9003">
+            <hj:tlsServerParametersRef id="sample1"/>
+        </hj:engine>
+    </hj:engine-factory>
+</beans>

http://git-wip-us.apache.org/repos/asf/cxf/blob/e61a83d4/rt/transports/http-undertow/src/test/java/org/apache/cxf/transport/http_undertow/spring/conduit.xml
----------------------------------------------------------------------
diff --git a/rt/transports/http-undertow/src/test/java/org/apache/cxf/transport/http_undertow/spring/conduit.xml b/rt/transports/http-undertow/src/test/java/org/apache/cxf/transport/http_undertow/spring/conduit.xml
new file mode 100644
index 0000000..8be7266
--- /dev/null
+++ b/rt/transports/http-undertow/src/test/java/org/apache/cxf/transport/http_undertow/spring/conduit.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0"?>
+<!--
+  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.
+-->
+<h:conduit xmlns:h="http://cxf.apache.org/transports/http/configuration">
+    <h:client ConnectionTimeout="97"/>
+</h:conduit>

http://git-wip-us.apache.org/repos/asf/cxf/blob/e61a83d4/rt/transports/http-undertow/src/test/java/org/apache/cxf/transport/http_undertow/spring/destination.xml
----------------------------------------------------------------------
diff --git a/rt/transports/http-undertow/src/test/java/org/apache/cxf/transport/http_undertow/spring/destination.xml b/rt/transports/http-undertow/src/test/java/org/apache/cxf/transport/http_undertow/spring/destination.xml
new file mode 100644
index 0000000..7aafd0f
--- /dev/null
+++ b/rt/transports/http-undertow/src/test/java/org/apache/cxf/transport/http_undertow/spring/destination.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0"?>
+<!--
+  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.
+-->
+<h:destination xmlns:h="http://cxf.apache.org/transports/http/configuration">
+    <h:server ContentEncoding="foobar"/>
+    <h:contextMatchStrategy>exact</h:contextMatchStrategy>
+</h:destination>

http://git-wip-us.apache.org/repos/asf/cxf/blob/e61a83d4/rt/transports/http-undertow/src/test/java/org/apache/cxf/transport/http_undertow/spring/invalid-beans.xml
----------------------------------------------------------------------
diff --git a/rt/transports/http-undertow/src/test/java/org/apache/cxf/transport/http_undertow/spring/invalid-beans.xml b/rt/transports/http-undertow/src/test/java/org/apache/cxf/transport/http_undertow/spring/invalid-beans.xml
new file mode 100644
index 0000000..bc8da5d
--- /dev/null
+++ b/rt/transports/http-undertow/src/test/java/org/apache/cxf/transport/http_undertow/spring/invalid-beans.xml
@@ -0,0 +1,27 @@
+<?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.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans" 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" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://cxf.apache.org/transports/http/configuration http://cxf.apache.org/schemas/configuration/http-conf.xsd">
+    <h:destination id="{urn:test:ns}Foo.http-destination">
+        <h:server ContentEncoding="foobar"/>
+    </h:destination>
+    <h:conduit id="{urn:test:ns}Foo.http-conduit">
+        <h:client ConnectionTimeout="97"/>
+    </h:conduit>
+</beans>

http://git-wip-us.apache.org/repos/asf/cxf/blob/e61a83d4/rt/transports/http-undertow/src/test/java/org/apache/cxf/transport/http_undertow/spring/serverenginefactory.xml
----------------------------------------------------------------------
diff --git a/rt/transports/http-undertow/src/test/java/org/apache/cxf/transport/http_undertow/spring/serverenginefactory.xml b/rt/transports/http-undertow/src/test/java/org/apache/cxf/transport/http_undertow/spring/serverenginefactory.xml
new file mode 100644
index 0000000..49400a4
--- /dev/null
+++ b/rt/transports/http-undertow/src/test/java/org/apache/cxf/transport/http_undertow/spring/serverenginefactory.xml
@@ -0,0 +1,45 @@
+<?xml version="1.0"?>
+<!--
+  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.
+-->
+<hj:engine-factory xmlns:hj="http://cxf.apache.org/transports/http-undertow/configuration" xmlns:sec="http://cxf.apache.org/configuration/security" xmlns:beans="http://www.springframework.org/schema/beans" 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 port="9002">
+        <hj:handlers>
+            <bean class="undertowhandler1"/>
+            <bean class="undertowhandler2"/>
+        </hj:handlers>
+    </hj:engine>
+</hj:engine-factory>

http://git-wip-us.apache.org/repos/asf/cxf/blob/e61a83d4/rt/transports/pom.xml
----------------------------------------------------------------------
diff --git a/rt/transports/pom.xml b/rt/transports/pom.xml
index c0c3227..5370c27 100644
--- a/rt/transports/pom.xml
+++ b/rt/transports/pom.xml
@@ -33,6 +33,7 @@
         <module>local</module>
         <module>http</module>
         <module>http-jetty</module>
+        <module>http-undertow</module>
         <module>http-hc</module>
         <module>http-netty/netty-server</module>
         <module>http-netty/netty-client</module>

http://git-wip-us.apache.org/repos/asf/cxf/blob/e61a83d4/systests/pom.xml
----------------------------------------------------------------------
diff --git a/systests/pom.xml b/systests/pom.xml
index 3dfade6..b935926 100644
--- a/systests/pom.xml
+++ b/systests/pom.xml
@@ -36,6 +36,7 @@
         <module>transports</module>
         <module>transports-ssl3</module>
         <module>transport-jms</module>
+        <module>transport-undertow</module>
         <module>jaxws</module>
         <module>databinding</module>
         <module>jaxrs</module>

http://git-wip-us.apache.org/repos/asf/cxf/blob/e61a83d4/systests/transport-undertow/pom.xml
----------------------------------------------------------------------
diff --git a/systests/transport-undertow/pom.xml b/systests/transport-undertow/pom.xml
new file mode 100644
index 0000000..b8aecbb
--- /dev/null
+++ b/systests/transport-undertow/pom.xml
@@ -0,0 +1,253 @@
+<?xml version="1.0"?>
+<!--
+  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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+    <parent>
+        <artifactId>cxf-parent</artifactId>
+        <groupId>org.apache.cxf</groupId>
+        <version>3.2.0-SNAPSHOT</version>
+        <relativePath>../../parent/pom.xml</relativePath>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.apache.cxf.systests</groupId>
+    <artifactId>cxf-systests-transport-undertow</artifactId>
+    <name>Apache CXF Undertow Transport System Tests</name>
+    <description>Apache CXF Undertow Transport System Tests</description>
+    <url>http://cxf.apache.org</url>
+    <build>
+        <testSourceDirectory>${basedir}/src/test/java</testSourceDirectory>
+        <testResources>
+            <testResource>
+                <directory>src/test/java</directory>
+                <excludes>
+                    <exclude>**/*.java</exclude>
+                </excludes>
+            </testResource>
+            <testResource>
+                <directory>src/test/resources</directory>
+                <includes>
+                    <include>**/*</include>
+                </includes>
+            </testResource>
+        </testResources>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.cxf</groupId>
+                <artifactId>cxf-codegen-plugin</artifactId>
+                <version>${project.version}</version>
+                <executions>
+                    <execution>
+                        <id>generate-test-sources</id>
+                        <phase>generate-test-sources</phase>
+                        <configuration>
+                            <fork>${cxf.codegenplugin.forkmode}</fork>
+                            <testSourceRoot>${basedir}/target/generated/src/test/java</testSourceRoot>
+                            <testWsdlRoot>${basedir}/src/test/resources/wsdl_systest_transport</testWsdlRoot>
+                        </configuration>
+                        <goals>
+                            <goal>wsdl2java</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <artifactId>maven-jar-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>attach-sources</id>
+                        <goals>
+                            <goal>test-jar</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.cxf</groupId>
+            <artifactId>cxf-core</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.cxf</groupId>
+            <artifactId>cxf-rt-databinding-jaxb</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.cxf</groupId>
+            <artifactId>cxf-rt-frontend-jaxws</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.cxf</groupId>
+            <artifactId>cxf-rt-frontend-js</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.cxf</groupId>
+            <artifactId>cxf-rt-bindings-soap</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.cxf</groupId>
+            <artifactId>cxf-rt-databinding-aegis</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.cxf</groupId>
+            <artifactId>cxf-rt-transports-http</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.cxf</groupId>
+            <artifactId>cxf-rt-transports-http-hc</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.cxf</groupId>
+            <artifactId>cxf-rt-transports-udp</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.cxf</groupId>
+            <artifactId>cxf-rt-transports-http-undertow</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-jdk14</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>jcl-over-slf4j</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.cxf</groupId>
+            <artifactId>cxf-rt-transports-local</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.cxf</groupId>
+            <artifactId>cxf-rt-ws-policy</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.cxf</groupId>
+            <artifactId>cxf-rt-frontend-jaxrs</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.cxf</groupId>
+            <artifactId>cxf-testutils</artifactId>
+            <version>${project.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-web</artifactId>
+            <scope>test</scope>
+            <version>${cxf.spring.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-webmvc</artifactId>
+            <scope>test</scope>
+            <version>${cxf.spring.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-beans</artifactId>
+            <scope>test</scope>
+            <version>${cxf.spring.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-context</artifactId>
+            <scope>test</scope>
+            <version>${cxf.spring.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>httpunit</groupId>
+            <artifactId>httpunit</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>nekohtml</groupId>
+            <artifactId>nekohtml</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-core</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>${cxf.spring.mock}</artifactId>
+            <version>${cxf.spring.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-j2ee-connector_1.5_spec</artifactId>
+        </dependency>
+        <!-- make http://java.sun.com/dtd/web-app_2_3.dtd et al locally available during the tests -->
+        <dependency>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-servlet_3.0_spec</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>rhino</groupId>
+            <artifactId>js</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.codehaus.jettison</groupId>
+            <artifactId>jettison</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>commons-httpclient</groupId>
+            <artifactId>commons-httpclient</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.littleshoot</groupId>
+            <artifactId>littleproxy</artifactId>
+            <version>0.4</version>
+            <exclusions>
+                <exclusion>
+                    <groupId>log4j</groupId>
+                    <artifactId>log4j</artifactId>
+                </exclusion>
+                <exclusion>
+                    <groupId>org.slf4j</groupId>
+                    <artifactId>slf4j-log4j12</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+    </dependencies>
+</project>

http://git-wip-us.apache.org/repos/asf/cxf/blob/e61a83d4/systests/transport-undertow/src/test/java/org/apache/cxf/systest/http_undertow/ClientServerSessionTest.java
----------------------------------------------------------------------
diff --git a/systests/transport-undertow/src/test/java/org/apache/cxf/systest/http_undertow/ClientServerSessionTest.java b/systests/transport-undertow/src/test/java/org/apache/cxf/systest/http_undertow/ClientServerSessionTest.java
new file mode 100644
index 0000000..10489d5
--- /dev/null
+++ b/systests/transport-undertow/src/test/java/org/apache/cxf/systest/http_undertow/ClientServerSessionTest.java
@@ -0,0 +1,275 @@
+/**
+ * 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.systest.http_undertow;
+
+import java.lang.reflect.UndeclaredThrowableException;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.xml.ws.BindingProvider;
+import javax.xml.ws.Endpoint;
+import javax.xml.ws.WebServiceException;
+
+import org.apache.cxf.greeter_control.Greeter;
+import org.apache.cxf.greeter_control.GreeterService;
+import org.apache.cxf.helpers.CastUtils;
+import org.apache.cxf.testutil.common.AbstractBusClientServerTestBase;
+
+import org.junit.BeforeClass;
+import org.junit.Ignore;
+import org.junit.Test;
+
+public class ClientServerSessionTest extends AbstractBusClientServerTestBase {
+    public static final String PORT = SessionServer.PORT;
+    @BeforeClass
+    public static void startServers() throws Exception {
+        
+        assertTrue("server did not launch correctly",
+                       launchServer(SessionServer.class, true));
+        
+    }
+    
+    
+    @Test    
+    public void testInvocationWithSession() throws Exception {
+
+        GreeterService service = new GreeterService();
+        assertNotNull(service);
+
+        try {
+            Greeter greeter = service.getGreeterPort();
+            
+            BindingProvider bp = (BindingProvider)greeter;
+            updateAddressPort(bp, PORT);
+            bp.getRequestContext().put(BindingProvider.SESSION_MAINTAIN_PROPERTY, true);
+            
+            
+            Map<String, List<String>> headers 
+                = CastUtils.cast((Map<?, ?>)bp.getRequestContext().get("javax.xml.ws.http.request.headers"));
+
+            if (headers == null) {
+                headers = new HashMap<String, List<String>>();
+                bp.getRequestContext()
+                    .put("javax.xml.ws.http.request.headers", headers);
+            }
+
+            List<String> cookies = Arrays.asList(new String[] {"a=a", "b=b"});
+            headers.put("Cookie", cookies);
+            
+            String greeting = greeter.greetMe("Bonjour");
+            String cookie = "";
+            if (greeting.indexOf(';') != -1) {
+                cookie = greeting.substring(greeting.indexOf(';'));
+                greeting = greeting.substring(0, greeting.indexOf(';'));
+            }
+            assertNotNull("no response received from service", greeting);
+            assertEquals("Hello Bonjour", greeting);
+            assertTrue(cookie.contains("a=a"));
+            assertTrue(cookie.contains("b=b"));
+            
+            
+            greeting = greeter.greetMe("Hello");
+            cookie = "";
+            if (greeting.indexOf(';') != -1) {
+                cookie = greeting.substring(greeting.indexOf(';'));
+                greeting = greeting.substring(0, greeting.indexOf(';'));
+            }
+
+            assertNotNull("no response received from service", greeting);
+            assertEquals("Hello Bonjour", greeting);
+            assertTrue(cookie.contains("a=a"));
+            assertTrue(cookie.contains("b=b"));
+            
+            
+            greeting = greeter.greetMe("NiHao");
+            cookie = "";
+            if (greeting.indexOf(';') != -1) {
+                cookie = greeting.substring(greeting.indexOf(';'));
+                greeting = greeting.substring(0, greeting.indexOf(';'));
+            }
+            assertNotNull("no response received from service", greeting);
+            assertEquals("Hello Hello", greeting);
+            assertTrue(cookie.contains("a=a"));
+            assertTrue(cookie.contains("b=b"));
+        } catch (UndeclaredThrowableException ex) {
+            throw (Exception)ex.getCause();
+        }
+    }
+    
+    @Test    
+    public void testInvocationWithoutSession() throws Exception {
+
+        GreeterService service = new GreeterService();
+        assertNotNull(service);
+
+        try {
+            Greeter greeter = service.getGreeterPort();
+            updateAddressPort(greeter, PORT);
+
+            String greeting = greeter.greetMe("Bonjour");
+            
+            assertNotNull("no response received from service", greeting);
+            assertEquals("Hello Bonjour", greeting);
+            
+            greeting = greeter.greetMe("Hello");
+            assertNotNull("no response received from service", greeting);
+            assertEquals("Hello Hello", greeting);
+            
+            
+            greeting = greeter.greetMe("NiHao");
+            assertNotNull("no response received from service", greeting);
+            assertEquals("Hello NiHao", greeting);
+
+        } catch (UndeclaredThrowableException ex) {
+            throw (Exception)ex.getCause();
+        }
+    }
+    
+    @Test
+    @Ignore("seem to get random failures on everything except Linux with this."
+            + " Maybe a undertow issue.")
+    public void testPublishOnBusyPort() {
+        boolean isWindows = System.getProperty("os.name").startsWith("Windows");
+        
+        GreeterSessionImpl implementor = new GreeterSessionImpl();
+        String address = "http://localhost:" + PORT + "/SoapContext/GreeterPort";
+        try {
+            Endpoint.publish(address, implementor);
+            if (!isWindows) {
+                fail("Should have failed to publish as the port is busy");
+            } else {
+                System.err.println("Should have failed to publish as the port is busy, but certains "
+                                   + "of Windows allow this.");
+            }
+        } catch (WebServiceException ex) {
+            //ignore            
+        }
+        try {
+            //CXF-1589
+            Endpoint.publish(address, implementor);
+            if (!isWindows) {
+                fail("Should have failed to publish as the port is busy");
+            } else {
+                System.err.println("Should have failed to publish as the port is busy, but certains "
+                                   + "of Windows allow this.");
+            }
+        } catch (WebServiceException ex) {
+            //ignore
+        }
+        
+    }
+    
+    @Test    
+    public void testInvocationWithSessionFactory() throws Exception {
+        doSessionsTest("http://localhost:" + PORT + "/Stateful1");
+    }
+    @Test    
+    public void testInvocationWithSessionAnnotation() throws Exception {
+        doSessionsTest("http://localhost:" + PORT + "/Stateful2");
+    }
+    @Test    
+    public void testInvocationWithPerRequestAnnotation() throws Exception {
+        GreeterService service = new GreeterService();
+        assertNotNull(service);
+
+        Greeter greeter = service.getGreeterPort();
+        BindingProvider bp = (BindingProvider)greeter;
+        bp.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, 
+                                   "http://localhost:" + PORT + "/PerRequest");
+        bp.getRequestContext().put(BindingProvider.SESSION_MAINTAIN_PROPERTY, true);
+        String result = greeter.greetMe("World");
+        assertEquals("Hello World", result);
+        assertEquals("Bonjour default", greeter.sayHi());
+    }
+    @Test    
+    public void testInvocationWithSpringBeanAnnotation() throws Exception {
+        GreeterService service = new GreeterService();
+        assertNotNull(service);
+
+        Greeter greeter = service.getGreeterPort();
+        BindingProvider bp = (BindingProvider)greeter;
+        bp.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, 
+                                   "http://localhost:" + PORT + "/SpringBean");
+        bp.getRequestContext().put(BindingProvider.SESSION_MAINTAIN_PROPERTY, true);
+        String result = greeter.greetMe("World");
+        assertEquals("Hello World", result);
+        assertEquals("Bonjour World", greeter.sayHi());
+    }
+    
+    @Test    
+    public void testOnewayInvocationWithSession() throws Exception {
+
+        GreeterService service = new GreeterService();
+        assertNotNull(service);
+
+        try {
+            Greeter greeter = service.getGreeterPort();
+            
+            BindingProvider bp = (BindingProvider)greeter;
+            updateAddressPort(bp, PORT);
+            bp.getRequestContext().put(BindingProvider.SESSION_MAINTAIN_PROPERTY, true);
+            
+            
+                                             
+            greeter.greetMeOneWay("Bonjour");
+            
+            String greeting = greeter.greetMe("Hello");
+            if (greeting.indexOf(';') != -1) {
+                greeting = greeting.substring(0, greeting.indexOf(';'));
+            }
+            assertNotNull("no response received from service", greeting);
+            assertEquals("Hello Bonjour", greeting);
+            
+        } catch (UndeclaredThrowableException ex) {
+            throw (Exception)ex.getCause();
+        }
+    }
+    
+    private void doSessionsTest(String url) {
+        GreeterService service = new GreeterService();
+        assertNotNull(service);
+
+        Greeter greeter = service.getGreeterPort();
+        Greeter greeter2 = service.getGreeterPort();
+        
+        BindingProvider bp = (BindingProvider)greeter;
+
+        bp.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, url);
+        bp.getRequestContext().put(BindingProvider.SESSION_MAINTAIN_PROPERTY, true);
+
+        bp = (BindingProvider)greeter2;
+
+        bp.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, url);
+        bp.getRequestContext().put(BindingProvider.SESSION_MAINTAIN_PROPERTY, true);
+
+        String result = greeter.greetMe("World");
+        assertEquals("Hello World", result);
+        assertEquals("Bonjour World", greeter.sayHi());
+        
+        result = greeter2.greetMe("Universe");
+        assertEquals("Hello Universe", result);
+        assertEquals("Bonjour Universe", greeter2.sayHi());
+        
+        //make sure session 1 was maintained
+        assertEquals("Bonjour World", greeter.sayHi());
+    }
+}

http://git-wip-us.apache.org/repos/asf/cxf/blob/e61a83d4/systests/transport-undertow/src/test/java/org/apache/cxf/systest/http_undertow/Dummy.java
----------------------------------------------------------------------
diff --git a/systests/transport-undertow/src/test/java/org/apache/cxf/systest/http_undertow/Dummy.java b/systests/transport-undertow/src/test/java/org/apache/cxf/systest/http_undertow/Dummy.java
new file mode 100644
index 0000000..1e0bc47
--- /dev/null
+++ b/systests/transport-undertow/src/test/java/org/apache/cxf/systest/http_undertow/Dummy.java
@@ -0,0 +1,32 @@
+/**
+ * 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.systest.http_undertow;
+
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+
+@WebService
+public class Dummy implements DummyInterface {
+    @WebMethod
+    public String echo(String what) {
+        return what;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/cxf/blob/e61a83d4/systests/transport-undertow/src/test/java/org/apache/cxf/systest/http_undertow/DummyInterface.java
----------------------------------------------------------------------
diff --git a/systests/transport-undertow/src/test/java/org/apache/cxf/systest/http_undertow/DummyInterface.java b/systests/transport-undertow/src/test/java/org/apache/cxf/systest/http_undertow/DummyInterface.java
new file mode 100644
index 0000000..dd3227d
--- /dev/null
+++ b/systests/transport-undertow/src/test/java/org/apache/cxf/systest/http_undertow/DummyInterface.java
@@ -0,0 +1,29 @@
+/**
+ * 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.systest.http_undertow;
+
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+
+@WebService
+public interface DummyInterface {
+    @WebMethod
+    String echo(String what);
+
+}

http://git-wip-us.apache.org/repos/asf/cxf/blob/e61a83d4/systests/transport-undertow/src/test/java/org/apache/cxf/systest/http_undertow/GreeterImpl.java
----------------------------------------------------------------------
diff --git a/systests/transport-undertow/src/test/java/org/apache/cxf/systest/http_undertow/GreeterImpl.java b/systests/transport-undertow/src/test/java/org/apache/cxf/systest/http_undertow/GreeterImpl.java
new file mode 100644
index 0000000..00e3242
--- /dev/null
+++ b/systests/transport-undertow/src/test/java/org/apache/cxf/systest/http_undertow/GreeterImpl.java
@@ -0,0 +1,144 @@
+/**
+ * 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.systest.http_undertow;
+
+import java.util.concurrent.Future;
+
+import javax.jws.WebService;
+import javax.xml.ws.AsyncHandler;
+import javax.xml.ws.Response;
+
+import org.apache.hello_world_soap_http.BadRecordLitFault;
+import org.apache.hello_world_soap_http.Greeter;
+import org.apache.hello_world_soap_http.NoSuchCodeLitFault;
+import org.apache.hello_world_soap_http.types.BareDocumentResponse;
+import org.apache.hello_world_soap_http.types.GreetMeLaterResponse;
+import org.apache.hello_world_soap_http.types.GreetMeResponse;
+import org.apache.hello_world_soap_http.types.GreetMeSometimeResponse;
+import org.apache.hello_world_soap_http.types.SayHiResponse;
+import org.apache.hello_world_soap_http.types.TestDocLitFaultResponse;
+import org.apache.hello_world_soap_http.types.TestNillableResponse;
+
+
+@WebService(serviceName = "SOAPServiceAddressing", 
+            portName = "SoapPort", 
+            endpointInterface = "org.apache.hello_world_soap_http.Greeter", 
+            targetNamespace = "http://apache.org/hello_world_soap_http",
+            wsdlLocation = "testutils/hello_world.wsdl")
+public class GreeterImpl implements Greeter {
+
+    public String greetMe(String me) {
+        return "Hello " + me;
+    }
+
+    public String greetMeLater(long delay) {
+        //System.out.println("\n\n*** GreetMeLater called with: " + delay
+        //                   + " at: " + new java.util.Date().toString()
+        //                   + "***\n\n");
+        if (delay > 0) {
+            try {
+                Thread.sleep(delay);
+            } catch (InterruptedException ex) {
+                // ignore
+            }
+        }
+        return "Hello, finally";
+    }
+
+    public void greetMeOneWay(String requestType) {   
+    }
+
+    public String sayHi() {
+        return null;
+    }
+    
+    public void testDocLitFault(String faultType) throws BadRecordLitFault, NoSuchCodeLitFault {
+    }
+
+    public BareDocumentResponse testDocLitBare(String in) {
+        return null;
+    }
+
+    public String greetMeSometime(String me) {
+        return null;
+    }
+    
+    public Future<?>  greetMeSometimeAsync(String requestType, 
+                                           AsyncHandler<GreetMeSometimeResponse> asyncHandler) { 
+        return null; 
+    }
+    
+    public Response<GreetMeSometimeResponse> greetMeSometimeAsync(String requestType) { 
+        return null; 
+    }
+    
+    public Response<TestDocLitFaultResponse> testDocLitFaultAsync(String faultType) {  
+        return null; 
+    }
+    
+    public Response<BareDocumentResponse> testDocLitBareAsync(String bare) {
+        return null;
+    }
+    
+    public Future<?> greetMeAsync(String requestType, AsyncHandler<GreetMeResponse> asyncHandler) { 
+        return null; 
+    }
+    
+    public Response<GreetMeResponse> greetMeAsync(String requestType) { 
+        return null; 
+    }
+    
+    public Future<?> greetMeLaterAsync(long requestType, AsyncHandler<GreetMeLaterResponse> asyncHandler) { 
+        return null; 
+    }
+    
+    public Response<GreetMeLaterResponse> greetMeLaterAsync(long requestType) { 
+        return null; 
+    }
+    
+    public Future<?> sayHiAsync(AsyncHandler<SayHiResponse> asyncHandler) { 
+        return null; 
+    }
+    
+    public Response<SayHiResponse> sayHiAsync() { 
+        return null; 
+    }
+
+    public String testNillable(String nillElem, int intElem) {
+        return null;
+    }
+
+    public Response<TestNillableResponse> testNillableAsync(String nillElem,
+                                                            int intElem) {
+        return null;
+    }
+    
+    public Future<?> testNillableAsync(String nillElem, 
+                                       int intElem,
+                                       AsyncHandler<TestNillableResponse> asyncHandler) {
+        return null;
+    }
+
+    public Future<?> testDocLitFaultAsync(String faultType,
+                                          AsyncHandler<TestDocLitFaultResponse> asyncHandler) {
+        return null;
+    }
+    
+}

http://git-wip-us.apache.org/repos/asf/cxf/blob/e61a83d4/systests/transport-undertow/src/test/java/org/apache/cxf/systest/http_undertow/GreeterSessionImpl.java
----------------------------------------------------------------------
diff --git a/systests/transport-undertow/src/test/java/org/apache/cxf/systest/http_undertow/GreeterSessionImpl.java b/systests/transport-undertow/src/test/java/org/apache/cxf/systest/http_undertow/GreeterSessionImpl.java
new file mode 100644
index 0000000..34cbb26
--- /dev/null
+++ b/systests/transport-undertow/src/test/java/org/apache/cxf/systest/http_undertow/GreeterSessionImpl.java
@@ -0,0 +1,154 @@
+/**
+ * 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.systest.http_undertow;
+
+import java.util.concurrent.Future;
+import java.util.logging.Logger;
+
+import javax.annotation.Resource;
+import javax.jws.WebService;
+import javax.servlet.http.Cookie;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpSession;
+import javax.xml.ws.AsyncHandler;
+import javax.xml.ws.Response;
+import javax.xml.ws.WebServiceContext;
+import javax.xml.ws.WebServiceException;
+import javax.xml.ws.handler.MessageContext;
+
+
+import org.apache.cxf.common.logging.LogUtils;
+import org.apache.cxf.greeter_control.Greeter;
+import org.apache.cxf.greeter_control.types.GreetMeResponse;
+import org.apache.cxf.greeter_control.types.PingMeResponse;
+import org.apache.cxf.greeter_control.types.SayHiResponse;
+
+@WebService(serviceName = "GreeterService",
+            portName = "GreeterPort",
+            endpointInterface = "org.apache.cxf.greeter_control.Greeter", 
+            targetNamespace = "http://cxf.apache.org/greeter_control")
+public class GreeterSessionImpl implements Greeter {
+    private static final Logger LOG = 
+        LogUtils.getLogger(GreeterSessionImpl.class,
+                           null,
+                           GreeterSessionImpl.class.getPackage().getName());
+    
+    @Resource
+    private WebServiceContext context;
+    
+    // greetMe will use session to return last called name
+    public String greetMe(String me) {
+        LOG.info("Executing operation greetMe");        
+        LOG.info("Message received: " + me);
+        MessageContext mc = context.getMessageContext();
+        HttpServletRequest req = (HttpServletRequest)mc.get(MessageContext.SERVLET_REQUEST);
+        Cookie cookies[] = req.getCookies();
+        String val = "";
+        if (cookies != null) {
+            for (Cookie cookie : cookies) {
+                val += ";" + cookie.getName() + "=" + cookie.getValue();
+            }
+        }
+        
+        
+        HttpSession session = req.getSession();
+        // Get a session property "counter" from context
+        if (session == null) {
+            throw new WebServiceException("No session in WebServiceContext");
+        }
+        String name = (String)session.getAttribute("name");
+        if (name == null) {
+            name = me;
+            LOG.info("Starting the Session");
+        } 
+        
+        session.setAttribute("name", me);
+        
+        return "Hello " + name + val;
+    }
+    
+
+    public String sayHi() {
+        LOG.info("Executing operation sayHi");
+        
+        return "Bonjour ";
+    }
+    
+    public void pingMe() {
+    }
+
+
+    public Future<?> greetMeAsync(String requestType, AsyncHandler<GreetMeResponse> asyncHandler) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+
+    public Response<GreetMeResponse> greetMeAsync(String requestType) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+
+    public void greetMeOneWay(String me) {
+        LOG.info("Executing operation greetMeOneWay");        
+        LOG.info("Message received: " + me);
+        MessageContext mc = context.getMessageContext();
+        HttpServletRequest req = (HttpServletRequest)mc.get(MessageContext.SERVLET_REQUEST);
+        
+        HttpSession session = req.getSession();
+        if (session == null) {
+            throw new WebServiceException("No session in WebServiceContext");
+        }
+        String name = (String)session.getAttribute("name");
+        if (name == null) {
+            name = me;
+            LOG.info("Starting the Session");
+        } 
+        
+        session.setAttribute("name", me);
+                        
+    }
+
+
+    public Future<?> pingMeAsync(AsyncHandler<PingMeResponse> asyncHandler) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+
+    public Response<PingMeResponse> pingMeAsync() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+
+    public Future<?> sayHiAsync(AsyncHandler<SayHiResponse> asyncHandler) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+
+    public Response<SayHiResponse> sayHiAsync() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/cxf/blob/e61a83d4/systests/transport-undertow/src/test/java/org/apache/cxf/systest/http_undertow/MapIdentityManager.java
----------------------------------------------------------------------
diff --git a/systests/transport-undertow/src/test/java/org/apache/cxf/systest/http_undertow/MapIdentityManager.java b/systests/transport-undertow/src/test/java/org/apache/cxf/systest/http_undertow/MapIdentityManager.java
new file mode 100644
index 0000000..bef86e7
--- /dev/null
+++ b/systests/transport-undertow/src/test/java/org/apache/cxf/systest/http_undertow/MapIdentityManager.java
@@ -0,0 +1,126 @@
+/**
+ * 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.systest.http_undertow;
+
+import java.nio.charset.Charset;
+import java.security.MessageDigest;
+import java.security.NoSuchAlgorithmException;
+import java.security.Principal;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Map;
+import java.util.Set;
+
+import io.undertow.security.idm.Account;
+import io.undertow.security.idm.Credential;
+import io.undertow.security.idm.DigestCredential;
+import io.undertow.security.idm.IdentityManager;
+import io.undertow.security.idm.PasswordCredential;
+import io.undertow.util.HexConverter;
+
+class MapIdentityManager implements IdentityManager {
+    
+    private static final Charset UTF_8 = Charset.forName("UTF-8");
+
+    private final Map<String, char[]> users;
+
+    public MapIdentityManager(final Map<String, char[]> users) {
+        this.users = users;
+    }
+
+    @Override
+    public Account verify(Account account) {
+        // An existing account so for testing assume still valid.
+        return account;
+    }
+
+    @Override
+    public Account verify(String id, Credential credential) {
+        Account account = getAccount(id);
+        if (account != null && verifyCredential(account, credential)) {
+            return account;
+        }
+
+        return null;
+    }
+
+    @Override
+    public Account verify(Credential credential) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    private boolean verifyCredential(Account account, Credential credential) {
+        if (credential instanceof PasswordCredential) {
+            char[] password = ((PasswordCredential) credential).getPassword();
+            char[] expectedPassword = users.get(account.getPrincipal().getName());
+
+            return Arrays.equals(password, expectedPassword);
+        } else if (credential instanceof DigestCredential) {
+            DigestCredential digCred = (DigestCredential) credential;
+            MessageDigest digest = null;
+            try {
+                digest = digCred.getAlgorithm().getMessageDigest();
+
+                digest.update(account.getPrincipal().getName().getBytes(UTF_8));
+                digest.update((byte) ':');
+                digest.update(digCred.getRealm().getBytes(UTF_8));
+                digest.update((byte) ':');
+                char[] expectedPassword = users.get(account.getPrincipal().getName());
+                digest.update(new String(expectedPassword).getBytes(UTF_8));
+
+                return digCred.verifyHA1(HexConverter.convertToHexBytes(digest.digest()));
+            } catch (NoSuchAlgorithmException e) {
+                throw new IllegalStateException("Unsupported Algorithm", e);
+            } finally {
+                digest.reset();
+            }
+        }
+        return false;
+    }
+
+    private Account getAccount(final String id) {
+        if (users.containsKey(id)) {
+            return new Account() {
+
+                private final Principal principal = new Principal() {
+
+                    @Override
+                    public String getName() {
+                        return id;
+                    }
+                };
+
+                @Override
+                public Principal getPrincipal() {
+                    return principal;
+                }
+
+                @Override
+                public Set<String> getRoles() {
+                    return Collections.emptySet();
+                }
+
+            };
+        }
+        return null;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/cxf/blob/e61a83d4/systests/transport-undertow/src/test/java/org/apache/cxf/systest/http_undertow/PerRequestAnnotationGreeterImpl.java
----------------------------------------------------------------------
diff --git a/systests/transport-undertow/src/test/java/org/apache/cxf/systest/http_undertow/PerRequestAnnotationGreeterImpl.java b/systests/transport-undertow/src/test/java/org/apache/cxf/systest/http_undertow/PerRequestAnnotationGreeterImpl.java
new file mode 100644
index 0000000..6b7ebef
--- /dev/null
+++ b/systests/transport-undertow/src/test/java/org/apache/cxf/systest/http_undertow/PerRequestAnnotationGreeterImpl.java
@@ -0,0 +1,98 @@
+/**
+ * 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.systest.http_undertow;
+
+import java.util.concurrent.Future;
+
+import javax.jws.WebService;
+import javax.xml.ws.AsyncHandler;
+import javax.xml.ws.Response;
+
+
+import org.apache.cxf.annotations.FactoryType;
+import org.apache.cxf.greeter_control.Greeter;
+import org.apache.cxf.greeter_control.types.GreetMeResponse;
+import org.apache.cxf.greeter_control.types.PingMeResponse;
+import org.apache.cxf.greeter_control.types.SayHiResponse;
+
+@WebService(serviceName = "GreeterService",
+            portName = "GreeterPort",
+            endpointInterface = "org.apache.cxf.greeter_control.Greeter", 
+            targetNamespace = "http://cxf.apache.org/greeter_control")
+@FactoryType(FactoryType.Type.PerRequest)
+public class PerRequestAnnotationGreeterImpl implements Greeter {
+    String name = "default";
+    
+    // greetMe will use session to return last called name
+    public String greetMe(String me) {
+        name = me;
+        return "Hello " + me;
+    }
+    
+
+    public String sayHi() {
+        return "Bonjour " + name;
+    }
+    
+    public void pingMe() {
+    }
+
+
+    public Future<?> greetMeAsync(String requestType, AsyncHandler<GreetMeResponse> asyncHandler) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+
+    public Response<GreetMeResponse> greetMeAsync(String requestType) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+
+    public void greetMeOneWay(String requestType) {
+        // TODO Auto-generated method stub
+        
+    }
+
+
+    public Future<?> pingMeAsync(AsyncHandler<PingMeResponse> asyncHandler) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+
+    public Response<PingMeResponse> pingMeAsync() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+
+    public Future<?> sayHiAsync(AsyncHandler<SayHiResponse> asyncHandler) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+
+    public Response<SayHiResponse> sayHiAsync() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/cxf/blob/e61a83d4/systests/transport-undertow/src/test/java/org/apache/cxf/systest/http_undertow/Server.java
----------------------------------------------------------------------
diff --git a/systests/transport-undertow/src/test/java/org/apache/cxf/systest/http_undertow/Server.java b/systests/transport-undertow/src/test/java/org/apache/cxf/systest/http_undertow/Server.java
new file mode 100644
index 0000000..cf462d1
--- /dev/null
+++ b/systests/transport-undertow/src/test/java/org/apache/cxf/systest/http_undertow/Server.java
@@ -0,0 +1,65 @@
+/**
+ * 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.systest.http_undertow;
+
+
+import javax.xml.ws.Endpoint;
+
+import org.apache.cxf.Bus;
+import org.apache.cxf.BusFactory;
+import org.apache.cxf.bus.spring.SpringBusFactory;
+import org.apache.cxf.testutil.common.AbstractBusTestServerBase;
+
+
+public class Server extends AbstractBusTestServerBase  {
+    static final String PORT = allocatePort(Server.class);
+    static final String ADDRESS = "http://localhost:" + PORT + "/SoapContext/SoapPort";
+
+    Endpoint ep;
+    
+    
+    protected void run()  {
+
+        SpringBusFactory factory = new SpringBusFactory();
+        Bus bus = factory.createBus("org/apache/cxf/systest/http_undertow/server.xml");
+        BusFactory.setDefaultBus(bus);
+        setBus(bus);
+
+        GreeterImpl implementor = new GreeterImpl();
+        ep = Endpoint.publish(ADDRESS, implementor);
+    }
+    
+    @Override
+    public void tearDown() {
+        if (ep != null) {
+            ep.stop();
+        }
+    }
+        
+    public static void main(String[] args) {
+        try { 
+            Server s = new Server(); 
+            s.start();
+        } catch (Exception ex) {
+            ex.printStackTrace();
+            System.exit(-1);
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/cxf/blob/e61a83d4/systests/transport-undertow/src/test/java/org/apache/cxf/systest/http_undertow/SessionAnnotationGreeterImpl.java
----------------------------------------------------------------------
diff --git a/systests/transport-undertow/src/test/java/org/apache/cxf/systest/http_undertow/SessionAnnotationGreeterImpl.java b/systests/transport-undertow/src/test/java/org/apache/cxf/systest/http_undertow/SessionAnnotationGreeterImpl.java
new file mode 100644
index 0000000..1819c72
--- /dev/null
+++ b/systests/transport-undertow/src/test/java/org/apache/cxf/systest/http_undertow/SessionAnnotationGreeterImpl.java
@@ -0,0 +1,101 @@
+/**
+ * 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.systest.http_undertow;
+
+import java.util.concurrent.Future;
+
+import javax.jws.WebService;
+import javax.xml.ws.AsyncHandler;
+import javax.xml.ws.Response;
+
+
+import org.apache.cxf.annotations.FactoryType;
+import org.apache.cxf.greeter_control.Greeter;
+import org.apache.cxf.greeter_control.types.GreetMeResponse;
+import org.apache.cxf.greeter_control.types.PingMeResponse;
+import org.apache.cxf.greeter_control.types.SayHiResponse;
+
+@WebService(serviceName = "GreeterService",
+            portName = "GreeterPort",
+            endpointInterface = "org.apache.cxf.greeter_control.Greeter", 
+            targetNamespace = "http://cxf.apache.org/greeter_control")
+@FactoryType(FactoryType.Type.Session)
+public class SessionAnnotationGreeterImpl implements Greeter {
+    String name;
+    
+    public SessionAnnotationGreeterImpl() {
+    }
+    
+    // greetMe will use session to return last called name
+    public String greetMe(String me) {
+        name = me;
+        return "Hello " + me;
+    }
+    
+
+    public String sayHi() {
+        return "Bonjour " + name;
+    }
+    
+    public void pingMe() {
+    }
+
+
+    public Future<?> greetMeAsync(String requestType, AsyncHandler<GreetMeResponse> asyncHandler) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+
+    public Response<GreetMeResponse> greetMeAsync(String requestType) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+
+    public void greetMeOneWay(String requestType) {
+        // TODO Auto-generated method stub
+        
+    }
+
+
+    public Future<?> pingMeAsync(AsyncHandler<PingMeResponse> asyncHandler) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+
+    public Response<PingMeResponse> pingMeAsync() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+
+    public Future<?> sayHiAsync(AsyncHandler<SayHiResponse> asyncHandler) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+
+    public Response<SayHiResponse> sayHiAsync() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/cxf/blob/e61a83d4/systests/transport-undertow/src/test/java/org/apache/cxf/systest/http_undertow/SessionServer.java
----------------------------------------------------------------------
diff --git a/systests/transport-undertow/src/test/java/org/apache/cxf/systest/http_undertow/SessionServer.java b/systests/transport-undertow/src/test/java/org/apache/cxf/systest/http_undertow/SessionServer.java
new file mode 100644
index 0000000..59ee67b
--- /dev/null
+++ b/systests/transport-undertow/src/test/java/org/apache/cxf/systest/http_undertow/SessionServer.java
@@ -0,0 +1,58 @@
+/**
+ * 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.systest.http_undertow;
+
+import java.net.URL;
+
+import org.apache.cxf.Bus;
+import org.apache.cxf.bus.spring.SpringBusFactory;
+import org.apache.cxf.testutil.common.AbstractBusTestServerBase;
+
+public class SessionServer extends AbstractBusTestServerBase {
+    public static final String PORT = allocatePort(SessionServer.class);
+    Bus bus;
+    
+    @Override
+    protected void run() {
+        String configurationFile = "SessionServer.xml";
+        URL configure =
+            SessionServer.class.getResource(configurationFile);
+        bus = new SpringBusFactory().createBus(configure, true);
+        SpringBusFactory.setDefaultBus(bus);
+    }
+    
+    @Override
+    public void tearDown() {
+        bus.shutdown(true);
+        bus = null;
+    }
+    
+    public static void main(String[] args) {
+        try {
+            // System.out.println("!!!!start");
+            SessionServer s = new SessionServer();
+            s.start();
+        } catch (Exception ex) {
+            ex.printStackTrace();
+            System.exit(-1);
+        }
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/cxf/blob/e61a83d4/systests/transport-undertow/src/test/java/org/apache/cxf/systest/http_undertow/SpringAnnotationGreeterImpl.java
----------------------------------------------------------------------
diff --git a/systests/transport-undertow/src/test/java/org/apache/cxf/systest/http_undertow/SpringAnnotationGreeterImpl.java b/systests/transport-undertow/src/test/java/org/apache/cxf/systest/http_undertow/SpringAnnotationGreeterImpl.java
new file mode 100644
index 0000000..ffbe4fd
--- /dev/null
+++ b/systests/transport-undertow/src/test/java/org/apache/cxf/systest/http_undertow/SpringAnnotationGreeterImpl.java
@@ -0,0 +1,99 @@
+/**
+ * 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.systest.http_undertow;
+
+import java.util.concurrent.Future;
+
+import javax.jws.WebService;
+import javax.xml.ws.AsyncHandler;
+import javax.xml.ws.Response;
+
+import org.apache.cxf.annotations.FactoryType;
+import org.apache.cxf.greeter_control.Greeter;
+import org.apache.cxf.greeter_control.types.GreetMeResponse;
+import org.apache.cxf.greeter_control.types.PingMeResponse;
+import org.apache.cxf.greeter_control.types.SayHiResponse;
+import org.apache.cxf.service.invoker.spring.SpringBeanFactory;
+
+@WebService(serviceName = "GreeterService",
+            portName = "GreeterPort",
+            endpointInterface = "org.apache.cxf.greeter_control.Greeter", 
+            targetNamespace = "http://cxf.apache.org/greeter_control")
+@FactoryType(factoryClass = SpringBeanFactory.class, args = { "SpringBean" })
+public class SpringAnnotationGreeterImpl implements Greeter {
+    String name;
+    
+    
+    // greetMe will use session to return last called name
+    public String greetMe(String me) {
+        name = me;
+        return "Hello " + me;
+    }
+    
+
+    public String sayHi() {
+        return "Bonjour " + name;
+    }
+    
+    public void pingMe() {
+    }
+
+
+    public Future<?> greetMeAsync(String requestType, AsyncHandler<GreetMeResponse> asyncHandler) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+
+    public Response<GreetMeResponse> greetMeAsync(String requestType) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+
+    public void greetMeOneWay(String requestType) {
+        // TODO Auto-generated method stub
+        
+    }
+
+
+    public Future<?> pingMeAsync(AsyncHandler<PingMeResponse> asyncHandler) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+
+    public Response<PingMeResponse> pingMeAsync() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+
+    public Future<?> sayHiAsync(AsyncHandler<SayHiResponse> asyncHandler) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+
+    public Response<SayHiResponse> sayHiAsync() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+}


[4/6] cxf git commit: [CXF-6800]add http-undertow transport

Posted by ff...@apache.org.
http://git-wip-us.apache.org/repos/asf/cxf/blob/e61a83d4/rt/transports/http-undertow/src/main/resources/META-INF/spring.handlers
----------------------------------------------------------------------
diff --git a/rt/transports/http-undertow/src/main/resources/META-INF/spring.handlers b/rt/transports/http-undertow/src/main/resources/META-INF/spring.handlers
new file mode 100644
index 0000000..5fc9e3b
--- /dev/null
+++ b/rt/transports/http-undertow/src/main/resources/META-INF/spring.handlers
@@ -0,0 +1,21 @@
+#
+#
+#    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.
+#
+#
+http\://cxf.apache.org/transports/http-undertow/configuration=org.apache.cxf.transport.http_undertow.spring.NamespaceHandler

http://git-wip-us.apache.org/repos/asf/cxf/blob/e61a83d4/rt/transports/http-undertow/src/main/resources/META-INF/spring.schemas
----------------------------------------------------------------------
diff --git a/rt/transports/http-undertow/src/main/resources/META-INF/spring.schemas b/rt/transports/http-undertow/src/main/resources/META-INF/spring.schemas
new file mode 100644
index 0000000..1deed7a
--- /dev/null
+++ b/rt/transports/http-undertow/src/main/resources/META-INF/spring.schemas
@@ -0,0 +1,21 @@
+#
+#
+#    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.
+#
+#
+http\://cxf.apache.org/schemas/configuration/http-undertow.xsd=schemas/configuration/http-undertow.xsd

http://git-wip-us.apache.org/repos/asf/cxf/blob/e61a83d4/rt/transports/http-undertow/src/main/resources/schemas/configuration/http-undertow.xsd
----------------------------------------------------------------------
diff --git a/rt/transports/http-undertow/src/main/resources/schemas/configuration/http-undertow.xsd b/rt/transports/http-undertow/src/main/resources/schemas/configuration/http-undertow.xsd
new file mode 100644
index 0000000..d6b677f
--- /dev/null
+++ b/rt/transports/http-undertow/src/main/resources/schemas/configuration/http-undertow.xsd
@@ -0,0 +1,195 @@
+<?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-undertow/configuration" 
+           xmlns:tns="http://cxf.apache.org/transports/http-undertow/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"
+  		   xmlns:ptp="http://cxf.apache.org/configuration/parameterized-types" 
+  		   xsi:schemaLocation="
+  		     http://www.springframework.org/schema/beans
+  		       http://www.springframework.org/schema/beans/spring-beans.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"/>
+    <xs:import namespace="http://cxf.apache.org/configuration/parameterized-types"
+               schemaLocation="http://cxf.apache.org/schemas/configuration/parameterized-types.xsd"/>
+    
+    <!-- Is this really supposed to be supperceeded by http-conf:HTTPListenerPolicy? -->
+    <xs:complexType name="ThreadingParametersType">
+       <xs:attribute name="minThreads" type="ptp:ParameterizedUShort">
+          <xs:annotation>
+             <xs:documentation>Specify the number of "core" threads for the worker task thread pool. Generally this should be reasonably high, at least 10 per CPU core.</xs:documentation>
+          </xs:annotation>
+       </xs:attribute>
+       <xs:attribute name="maxThreads" type="ptp:ParameterizedUShort">
+       <xs:annotation>
+             <xs:documentation>Specify the maximum number of threads for the worker task thread pool.</xs:documentation>
+          </xs:annotation>
+       </xs:attribute>
+       <xs:attribute name="workerIOThreads" type="ptp:ParameterizedUShort">
+       <xs:annotation>
+             <xs:documentation>Specify the number of I/O threads to create for the worker.  If not specified, a default will be chosen. One IO thread per CPU core is a reasonable default.</xs:documentation>
+          </xs:annotation>
+       </xs:attribute>
+    </xs:complexType>
+    
+    <xs:complexType name="ThreadingParametersIdentifiedType">
+       <xs:sequence>
+         <xs:element name="threadingParameters" type="tns:ThreadingParametersType">
+            <xs:annotation>
+               <xs:documentation>Specifies the thread pool properties for the parameter set.</xs:documentation>
+            </xs:annotation>
+         </xs:element>
+       </xs:sequence>
+         <xs:attribute name="id" type="xs:string">
+             <xs:annotation>
+                <xs:documentation>Specifies a unique identifier by which the property set can be referred.</xs:documentation>
+             </xs:annotation>
+         </xs:attribute>
+    </xs:complexType>
+    
+    <xs:complexType name="TLSServerParametersIdentifiedType">
+       <xs:sequence>
+          <xs:element name="tlsServerParameters" type="sec:TLSServerParametersType">
+             <xs:annotation>
+                <xs:documentation>Specifies the properties for the parameter set.</xs:documentation>
+             </xs:annotation>
+          </xs:element>
+       </xs:sequence>
+          <xs:attribute name="id" type="xs:string">
+             <xs:annotation>
+                <xs:documentation>Specifies a unique identifier by which the property set can be referred.</xs:documentation>
+             </xs:annotation>
+          </xs:attribute>
+    </xs:complexType>
+    
+    <xs:complexType name="ParametersRefType">
+       <xs:attribute name="id" type="xs:string" use="required"/>
+    </xs:complexType>
+    
+    <xs:complexType name="UndertowHTTPServerEngineConfigType">
+       <xs:sequence>
+         <xs:choice minOccurs="0" maxOccurs="1">
+          <xs:element name="tlsServerParameters" 
+                      type="sec:TLSServerParametersType">
+             <xs:annotation>
+                <xs:documentation>Specifies an instance of the security parameters for the Undertow instance.</xs:documentation>
+             </xs:annotation>
+          </xs:element>
+          <xs:element name="tlsServerParametersRef"
+                      type="tns:ParametersRefType">
+             <xs:annotation>
+                <xs:documentation>Specifies a reference to a reusable set of security parameters.</xs:documentation>
+             </xs:annotation>
+          </xs:element>
+         </xs:choice>
+         <xs:choice minOccurs="0" maxOccurs="1">
+          <xs:element name="threadingParameters" 
+                      type="tns:ThreadingParametersType">
+             <xs:annotation>
+                <xs:documentation>Specifies an instance of the threading configuration use for the Undertow engine.</xs:documentation>
+             </xs:annotation>
+          </xs:element>
+          <xs:element name="threadingParametersRef"
+                      type="tns:ParametersRefType">
+             <xs:annotation>
+                <xs:documentation>Specifies a reference to a reusable set of threading parameters.</xs:documentation>
+             </xs:annotation>
+          </xs:element>
+         </xs:choice>         
+         <xs:element name="handlers" type="xsd:anyType" minOccurs="0"/>
+       </xs:sequence>
+       
+       <xs:attribute name="port" type="ptp:ParameterizedInt" use="required">
+             <xs:annotation>
+                <xs:documentation>Specifies the port used by the Undertow instance.
+                You can specify a value of 0 for the port attribute. Any threading 
+                properties specified in an engine element with its port attribute
+                set to 0 are used as the configuration for all Undertow listeners that are not explicitly configured.</xs:documentation>
+             </xs:annotation>
+       </xs:attribute>
+       <xs:attribute name="host" type="xs:string">
+             <xs:annotation>
+                <xs:documentation>
+                  Specifies the listen address used by the Undertow instance.
+                  Value can be a hostname or ip address.
+                  If not specified, Undertow will listen on all local addresses.
+                </xs:documentation>
+             </xs:annotation>
+       </xs:attribute>
+       <xs:attribute name="continuationsEnabled" type="ptp:ParameterizedBoolean">
+           <xs:annotation>
+                <xs:documentation>Specifies if Undertow Continuations will be explicitly supported
+                by Undertow destinations. Continuations will be checked if this attribute is set to true or omitted, ignored otherwise.</xs:documentation>
+             </xs:annotation>
+       </xs:attribute>
+
+       <xs:attribute name="maxIdleTime" type="ptp:ParameterizedInt">
+           <xs:annotation>  
+                <xs:documentation>Specifies the maximum idle time for a undertow connection. The timer is reset whenever there are any read or write actions on the underlying stream.</xs:documentation> 
+           </xs:annotation>
+       </xs:attribute>
+
+    </xs:complexType>
+    
+    <xs:complexType name="UndertowHTTPServerEngineFactoryConfigType">
+       <xs:sequence>
+           <xs:element name="identifiedTLSServerParameters" 
+                       type="tns:TLSServerParametersIdentifiedType"
+                       minOccurs="0" maxOccurs="unbounded">
+              <xs:annotation>
+                 <xs:documentation>Specifies a reusable set of properties for securing an HTTP service provider.</xs:documentation>
+              </xs:annotation>
+           </xs:element>
+           <xs:element name="identifiedThreadingParameters"
+                       type="tns:ThreadingParametersIdentifiedType"
+                       minOccurs="0" maxOccurs="unbounded">
+              <xs:annotation>
+                 <xs:documentation>Specifies a reusable set of properties for controlling a Undertow instance's thread pool.</xs:documentation>
+              </xs:annotation>
+           </xs:element>
+           <xs:element name="engine" 
+                       type="tns:UndertowHTTPServerEngineConfigType" 
+                       minOccurs="0" maxOccurs="unbounded">
+              <xs:annotation>
+                 <xs:documentation>Specifies the configuration for a particular Undertow runtime instance.</xs:documentation>
+              </xs:annotation>
+           </xs:element>
+       </xs:sequence>
+       <xs:attribute name="bus" type="xs:string" default="cxf"/>
+       <xs:attribute name="id" type="xs:ID" use="optional"/>
+    </xs:complexType>
+    
+    <xs:element name="engine-factory" 
+                type="tns:UndertowHTTPServerEngineFactoryConfigType">
+       <xs:annotation>
+          <xs:documentation>Contains the configuration for a Undertow instance.</xs:documentation>
+       </xs:annotation>
+    </xs:element>
+ </xs:schema>

http://git-wip-us.apache.org/repos/asf/cxf/blob/e61a83d4/rt/transports/http-undertow/src/test/java/org/apache/cxf/transport/http_undertow/UndertowHTTPDestinationTest.java
----------------------------------------------------------------------
diff --git a/rt/transports/http-undertow/src/test/java/org/apache/cxf/transport/http_undertow/UndertowHTTPDestinationTest.java b/rt/transports/http-undertow/src/test/java/org/apache/cxf/transport/http_undertow/UndertowHTTPDestinationTest.java
new file mode 100644
index 0000000..bc51936
--- /dev/null
+++ b/rt/transports/http-undertow/src/test/java/org/apache/cxf/transport/http_undertow/UndertowHTTPDestinationTest.java
@@ -0,0 +1,892 @@
+/**
+ * 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_undertow;
+
+import java.io.IOException;
+import java.io.OutputStream;
+import java.net.URL;
+import java.nio.charset.StandardCharsets;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.TreeMap;
+
+import javax.servlet.ServletInputStream;
+import javax.servlet.ServletOutputStream;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.xml.bind.JAXBElement;
+import javax.xml.namespace.QName;
+
+import org.apache.cxf.Bus;
+import org.apache.cxf.BusException;
+import org.apache.cxf.BusFactory;
+import org.apache.cxf.bus.extension.ExtensionManagerBus;
+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.continuations.SuspendedInvocationException;
+import org.apache.cxf.endpoint.EndpointResolverRegistry;
+import org.apache.cxf.helpers.CastUtils;
+import org.apache.cxf.io.AbstractWrappedOutputStream;
+import org.apache.cxf.message.ExchangeImpl;
+import org.apache.cxf.message.Message;
+import org.apache.cxf.message.MessageImpl;
+import org.apache.cxf.policy.PolicyDataEngine;
+import org.apache.cxf.security.transport.TLSSessionInfo;
+import org.apache.cxf.service.model.EndpointInfo;
+import org.apache.cxf.service.model.ServiceInfo;
+import org.apache.cxf.transport.Conduit;
+import org.apache.cxf.transport.ConduitInitiator;
+import org.apache.cxf.transport.ConduitInitiatorManager;
+import org.apache.cxf.transport.Destination;
+import org.apache.cxf.transport.MessageObserver;
+import org.apache.cxf.transport.http.AbstractHTTPDestination;
+import org.apache.cxf.transport.http.ContinuationProviderFactory;
+import org.apache.cxf.transport.http.DestinationRegistry;
+import org.apache.cxf.transport.http.HTTPTransportFactory;
+import org.apache.cxf.transports.http.configuration.HTTPServerPolicy;
+import org.apache.cxf.ws.addressing.AddressingProperties;
+import org.apache.cxf.ws.addressing.EndpointReferenceType;
+import org.apache.cxf.ws.addressing.EndpointReferenceUtils;
+import org.apache.cxf.ws.addressing.JAXWSAConstants;
+import org.easymock.EasyMock;
+
+
+import org.junit.After;
+import org.junit.Assert;
+import org.junit.Test;
+
+import io.undertow.util.HeaderMap;
+import io.undertow.util.HttpString;
+
+public class UndertowHTTPDestinationTest extends Assert {
+    protected static final String AUTH_HEADER = "Authorization";
+    protected static final String USER = "copernicus";
+    protected static final String PASSWD = "epicycles";
+    protected static final String BASIC_AUTH =
+        "Basic " + Base64Utility.encode((USER + ":" + PASSWD).getBytes());   
+
+    private static final String NOWHERE = "http://nada.nothing.nowhere.null/";
+    private static final String PAYLOAD = "message payload";
+    private static final String CHALLENGE_HEADER = "WWW-Authenticate";
+    private static final String BASIC_CHALLENGE = "Basic realm=terra";
+    private static final String DIGEST_CHALLENGE = "Digest realm=luna";
+    private static final String CUSTOM_CHALLENGE = "Custom realm=sol";
+    private Bus bus;
+    private Bus threadDefaultBus;
+    private Conduit decoupledBackChannel;
+    private EndpointInfo endpointInfo;
+    private EndpointReferenceType address;
+    private UndertowHTTPServerEngine engine;
+    private HTTPServerPolicy policy;
+    private UndertowHTTPDestination destination;
+    private HttpServletRequest request;
+    private HttpServletResponse response;
+    private Message inMessage;
+    private Message outMessage;
+    private MessageObserver observer;
+    private ServletInputStream is;
+    private ServletOutputStream os;
+    private HTTPTransportFactory transportFactory; 
+
+    /**
+     * This class replaces the engine in the Undertow Destination.
+     */
+    private class EasyMockUndertowHTTPDestination
+        extends UndertowHTTPDestination {
+
+        EasyMockUndertowHTTPDestination(Bus bus,
+                                            DestinationRegistry registry,
+                                            EndpointInfo endpointInfo,
+                                            UndertowHTTPServerEngineFactory serverEngineFactory,
+                                            UndertowHTTPServerEngine easyMockEngine) throws IOException {
+            super(bus, registry, endpointInfo, serverEngineFactory);
+            engine = easyMockEngine;
+        }
+        
+        @Override
+        public void retrieveEngine() {
+            // Leave engine alone.
+        }
+    }
+    @After
+    public void tearDown() {
+        if (bus != null) {
+            bus.shutdown(true);
+        }
+        bus = null;
+        transportFactory = null;
+        decoupledBackChannel = null;
+        address = null;
+        engine = null;
+        request = null;
+        response = null;
+        inMessage = null;
+        outMessage = null;
+        is = null;
+        os = null;
+        destination = null;
+        BusFactory.setDefaultBus(null); 
+    }
+    
+    @Test
+    public void testGetAddress() throws Exception {
+        destination = setUpDestination();
+        EndpointReferenceType ref = destination.getAddress();
+        assertNotNull("unexpected null address", ref);
+        assertEquals("unexpected address",
+                     EndpointReferenceUtils.getAddress(ref),
+                     StringUtils.addDefaultPortIfMissing(EndpointReferenceUtils.getAddress(address)));
+        assertEquals("unexpected service name local part",
+                     EndpointReferenceUtils.getServiceName(ref, bus).getLocalPart(),
+                     "Service");
+        assertEquals("unexpected portName",
+                     EndpointReferenceUtils.getPortName(ref),
+                     "Port");
+    }
+    
+    @Test
+    public void testRandomPortAllocation() throws Exception {
+        bus = BusFactory.getDefaultBus(true);
+        transportFactory = new HTTPTransportFactory();
+        ServiceInfo serviceInfo = new ServiceInfo();
+        serviceInfo.setName(new QName("bla", "Service"));
+        EndpointInfo ei = new EndpointInfo(serviceInfo, "");
+        ei.setName(new QName("bla", "Port"));
+        
+        Destination d1 = transportFactory.getDestination(ei, bus);
+        URL url = new URL(d1.getAddress().getAddress().getValue());
+        assertTrue("No random port has been allocated", 
+                   url.getPort() > 0);
+        
+    }
+    
+    @Test
+    public void testSuspendedException() throws Exception {
+        destination = setUpDestination(false, false);
+        setUpDoService(false);
+        final RuntimeException ex = new RuntimeException();
+        observer = new MessageObserver() {
+            public void onMessage(Message m) {
+                throw new SuspendedInvocationException(ex);
+            }
+        };
+        destination.setMessageObserver(observer);
+        try {
+            destination.doService(request, response);
+            fail("Suspended invocation swallowed");
+        } catch (RuntimeException runtimeEx) {
+            assertSame("Original exception is not preserved", ex, runtimeEx);
+        }
+    }
+    
+    
+    @Test
+    public void testContinuationsIgnored() throws Exception {
+        
+        HttpServletRequest httpRequest = EasyMock.createMock(HttpServletRequest.class);
+        
+        ServiceInfo serviceInfo = new ServiceInfo();
+        serviceInfo.setName(new QName("bla", "Service"));
+        EndpointInfo ei = new EndpointInfo(serviceInfo, "");
+        ei.setName(new QName("bla", "Port"));
+        
+        final UndertowHTTPServerEngine httpEngine = new UndertowHTTPServerEngine();
+        httpEngine.setContinuationsEnabled(false);
+        UndertowHTTPServerEngineFactory factory = new UndertowHTTPServerEngineFactory() {
+            @Override
+            public UndertowHTTPServerEngine retrieveUndertowHTTPServerEngine(int port) {
+                return httpEngine;
+            }
+        };
+        Bus b2 = new ExtensionManagerBus();
+        transportFactory = new HTTPTransportFactory();
+        b2.setExtension(factory, UndertowHTTPServerEngineFactory.class);
+        
+        TestUndertowDestination testDestination = 
+            new TestUndertowDestination(b2, 
+                                     transportFactory.getRegistry(), 
+                                     ei,
+                                     factory);
+        testDestination.finalizeConfig();
+        Message mi = testDestination.retrieveFromContinuation(httpRequest);
+        assertNull("Continuations must be ignored", mi);
+    }
+    
+    @Test
+    public void testGetMultiple() throws Exception {
+        bus = BusFactory.getDefaultBus(true);
+        transportFactory = new HTTPTransportFactory();
+        
+        ServiceInfo serviceInfo = new ServiceInfo();
+        serviceInfo.setName(new QName("bla", "Service"));        
+        EndpointInfo ei = new EndpointInfo(serviceInfo, "");
+        ei.setName(new QName("bla", "Port"));
+        ei.setAddress("http://foo");
+        Destination d1 = transportFactory.getDestination(ei, bus);
+        
+        Destination d2 = transportFactory.getDestination(ei, bus);
+        
+        // Second get should not generate a new destination. It should just retrieve the existing one
+        assertEquals(d1, d2);
+        
+        d2.shutdown();
+        
+        Destination d3 = transportFactory.getDestination(ei, bus);
+        // Now a new destination should have been created
+        assertNotSame(d1, d3);
+    }
+    
+    
+    @Test
+    public void testRemoveServant() throws Exception {
+        destination = setUpDestination();
+        setUpRemoveServant();
+        destination.setMessageObserver(null);
+    }
+
+    @Test
+    public void testDoServiceRedirectURL() throws Exception {
+        destination = setUpDestination(false, false);
+        setUpDoService(true);
+        destination.doService(request, response);
+        
+    }
+
+    @Test
+    public void testDoService() throws Exception {
+        Bus defaultBus = new ExtensionManagerBus();
+        assertSame("Default thread bus has not been set",
+                   defaultBus, BusFactory.getThreadDefaultBus()); 
+        destination = setUpDestination(false, false);
+        setUpDoService(false);
+        assertSame("Default thread bus has been unexpectedly reset",
+                   defaultBus, BusFactory.getThreadDefaultBus());
+        destination.doService(request, response);
+        verifyDoService();
+        assertSame("Default thread bus has not been reset",
+                    defaultBus, BusFactory.getThreadDefaultBus());
+    }
+    
+    @Test
+    public void testDoServiceWithHttpGET() throws Exception {
+        destination = setUpDestination(false, false);
+        setUpDoService(false,
+                       false,
+                       false,
+                       "GET",
+                       "?customerId=abc&cutomerAdd=def",
+                       200);
+        destination.doService(request, response);
+        
+        assertNotNull("unexpected null message", inMessage);
+        assertEquals("unexpected method",
+                     inMessage.get(Message.HTTP_REQUEST_METHOD),
+                     "GET");
+        assertEquals("unexpected path",
+                     inMessage.get(Message.PATH_INFO),
+                     "/bar/foo");
+        assertEquals("unexpected query",
+                     inMessage.get(Message.QUERY_STRING),
+                     "?customerId=abc&cutomerAdd=def");
+
+    }
+
+    @Test
+    public void testGetAnonBackChannel() throws Exception {
+        destination = setUpDestination(false, false);
+        setUpDoService(false);
+        destination.doService(request, response);
+        setUpInMessage();
+        Conduit backChannel = destination.getBackChannel(inMessage);
+        
+        assertNotNull("expected back channel", backChannel);
+        assertEquals("unexpected target",
+                     EndpointReferenceUtils.ANONYMOUS_ADDRESS,
+                     backChannel.getTarget().getAddress().getValue());
+    }
+    
+    @Test
+    public void testGetBackChannelSend() throws Exception {
+        destination = setUpDestination(false, false);
+        setUpDoService(false, true);
+        destination.doService(request, response);
+        setUpInMessage();
+        Conduit backChannel =
+            destination.getBackChannel(inMessage);
+        outMessage = setUpOutMessage();
+        backChannel.prepare(outMessage);
+        verifyBackChannelSend(backChannel, outMessage, 200);
+    }
+
+    @Test
+    public void testGetBackChannelSendFault() throws Exception {
+        destination = setUpDestination(false, false);
+        setUpDoService(false, true, 500);
+        destination.doService(request, response);
+        setUpInMessage();
+        Conduit backChannel =
+            destination.getBackChannel(inMessage);
+        outMessage = setUpOutMessage();
+        backChannel.prepare(outMessage);
+        verifyBackChannelSend(backChannel, outMessage, 500);
+    }
+    
+    @Test
+    public void testGetBackChannelSendOneway() throws Exception {
+        destination = setUpDestination(false, false);
+        setUpDoService(false, true, 500);
+        destination.doService(request, response);
+        setUpInMessage();
+        Conduit backChannel =
+            destination.getBackChannel(inMessage);
+        outMessage = setUpOutMessage();
+        backChannel.prepare(outMessage);
+        verifyBackChannelSend(backChannel, outMessage, 500, true);
+    }
+
+    @Test
+    public void testGetBackChannelSendDecoupled() throws Exception {
+        destination = setUpDestination(false, false);
+        setUpDoService(false, true, true, 202);
+        destination.doService(request, response);
+        setUpInMessage();
+        
+        Message partialResponse = setUpOutMessage();
+        partialResponse.put(Message.PARTIAL_RESPONSE_MESSAGE, Boolean.TRUE);
+        Conduit partialBackChannel =
+            destination.getBackChannel(inMessage);
+        partialBackChannel.prepare(partialResponse);
+        verifyBackChannelSend(partialBackChannel, partialResponse, 202);
+
+        outMessage = setUpOutMessage();
+        Conduit fullBackChannel =
+            destination.getBackChannel(inMessage);
+
+        fullBackChannel.prepare(outMessage);
+    }
+    
+    @Test
+    public void testServerPolicyInServiceModel()
+        throws Exception {
+        policy = new HTTPServerPolicy();
+        address = getEPR("bar/foo");
+        bus = BusFactory.getDefaultBus(true);
+        
+        transportFactory = new HTTPTransportFactory();
+        
+        ServiceInfo serviceInfo = new ServiceInfo();
+        serviceInfo.setName(new QName("bla", "Service"));        
+        endpointInfo = new EndpointInfo(serviceInfo, "");
+        endpointInfo.setName(new QName("bla", "Port"));
+        endpointInfo.addExtensor(policy);
+        
+        engine = EasyMock.createMock(UndertowHTTPServerEngine.class);
+        EasyMock.replay();
+        endpointInfo.setAddress(NOWHERE + "bar/foo");
+        
+        UndertowHTTPDestination dest = 
+            new EasyMockUndertowHTTPDestination(
+                    bus, transportFactory.getRegistry(), endpointInfo, null, engine);
+        assertEquals(policy, dest.getServer());
+    }
+        
+    @Test
+    public void testMultiplexGetAddressWithId() throws Exception {
+        destination = setUpDestination();
+        final String id = "ID2";
+        EndpointReferenceType refWithId = destination.getAddressWithId(id);
+        assertNotNull(refWithId);
+        assertNotNull(refWithId.getReferenceParameters());
+        assertNotNull(refWithId.getReferenceParameters().getAny());
+        assertTrue("it is an element", 
+                   refWithId.getReferenceParameters().getAny().get(0) instanceof JAXBElement);
+        JAXBElement<?> el = (JAXBElement<?>) refWithId.getReferenceParameters().getAny().get(0);
+        assertEquals("match our id", el.getValue(), id);
+    }
+    
+    @Test
+    public void testMultiplexGetAddressWithIdForAddress() throws Exception {
+        destination = setUpDestination();
+        destination.setMultiplexWithAddress(true);
+        
+        final String id = "ID3";
+        EndpointReferenceType refWithId = destination.getAddressWithId(id);
+        assertNotNull(refWithId);
+        assertNull(refWithId.getReferenceParameters());
+        assertTrue("match our id", EndpointReferenceUtils.getAddress(refWithId).indexOf(id) != -1);
+    }
+    
+    @Test
+    public void testMultiplexGetIdForAddress() throws Exception {
+        destination = setUpDestination();
+        destination.setMultiplexWithAddress(true);
+        
+        final String id = "ID3";
+        EndpointReferenceType refWithId = destination.getAddressWithId(id);
+        String pathInfo = EndpointReferenceUtils.getAddress(refWithId);
+        
+        Map<String, Object> context = new HashMap<String, Object>();
+        assertNull("fails with no context", destination.getId(context));
+        
+        context.put(Message.PATH_INFO, pathInfo);
+        String result = destination.getId(context);
+        assertNotNull(result);
+        assertEquals("match our id", result, id);
+    }
+    
+    @Test
+    public void testMultiplexGetId() throws Exception {
+        destination = setUpDestination();
+        
+        final String id = "ID3";
+        EndpointReferenceType refWithId = destination.getAddressWithId(id);
+        
+        Map<String, Object> context = new HashMap<String, Object>();
+        assertNull("fails with no context", destination.getId(context));
+        
+        AddressingProperties maps = EasyMock.createMock(AddressingProperties.class);
+        maps.getToEndpointReference();
+        EasyMock.expectLastCall().andReturn(refWithId);
+        EasyMock.replay(maps);      
+        context.put(JAXWSAConstants.ADDRESSING_PROPERTIES_INBOUND, maps);
+        String result = destination.getId(context);
+        assertNotNull(result);
+        assertEquals("match our id", result, id);
+    }
+    
+    private UndertowHTTPDestination setUpDestination()
+        throws Exception {
+        return setUpDestination(false, false);
+    };
+    
+    private UndertowHTTPDestination setUpDestination(
+            boolean contextMatchOnStem, boolean mockedBus)
+        throws Exception {
+        policy = new HTTPServerPolicy();
+        address = getEPR("bar/foo");
+        
+
+        transportFactory = new HTTPTransportFactory();
+
+        final ConduitInitiator ci = new ConduitInitiator() {
+            public Conduit getConduit(EndpointInfo targetInfo, Bus b) throws IOException {
+                return decoupledBackChannel;
+            }
+
+            public Conduit getConduit(EndpointInfo localInfo, EndpointReferenceType target, Bus b)
+                throws IOException {
+                return decoupledBackChannel;
+            }
+
+            public List<String> getTransportIds() {
+                return null;
+            }
+
+            public Set<String> getUriPrefixes() {
+                return new HashSet<String>(Collections.singletonList("http"));
+            }
+            
+        };
+        ConduitInitiatorManager mgr = new ConduitInitiatorManager() {
+            public void deregisterConduitInitiator(String name) {
+            }
+
+            public ConduitInitiator getConduitInitiator(String name) throws BusException {
+                return null;
+            }
+
+            public ConduitInitiator getConduitInitiatorForUri(String uri) {
+                return ci;
+            }
+
+            public void registerConduitInitiator(String name, ConduitInitiator factory) {
+            }
+        };
+        
+        if (!mockedBus) {
+            bus = new ExtensionManagerBus();
+            bus.setExtension(mgr, ConduitInitiatorManager.class);
+        } else {
+            bus = EasyMock.createMock(Bus.class);
+            bus.getExtension(EndpointResolverRegistry.class);
+            EasyMock.expectLastCall().andReturn(null);
+            bus.getExtension(ContinuationProviderFactory.class);
+            EasyMock.expectLastCall().andReturn(null).anyTimes();
+            bus.getExtension(PolicyDataEngine.class);
+            EasyMock.expectLastCall().andReturn(null).anyTimes();
+            bus.hasExtensionByName("org.apache.cxf.ws.policy.PolicyEngine");
+            EasyMock.expectLastCall().andReturn(false);
+            bus.getExtension(ClassLoader.class);
+            EasyMock.expectLastCall().andReturn(this.getClass().getClassLoader());
+            EasyMock.replay(bus);
+        }
+        
+        
+        engine = EasyMock.createNiceMock(UndertowHTTPServerEngine.class);
+        ServiceInfo serviceInfo = new ServiceInfo();
+        serviceInfo.setName(new QName("bla", "Service"));        
+        endpointInfo = new EndpointInfo(serviceInfo, "");
+        endpointInfo.setName(new QName("bla", "Port"));
+        endpointInfo.setAddress(NOWHERE + "bar/foo");
+       
+        endpointInfo.addExtensor(policy);
+        engine.addServant(EasyMock.eq(new URL(NOWHERE + "bar/foo")),
+                          EasyMock.isA(UndertowHTTPHandler.class));
+        EasyMock.expectLastCall();
+        engine.getContinuationsEnabled();
+        EasyMock.expectLastCall().andReturn(true);
+        EasyMock.replay(engine);
+        
+        UndertowHTTPDestination dest = new EasyMockUndertowHTTPDestination(bus,
+                                                             transportFactory.getRegistry(),
+                                                             endpointInfo,
+                                                             null,
+                                                             engine);
+        dest.retrieveEngine();
+        policy = dest.getServer();
+        observer = new MessageObserver() {
+            public void onMessage(Message m) {
+                inMessage = m;
+                threadDefaultBus = BusFactory.getThreadDefaultBus();
+            }
+        };
+        dest.setMessageObserver(observer);
+        return dest;
+    }
+        
+    private void setUpRemoveServant() throws Exception {
+        EasyMock.reset(engine);
+        engine.removeServant(EasyMock.eq(new URL(NOWHERE + "bar/foo")));
+        EasyMock.expectLastCall();
+        EasyMock.replay(engine);
+    }
+    
+    private void setUpDoService(boolean setRedirectURL) throws Exception {
+        setUpDoService(setRedirectURL, false);
+    }
+
+    private void setUpDoService(boolean setRedirectURL,
+                                boolean sendResponse) throws Exception {
+        setUpDoService(setRedirectURL,
+                       sendResponse,
+                       false);
+    }      
+
+    private void setUpDoService(boolean setRedirectURL,
+                                boolean sendResponse, int status) throws Exception {
+        String method = "POST";
+        String query = "?name";
+        setUpDoService(setRedirectURL, sendResponse, false, method, query, status);
+    }
+    
+    private void setUpDoService(boolean setRedirectURL,
+                                boolean sendResponse, boolean decoupled, int status) throws Exception {
+        String method = "POST";
+        String query = "?name";
+        setUpDoService(setRedirectURL, sendResponse, decoupled, method, query, status);
+    }
+    
+    private void setUpDoService(boolean setRedirectURL,
+            boolean sendResponse,
+            boolean decoupled) throws Exception {
+        String method = "POST";
+        String query = "?name";
+        setUpDoService(setRedirectURL, sendResponse, decoupled, method, query, 200);
+    }
+
+    private void setUpDoService(boolean setRedirectURL,
+                                boolean sendResponse,
+                                boolean decoupled,
+                                String method,
+                                String query,
+                                int status
+                                ) throws Exception {
+       
+        is = EasyMock.createMock(ServletInputStream.class);
+        os = EasyMock.createMock(ServletOutputStream.class);
+        request = EasyMock.createMock(HttpServletRequest.class);
+        response = EasyMock.createMock(HttpServletResponse.class);
+        request.getMethod();
+        EasyMock.expectLastCall().andReturn(method).atLeastOnce();
+        request.getUserPrincipal();
+        EasyMock.expectLastCall().andReturn(null).anyTimes();
+        
+        if (setRedirectURL) {
+            policy.setRedirectURL(NOWHERE + "foo/bar");
+            response.sendRedirect(EasyMock.eq(NOWHERE + "foo/bar"));
+            EasyMock.expectLastCall();
+            response.flushBuffer();
+            EasyMock.expectLastCall();
+            EasyMock.expectLastCall();
+        } else { 
+            //getQueryString for if statement
+            request.getQueryString();
+            EasyMock.expectLastCall().andReturn(query);      
+            
+            if ("GET".equals(method) && "?wsdl".equals(query)) {
+                verifyGetWSDLQuery();                
+            } else { // test for the post
+                EasyMock.expect(request.getAttribute(AbstractHTTPDestination.CXF_CONTINUATION_MESSAGE))
+                    .andReturn(null);
+                
+                       
+                EasyMock.expect(request.getInputStream()).andReturn(is);
+                EasyMock.expect(request.getContextPath()).andReturn("/bar");
+                EasyMock.expect(request.getServletPath()).andReturn("");
+                EasyMock.expect(request.getPathInfo()).andReturn("/foo");
+                EasyMock.expect(request.getRequestURI()).andReturn("/foo");
+                EasyMock.expect(request.getRequestURL())
+                    .andReturn(new StringBuffer("http://localhost/foo")).anyTimes();
+                EasyMock.expect(request.getCharacterEncoding()).andReturn(StandardCharsets.UTF_8.name());
+                EasyMock.expect(request.getQueryString()).andReturn(query);    
+                EasyMock.expect(request.getHeader("Accept")).andReturn("*/*");  
+                EasyMock.expect(request.getContentType()).andReturn("text/xml charset=utf8").times(2);
+                EasyMock.expect(request.getAttribute("http.service.redirection")).andReturn(null).anyTimes();
+                
+                HeaderMap httpFields = new HeaderMap();
+                httpFields.add(new HttpString("content-type"), "text/xml");
+                httpFields.add(new HttpString("content-type"), "charset=utf8");
+                httpFields.put(new HttpString(UndertowHTTPDestinationTest.AUTH_HEADER), 
+                               UndertowHTTPDestinationTest.BASIC_AUTH);
+                List<String> headers = new ArrayList<String>();
+                for (HttpString header : httpFields.getHeaderNames()) {
+                    headers.add(header.toString());
+                }
+                EasyMock.expect(request.getHeaderNames()).andReturn(Collections.enumeration(headers));
+                request.getHeaders("content-type");
+                EasyMock.expectLastCall().andReturn(Collections.enumeration(httpFields.get("content-type")));
+                request.getHeaders(UndertowHTTPDestinationTest.AUTH_HEADER);
+                EasyMock.expectLastCall().andReturn(Collections.enumeration(
+                                                    httpFields.get(UndertowHTTPDestinationTest.AUTH_HEADER)));
+                 
+                EasyMock.expect(request.getInputStream()).andReturn(is);
+                EasyMock.expectLastCall();  
+                response.flushBuffer();
+                EasyMock.expectLastCall();
+                if (sendResponse) {
+                    response.setStatus(status);
+                    EasyMock.expectLastCall();
+                    response.setContentType("text/xml charset=utf8");
+                    EasyMock.expectLastCall();
+                    response.addHeader(EasyMock.isA(String.class), EasyMock.isA(String.class));
+                    EasyMock.expectLastCall().anyTimes();
+                    response.setContentLength(0);
+                    EasyMock.expectLastCall().anyTimes();
+                    response.getOutputStream();
+                    EasyMock.expectLastCall().andReturn(os);
+                    response.getStatus();
+                    EasyMock.expectLastCall().andReturn(status).anyTimes();
+                    response.flushBuffer();
+                    EasyMock.expectLastCall();                
+                }
+                request.getAttribute("javax.servlet.request.cipher_suite");
+                EasyMock.expectLastCall().andReturn("anythingwilldoreally");
+                request.getAttribute("javax.net.ssl.session");
+                EasyMock.expectLastCall().andReturn(null);
+                request.getAttribute("javax.servlet.request.X509Certificate");
+                EasyMock.expectLastCall().andReturn(null);
+            }
+        }
+        
+        if (decoupled) {
+            setupDecoupledBackChannel();
+        }
+        EasyMock.replay(response);
+        EasyMock.replay(request);
+    }
+    
+    private void setupDecoupledBackChannel() throws IOException {
+        decoupledBackChannel = EasyMock.createMock(Conduit.class);
+        decoupledBackChannel.setMessageObserver(EasyMock.isA(MessageObserver.class));           
+        decoupledBackChannel.prepare(EasyMock.isA(Message.class));
+        EasyMock.expectLastCall();
+        EasyMock.replay(decoupledBackChannel);
+    }
+    
+    private void setUpInMessage() {
+        inMessage.setExchange(new ExchangeImpl());
+    }
+    
+    private Message setUpOutMessage() {
+        Message outMsg = new MessageImpl();
+        outMsg.putAll(inMessage);
+        outMsg.setExchange(new ExchangeImpl());
+        outMsg.put(Message.PROTOCOL_HEADERS,
+                   new TreeMap<String, List<String>>(String.CASE_INSENSITIVE_ORDER));
+        return outMsg;
+    }
+    
+    private void setUpResponseHeaders(Message outMsg) {
+        Map<String, List<String>> responseHeaders =
+            CastUtils.cast((Map<?, ?>)outMsg.get(Message.PROTOCOL_HEADERS));
+        assertNotNull("expected response headers", responseHeaders);
+        List<String> challenges = new ArrayList<String>();
+        challenges.add(BASIC_CHALLENGE);
+        challenges.add(DIGEST_CHALLENGE);
+        challenges.add(CUSTOM_CHALLENGE);
+        responseHeaders.put(CHALLENGE_HEADER, challenges);
+    }
+    
+    private void verifyGetWSDLQuery() throws Exception {
+        EasyMock.reset(bus);        
+        request.getRequestURL();
+        EasyMock.expectLastCall().andReturn(new StringBuffer("http://localhost/bar/foo")).times(2);
+        request.getPathInfo();
+        EasyMock.expectLastCall().andReturn("/bar/foo");
+        request.getCharacterEncoding();
+        EasyMock.expectLastCall().andReturn(StandardCharsets.UTF_8.name());
+        request.getQueryString();
+        EasyMock.expectLastCall().andReturn("wsdl");    
+        response.setContentType("text/xml");
+        EasyMock.expectLastCall();        
+        response.getOutputStream();
+        EasyMock.expectLastCall().andReturn(os).anyTimes();
+        EasyMock.expectLastCall();
+        EasyMock.replay(bus);
+    }
+
+    private void verifyDoService() throws Exception {
+        assertSame("Default thread bus has not been set for request",
+                    bus, threadDefaultBus);
+        assertNotNull("unexpected null message", inMessage);
+        assertSame("unexpected HTTP request",
+                   inMessage.get(UndertowHTTPDestination.HTTP_REQUEST),
+                   request);
+        assertSame("unexpected HTTP response",
+                   inMessage.get(UndertowHTTPDestination.HTTP_RESPONSE),
+                   response);
+        assertEquals("unexpected method",
+                     inMessage.get(Message.HTTP_REQUEST_METHOD),
+                     "POST");
+        assertEquals("unexpected path",
+                     inMessage.get(Message.PATH_INFO),
+                     "/bar/foo");
+        assertEquals("unexpected query",
+                     inMessage.get(Message.QUERY_STRING),
+                     "?name");        
+        assertNotNull("unexpected query",
+                   inMessage.get(TLSSessionInfo.class));
+        verifyRequestHeaders();
+                
+    }
+
+    private void verifyRequestHeaders() throws Exception {
+        Map<String, List<String>> requestHeaders =
+            CastUtils.cast((Map<?, ?>)inMessage.get(Message.PROTOCOL_HEADERS));
+        assertNotNull("expected request headers",
+                      requestHeaders);        
+        List<String> values = requestHeaders.get("content-type");
+        assertNotNull("expected field", values);
+        assertEquals("unexpected values", 2, values.size());
+        assertTrue("expected value", values.contains("text/xml"));
+        assertTrue("expected value", values.contains("charset=utf8"));
+        values = requestHeaders.get(AUTH_HEADER);
+        assertNotNull("expected field", values);
+        assertEquals("unexpected values", 1, values.size());
+        assertTrue("expected value", values.contains(BASIC_AUTH));
+        
+        AuthorizationPolicy authpolicy =
+            inMessage.get(AuthorizationPolicy.class);
+        assertNotNull("Expected some auth tokens", policy);
+        assertEquals("expected user",
+                     USER,
+                     authpolicy.getUserName());
+        assertEquals("expected passwd",
+                     PASSWD,
+                     authpolicy.getPassword());
+    }
+    
+    private void verifyResponseHeaders(Message outMsg) throws Exception {
+        Map<String, List<String>> responseHeaders =
+            CastUtils.cast((Map<?, ?>)outMsg.get(Message.PROTOCOL_HEADERS));
+        assertNotNull("expected response headers",
+                      responseHeaders);
+        
+    }
+    
+    private void verifyBackChannelSend(Conduit backChannel,
+                                       Message outMsg,
+                                       int status) throws Exception {
+        verifyBackChannelSend(backChannel, outMsg, status, false);
+    }
+    
+    private void verifyBackChannelSend(Conduit backChannel,
+                                       Message outMsg,
+                                       int status,
+                                       boolean oneway) throws Exception {
+        outMsg.getExchange().setOneWay(oneway);
+
+        assertTrue("unexpected back channel type",
+                   backChannel instanceof UndertowHTTPDestination.BackChannelConduit);
+        assertTrue("unexpected content formats",
+                   outMsg.getContentFormats().contains(OutputStream.class));
+        OutputStream responseOS = outMsg.getContent(OutputStream.class);
+        assertNotNull("expected output stream", responseOS);
+        assertTrue("unexpected output stream type",
+                   responseOS instanceof AbstractWrappedOutputStream);
+               
+        outMsg.put(Message.RESPONSE_CODE, status);          
+        responseOS.write(PAYLOAD.getBytes());
+        
+        setUpResponseHeaders(outMsg);
+        
+        responseOS.flush();        
+        assertEquals("unexpected status",
+                     status,
+                     response.getStatus());
+        
+        verifyResponseHeaders(outMsg);     
+        
+        if (oneway) {
+            assertNull("unexpected HTTP response",
+                       outMsg.get(UndertowHTTPDestination.HTTP_RESPONSE));
+        } else {
+            assertNotNull("expected HTTP response",
+                           outMsg.get(UndertowHTTPDestination.HTTP_RESPONSE));
+            responseOS.close();            
+        }
+    }
+    
+    static EndpointReferenceType getEPR(String s) {
+        return EndpointReferenceUtils.getEndpointReference(NOWHERE + s);
+    }
+    
+    private static class TestUndertowDestination extends UndertowHTTPDestination {
+        TestUndertowDestination(Bus bus,
+                                    DestinationRegistry registry,
+                                    EndpointInfo endpointInfo,
+                                    UndertowHTTPServerEngineFactory serverEngineFactory) throws IOException {
+            super(bus, registry, endpointInfo, serverEngineFactory);
+        }
+        
+        @Override
+        public Message retrieveFromContinuation(HttpServletRequest request) {
+            return super.retrieveFromContinuation(request);
+        }
+        
+        
+    }
+}

http://git-wip-us.apache.org/repos/asf/cxf/blob/e61a83d4/rt/transports/http-undertow/src/test/java/org/apache/cxf/transport/http_undertow/UndertowHTTPServerEngineFactoryTest.java
----------------------------------------------------------------------
diff --git a/rt/transports/http-undertow/src/test/java/org/apache/cxf/transport/http_undertow/UndertowHTTPServerEngineFactoryTest.java b/rt/transports/http-undertow/src/test/java/org/apache/cxf/transport/http_undertow/UndertowHTTPServerEngineFactoryTest.java
new file mode 100644
index 0000000..e1ac2d0
--- /dev/null
+++ b/rt/transports/http-undertow/src/test/java/org/apache/cxf/transport/http_undertow/UndertowHTTPServerEngineFactoryTest.java
@@ -0,0 +1,145 @@
+/**
+ * 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_undertow;
+
+import java.net.URL;
+
+
+import org.apache.cxf.Bus;
+import org.apache.cxf.BusFactory;
+import org.apache.cxf.bus.spring.SpringBusFactory;
+import org.apache.cxf.transport.DestinationFactory;
+import org.apache.cxf.transport.DestinationFactoryManager;
+import org.apache.cxf.transport.http.HTTPTransportFactory;
+
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Assert;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+
+
+public class UndertowHTTPServerEngineFactoryTest
+        extends Assert {
+    Bus bus;
+    
+    @BeforeClass
+    public static void classUp() {
+        // Get rid of any notion of a default bus set by other 
+        // rogue tests.
+        BusFactory.setDefaultBus(null);
+    }
+    
+    @AfterClass
+    public static void classDown() {
+        // Clean up.
+        BusFactory.setDefaultBus(null);
+    }
+    
+    @After
+    public void tearDown() {
+        if (bus != null) {
+            bus.shutdown(false);
+            bus = null;
+        }
+    }
+    
+    /**
+     * This test makes sure that a default Spring initialized bus will 
+     * have the UndertowHTTPServerEngineFactory (absent of <httpu:engine-factory>
+     * configuration.
+     */
+    @Test
+    public void testMakeSureTransportFactoryHasEngineFactory() throws Exception {
+        bus = BusFactory.getDefaultBus(true);
+        
+        assertNotNull("Cannot get bus", bus);
+        
+        // Make sure we got the Transport Factory.
+        DestinationFactoryManager destFM = 
+            bus.getExtension(DestinationFactoryManager.class);
+        assertNotNull("Cannot get DestinationFactoryManager", destFM);
+        DestinationFactory destF = 
+            destFM.getDestinationFactory(
+                    "http://cxf.apache.org/transports/http");
+        assertNotNull("No DestinationFactory", destF);
+        assertTrue(HTTPTransportFactory.class.isInstance(destF));
+
+        // And the UndertowHTTPServerEngineFactory should be there.
+        UndertowHTTPServerEngineFactory factory =
+            bus.getExtension(UndertowHTTPServerEngineFactory.class);
+        assertNotNull("EngineFactory is not configured.", factory);
+    }
+    
+    /**
+     * This test makes sure that with a <httpu:engine-factory bus="cxf">
+     * that the bus is configured with the rightly configured Undertow
+     * HTTP Server Engine Factory.  Port 1234 should have be configured
+     * for TLS.
+     */
+    @Test
+    public void testMakeSureTransportFactoryHasEngineFactoryConfigured() throws Exception {
+        
+        // This file configures the factory to configure
+        // port 1234 with default TLS.
+        
+        URL config = getClass().getResource("server-engine-factory.xml");
+        
+        bus = new SpringBusFactory().createBus(config, true);
+        
+        UndertowHTTPServerEngineFactory factory =
+            bus.getExtension(UndertowHTTPServerEngineFactory.class);
+        
+        assertNotNull("EngineFactory is not configured.", factory);
+        
+        // The Engine for port 1234 should be configured for TLS.
+        // This will throw an error if it is not.
+        UndertowHTTPServerEngine engine = null;
+        engine = factory.createUndertowHTTPServerEngine(1234, "https");
+        
+        assertNotNull("Engine is not available.", engine);
+        assertEquals(1234, engine.getPort());
+        assertEquals("Not https", "https", engine.getProtocol());
+        
+        try {
+            engine = factory.createUndertowHTTPServerEngine(1234, "http");
+            fail("The engine's protocol should be https");
+        } catch (Exception e) {
+            // expect the exception
+        }
+    }
+    
+    @Test
+    public void testAnInvalidConfiguresfile() {
+        
+        // This file configures the factory to configure
+        // port 1234 with default TLS.
+        
+        URL config = getClass().getResource("invalid-engines.xml");
+
+        bus = new SpringBusFactory().createBus(config);
+            
+        UndertowHTTPServerEngineFactory factory =
+            bus.getExtension(UndertowHTTPServerEngineFactory.class);
+            
+        assertNotNull("EngineFactory is not configured.", factory);
+    }   
+
+}

http://git-wip-us.apache.org/repos/asf/cxf/blob/e61a83d4/rt/transports/http-undertow/src/test/java/org/apache/cxf/transport/http_undertow/UndertowHTTPServerEngineTest.java
----------------------------------------------------------------------
diff --git a/rt/transports/http-undertow/src/test/java/org/apache/cxf/transport/http_undertow/UndertowHTTPServerEngineTest.java b/rt/transports/http-undertow/src/test/java/org/apache/cxf/transport/http_undertow/UndertowHTTPServerEngineTest.java
new file mode 100644
index 0000000..a909822
--- /dev/null
+++ b/rt/transports/http-undertow/src/test/java/org/apache/cxf/transport/http_undertow/UndertowHTTPServerEngineTest.java
@@ -0,0 +1,266 @@
+/**
+ * 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_undertow;
+
+
+
+import java.io.ByteArrayOutputStream;
+import java.io.InputStream;
+import java.lang.management.ManagementFactory;
+import java.net.HttpURLConnection;
+import java.net.URL;
+import java.net.URLConnection;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Set;
+
+import javax.management.ObjectName;
+
+import org.apache.cxf.Bus;
+import org.apache.cxf.configuration.Configurer;
+import org.apache.cxf.configuration.jsse.TLSServerParameters;
+import org.apache.cxf.configuration.spring.ConfigurerImpl;
+import org.apache.cxf.helpers.CastUtils;
+import org.apache.cxf.helpers.IOUtils;
+import org.apache.cxf.management.InstrumentationManager;
+import org.apache.cxf.testutil.common.TestUtil;
+import org.easymock.EasyMock;
+import org.easymock.IMocksControl;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+
+public class UndertowHTTPServerEngineTest extends Assert {
+    private static final int PORT1 
+        = Integer.valueOf(TestUtil.getPortNumber(UndertowHTTPServerEngineTest.class, 1));
+    private static final int PORT2
+        = Integer.valueOf(TestUtil.getPortNumber(UndertowHTTPServerEngineTest.class, 2));
+    private static final int PORT3 
+        = Integer.valueOf(TestUtil.getPortNumber(UndertowHTTPServerEngineTest.class, 3));
+    
+
+    private Bus bus;
+    private IMocksControl control;
+    private UndertowHTTPServerEngineFactory factory;
+
+    @Before
+    public void setUp() throws Exception {
+        control = EasyMock.createNiceControl();
+        bus = control.createMock(Bus.class);
+        
+        Configurer configurer = new ConfigurerImpl();
+        bus.getExtension(Configurer.class);
+        EasyMock.expectLastCall().andReturn(configurer).anyTimes();
+        
+        InstrumentationManager iManager = control.createMock(InstrumentationManager.class);
+        iManager.getMBeanServer();
+        EasyMock.expectLastCall().andReturn(ManagementFactory.getPlatformMBeanServer()).anyTimes();
+        
+        bus.getExtension(InstrumentationManager.class);
+        EasyMock.expectLastCall().andReturn(iManager).anyTimes();
+        
+        control.replay();
+
+        factory = new UndertowHTTPServerEngineFactory();
+        factory.setBus(bus);
+
+    }
+    
+    
+    
+    @Test
+    public void testEngineRetrieval() throws Exception {
+        UndertowHTTPServerEngine engine =
+            factory.createUndertowHTTPServerEngine(PORT1, "http");
+
+        assertTrue(
+            "Engine references for the same port should point to the same instance",
+            engine == factory.retrieveUndertowHTTPServerEngine(PORT1));
+
+        UndertowHTTPServerEngineFactory.destroyForPort(PORT1);
+    }
+
+    @Test
+    public void testHttpAndHttps() throws Exception {
+        UndertowHTTPServerEngine engine =
+            factory.createUndertowHTTPServerEngine(PORT1, "http");
+
+        assertTrue("Protocol must be http",
+                "http".equals(engine.getProtocol()));
+
+        engine = new UndertowHTTPServerEngine();
+        engine.setPort(PORT2);
+        engine.setMaxIdleTime(30000);
+        engine.setTlsServerParameters(new TLSServerParameters());
+        engine.finalizeConfig();
+
+        List<UndertowHTTPServerEngine> list = new ArrayList<UndertowHTTPServerEngine>();
+        list.add(engine);
+        factory.setEnginesList(list);
+        engine = factory.createUndertowHTTPServerEngine(PORT2, "https");
+        UndertowHTTPTestHandler handler1 = new UndertowHTTPTestHandler("string1", true);
+        
+        engine.addServant(new URL("https://localhost:" + PORT2 + "/test"), handler1);
+        assertTrue("Protocol must be https",
+                "https".equals(engine.getProtocol()));
+        
+        assertEquals("Get the wrong maxIdleTime.", 30000, engine.getMaxIdleTime());
+
+        factory.setTLSServerParametersForPort(PORT1, new TLSServerParameters());
+        engine = factory.createUndertowHTTPServerEngine(PORT1, "https");
+        assertTrue("Protocol must be https",
+                   "https".equals(engine.getProtocol()));
+
+        factory.setTLSServerParametersForPort(PORT3, new TLSServerParameters());
+        engine = factory.createUndertowHTTPServerEngine(PORT3, "https");
+        assertTrue("Protocol must be https",
+                   "https".equals(engine.getProtocol()));
+
+        UndertowHTTPServerEngineFactory.destroyForPort(PORT1);
+        UndertowHTTPServerEngineFactory.destroyForPort(PORT2);
+        UndertowHTTPServerEngineFactory.destroyForPort(PORT3);
+    }
+
+
+    
+
+    @Test
+    public void testaddServants() throws Exception {
+        String urlStr = "http://localhost:" + PORT1 + "/hello/test";
+        String urlStr2 = "http://localhost:" + PORT1 + "/hello233/test";
+        UndertowHTTPServerEngine engine =
+            factory.createUndertowHTTPServerEngine(PORT1, "http");
+        engine.setMaxIdleTime(30000);
+        engine.addServant(new URL(urlStr), new UndertowHTTPTestHandler("string1", true));
+        assertEquals("Get the wrong maxIdleTime.", 30000, engine.getMaxIdleTime());
+        
+        String response = null;
+        response = getResponse(urlStr);
+        assertEquals("The undertow http handler did not take effect", response, "string1");
+
+        try {
+            engine.addServant(new URL(urlStr), new UndertowHTTPTestHandler("string2", true));
+            fail("We don't support to publish the two service at the same context path");
+        } catch (Exception ex) {
+            assertTrue("Get a wrong exception message", ex.getMessage().indexOf("hello/test") > 0);
+        }
+        
+        try {
+            engine.addServant(new URL(urlStr + "/test"), new UndertowHTTPTestHandler("string2", true));
+            fail("We don't support to publish the two service at the same context path");
+        } catch (Exception ex) {
+            assertTrue("Get a wrong exception message", ex.getMessage().indexOf("hello/test/test") > 0);
+        }
+        
+        try {
+            engine.addServant(new URL("http://localhost:" + PORT1 + "/hello"), 
+                              new UndertowHTTPTestHandler("string2", true));
+            fail("We don't support to publish the two service at the same context path");
+        } catch (Exception ex) {
+            assertTrue("Get a wrong exception message", ex.getMessage().indexOf("hello") > 0);
+        }
+        
+        // check if the system property change could work
+        System.setProperty("org.apache.cxf.transports.http_undertow.DontCheckUrl", "true");
+        engine.addServant(new URL(urlStr + "/test"), new UndertowHTTPTestHandler("string2", true));
+        // clean up the System property setting
+        System.clearProperty("org.apache.cxf.transports.http_undertow.DontCheckUrl");
+        
+        engine.addServant(new URL(urlStr2), new UndertowHTTPTestHandler("string2", true));
+        
+        Set<ObjectName>  s = CastUtils.cast(ManagementFactory.getPlatformMBeanServer().
+            queryNames(new ObjectName("org.xnio:type=Xnio,provider=\"nio\""), null));
+        assertEquals("Could not find Undertow Server: " + s, 1, s.size());
+        
+        engine.removeServant(new URL(urlStr));
+        engine.shutdown();
+        response = getResponse(urlStr2);
+        assertEquals("The undertow http handler did not take effect", response, "string2");
+        // set the get request
+        UndertowHTTPServerEngineFactory.destroyForPort(PORT1);
+
+    }
+    
+    /**
+     * Test that multiple UndertowHTTPServerEngine instances can be used simultaneously
+     * without having name collisions.
+     */
+    @Test
+    public void testJmxSupport() throws Exception {
+        String urlStr = "http://localhost:" + PORT1 + "/hello/test";
+        String urlStr2 = "http://localhost:" + PORT2 + "/hello/test";
+        UndertowHTTPServerEngine engine =
+            factory.createUndertowHTTPServerEngine(PORT1, "http");
+        UndertowHTTPServerEngine engine2 =
+            factory.createUndertowHTTPServerEngine(PORT2, "http");
+        UndertowHTTPTestHandler handler1 = new UndertowHTTPTestHandler("string1", true);
+        UndertowHTTPTestHandler handler2 = new UndertowHTTPTestHandler("string2", true);
+        
+        engine.addServant(new URL(urlStr), handler1);
+        
+        Set<ObjectName>  s = CastUtils.cast(ManagementFactory.getPlatformMBeanServer().
+            queryNames(new ObjectName("org.xnio:type=Xnio,provider=\"nio\""), null));
+        assertEquals("Could not find 1 Undertow Server: " + s, 1, s.size());
+        
+        engine2.addServant(new URL(urlStr2), handler2);
+        
+        s = CastUtils.cast(ManagementFactory.getPlatformMBeanServer().
+            queryNames(new ObjectName("org.xnio:type=Xnio,provider=\"nio\",worker=\"*\""), null));
+        assertEquals("Could not find 2 Undertow Server: " + s, 2, s.size());
+        
+        engine.removeServant(new URL(urlStr));
+        engine2.removeServant(new URL(urlStr2));
+        
+        
+        engine.shutdown();
+        
+        s = CastUtils.cast(ManagementFactory.getPlatformMBeanServer().
+            queryNames(new ObjectName("org.xnio:type=Xnio,provider=\"nio\",worker=\"*\""), null));
+        assertEquals("Could not find 2 Undertow Server: " + s, 1, s.size());
+        
+        engine2.shutdown();
+        
+        s = CastUtils.cast(ManagementFactory.getPlatformMBeanServer().
+            queryNames(new ObjectName("org.xnio:type=Xnio,provider=\"nio\",worker=\"*\""), null));
+        assertEquals("Could not find 0 Undertow Server: " + s, 0, s.size());
+        
+        UndertowHTTPServerEngineFactory.destroyForPort(PORT1);
+        UndertowHTTPServerEngineFactory.destroyForPort(PORT2);
+    }
+
+     
+    
+
+    private String getResponse(String target) throws Exception {
+        URL url = new URL(target);
+
+        URLConnection connection = url.openConnection();
+
+        assertTrue(connection instanceof HttpURLConnection);
+        connection.connect();
+        InputStream in = connection.getInputStream();
+        ByteArrayOutputStream buffer = new ByteArrayOutputStream();
+        IOUtils.copy(in, buffer);
+        return buffer.toString();
+    }
+    
+    
+}

http://git-wip-us.apache.org/repos/asf/cxf/blob/e61a83d4/rt/transports/http-undertow/src/test/java/org/apache/cxf/transport/http_undertow/UndertowHTTPTestHandler.java
----------------------------------------------------------------------
diff --git a/rt/transports/http-undertow/src/test/java/org/apache/cxf/transport/http_undertow/UndertowHTTPTestHandler.java b/rt/transports/http-undertow/src/test/java/org/apache/cxf/transport/http_undertow/UndertowHTTPTestHandler.java
new file mode 100644
index 0000000..00101f9
--- /dev/null
+++ b/rt/transports/http-undertow/src/test/java/org/apache/cxf/transport/http_undertow/UndertowHTTPTestHandler.java
@@ -0,0 +1,78 @@
+/**
+ * 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_undertow;
+
+
+import io.undertow.io.Sender;
+import io.undertow.server.HttpServerExchange;
+import io.undertow.servlet.handlers.ServletRequestContext;
+import io.undertow.servlet.spec.HttpServletRequestImpl;
+import io.undertow.servlet.spec.HttpServletResponseImpl;
+import io.undertow.servlet.spec.ServletContextImpl;
+import io.undertow.util.Headers;
+
+public class UndertowHTTPTestHandler extends UndertowHTTPHandler {
+       
+    private String responseStr;
+
+    public UndertowHTTPTestHandler(String s, boolean cmExact) {
+        super(null, cmExact);
+        responseStr = s;
+    }
+
+    
+    @Override
+    public void handleRequest(HttpServerExchange undertowExchange) throws Exception {
+        try {
+            
+            HttpServletResponseImpl response = new HttpServletResponseImpl(undertowExchange,
+                                                                           (ServletContextImpl)servletContext);
+            HttpServletRequestImpl request = new HttpServletRequestImpl(undertowExchange,
+                                                                        (ServletContextImpl)servletContext);
+
+            ServletRequestContext servletRequestContext = new ServletRequestContext(((ServletContextImpl)servletContext)
+                .getDeployment(), request, response, null);
+            
+             
+            undertowExchange.putAttachment(ServletRequestContext.ATTACHMENT_KEY, servletRequestContext);
+            request.setAttribute("HTTP_HANDLER", this);
+            request.setAttribute("UNDERTOW_DESTINATION", undertowHTTPDestination);
+                        
+            // just return the response for testing
+            response.getOutputStream().write(responseStr.getBytes());
+            response.flushBuffer();
+        } catch (Throwable t) {
+            t.printStackTrace();
+            if (undertowExchange.isResponseChannelAvailable()) {
+                undertowExchange.setResponseCode(500);
+                final String errorPage = "<html><head><title>Error</title>"
+                    + "</head><body>Internal Error 500" + t.getMessage()
+                    + "</body></html>";
+                undertowExchange.getResponseHeaders().put(Headers.CONTENT_LENGTH,
+                                                          "" + errorPage.length());
+                undertowExchange.getResponseHeaders().put(Headers.CONTENT_TYPE, "text/html");
+                Sender sender = undertowExchange.getResponseSender();
+                sender.send(errorPage);
+            }
+        }
+    }
+
+
+
+}

http://git-wip-us.apache.org/repos/asf/cxf/blob/e61a83d4/rt/transports/http-undertow/src/test/java/org/apache/cxf/transport/http_undertow/blueprint/HTTPUndertowTransportNamespaceHandlerTest.java
----------------------------------------------------------------------
diff --git a/rt/transports/http-undertow/src/test/java/org/apache/cxf/transport/http_undertow/blueprint/HTTPUndertowTransportNamespaceHandlerTest.java b/rt/transports/http-undertow/src/test/java/org/apache/cxf/transport/http_undertow/blueprint/HTTPUndertowTransportNamespaceHandlerTest.java
new file mode 100644
index 0000000..28c55ad
--- /dev/null
+++ b/rt/transports/http-undertow/src/test/java/org/apache/cxf/transport/http_undertow/blueprint/HTTPUndertowTransportNamespaceHandlerTest.java
@@ -0,0 +1,36 @@
+/**
+ * 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_undertow.blueprint;
+
+import org.junit.Assert;
+import org.junit.Test;
+
+/**
+ * 
+ */
+public class HTTPUndertowTransportNamespaceHandlerTest extends Assert {
+    @Test
+    public void testGetSchemaLocation() {
+        HTTPUndertowTransportNamespaceHandler handler = new HTTPUndertowTransportNamespaceHandler();
+        
+        assertNotNull(handler.getSchemaLocation("http://cxf.apache.org/transports/http-undertow/configuration"));
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/cxf/blob/e61a83d4/rt/transports/http-undertow/src/test/java/org/apache/cxf/transport/http_undertow/invalid-engines.xml
----------------------------------------------------------------------
diff --git a/rt/transports/http-undertow/src/test/java/org/apache/cxf/transport/http_undertow/invalid-engines.xml b/rt/transports/http-undertow/src/test/java/org/apache/cxf/transport/http_undertow/invalid-engines.xml
new file mode 100644
index 0000000..80252e6
--- /dev/null
+++ b/rt/transports/http-undertow/src/test/java/org/apache/cxf/transport/http_undertow/invalid-engines.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0"?>
+<!--
+  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.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans" xmlns:beans="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:sec="http://cxf.apache.org/configuration/security" xmlns:http="http://cxf.apache.org/transports/http/configuration" xmlns:httpu="http://cxf.apache.org/transports/http-undertow/configuration" xmlns:jaxws="http://java.sun.com/xml/ns/jaxws" xsi:schemaLocation="                    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-undertow/configuration               http://cxf.apache.org/schemas/configuration/http-undertow.xsd            http://www.springframework.org/schema/beans               http://www.springframework.org/schema/beans/spring-beans.xsd">
+    <httpu:engine-factory bus="cxf">
+        <httpu:engine port="1234">
+            <httpu:tlsServerParameters>
+                <sec:clientAuthentication want="true" required="true"/>
+            </httpu:tlsServerParameters>
+        </httpu:engine>
+    </httpu:engine-factory>
+</beans>

http://git-wip-us.apache.org/repos/asf/cxf/blob/e61a83d4/rt/transports/http-undertow/src/test/java/org/apache/cxf/transport/http_undertow/server-engine-factory.xml
----------------------------------------------------------------------
diff --git a/rt/transports/http-undertow/src/test/java/org/apache/cxf/transport/http_undertow/server-engine-factory.xml b/rt/transports/http-undertow/src/test/java/org/apache/cxf/transport/http_undertow/server-engine-factory.xml
new file mode 100644
index 0000000..d634930
--- /dev/null
+++ b/rt/transports/http-undertow/src/test/java/org/apache/cxf/transport/http_undertow/server-engine-factory.xml
@@ -0,0 +1,28 @@
+<?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.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:sec="http://cxf.apache.org/configuration/security" xmlns:http="http://cxf.apache.org/transports/http/configuration" xmlns:httpu="http://cxf.apache.org/transports/http-undertow/configuration" xmlns:jaxws="http://java.sun.com/xml/ns/jaxws" xsi:schemaLocation="                    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-undertow/configuration               http://cxf.apache.org/schemas/configuration/http-undertow.xsd            http://www.springframework.org/schema/beans               http://www.springframework.org/schema/beans/spring-beans.xsd">
+    <httpu:engine-factory bus="cxf">
+        <httpu:engine port="1234">
+            <httpu:tlsServerParameters>
+                <sec:clientAuthentication want="true" required="true"/>
+            </httpu:tlsServerParameters>
+        </httpu:engine>
+    </httpu:engine-factory>
+</beans>


[5/6] cxf git commit: [CXF-6800]add http-undertow transport

Posted by ff...@apache.org.
http://git-wip-us.apache.org/repos/asf/cxf/blob/e61a83d4/rt/transports/http-undertow/src/main/java/org/apache/cxf/transport/http_undertow/UndertowHTTPServerEngineFactory.java
----------------------------------------------------------------------
diff --git a/rt/transports/http-undertow/src/main/java/org/apache/cxf/transport/http_undertow/UndertowHTTPServerEngineFactory.java b/rt/transports/http-undertow/src/main/java/org/apache/cxf/transport/http_undertow/UndertowHTTPServerEngineFactory.java
new file mode 100644
index 0000000..458cc10
--- /dev/null
+++ b/rt/transports/http-undertow/src/main/java/org/apache/cxf/transport/http_undertow/UndertowHTTPServerEngineFactory.java
@@ -0,0 +1,341 @@
+/**
+ * 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_undertow;
+
+import java.io.IOException;
+import java.security.GeneralSecurityException;
+import java.util.List;
+import java.util.Map;
+import java.util.TreeMap;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import javax.annotation.Resource;
+import javax.management.MBeanServer;
+
+import org.apache.cxf.Bus;
+import org.apache.cxf.buslifecycle.BusLifeCycleListener;
+import org.apache.cxf.buslifecycle.BusLifeCycleManager;
+import org.apache.cxf.common.injection.NoJSR250Annotations;
+import org.apache.cxf.common.logging.LogUtils;
+import org.apache.cxf.configuration.jsse.TLSServerParameters;
+import org.apache.cxf.management.InstrumentationManager;
+
+
+/**
+ * This Bus Extension handles the configuration of network port
+ * numbers for use with "http" or "https". This factory 
+ * caches the UndertowHTTPServerEngines so that they may be 
+ * retrieved if already previously configured.
+ */
+@NoJSR250Annotations(unlessNull = "bus")
+public class UndertowHTTPServerEngineFactory {
+    
+    private static final Logger LOG =
+        LogUtils.getL7dLogger(UndertowHTTPServerEngineFactory.class);    
+    
+    private static final int FALLBACK_THREADING_PARAMS_KEY = 0;
+
+    /**
+     * This map holds references for allocated ports.
+     */
+    // Still use the static map to hold the port information
+    // in the same JVM
+    private static ConcurrentHashMap<Integer, UndertowHTTPServerEngine> portMap =
+        new ConcurrentHashMap<Integer, UndertowHTTPServerEngine>();
+    
+    
+   
+    private BusLifeCycleManager lifeCycleManager;
+    /**
+     * This map holds the threading parameters that are to be applied
+     * to new Engines when bound to the reference id.
+     */
+    private Map<String, ThreadingParameters> threadingParametersMap =
+        new TreeMap<String, ThreadingParameters>();
+
+    private ThreadingParameters fallbackThreadingParameters;
+    
+    /**
+     * This map holds TLS Server Parameters that are to be used to
+     * configure a subsequently created UndertowHTTPServerEngine.
+     */
+    private Map<String, TLSServerParameters> tlsParametersMap =
+        new TreeMap<String, TLSServerParameters>();
+    
+    
+    /**
+     * The bus.
+     */
+    private Bus bus;
+    
+    
+    public UndertowHTTPServerEngineFactory() {
+        // Empty
+    }    
+    public UndertowHTTPServerEngineFactory(Bus b) {
+        setBus(b);
+    }    
+    public UndertowHTTPServerEngineFactory(Bus b,
+                                        Map<String, TLSServerParameters> tls,
+                                        Map<String, ThreadingParameters> threading) {
+        tlsParametersMap.putAll(tls);
+        threadingParametersMap.putAll(threading);
+        setBus(b);
+    }    
+    
+    private static UndertowHTTPServerEngine getOrCreate(UndertowHTTPServerEngineFactory factory,
+                    String host,
+                    int port,
+                    TLSServerParameters tlsParams) throws IOException, GeneralSecurityException {
+        
+        UndertowHTTPServerEngine ref = portMap.get(port);
+        if (ref == null) {
+            ref = new UndertowHTTPServerEngine(host, port);
+            if (tlsParams != null) {
+                ref.setTlsServerParameters(tlsParams);
+            }
+            UndertowHTTPServerEngine tmpRef = portMap.putIfAbsent(port, ref);
+            ref.finalizeConfig();
+            if (tmpRef != null) {
+                ref = tmpRef;
+            }
+        }
+        return ref;
+    }
+    
+       
+    /**
+     * This call is used to set the bus. It should only be called once.
+     * @param bus
+     */
+    @Resource(name = "cxf")
+    public final void setBus(Bus bus) {
+        this.bus = bus;
+        if (bus != null) {
+            bus.setExtension(this, UndertowHTTPServerEngineFactory.class);
+            lifeCycleManager = bus.getExtension(BusLifeCycleManager.class);
+            if (null != lifeCycleManager) {
+                lifeCycleManager.registerLifeCycleListener(new UndertowBusLifeCycleListener());
+            }        
+        }
+    }
+    private class UndertowBusLifeCycleListener implements BusLifeCycleListener {
+        public void initComplete() {
+            UndertowHTTPServerEngineFactory.this.initComplete();
+        }
+
+        public void preShutdown() {
+            UndertowHTTPServerEngineFactory.this.preShutdown();
+        }
+
+        public void postShutdown() {
+            UndertowHTTPServerEngineFactory.this.postShutdown();
+        }
+    }
+    
+    public Bus getBus() {
+        return bus;
+    }
+    
+    
+    /**
+     * This call sets TLSParametersMap for a UndertowHTTPServerEngine
+     * 
+     */
+    public void setTlsServerParametersMap(
+        Map<String, TLSServerParameters>  tlsParamsMap) {
+        
+        tlsParametersMap = tlsParamsMap;
+    }
+    
+    public Map<String, TLSServerParameters> getTlsServerParametersMap() {
+        return tlsParametersMap;
+    }
+    
+    public void setEnginesList(List<UndertowHTTPServerEngine> enginesList) {
+        for (UndertowHTTPServerEngine engine : enginesList) {
+            if (engine.getPort() == FALLBACK_THREADING_PARAMS_KEY) {
+                fallbackThreadingParameters = engine.getThreadingParameters();
+            }
+            portMap.putIfAbsent(engine.getPort(), engine);
+        }    
+    }
+    
+    /**
+     * This call sets the ThreadingParameters for a UndertowHTTPServerEngine
+     * 
+     */
+    public void setThreadingParametersMap(
+        Map<String, ThreadingParameters> threadingParamsMap) {
+        
+        threadingParametersMap = threadingParamsMap;
+    }
+    
+    public Map<String, ThreadingParameters> getThreadingParametersMap() {
+        return threadingParametersMap;
+    }
+    
+    /**
+     * This call sets TLSServerParameters for a UndertowHTTPServerEngine
+     * that will be subsequently created. It will not alter an engine
+     * that has already been created for that network port.
+     * @param host       if not null, server will listen on this address/host, 
+     *                   otherwise, server will listen on all local addresses.
+     * @param port       The network port number to bind to the engine.
+     * @param tlsParams  The tls server parameters. Cannot be null.
+     * @throws IOException 
+     * @throws GeneralSecurityException 
+     */
+    public void setTLSServerParametersForPort(
+        String host,
+        int port, 
+        TLSServerParameters tlsParams) throws GeneralSecurityException, IOException {
+        if (tlsParams == null) {
+            throw new IllegalArgumentException("tlsParams cannot be null");
+        }
+        UndertowHTTPServerEngine ref = retrieveUndertowHTTPServerEngine(port);
+        if (null == ref) {
+            getOrCreate(this, host, port, tlsParams);
+        } else {
+            ref.setTlsServerParameters(tlsParams);            
+        }
+    }
+
+    /**
+     * calls thru to {{@link #createUndertowHTTPServerEngine(String, int, String)} with 'null' for host value
+     */
+    public void setTLSServerParametersForPort(
+        int port, 
+        TLSServerParameters tlsParams) throws GeneralSecurityException, IOException {
+        setTLSServerParametersForPort(null, port, tlsParams);
+    }
+
+    /**
+     * This call retrieves a previously configured UndertowHTTPServerEngine for the
+     * given port. If none exists, this call returns null.
+     */
+    public synchronized UndertowHTTPServerEngine retrieveUndertowHTTPServerEngine(int port) {
+        return portMap.get(port);
+    }
+
+    /**
+     * This call creates a new UndertowHTTPServerEngine 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 UndertowHTTPEngine 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.
+     * 
+     * @param host if not null, server will listen on this host/address, otherwise
+     *        server will listen on all local addresses.
+     * @param port listen port for server
+     * @param protocol "http" or "https"
+     * @return
+     * @throws GeneralSecurityException
+     * @throws IOException
+     */
+    public synchronized UndertowHTTPServerEngine createUndertowHTTPServerEngine(String host, int port, 
+        String protocol) throws GeneralSecurityException, IOException {
+        LOG.fine("Creating Undertow HTTP Server Engine for port " + port + ".");        
+        UndertowHTTPServerEngine ref = getOrCreate(this, host, port, null);
+        // checking the protocol    
+        if (!protocol.equals(ref.getProtocol())) {
+            throw new IOException("Protocol mismatch for port " + port + ": "
+                        + "engine's protocol is " + ref.getProtocol()
+                        + ", the url protocol is " + protocol);
+        }
+
+        if (!(ref.isSetThreadingParameters()
+              || null == fallbackThreadingParameters)) {
+            if (LOG.isLoggable(Level.INFO)) {
+                final int min = fallbackThreadingParameters.getMinThreads();
+                final int max = fallbackThreadingParameters.getMaxThreads();
+                
+                LOG.log(Level.INFO,
+                        "FALLBACK_THREADING_PARAMETERS_MSG",
+                        new Object[] {port, min, max, ""});
+            }
+            ref.setThreadingParameters(fallbackThreadingParameters);
+        }
+                
+        return ref;
+    }
+
+    /**
+     * Calls thru to {{@link #createUndertowHTTPServerEngine(String, int, String)} with a 'null' host value
+     */
+    public synchronized UndertowHTTPServerEngine createUndertowHTTPServerEngine(int port, 
+        String protocol) throws GeneralSecurityException, IOException {
+        return createUndertowHTTPServerEngine(null, port, protocol);
+    }
+    
+    /**
+     * This method removes the Server Engine from the port map and stops it.
+     */
+    public static synchronized void destroyForPort(int port) {
+        UndertowHTTPServerEngine ref = portMap.remove(port);
+        if (ref != null) {
+            LOG.fine("Stopping Undertow HTTP Server Engine on port " + port + ".");
+            try {
+                ref.stop();
+            } catch (Exception e) {
+                e.printStackTrace();
+            }            
+        }
+    }
+    
+    public MBeanServer getMBeanServer() {
+        if (bus != null && bus.getExtension(InstrumentationManager.class) != null) {
+            return bus.getExtension(InstrumentationManager.class).getMBeanServer();
+        }
+        return null;
+    }
+    
+    
+    public void initComplete() {
+        // do nothing here
+    }
+
+    public void postShutdown() {
+        // shut down the Undertow server in the portMap
+        // To avoid the CurrentModificationException, 
+        // do not use portMap.values directly       
+        UndertowHTTPServerEngine[] engines = 
+            portMap.values().toArray(new UndertowHTTPServerEngine[portMap.values().size()]);
+        for (UndertowHTTPServerEngine engine : engines) {
+            engine.shutdown();
+        }
+        // clean up the collections
+        threadingParametersMap.clear();
+        tlsParametersMap.clear();
+    }
+
+    public void preShutdown() {
+        // do nothing here 
+        // just let server registry to call the server stop first
+    }
+    
+
+        
+
+}

http://git-wip-us.apache.org/repos/asf/cxf/blob/e61a83d4/rt/transports/http-undertow/src/main/java/org/apache/cxf/transport/http_undertow/blueprint/HTTPUndertowTransportNamespaceHandler.java
----------------------------------------------------------------------
diff --git a/rt/transports/http-undertow/src/main/java/org/apache/cxf/transport/http_undertow/blueprint/HTTPUndertowTransportNamespaceHandler.java b/rt/transports/http-undertow/src/main/java/org/apache/cxf/transport/http_undertow/blueprint/HTTPUndertowTransportNamespaceHandler.java
new file mode 100644
index 0000000..60d5558
--- /dev/null
+++ b/rt/transports/http-undertow/src/main/java/org/apache/cxf/transport/http_undertow/blueprint/HTTPUndertowTransportNamespaceHandler.java
@@ -0,0 +1,83 @@
+/**
+ * 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_undertow.blueprint;
+
+import java.net.URL;
+import java.util.Set;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+import org.apache.aries.blueprint.NamespaceHandler;
+import org.apache.aries.blueprint.Namespaces;
+import org.apache.aries.blueprint.ParserContext;
+import org.apache.cxf.common.logging.LogUtils;
+import org.osgi.service.blueprint.reflect.ComponentMetadata;
+import org.osgi.service.blueprint.reflect.Metadata;
+
+@Namespaces("http://cxf.apache.org/transports/http-undertow/configuration")
+public class HTTPUndertowTransportNamespaceHandler implements NamespaceHandler {
+
+    public static final String UNDERTOW_TRANSPORT = "http://cxf.apache.org/transports/http-undertow/configuration";
+
+    private static final String UNDERTOW_ENGINE = "engine";
+
+    private static final String UNDERTOW_ENGINE_FACTORY = "engine-factory";
+
+    private static final Logger LOG = LogUtils.getL7dLogger(HTTPUndertowTransportNamespaceHandler.class);
+
+    public URL getSchemaLocation(String s) {
+        if (UNDERTOW_TRANSPORT.equals(s)) {
+            return getClass().getClassLoader().
+                getResource("schemas/configuration/http-undertow.xsd");
+        } else {
+            return null;
+        }
+    }
+
+    @SuppressWarnings("rawtypes")
+    public Set<Class> getManagedClasses() {
+        return null;
+    }
+
+    public Metadata parse(Element element, ParserContext parserContext) {
+        if (LOG.isLoggable(Level.FINE)) {
+            LOG.fine("Parsing element {{" + element.getNamespaceURI() + "}}{" + element.getLocalName() + "}");
+        }
+
+        if (UNDERTOW_ENGINE.equals(element.getLocalName())) {
+            //This doesn't hit normal configs.
+            return new UndertowServerEngineParser().parse(element, parserContext);
+        } else if (UNDERTOW_ENGINE_FACTORY.equals(element.getLocalName())) {
+
+            return new UndertowServerEngineFactoryParser().parse(element, parserContext);
+        }
+
+        return null;
+    }
+
+    public ComponentMetadata decorate(Node node, 
+                                      ComponentMetadata componentMetadata, 
+                                      ParserContext parserContext) {
+        LOG.info("Decorating node " + node + " " + componentMetadata);
+        return componentMetadata;
+    }
+}

http://git-wip-us.apache.org/repos/asf/cxf/blob/e61a83d4/rt/transports/http-undertow/src/main/java/org/apache/cxf/transport/http_undertow/blueprint/UndertowHTTPServerEngineFactoryHolder.java
----------------------------------------------------------------------
diff --git a/rt/transports/http-undertow/src/main/java/org/apache/cxf/transport/http_undertow/blueprint/UndertowHTTPServerEngineFactoryHolder.java b/rt/transports/http-undertow/src/main/java/org/apache/cxf/transport/http_undertow/blueprint/UndertowHTTPServerEngineFactoryHolder.java
new file mode 100644
index 0000000..3e5f5a4
--- /dev/null
+++ b/rt/transports/http-undertow/src/main/java/org/apache/cxf/transport/http_undertow/blueprint/UndertowHTTPServerEngineFactoryHolder.java
@@ -0,0 +1,234 @@
+/**
+ * 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_undertow.blueprint;
+
+import java.io.StringReader;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.TreeMap;
+import java.util.logging.Logger;
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBElement;
+import javax.xml.bind.JAXBException;
+
+import org.w3c.dom.Element;
+
+import org.apache.cxf.common.jaxb.JAXBContextCache;
+import org.apache.cxf.common.jaxb.JAXBUtils;
+import org.apache.cxf.common.logging.LogUtils;
+import org.apache.cxf.common.util.PackageUtils;
+import org.apache.cxf.common.util.StringUtils;
+import org.apache.cxf.configuration.jsse.TLSServerParameters;
+import org.apache.cxf.configuration.jsse.TLSServerParametersConfig;
+import org.apache.cxf.staxutils.StaxUtils;
+import org.apache.cxf.transport.http_undertow.CXFUndertowHttpHandler;
+import org.apache.cxf.transport.http_undertow.ThreadingParameters;
+import org.apache.cxf.transport.http_undertow.UndertowHTTPServerEngine;
+import org.apache.cxf.transport.http_undertow.UndertowHTTPServerEngineFactory;
+import org.apache.cxf.transports.http_undertow.configuration.TLSServerParametersIdentifiedType;
+import org.apache.cxf.transports.http_undertow.configuration.ThreadingParametersIdentifiedType;
+import org.apache.cxf.transports.http_undertow.configuration.ThreadingParametersType;
+import org.apache.cxf.transports.http_undertow.configuration.UndertowHTTPServerEngineConfigType;
+import org.apache.cxf.transports.http_undertow.configuration.UndertowHTTPServerEngineFactoryConfigType;
+
+
+public class UndertowHTTPServerEngineFactoryHolder {
+
+    private static final Logger LOG = LogUtils.getL7dLogger(UndertowHTTPServerEngineFactoryHolder.class);
+
+    private String parsedElement;
+    private UndertowHTTPServerEngineFactory factory;
+    
+    private Map<String, List<CXFUndertowHttpHandler>> handlersMap;
+    
+    
+    private JAXBContext jaxbContext;
+    private Set<Class<?>> jaxbClasses;
+
+    public UndertowHTTPServerEngineFactoryHolder() {
+    }
+
+    public void init() {
+        try {
+            Element element = StaxUtils.read(new StringReader(parsedElement)).getDocumentElement();
+            
+            UndertowHTTPServerEngineFactoryConfigType config 
+                = (UndertowHTTPServerEngineFactoryConfigType) getJaxbObject(element,
+                    UndertowHTTPServerEngineFactoryConfigType.class);
+
+            factory = new UndertowHTTPServerEngineFactory();
+
+            Map<String, ThreadingParameters> threadingParametersMap 
+                = new TreeMap<String, ThreadingParameters>();
+
+            if (config.getIdentifiedThreadingParameters() != null) {
+                for (ThreadingParametersIdentifiedType threads : config.getIdentifiedThreadingParameters()) {
+                    ThreadingParameters rThreads = new ThreadingParameters();
+                    String id = threads.getId();
+                    rThreads.setMaxThreads(threads.getThreadingParameters().getMaxThreads());
+                    rThreads.setMinThreads(threads.getThreadingParameters().getMinThreads());
+                    rThreads.setWorkerIOThreads(threads.getThreadingParameters().getWorkerIOThreads());
+                    threadingParametersMap.put(id, rThreads);
+                }
+
+                factory.setThreadingParametersMap(threadingParametersMap);
+            }
+
+            //SSL
+            Map<String, TLSServerParameters> sslMap = new TreeMap<String, TLSServerParameters>();
+            if (config.getIdentifiedTLSServerParameters() != null) {
+
+                for (TLSServerParametersIdentifiedType t : config.getIdentifiedTLSServerParameters()) {
+                    try {
+                        TLSServerParameters parameter 
+                            = new TLSServerParametersConfig(t.getTlsServerParameters());
+                        sslMap.put(t.getId(), parameter);
+                    } catch (Exception e) {
+                        throw new RuntimeException("Could not configure TLS for id " + t.getId(), e);
+                    }
+                }
+                factory.setTlsServerParametersMap(sslMap);
+            }
+            //Engines
+
+            List<UndertowHTTPServerEngine> engineList = new ArrayList<UndertowHTTPServerEngine>();
+            for (UndertowHTTPServerEngineConfigType engine : config.getEngine()) {
+                UndertowHTTPServerEngine eng = new UndertowHTTPServerEngine();
+                
+                if (engine.getHandlers() != null && handlersMap != null) {
+                    List<CXFUndertowHttpHandler> handlers = handlersMap.get(engine.getPort().toString());
+                    if (handlers != null) {
+                        eng.setHandlers(handlers);
+                    } else {
+                        throw new RuntimeException("Could not find the handlers instance for engine with port"
+                            + engine.getPort().toString());
+                    }
+                }
+                
+                if (engine.isContinuationsEnabled() != null) {
+                    eng.setContinuationsEnabled(engine.isContinuationsEnabled());
+                }
+
+                
+                if (engine.getHost() != null && !StringUtils.isEmpty(engine.getHost())) {
+                    eng.setHost(engine.getHost());
+                }
+                if (engine.getMaxIdleTime() != null) {
+                    eng.setMaxIdleTime(engine.getMaxIdleTime());
+                }
+                if (engine.getPort() != null) {
+                    eng.setPort(engine.getPort());
+                }
+                
+                if (engine.getThreadingParameters() != null) {
+                    ThreadingParametersType threads = engine.getThreadingParameters();
+                    ThreadingParameters rThreads = new ThreadingParameters();
+                    rThreads.setMaxThreads(threads.getMaxThreads());
+                    rThreads.setMinThreads(threads.getMinThreads());
+                    rThreads.setWorkerIOThreads(threads.getWorkerIOThreads());
+                    eng.setThreadingParameters(rThreads);
+                }
+
+                
+                if (engine.getTlsServerParameters() != null) {
+                    TLSServerParameters parameter = null;
+                    try {
+                        parameter = new TLSServerParametersConfig(engine.getTlsServerParameters());
+                        eng.setTlsServerParameters(parameter);
+                    } catch (Exception e) {
+                        throw new RuntimeException("Could not configure TLS for engine on  " 
+                            + eng.getHost() + ":" + eng.getPort(), e);
+                    }
+                }
+                eng.finalizeConfig();
+
+                engineList.add(eng);
+            }
+            factory.setEnginesList(engineList);
+            //Unravel this completely.
+
+            factory.initComplete();
+        } catch (Exception e) {
+            throw new RuntimeException("Could not process configuration.", e);
+        }
+    }
+
+    public void destroy() {
+        // need to release the reference of the jaxb Classes
+        factory.postShutdown();
+        jaxbClasses.clear();
+        jaxbContext = null;
+    }
+
+    public String getParsedElement() {
+        return parsedElement;
+    }
+
+    public void setParsedElement(String parsedElement) {
+        this.parsedElement = parsedElement;
+    }
+    
+    
+    protected <T> T getJaxbObject(Element parent, Class<T> c) {
+
+        try {
+            JAXBElement<T> ele = JAXBUtils.unmarshall(getContext(c), parent, c);
+            return ele.getValue();
+        } catch (JAXBException e) {
+            LOG.warning("Unable to parse property due to " + e);
+            return null;
+        }
+    }
+
+    protected synchronized JAXBContext getContext(Class<?> cls) {
+        if (jaxbContext == null || jaxbClasses == null || !jaxbClasses.contains(cls)) {
+            try {
+                Set<Class<?>> tmp = new HashSet<Class<?>>();
+                if (jaxbClasses != null) {
+                    tmp.addAll(jaxbClasses);
+                }
+                JAXBContextCache.addPackage(tmp, PackageUtils.getPackageName(cls), 
+                                            cls == null ? getClass().getClassLoader() : cls.getClassLoader());
+                if (cls != null) {
+                    boolean hasOf = false;
+                    for (Class<?> c : tmp) {
+                        if (c.getPackage() == cls.getPackage() && "ObjectFactory".equals(c.getSimpleName())) {
+                            hasOf = true;
+                        }
+                    }
+                    if (!hasOf) {
+                        tmp.add(cls);
+                    }
+                }
+                JAXBContextCache.scanPackages(tmp);
+                JAXBContextCache.CachedContextAndSchemas ccs 
+                    = JAXBContextCache.getCachedContextAndSchemas(tmp, null, null, null, false);
+                jaxbClasses = ccs.getClasses();
+                jaxbContext = ccs.getContext();
+            } catch (JAXBException e) {
+                throw new RuntimeException(e);
+            }
+        }
+        return jaxbContext;
+    }
+}

http://git-wip-us.apache.org/repos/asf/cxf/blob/e61a83d4/rt/transports/http-undertow/src/main/java/org/apache/cxf/transport/http_undertow/blueprint/UndertowServerEngineFactoryParser.java
----------------------------------------------------------------------
diff --git a/rt/transports/http-undertow/src/main/java/org/apache/cxf/transport/http_undertow/blueprint/UndertowServerEngineFactoryParser.java b/rt/transports/http-undertow/src/main/java/org/apache/cxf/transport/http_undertow/blueprint/UndertowServerEngineFactoryParser.java
new file mode 100644
index 0000000..016ed0a
--- /dev/null
+++ b/rt/transports/http-undertow/src/main/java/org/apache/cxf/transport/http_undertow/blueprint/UndertowServerEngineFactoryParser.java
@@ -0,0 +1,112 @@
+/**
+ * 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_undertow.blueprint;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.StringTokenizer;
+import java.util.UUID;
+
+import org.w3c.dom.Element;
+
+import org.apache.aries.blueprint.ParserContext;
+import org.apache.aries.blueprint.mutable.MutableBeanMetadata;
+import org.apache.aries.blueprint.reflect.MapEntryImpl;
+import org.apache.aries.blueprint.reflect.MapMetadataImpl;
+import org.apache.cxf.common.util.StringUtils;
+import org.apache.cxf.configuration.blueprint.AbstractBPBeanDefinitionParser;
+import org.apache.cxf.helpers.DOMUtils;
+import org.apache.cxf.staxutils.StaxUtils;
+import org.osgi.service.blueprint.reflect.ComponentMetadata;
+import org.osgi.service.blueprint.reflect.MapEntry;
+import org.osgi.service.blueprint.reflect.Metadata;
+import org.osgi.service.blueprint.reflect.ValueMetadata;
+
+public class UndertowServerEngineFactoryParser extends AbstractBPBeanDefinitionParser {
+
+    public static final String UNDERTOW_TRANSPORT = "http://cxf.apache.org/transports/http-undertow/configuration";
+
+    public static final String UNDERTOW_THREADING = "http://cxf.apache.org/configuration/parameterized-types";
+
+    public static String getIdOrName(Element elem) {
+        String id = elem.getAttribute("id");
+
+        if (null == id || "".equals(id)) {
+            String names = elem.getAttribute("name");
+            if (null != names) {
+                StringTokenizer st = new StringTokenizer(names, ",");
+                if (st.countTokens() > 0) {
+                    id = st.nextToken();
+                }
+            }
+        }
+        return id;
+    }
+
+    public Metadata parse(Element element, ParserContext context) {
+
+        //Endpoint definition
+        MutableBeanMetadata ef = context.createMetadata(MutableBeanMetadata.class);
+        if (!StringUtils.isEmpty(getIdOrName(element))) {
+            ef.setId(getIdOrName(element));
+        } else {
+            ef.setId("undertow.engine.factory-holder-" + UUID.randomUUID().toString());
+        }
+        ef.setRuntimeClass(UndertowHTTPServerEngineFactoryHolder.class);
+
+        // setup the HandlersMap property for the UndertowHTTPServerEngineFactoryHolder
+        
+        try {
+            // Print the DOM node
+            String xmlString = StaxUtils.toString(element);
+            ef.addProperty("parsedElement", createValue(context, xmlString));
+            ef.setInitMethod("init");
+            ef.setActivation(ComponentMetadata.ACTIVATION_EAGER);
+            ef.setDestroyMethod("destroy");
+            
+            // setup the EngineConnector
+            List<Element> engines = DOMUtils
+                .getChildrenWithName(element, HTTPUndertowTransportNamespaceHandler.UNDERTOW_TRANSPORT, "engine");
+            ef.addProperty("handlersMap", parseEngineHandlers(engines, ef, context));
+            return ef;
+        } catch (Exception e) {
+            throw new RuntimeException("Could not process configuration.", e);
+        }
+    }
+    
+       
+    protected Metadata parseEngineHandlers(List<Element> engines, ComponentMetadata enclosingComponent, 
+                                           ParserContext context) {
+        List<MapEntry> entries = new ArrayList<MapEntry>();
+        for (Element engine : engines) {
+            String port = engine.getAttribute("port");
+            ValueMetadata keyValue = createValue(context, port);
+            Element handlers = DOMUtils
+                .getFirstChildWithName(engine, HTTPUndertowTransportNamespaceHandler.UNDERTOW_TRANSPORT,
+                                       "handlers");
+            if (handlers != null) {
+                Metadata valValue = parseListData(context, enclosingComponent, handlers);
+                entries.add(new MapEntryImpl(keyValue, valValue));
+            }
+        }
+        return new MapMetadataImpl("java.lang.String", "java.util.List", entries);
+    }
+    
+    
+}

http://git-wip-us.apache.org/repos/asf/cxf/blob/e61a83d4/rt/transports/http-undertow/src/main/java/org/apache/cxf/transport/http_undertow/blueprint/UndertowServerEngineParser.java
----------------------------------------------------------------------
diff --git a/rt/transports/http-undertow/src/main/java/org/apache/cxf/transport/http_undertow/blueprint/UndertowServerEngineParser.java b/rt/transports/http-undertow/src/main/java/org/apache/cxf/transport/http_undertow/blueprint/UndertowServerEngineParser.java
new file mode 100644
index 0000000..6b9c63b
--- /dev/null
+++ b/rt/transports/http-undertow/src/main/java/org/apache/cxf/transport/http_undertow/blueprint/UndertowServerEngineParser.java
@@ -0,0 +1,32 @@
+/**
+ * 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_undertow.blueprint;
+
+import org.w3c.dom.Element;
+
+import org.apache.aries.blueprint.ParserContext;
+import org.apache.cxf.configuration.blueprint.AbstractBPBeanDefinitionParser;
+import org.osgi.service.blueprint.reflect.Metadata;
+
+public class UndertowServerEngineParser extends AbstractBPBeanDefinitionParser {
+
+    public Metadata parse(Element element, ParserContext context) {
+        return null;
+    }
+}

http://git-wip-us.apache.org/repos/asf/cxf/blob/e61a83d4/rt/transports/http-undertow/src/main/java/org/apache/cxf/transport/http_undertow/osgi/HTTPUndertowTransportActivator.java
----------------------------------------------------------------------
diff --git a/rt/transports/http-undertow/src/main/java/org/apache/cxf/transport/http_undertow/osgi/HTTPUndertowTransportActivator.java b/rt/transports/http-undertow/src/main/java/org/apache/cxf/transport/http_undertow/osgi/HTTPUndertowTransportActivator.java
new file mode 100644
index 0000000..5f87db0
--- /dev/null
+++ b/rt/transports/http-undertow/src/main/java/org/apache/cxf/transport/http_undertow/osgi/HTTPUndertowTransportActivator.java
@@ -0,0 +1,382 @@
+/**
+ * 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_undertow.osgi;
+
+import java.io.IOException;
+import java.security.GeneralSecurityException;
+import java.util.Dictionary;
+import java.util.Enumeration;
+import java.util.List;
+import java.util.Properties;
+import java.util.StringTokenizer;
+
+import javax.management.MBeanServer;
+
+import org.apache.cxf.bus.blueprint.BlueprintNameSpaceHandlerFactory;
+import org.apache.cxf.bus.blueprint.NamespaceHandlerRegisterer;
+import org.apache.cxf.configuration.jsse.TLSParameterJaxBUtils;
+import org.apache.cxf.configuration.jsse.TLSServerParameters;
+import org.apache.cxf.configuration.security.CertStoreType;
+import org.apache.cxf.configuration.security.CertificateConstraintsType;
+import org.apache.cxf.configuration.security.ClientAuthentication;
+import org.apache.cxf.configuration.security.CombinatorType;
+import org.apache.cxf.configuration.security.DNConstraintsType;
+import org.apache.cxf.configuration.security.FiltersType;
+import org.apache.cxf.configuration.security.KeyManagersType;
+import org.apache.cxf.configuration.security.KeyStoreType;
+import org.apache.cxf.configuration.security.SecureRandomParameters;
+import org.apache.cxf.configuration.security.TrustManagersType;
+import org.apache.cxf.transport.http_undertow.ThreadingParameters;
+import org.apache.cxf.transport.http_undertow.UndertowHTTPServerEngine;
+import org.apache.cxf.transport.http_undertow.UndertowHTTPServerEngineFactory;
+import org.apache.cxf.transport.http_undertow.blueprint.HTTPUndertowTransportNamespaceHandler;
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.Constants;
+import org.osgi.framework.ServiceRegistration;
+import org.osgi.service.cm.ConfigurationException;
+import org.osgi.service.cm.ManagedServiceFactory;
+import org.osgi.util.tracker.ServiceTracker;
+
+public class HTTPUndertowTransportActivator 
+    implements BundleActivator, ManagedServiceFactory {
+    public static final String FACTORY_PID = "org.apache.cxf.http.undertow";
+    
+    BundleContext context; 
+    MBeanServer mbeans;
+    ServiceTracker mbeanServerTracker;
+    ServiceRegistration reg;
+    
+    UndertowHTTPServerEngineFactory factory = new UndertowHTTPServerEngineFactory() {
+        public MBeanServer getMBeanServer() {
+            return (MBeanServer)mbeanServerTracker.getService();
+        }
+    };
+    
+    public void start(BundleContext ctx) throws Exception {
+        this.context = ctx;
+        Properties servProps = new Properties();
+        servProps.put(Constants.SERVICE_PID, FACTORY_PID);  
+        reg = context.registerService(ManagedServiceFactory.class.getName(),
+                                       this, servProps);
+        
+        mbeanServerTracker = new ServiceTracker(ctx, MBeanServer.class.getName(), null);
+        BlueprintNameSpaceHandlerFactory nsHandlerFactory = new BlueprintNameSpaceHandlerFactory() {
+            
+            @Override
+            public Object createNamespaceHandler() {
+                return new HTTPUndertowTransportNamespaceHandler();
+            }
+        };
+        NamespaceHandlerRegisterer.register(context, nsHandlerFactory,
+                                            "http://cxf.apache.org/transports/http-undertow/configuration");  
+    }
+
+    public void stop(BundleContext ctx) throws Exception {
+        mbeanServerTracker.close();
+        reg.unregister();
+    }
+
+    public String getName() {
+        return FACTORY_PID;
+    }
+
+    @SuppressWarnings("unchecked")
+    public void updated(String pid, @SuppressWarnings("rawtypes") Dictionary properties)
+        throws ConfigurationException {
+        if (pid == null) {
+            return;
+        }
+        int port = Integer.parseInt((String)properties.get("port"));
+        
+        String host = (String)properties.get("host");
+        try {
+            TLSServerParameters tls = createTlsServerParameters(properties);
+            if (tls != null) {
+                factory.setTLSServerParametersForPort(host, port, tls);
+            } else {
+                factory.createUndertowHTTPServerEngine(host, port, "http");
+            }
+            
+            UndertowHTTPServerEngine e = factory.retrieveUndertowHTTPServerEngine(port);
+            configure(e, properties);
+        } catch (GeneralSecurityException e) {
+            throw new ConfigurationException(null, null, e);
+        } catch (IOException e) {
+            throw new ConfigurationException(null, null, e);
+        }
+    }
+
+
+    private void configure(UndertowHTTPServerEngine e, Dictionary<String, String> properties) {
+        ThreadingParameters threading = createThreadingParameters(properties);
+        if (threading != null) {
+            e.setThreadingParameters(threading);
+        }
+        Enumeration<String> keys = properties.keys();
+        while (keys.hasMoreElements()) {
+            String k = keys.nextElement();
+            if ("continuationsEnabled".equals(k)) {
+                e.setContinuationsEnabled(Boolean.parseBoolean(properties.get(k)));
+            } else if ("maxIdleTime".equals(k)) {
+                e.setMaxIdleTime(Integer.parseInt(properties.get(k)));
+            } 
+        }
+    }
+
+    public void deleted(String pid) {
+    }
+
+    private ThreadingParameters createThreadingParameters(Dictionary<String, String> d) {
+        Enumeration<String> keys = d.keys();
+        ThreadingParameters p = null;
+        while (keys.hasMoreElements()) {
+            String k = keys.nextElement();
+            if (k.startsWith("threadingParameters.")) {
+                if (p == null) {
+                    p = new ThreadingParameters();
+                }
+                String v = d.get(k);
+                k = k.substring("threadingParameters.".length());
+                if ("minThreads".equals(k)) {
+                    p.setMinThreads(Integer.parseInt(v));
+                } else if ("maxThreads".equals(k)) {
+                    p.setMaxThreads(Integer.parseInt(v));
+                } else if ("workerIOThreads".equals(k)) {
+                    p.setWorkerIOThreads(Integer.parseInt(v));
+                }
+            }
+        }
+        return p;
+    }
+
+    private TLSServerParameters createTlsServerParameters(Dictionary<String, String> d) {
+        Enumeration<String> keys = d.keys();
+        TLSServerParameters p = null;
+        SecureRandomParameters srp = null;
+        KeyManagersType kmt = null;
+        TrustManagersType tmt = null;
+        while (keys.hasMoreElements()) {
+            String k = keys.nextElement();
+            if (k.startsWith("tlsServerParameters.")) {
+                if (p == null) {
+                    p = new TLSServerParameters();
+                }
+                String v = d.get(k);
+                k = k.substring("tlsServerParameters.".length());
+
+                if ("secureSocketProtocol".equals(k)) {
+                    p.setSecureSocketProtocol(v);
+                } else if ("jsseProvider".equals(k)) {
+                    p.setJsseProvider(v);
+                } else if ("certAlias".equals(k)) {
+                    p.setCertAlias(v);
+                } else if ("clientAuthentication.want".equals(k)) {
+                    if (p.getClientAuthentication() == null) {
+                        p.setClientAuthentication(new ClientAuthentication());
+                    }
+                    p.getClientAuthentication().setWant(Boolean.parseBoolean(v));
+                } else if ("clientAuthentication.required".equals(k)) {
+                    if (p.getClientAuthentication() == null) {
+                        p.setClientAuthentication(new ClientAuthentication());
+                    }
+                    p.getClientAuthentication().setRequired(Boolean.parseBoolean(v));
+                } else if (k.startsWith("certConstraints.")) {
+                    configureCertConstraints(p, k, v);
+                } else if (k.startsWith("secureRandomParameters.")) {
+                    srp = configureSecureRandom(srp, k, v);
+                } else if (k.startsWith("cipherSuitesFilter.")) {
+                    configureCipherSuitesFilter(p, k, v);
+                } else if (k.startsWith("cipherSuites")) {
+                    StringTokenizer st = new StringTokenizer(v, ",");
+                    while (st.hasMoreTokens()) {
+                        p.getCipherSuites().add(st.nextToken());
+                    }
+                }  else if (k.startsWith("excludeProtocols")) {
+                    StringTokenizer st = new StringTokenizer(v, ",");
+                    while (st.hasMoreTokens()) {
+                        p.getExcludeProtocols().add(st.nextToken());
+                    }
+                } else if (k.startsWith("trustManagers.")) {
+                    tmt = getTrustManagers(tmt,
+                                          k.substring("trustManagers.".length()),
+                                          v);
+                } else if (k.startsWith("keyManagers.")) {
+                    kmt = getKeyManagers(kmt,
+                                         k.substring("keyManagers.".length()),
+                                         v);
+                }
+            }
+        }
+        
+        try {
+            if (srp != null) {
+                p.setSecureRandom(TLSParameterJaxBUtils.getSecureRandom(srp));
+            }
+            if (kmt != null) {
+                p.setKeyManagers(TLSParameterJaxBUtils.getKeyManagers(kmt));
+            }
+            if (tmt != null) {
+                p.setTrustManagers(TLSParameterJaxBUtils.getTrustManagers(tmt));
+            }
+        } catch (RuntimeException e) {
+            throw e;
+        } catch (Exception e) {
+            throw new RuntimeException(e);
+        }
+        return p;
+    }
+
+    private void configureCipherSuitesFilter(TLSServerParameters p, String k, String v) {
+        k = k.substring("cipherSuitesFilter.".length());
+        StringTokenizer st = new StringTokenizer(v, ",");
+        FiltersType ft = p.getCipherSuitesFilter();
+        if (ft == null) {
+            ft = new FiltersType();
+            p.setCipherSuitesFilter(ft);
+        }
+        List<String> lst = "include".equals(k) ? ft.getInclude() : ft.getExclude();
+        while (st.hasMoreTokens()) {
+            lst.add(st.nextToken());
+        }
+    }
+
+    private SecureRandomParameters configureSecureRandom(SecureRandomParameters srp, String k, String v) {
+        k = k.substring("secureRandomParameters.".length());
+        if (srp == null) {
+            srp = new SecureRandomParameters();
+        }
+        if ("algorithm".equals(k)) {
+            srp.setAlgorithm(v);
+        } else if ("provider".equals(k)) {
+            srp.setProvider(v);
+        }
+        return srp;
+    }
+
+    private void configureCertConstraints(TLSServerParameters p, String k, String v) {
+        k = k.substring("certConstraints.".length());
+        CertificateConstraintsType cct = p.getCertConstraints();
+        if (cct == null) {
+            cct = new CertificateConstraintsType();
+            p.setCertConstraints(cct);
+        }
+        DNConstraintsType dnct = null;
+        if (k.startsWith("SubjectDNConstraints.")) {
+            dnct = cct.getSubjectDNConstraints();
+            if (dnct == null) {
+                dnct = new DNConstraintsType();
+                cct.setSubjectDNConstraints(dnct);
+            }
+            k = k.substring("SubjectDNConstraints.".length());
+        } else if (k.startsWith("IssuerDNConstraints.")) {
+            dnct = cct.getIssuerDNConstraints();
+            if (dnct == null) {
+                dnct = new DNConstraintsType();
+                cct.setIssuerDNConstraints(dnct);
+            }
+            k = k.substring("IssuerDNConstraints.".length());
+        }
+        if (dnct != null) {
+            if ("combinator".equals(k)) {
+                dnct.setCombinator(CombinatorType.fromValue(v));
+            } else if ("RegularExpression".equals(k)) {
+                dnct.getRegularExpression().add(k);
+            }
+        }
+    }
+
+    private KeyManagersType getKeyManagers(KeyManagersType keyManagers, String k, String v) {
+        if (keyManagers == null) {
+            keyManagers = new KeyManagersType();
+        }
+        if ("factoryAlgorithm".equals(k)) {
+            keyManagers.setFactoryAlgorithm(v);
+        } else if ("provider".equals(k)) {
+            keyManagers.setProvider(v);
+        } else if ("keyPassword".equals(k)) {
+            keyManagers.setKeyPassword(v);
+        } else if (k.startsWith("keyStore.")) {
+            keyManagers.setKeyStore(getKeyStore(keyManagers.getKeyStore(),
+                                                k.substring("keyStore.".length()),
+                                                v));
+        }
+        return keyManagers;
+    }
+
+    private KeyStoreType getKeyStore(KeyStoreType ks, String k, String v) {
+        if (ks == null) {
+            ks = new KeyStoreType();
+        }
+        if ("type".equals(k)) {
+            ks.setType(v);
+        } else if ("password".equals(k)) {
+            ks.setPassword(v);
+        } else if ("provider".equals(k)) {
+            ks.setProvider(v);
+        } else if ("url".equals(k)) {
+            ks.setUrl(v);
+        } else if ("file".equals(k)) {
+            ks.setFile(v);
+        } else if ("resource".equals(k)) {
+            ks.setResource(v);
+        }
+        return ks;
+    }
+
+    private TrustManagersType getTrustManagers(TrustManagersType tmt, String k, String v) {
+        if (tmt == null) {
+            tmt = new TrustManagersType();
+        }
+        if ("provider".equals(k)) {
+            tmt.setProvider(v);
+        } else if ("factoryAlgorithm".equals(k)) {
+            tmt.setFactoryAlgorithm(v);
+        } else if (k.startsWith("keyStore.")) {
+            tmt.setKeyStore(getKeyStore(tmt.getKeyStore(),
+                                        k.substring("keyStore.".length()),
+                                        v));
+        } else if (k.startsWith("certStore")) {
+            tmt.setCertStore(getCertStore(tmt.getCertStore(),
+                                          k.substring("certStore.".length()),
+                                          v));
+        }
+        return tmt;
+    }
+
+    private CertStoreType getCertStore(CertStoreType cs, String k, String v) {
+        if (cs == null) {
+            cs = new CertStoreType();
+        }
+        if ("file".equals(k)) {
+            cs.setFile(v);
+        } else if ("url".equals(k)) {
+            cs.setUrl(v);
+        } else if ("resource".equals(k)) {
+            cs.setResource(v);
+        }
+        return cs;
+    }
+
+
+    
+    
+    
+}

http://git-wip-us.apache.org/repos/asf/cxf/blob/e61a83d4/rt/transports/http-undertow/src/main/java/org/apache/cxf/transport/http_undertow/spring/NamespaceHandler.java
----------------------------------------------------------------------
diff --git a/rt/transports/http-undertow/src/main/java/org/apache/cxf/transport/http_undertow/spring/NamespaceHandler.java b/rt/transports/http-undertow/src/main/java/org/apache/cxf/transport/http_undertow/spring/NamespaceHandler.java
new file mode 100644
index 0000000..d8d6c92
--- /dev/null
+++ b/rt/transports/http-undertow/src/main/java/org/apache/cxf/transport/http_undertow/spring/NamespaceHandler.java
@@ -0,0 +1,30 @@
+/**
+ * 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_undertow.spring;
+
+import org.springframework.beans.factory.xml.NamespaceHandlerSupport;
+
+public class NamespaceHandler extends NamespaceHandlerSupport {
+    public void init() {
+        registerBeanDefinitionParser("engine-factory", 
+                new UndertowHTTPServerEngineFactoryBeanDefinitionParser());
+        registerBeanDefinitionParser("engine",
+                                     new UndertowHTTPServerEngineBeanDefinitionParser());
+    }
+}

http://git-wip-us.apache.org/repos/asf/cxf/blob/e61a83d4/rt/transports/http-undertow/src/main/java/org/apache/cxf/transport/http_undertow/spring/UndertowHTTPServerEngineBeanDefinitionParser.java
----------------------------------------------------------------------
diff --git a/rt/transports/http-undertow/src/main/java/org/apache/cxf/transport/http_undertow/spring/UndertowHTTPServerEngineBeanDefinitionParser.java b/rt/transports/http-undertow/src/main/java/org/apache/cxf/transport/http_undertow/spring/UndertowHTTPServerEngineBeanDefinitionParser.java
new file mode 100644
index 0000000..48e608b
--- /dev/null
+++ b/rt/transports/http-undertow/src/main/java/org/apache/cxf/transport/http_undertow/spring/UndertowHTTPServerEngineBeanDefinitionParser.java
@@ -0,0 +1,345 @@
+/**
+ * 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_undertow.spring;
+
+
+
+import java.io.IOException;
+import java.security.GeneralSecurityException;
+import java.util.List;
+
+import javax.annotation.PostConstruct;
+import javax.xml.bind.JAXBContext;
+
+import org.w3c.dom.Attr;
+import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+import org.apache.cxf.Bus;
+import org.apache.cxf.bus.spring.BusWiringBeanFactoryPostProcessor;
+import org.apache.cxf.common.injection.NoJSR250Annotations;
+import org.apache.cxf.configuration.jsse.TLSServerParametersConfig;
+import org.apache.cxf.configuration.security.CertificateConstraintsType;
+import org.apache.cxf.configuration.security.CipherSuites;
+import org.apache.cxf.configuration.security.ClientAuthentication;
+import org.apache.cxf.configuration.security.ExcludeProtocols;
+import org.apache.cxf.configuration.security.FiltersType;
+import org.apache.cxf.configuration.security.IncludeProtocols;
+import org.apache.cxf.configuration.security.KeyManagersType;
+import org.apache.cxf.configuration.security.SecureRandomParameters;
+import org.apache.cxf.configuration.security.TLSServerParametersType;
+import org.apache.cxf.configuration.security.TrustManagersType;
+import org.apache.cxf.configuration.spring.AbstractBeanDefinitionParser;
+import org.apache.cxf.helpers.DOMUtils;
+import org.apache.cxf.transport.http_undertow.ThreadingParameters;
+import org.apache.cxf.transport.http_undertow.UndertowHTTPServerEngine;
+import org.apache.cxf.transport.http_undertow.UndertowHTTPServerEngineFactory;
+import org.apache.cxf.transports.http_undertow.configuration.TLSServerParametersIdentifiedType;
+import org.apache.cxf.transports.http_undertow.configuration.ThreadingParametersIdentifiedType;
+import org.apache.cxf.transports.http_undertow.configuration.ThreadingParametersType;
+import org.springframework.beans.BeansException;
+import org.springframework.beans.factory.InitializingBean;
+import org.springframework.beans.factory.config.ConstructorArgumentValues.ValueHolder;
+import org.springframework.beans.factory.support.BeanDefinitionBuilder;
+import org.springframework.beans.factory.xml.ParserContext;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.ApplicationContextAware;
+
+
+
+
+
+public class UndertowHTTPServerEngineBeanDefinitionParser extends AbstractBeanDefinitionParser {
+    private static final String SECURITY_NS =
+        "http://cxf.apache.org/configuration/security";
+
+    public void doParse(Element element, ParserContext ctx, BeanDefinitionBuilder bean) {
+        
+        String portStr = element.getAttribute("port");
+        bean.addPropertyValue("port", portStr);
+        
+        String hostStr = element.getAttribute("host");
+        if (hostStr != null && !"".equals(hostStr.trim())) {
+            bean.addPropertyValue("host", hostStr);
+        }
+
+        String continuationsStr = element.getAttribute("continuationsEnabled");
+        if (continuationsStr != null && continuationsStr.length() > 0) {
+            bean.addPropertyValue("continuationsEnabled", continuationsStr);
+        }
+        
+        String maxIdleTimeStr = element.getAttribute("maxIdleTime");
+        if (maxIdleTimeStr != null && !"".equals(maxIdleTimeStr.trim())) {
+            bean.addPropertyValue("maxIdleTime", maxIdleTimeStr);
+        }
+        
+                
+        ValueHolder busValue = ctx.getContainingBeanDefinition()
+            .getConstructorArgumentValues().getArgumentValue(0, Bus.class);
+        bean.addPropertyValue("bus", busValue.getValue());
+        try {
+            Element elem = DOMUtils.getFirstElement(element);
+            while (elem != null) {
+                String name = elem.getLocalName();
+                if ("tlsServerParameters".equals(name)) {
+                    mapTLSServerParameters(elem, bean);
+                } else if ("threadingParameters".equals(name)) {
+                    mapElementToJaxbPropertyFactory(elem,
+                                                    bean,
+                                                    "threadingParameters",
+                                                    ThreadingParametersType.class,
+                                                    UndertowHTTPServerEngineBeanDefinitionParser.class,
+                                                    "createThreadingParameters");
+                } else if ("tlsServerParametersRef".equals(name)) {
+                    mapElementToJaxbPropertyFactory(elem,
+                                                    bean,
+                                                    "tlsServerParametersRef",
+                                                    TLSServerParametersIdentifiedType.class,
+                                                    UndertowHTTPServerEngineBeanDefinitionParser.class,
+                                                    "createTLSServerParametersConfigRef");
+                } else if ("threadingParametersRef".equals(name)) {
+                    mapElementToJaxbPropertyFactory(elem,
+                                                    bean,
+                                                    "threadingParametersRef",
+                                                    ThreadingParametersIdentifiedType.class,
+                                                    UndertowHTTPServerEngineBeanDefinitionParser.class,
+                                                    "createThreadingParametersRef"
+                                                    );
+                } else if ("handlers".equals(name)) {
+                    List<?> handlers = 
+                        ctx.getDelegate().parseListElement(elem, bean.getBeanDefinition());
+                    bean.addPropertyValue("handlers", handlers);
+                }
+                elem = org.apache.cxf.helpers.DOMUtils.getNextElement(elem);          
+            }
+        } catch (Exception e) {
+            throw new RuntimeException("Could not process configuration.", e);
+        }
+
+        bean.setLazyInit(false);
+    }
+    
+    private void mapTLSServerParameters(Element e, BeanDefinitionBuilder bean) {
+        BeanDefinitionBuilder paramsbean 
+            = BeanDefinitionBuilder.rootBeanDefinition(TLSServerParametersConfig.TLSServerParametersTypeInternal.class);
+        
+        // read the attributes
+        NamedNodeMap as = e.getAttributes();
+        for (int i = 0; i < as.getLength(); i++) {
+            Attr a = (Attr) as.item(i);
+            if (a.getNamespaceURI() == null) {
+                String aname = a.getLocalName();
+                if ("jsseProvider".equals(aname) 
+                    || "secureSocketProtocol".equals(aname)) {
+                    paramsbean.addPropertyValue(aname, a.getValue());
+                }
+            }
+        }
+        
+        // read the child elements
+        Node n = e.getFirstChild();
+        while (n != null) {
+            if (Node.ELEMENT_NODE != n.getNodeType() 
+                || !SECURITY_NS.equals(n.getNamespaceURI())) {
+                n = n.getNextSibling();
+                continue;
+            }
+            String ename = n.getLocalName();
+            // Schema should require that no more than one each of these exist.
+            String ref = ((Element)n).getAttribute("ref");
+
+            if ("keyManagers".equals(ename)) {
+                if (ref != null && ref.length() > 0) {
+                    paramsbean.addPropertyReference("keyManagersRef", ref);
+                } else {
+                    mapElementToJaxbProperty((Element)n, paramsbean, ename, 
+                                             KeyManagersType.class);
+                }
+            } else if ("trustManagers".equals(ename)) {
+                if (ref != null && ref.length() > 0) {
+                    paramsbean.addPropertyReference("trustManagersRef", ref);
+                } else {
+                    mapElementToJaxbProperty((Element)n, paramsbean, ename, 
+                                             TrustManagersType.class);
+                }
+            } else if ("cipherSuites".equals(ename)) {
+                mapElementToJaxbProperty((Element)n, paramsbean, ename,
+                                         CipherSuites.class);
+            } else if ("cipherSuitesFilter".equals(ename)) {
+                mapElementToJaxbProperty((Element)n, paramsbean, ename,
+                                         FiltersType.class);
+            } else if ("excludeProtocols".equals(ename)) {
+                mapElementToJaxbProperty((Element)n, paramsbean, ename,
+                                         ExcludeProtocols.class);
+            } else if ("includeProtocols".equals(ename)) {
+                mapElementToJaxbProperty((Element)n, paramsbean, ename,
+                                         IncludeProtocols.class);
+            } else if ("secureRandomParameters".equals(ename)) {
+                mapElementToJaxbProperty((Element)n, paramsbean, ename,
+                                         SecureRandomParameters.class);
+            } else if ("clientAuthentication".equals(ename)) {
+                mapElementToJaxbProperty((Element)n, paramsbean, ename,
+                                         ClientAuthentication.class);
+            } else if ("certConstraints".equals(ename)) {
+                mapElementToJaxbProperty((Element)n, paramsbean, ename,
+                                         CertificateConstraintsType.class);
+            } else if ("certAlias".equals(ename)) {
+                paramsbean.addPropertyValue(ename, n.getTextContent());
+            }
+            n = n.getNextSibling();
+        }
+
+        BeanDefinitionBuilder jaxbbean 
+            = BeanDefinitionBuilder.rootBeanDefinition(TLSServerParametersConfig.class);
+        jaxbbean.addConstructorArgValue(paramsbean.getBeanDefinition());
+        bean.addPropertyValue("tlsServerParameters", jaxbbean.getBeanDefinition());
+    }
+
+    private static ThreadingParameters toThreadingParameters(
+                                    ThreadingParametersType paramtype) {
+        ThreadingParameters params = new ThreadingParameters();
+        if (paramtype.getMaxThreads() != null) {
+            params.setMaxThreads(paramtype.getMaxThreads());
+        }
+        if (paramtype.getMinThreads() != null) {
+            params.setMinThreads(paramtype.getMinThreads());
+        }
+        if (paramtype.getWorkerIOThreads() != null) {
+            params.setWorkerIOThreads(paramtype.getWorkerIOThreads());
+        }
+            
+        return params;
+    }
+    
+       
+    /*
+     * 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 SpringUndertowHTTPServerEngine.class;
+    }
+    
+    @NoJSR250Annotations
+    public static class SpringUndertowHTTPServerEngine extends UndertowHTTPServerEngine
+        implements ApplicationContextAware, InitializingBean {
+        
+        String threadingRef;
+        String tlsRef;
+        Bus bus;
+        UndertowHTTPServerEngineFactory factory;
+        
+        public SpringUndertowHTTPServerEngine(
+            UndertowHTTPServerEngineFactory fac,
+            Bus b,
+            String host,
+            int port) {
+            super(host, port);
+            bus = b;
+            factory = fac;
+        }
+        
+        public SpringUndertowHTTPServerEngine() {
+            super();
+        }
+        
+        public void setBus(Bus b) {
+            bus = b;
+            if (null != bus && null == factory) {
+                factory = bus.getExtension(UndertowHTTPServerEngineFactory.class);
+            } 
+        }
+        
+        public void setApplicationContext(ApplicationContext ctx) throws BeansException {
+            if (bus == null) {
+                bus = BusWiringBeanFactoryPostProcessor.addDefaultBus(ctx);
+            }
+        }
+        
+        public void setThreadingParametersRef(String s) {
+            threadingRef = s;
+        }
+        public void setTlsServerParametersRef(String s) {
+            tlsRef = s;
+        }
+        
+        @PostConstruct
+        public void finalizeConfig() 
+            throws GeneralSecurityException,
+                   IOException {
+            if (tlsRef != null || threadingRef != null) {
+
+                if (threadingRef != null) {
+                    setThreadingParameters(factory.getThreadingParametersMap().get(threadingRef));
+                }
+                if (tlsRef != null) {
+                    setTlsServerParameters(factory.getTlsServerParametersMap().get(tlsRef));
+                }
+            }
+            super.finalizeConfig();
+        }
+
+        public void afterPropertiesSet() throws Exception {
+            finalizeConfig();
+        }
+
+    }
+        
+
+    
+    public static TLSServerParametersConfig createTLSServerParametersConfig(String s, 
+                                                                            JAXBContext context) 
+        throws GeneralSecurityException, IOException {
+        
+        TLSServerParametersType parametersType = unmarshalFactoryString(s, context,
+                                                                        TLSServerParametersType.class);
+        
+        return new TLSServerParametersConfig(parametersType);
+    }
+    public static String createTLSServerParametersConfigRef(String s, JAXBContext context)
+    
+        throws GeneralSecurityException, IOException {
+        
+        TLSServerParametersIdentifiedType parameterTypeRef 
+            = unmarshalFactoryString(s, context, TLSServerParametersIdentifiedType.class);
+        
+        return parameterTypeRef.getId(); 
+    } 
+    
+    public static ThreadingParameters createThreadingParameters(String s, JAXBContext context) {
+        
+        ThreadingParametersType parametersType = unmarshalFactoryString(s, context,
+                                                                        ThreadingParametersType.class);
+        
+        return toThreadingParameters(parametersType);
+    }
+    public static String createThreadingParametersRef(String s, JAXBContext context) {
+        ThreadingParametersIdentifiedType parametersType 
+            = unmarshalFactoryString(s, context, ThreadingParametersIdentifiedType.class);
+        return parametersType.getId();
+    }
+}

http://git-wip-us.apache.org/repos/asf/cxf/blob/e61a83d4/rt/transports/http-undertow/src/main/java/org/apache/cxf/transport/http_undertow/spring/UndertowHTTPServerEngineFactoryBeanDefinitionParser.java
----------------------------------------------------------------------
diff --git a/rt/transports/http-undertow/src/main/java/org/apache/cxf/transport/http_undertow/spring/UndertowHTTPServerEngineFactoryBeanDefinitionParser.java b/rt/transports/http-undertow/src/main/java/org/apache/cxf/transport/http_undertow/spring/UndertowHTTPServerEngineFactoryBeanDefinitionParser.java
new file mode 100644
index 0000000..4d69832
--- /dev/null
+++ b/rt/transports/http-undertow/src/main/java/org/apache/cxf/transport/http_undertow/spring/UndertowHTTPServerEngineFactoryBeanDefinitionParser.java
@@ -0,0 +1,159 @@
+/**
+ * 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_undertow.spring;
+
+import java.util.List;
+import java.util.Map;
+
+import javax.xml.namespace.QName;
+
+import org.w3c.dom.Element;
+
+import org.apache.cxf.Bus;
+import org.apache.cxf.bus.spring.BusWiringBeanFactoryPostProcessor;
+import org.apache.cxf.common.injection.NoJSR250Annotations;
+import org.apache.cxf.common.util.StringUtils;
+import org.apache.cxf.configuration.jsse.TLSServerParameters;
+import org.apache.cxf.configuration.spring.AbstractBeanDefinitionParser;
+import org.apache.cxf.configuration.spring.BusWiringType;
+import org.apache.cxf.helpers.DOMUtils;
+import org.apache.cxf.transport.http_undertow.ThreadingParameters;
+import org.apache.cxf.transport.http_undertow.UndertowHTTPServerEngineFactory;
+import org.apache.cxf.transports.http_undertow.configuration.TLSServerParametersIdentifiedType;
+import org.apache.cxf.transports.http_undertow.configuration.ThreadingParametersIdentifiedType;
+
+import org.springframework.beans.BeansException;
+import org.springframework.beans.factory.BeanDefinitionStoreException;
+import org.springframework.beans.factory.support.AbstractBeanDefinition;
+import org.springframework.beans.factory.support.BeanDefinitionBuilder;
+import org.springframework.beans.factory.support.ManagedList;
+import org.springframework.beans.factory.xml.ParserContext;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.ApplicationContextAware;
+
+public class UndertowHTTPServerEngineFactoryBeanDefinitionParser
+        extends AbstractBeanDefinitionParser {
+    static final String HTTP_UNDERTOW_NS = "http://cxf.apache.org/transports/http-undertow/configuration";
+
+    protected String resolveId(Element elem, AbstractBeanDefinition definition, 
+                               ParserContext ctx) throws BeanDefinitionStoreException {
+        String id = this.getIdOrName(elem);
+        if (StringUtils.isEmpty(id)) {
+            return UndertowHTTPServerEngineFactory.class.getName();            
+        }
+        id = super.resolveId(elem, definition, ctx);
+        if (!ctx.getRegistry().containsBeanDefinition(UndertowHTTPServerEngineFactory.class.getName())) {
+            ctx.getRegistry().registerAlias(id, UndertowHTTPServerEngineFactory.class.getName());
+        }
+        return id;
+    }
+    
+
+    @Override
+    public void doParse(Element element, ParserContext ctx, BeanDefinitionBuilder bean) {
+         
+        String bus = element.getAttribute("bus");
+        
+        BeanDefinitionBuilder factbean 
+            = BeanDefinitionBuilder
+                .rootBeanDefinition(UndertowSpringTypesFactory.class);
+
+        ctx.getRegistry()
+            .registerBeanDefinition(UndertowSpringTypesFactory.class.getName(),
+                                    factbean.getBeanDefinition());
+        try {
+            if (StringUtils.isEmpty(bus)) {
+                addBusWiringAttribute(bean, BusWiringType.CONSTRUCTOR);
+            } else {
+                bean.addConstructorArgReference(bus);
+            }
+
+            bean.addConstructorArgValue(mapElementToJaxbBean(element,
+                                                        TLSServerParametersIdentifiedType.class,
+                                                        UndertowSpringTypesFactory.class,
+                                                        "createTLSServerParametersMap"));
+            bean.addConstructorArgValue(mapElementToJaxbBean(element,
+                                                        ThreadingParametersIdentifiedType.class,
+                                                        UndertowSpringTypesFactory.class,
+                                "createThreadingParametersMap"));
+            
+            // parser the engine list
+            List<Object> list = 
+                getRequiredElementsList(element, ctx, new QName(HTTP_UNDERTOW_NS, "engine"), bean);
+            if (list.size() > 0) {
+                bean.addPropertyValue("enginesList", list);
+            }
+        } catch (Exception e) {
+            throw new RuntimeException("Could not process configuration.", e);
+        }
+    }    
+    
+    private List<Object> getRequiredElementsList(Element parent, ParserContext ctx, QName name,
+                                         BeanDefinitionBuilder bean) {
+       
+        List<Element> elemList = DOMUtils.findAllElementsByTagNameNS(parent, 
+                                                                     name.getNamespaceURI(), 
+                                                                     name.getLocalPart());
+        ManagedList<Object> list = new ManagedList<Object>(elemList.size());
+        list.setSource(ctx.extractSource(parent));
+        
+        for (Element elem : elemList) {
+            list.add(ctx.getDelegate().parsePropertySubElement(elem, bean.getBeanDefinition()));
+        }
+        return list;
+    }
+    
+    
+          
+    /*
+     * 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 SpringUndertowHTTPServerEngineFactory.class;
+    }
+    
+    @NoJSR250Annotations(unlessNull = "bus")
+    public static class SpringUndertowHTTPServerEngineFactory extends UndertowHTTPServerEngineFactory 
+        implements ApplicationContextAware {
+
+        public SpringUndertowHTTPServerEngineFactory() {
+            super();
+        }
+        public SpringUndertowHTTPServerEngineFactory(Bus bus,
+                                                  Map<String, TLSServerParameters> tls,
+                                                  Map<String, ThreadingParameters> threading) {
+            super(bus, tls, threading);
+        }    
+        
+        public void setApplicationContext(ApplicationContext ctx) throws BeansException {
+            if (getBus() == null) {
+                setBus(BusWiringBeanFactoryPostProcessor.addDefaultBus(ctx));
+            }
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/cxf/blob/e61a83d4/rt/transports/http-undertow/src/main/java/org/apache/cxf/transport/http_undertow/spring/UndertowSpringTypesFactory.java
----------------------------------------------------------------------
diff --git a/rt/transports/http-undertow/src/main/java/org/apache/cxf/transport/http_undertow/spring/UndertowSpringTypesFactory.java b/rt/transports/http-undertow/src/main/java/org/apache/cxf/transport/http_undertow/spring/UndertowSpringTypesFactory.java
new file mode 100644
index 0000000..7e88ed1
--- /dev/null
+++ b/rt/transports/http-undertow/src/main/java/org/apache/cxf/transport/http_undertow/spring/UndertowSpringTypesFactory.java
@@ -0,0 +1,172 @@
+/**
+ * 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_undertow.spring;
+
+import java.io.StringReader;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.TreeMap;
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBElement;
+import javax.xml.bind.JAXBException;
+import javax.xml.bind.Unmarshaller;
+import javax.xml.namespace.QName;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+import org.apache.cxf.common.injection.NoJSR250Annotations;
+import org.apache.cxf.configuration.jsse.TLSServerParameters;
+import org.apache.cxf.configuration.jsse.TLSServerParametersConfig;
+import org.apache.cxf.staxutils.StaxUtils;
+import org.apache.cxf.transport.http_undertow.ThreadingParameters;
+import org.apache.cxf.transports.http_undertow.configuration.TLSServerParametersIdentifiedType;
+import org.apache.cxf.transports.http_undertow.configuration.ThreadingParametersIdentifiedType;
+import org.apache.cxf.transports.http_undertow.configuration.ThreadingParametersType;
+
+@NoJSR250Annotations
+public final class UndertowSpringTypesFactory {
+    public UndertowSpringTypesFactory() {
+        
+    }
+    private static Map<String, ThreadingParameters> toThreadingParameters(
+        List <ThreadingParametersIdentifiedType> list) {
+        Map<String, ThreadingParameters> map = new TreeMap<String, ThreadingParameters>();
+        for (ThreadingParametersIdentifiedType t : list) {
+            ThreadingParameters parameter = 
+                toThreadingParameters(t.getThreadingParameters());
+            map.put(t.getId(), parameter);
+        } 
+        return map;
+    }
+    private static ThreadingParameters toThreadingParameters(ThreadingParametersType paramtype) {
+        ThreadingParameters params = new ThreadingParameters();
+        params.setMaxThreads(paramtype.getMaxThreads());
+        params.setMinThreads(paramtype.getMinThreads());
+        params.setWorkerIOThreads(paramtype.getWorkerIOThreads());
+        return params;
+    }
+        
+    private static Map<String, TLSServerParameters> toTLSServerParamenters(
+        List <TLSServerParametersIdentifiedType> list) {
+        Map<String, TLSServerParameters> map = new TreeMap<String, TLSServerParameters>();
+        for (TLSServerParametersIdentifiedType t : list) {
+            try {             
+                TLSServerParameters parameter = new TLSServerParametersConfig(t.getTlsServerParameters());
+                map.put(t.getId(), parameter);
+            } catch (Exception e) {
+                throw new RuntimeException(
+                        "Could not configure TLS for id " + t.getId(), e);
+            }
+            
+        }
+        return map;
+    }
+    public Map<String, ThreadingParameters> createThreadingParametersMap(String s,
+                                                                         JAXBContext ctx) 
+        throws Exception {
+        Document doc = StaxUtils.read(new StringReader(s));
+        List <ThreadingParametersIdentifiedType> threadingParametersIdentifiedTypes = 
+            UndertowSpringTypesFactory
+                .parseListElement(doc.getDocumentElement(), 
+                                  new QName(UndertowHTTPServerEngineFactoryBeanDefinitionParser.HTTP_UNDERTOW_NS,
+                                            "identifiedThreadingParameters"), 
+                                  ThreadingParametersIdentifiedType.class, ctx);
+        Map<String, ThreadingParameters> threadingParametersMap =
+            toThreadingParameters(threadingParametersIdentifiedTypes);
+        return threadingParametersMap;
+    }
+    
+    public Map<String, TLSServerParameters> createTLSServerParametersMap(String s,
+                                                                         JAXBContext ctx) 
+        throws Exception {
+        Document doc = StaxUtils.read(new StringReader(s));
+        
+        List <TLSServerParametersIdentifiedType> tlsServerParameters =
+            UndertowSpringTypesFactory
+                .parseListElement(doc.getDocumentElement(), 
+                                  new QName(UndertowHTTPServerEngineFactoryBeanDefinitionParser.HTTP_UNDERTOW_NS,
+                                            "identifiedTLSServerParameters"),
+                                  TLSServerParametersIdentifiedType.class,
+                                  ctx);
+        Map<String, TLSServerParameters> tlsServerParametersMap =
+            toTLSServerParamenters(tlsServerParameters);
+        return tlsServerParametersMap;
+    }
+    
+    @SuppressWarnings("unchecked")
+    public static <V> List<V> parseListElement(Element parent, 
+                                           QName name, 
+                                           Class<?> c,
+                                           JAXBContext context) throws JAXBException {
+        List<V> list = new ArrayList<V>();
+        Node data = null;
+           
+        Unmarshaller u = context.createUnmarshaller();
+        Node node = parent.getFirstChild();           
+        while (node != null) {
+            if (node.getNodeType() == Node.ELEMENT_NODE && name.getLocalPart().equals(node.getLocalName())
+                && name.getNamespaceURI().equals(node.getNamespaceURI())) {
+                data = node;
+                Object obj = unmarshal(u, data, c);                
+                if (obj != null) {                    
+                    list.add((V) obj);
+                }
+            }
+            node = node.getNextSibling();
+        }
+        return list;
+    }
+    
+    
+
+    
+    
+    private static Object unmarshal(Unmarshaller u,
+                                     Node data, Class<?> c) {
+        if (u == null) {
+            return null;
+        }
+        
+        Object obj = null;        
+        try {
+            if (c != null) {
+                obj = u.unmarshal(data, c);
+            } else {
+                obj = u.unmarshal(data);
+            }
+
+            if (obj instanceof JAXBElement<?>) {
+                JAXBElement<?> el = (JAXBElement<?>)obj;
+                obj = el.getValue();
+            }
+           
+        } catch (JAXBException e) {
+            throw new RuntimeException("Could not parse configuration.", e);
+        }
+        
+        return obj; 
+        
+    }
+               
+
+}

http://git-wip-us.apache.org/repos/asf/cxf/blob/e61a83d4/rt/transports/http-undertow/src/main/resources/META-INF/blueprint.handlers
----------------------------------------------------------------------
diff --git a/rt/transports/http-undertow/src/main/resources/META-INF/blueprint.handlers b/rt/transports/http-undertow/src/main/resources/META-INF/blueprint.handlers
new file mode 100644
index 0000000..ca94a97
--- /dev/null
+++ b/rt/transports/http-undertow/src/main/resources/META-INF/blueprint.handlers
@@ -0,0 +1,22 @@
+#
+#
+#    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.
+#
+#
+org.apache.cxf.transport.http_undertow.blueprint.HTTPUndertowTransportNamespaceHandler
+

http://git-wip-us.apache.org/repos/asf/cxf/blob/e61a83d4/rt/transports/http-undertow/src/main/resources/META-INF/cxf/bus-extensions.txt
----------------------------------------------------------------------
diff --git a/rt/transports/http-undertow/src/main/resources/META-INF/cxf/bus-extensions.txt b/rt/transports/http-undertow/src/main/resources/META-INF/cxf/bus-extensions.txt
new file mode 100644
index 0000000..cba69a1
--- /dev/null
+++ b/rt/transports/http-undertow/src/main/resources/META-INF/cxf/bus-extensions.txt
@@ -0,0 +1,2 @@
+org.apache.cxf.transport.http_undertow.UndertowDestinationFactory::true
+org.apache.cxf.transport.http_undertow.UndertowHTTPServerEngineFactory::true


[6/6] cxf git commit: [CXF-6800]add http-undertow transport

Posted by ff...@apache.org.
[CXF-6800]add http-undertow transport


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/e61a83d4
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/e61a83d4
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/e61a83d4

Branch: refs/heads/master
Commit: e61a83d4ac18fc760fc5d4bc8fb19d6072aaac52
Parents: 4fd1237
Author: Freeman Fang <fr...@gmail.com>
Authored: Fri Feb 26 11:50:30 2016 +0800
Committer: Freeman Fang <fr...@gmail.com>
Committed: Fri Feb 26 11:50:30 2016 +0800

----------------------------------------------------------------------
 parent/pom.xml                                  |  12 +
 rt/transports/http-undertow/pom.xml             | 184 ++++
 .../src/main/build-resources/catalog.cat        |  25 +
 .../http_undertow/CXFUndertowHttpHandler.java   |  26 +
 .../http_undertow/CxfUndertwoServlet.java       |  58 ++
 .../transport/http_undertow/Messages.properties |  85 ++
 .../http_undertow/NotFoundHandler.java          |  35 +
 .../transport/http_undertow/ServerEngine.java   |  44 +
 .../SimpleErrorPageHandler.java.bak             |  51 ++
 .../http_undertow/ThreadingParameters.java      |  84 ++
 .../UndertowDestinationFactory.java             |  42 +
 .../http_undertow/UndertowHTTPDestination.java  | 250 ++++++
 .../http_undertow/UndertowHTTPHandler.java      | 131 +++
 .../http_undertow/UndertowHTTPServerEngine.java | 541 +++++++++++
 .../UndertowHTTPServerEngineFactory.java        | 341 +++++++
 .../HTTPUndertowTransportNamespaceHandler.java  |  83 ++
 .../UndertowHTTPServerEngineFactoryHolder.java  | 234 +++++
 .../UndertowServerEngineFactoryParser.java      | 112 +++
 .../blueprint/UndertowServerEngineParser.java   |  32 +
 .../osgi/HTTPUndertowTransportActivator.java    | 382 ++++++++
 .../http_undertow/spring/NamespaceHandler.java  |  30 +
 ...towHTTPServerEngineBeanDefinitionParser.java | 345 +++++++
 ...ServerEngineFactoryBeanDefinitionParser.java | 159 ++++
 .../spring/UndertowSpringTypesFactory.java      | 172 ++++
 .../main/resources/META-INF/blueprint.handlers  |  22 +
 .../resources/META-INF/cxf/bus-extensions.txt   |   2 +
 .../src/main/resources/META-INF/spring.handlers |  21 +
 .../src/main/resources/META-INF/spring.schemas  |  21 +
 .../schemas/configuration/http-undertow.xsd     | 195 ++++
 .../UndertowHTTPDestinationTest.java            | 892 +++++++++++++++++++
 .../UndertowHTTPServerEngineFactoryTest.java    | 145 +++
 .../UndertowHTTPServerEngineTest.java           | 266 ++++++
 .../http_undertow/UndertowHTTPTestHandler.java  |  78 ++
 ...TPUndertowTransportNamespaceHandlerTest.java |  36 +
 .../transport/http_undertow/invalid-engines.xml |  28 +
 .../http_undertow/server-engine-factory.xml     |  28 +
 .../spring/ApplicationContextTest.java          | 184 ++++
 .../http_undertow/spring/TestDummyHandler.java  |  41 +
 .../http_undertow/spring/bean.properties        |  30 +
 .../http_undertow/spring/beans-props.xml        |  74 ++
 .../transport/http_undertow/spring/beans.xml    |  61 ++
 .../transport/http_undertow/spring/conduit.xml  |  22 +
 .../http_undertow/spring/destination.xml        |  23 +
 .../http_undertow/spring/invalid-beans.xml      |  27 +
 .../spring/serverenginefactory.xml              |  45 +
 rt/transports/pom.xml                           |   1 +
 systests/pom.xml                                |   1 +
 systests/transport-undertow/pom.xml             | 253 ++++++
 .../http_undertow/ClientServerSessionTest.java  | 275 ++++++
 .../apache/cxf/systest/http_undertow/Dummy.java |  32 +
 .../systest/http_undertow/DummyInterface.java   |  29 +
 .../cxf/systest/http_undertow/GreeterImpl.java  | 144 +++
 .../http_undertow/GreeterSessionImpl.java       | 154 ++++
 .../http_undertow/MapIdentityManager.java       | 126 +++
 .../PerRequestAnnotationGreeterImpl.java        |  98 ++
 .../cxf/systest/http_undertow/Server.java       |  65 ++
 .../SessionAnnotationGreeterImpl.java           | 101 +++
 .../systest/http_undertow/SessionServer.java    |  58 ++
 .../SpringAnnotationGreeterImpl.java            |  99 ++
 .../http_undertow/StatefulGreeterImpl.java      |  96 ++
 .../systest/http_undertow/ThreadPoolTest.java   | 112 +++
 .../http_undertow/UndertowBasicAuthHandler.java |  80 ++
 .../http_undertow/UndertowBasicAuthServer.java  |  70 ++
 .../http_undertow/UndertowBasicAuthTest.java    | 102 +++
 .../UndertowDigestAuthHandler.java              |  81 ++
 .../http_undertow/UndertowDigestAuthTest.java   | 202 +++++
 .../ClientServerWrappedContinuationTest.java    | 159 ++++
 .../continuations/ControlWorker.java            |  59 ++
 .../continuations/HelloContinuation.java        |  36 +
 .../continuations/HelloContinuationService.java |  49 +
 .../HelloImplWithWrapppedContinuation.java      | 129 +++
 .../continuations/HelloWorker.java              |  67 ++
 .../src/test/resources/keys/Bethal.jks          | Bin 0 -> 2202 bytes
 .../src/test/resources/keys/Bethal.p12          | Bin 0 -> 2540 bytes
 .../src/test/resources/keys/Gordy.jks           | Bin 0 -> 2197 bytes
 .../src/test/resources/keys/Morpit.jks          | Bin 0 -> 2221 bytes
 .../src/test/resources/keys/Morpit.p12          | Bin 0 -> 2564 bytes
 .../src/test/resources/keys/Poltim.jks          | Bin 0 -> 2203 bytes
 .../src/test/resources/keys/Tarpin.jks          | Bin 0 -> 2201 bytes
 .../src/test/resources/keys/Truststore.jks      | Bin 0 -> 4447 bytes
 .../src/test/resources/keys/Truststore.pem      |  86 ++
 .../src/test/resources/keys/alice.jks           | Bin 0 -> 4125 bytes
 .../src/test/resources/keys/bob.jks             | Bin 0 -> 4122 bytes
 .../src/test/resources/keys/cxfca.jks           | Bin 0 -> 961 bytes
 .../src/test/resources/keys/genkeys.sh          |  53 ++
 .../src/test/resources/keys/subjalt.jks         | Bin 0 -> 8891 bytes
 .../cxf/systest/http_undertow/SessionServer.xml |  46 +
 .../systest/http_undertow/continuations/cxf.xml |  24 +
 .../http_undertow/continuations/cxf_https.xml   |  36 +
 .../continuations/jaxws-server.xml              |  47 +
 .../http_undertow/continuations/test.wsdl       | 100 +++
 .../apache/cxf/systest/http_undertow/cxf.xml    |  24 +
 .../http_undertow/server-lifecycle-beans.xml    |  47 +
 .../apache/cxf/systest/http_undertow/server.xml |  27 +
 .../apache/cxf/systest/http_undertow/test.html  |  23 +
 .../systest/http_undertow/undertow-engine.xml   |  45 +
 .../http_undertow/undertowBasicAuthServer.xml   |  29 +
 .../http_undertow/undertowDigestServer.xml      |  29 +
 98 files changed, 8993 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/e61a83d4/parent/pom.xml
----------------------------------------------------------------------
diff --git a/parent/pom.xml b/parent/pom.xml
index 45b7e36..b381bfc 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -118,6 +118,8 @@
         <cxf.jetty9.version>9.3.5.v20151012</cxf.jetty9.version>
         <cxf.jetty.version>${cxf.jetty9.version}</cxf.jetty.version>
         <cxf.jetty.osgi.version>[8.1,10)</cxf.jetty.osgi.version>
+        <cxf.undertow.version>1.3.7.Final</cxf.undertow.version>
+        <cxf.undertow.osgi.version>[1.3.7, 1.4)</cxf.undertow.osgi.version>
         <cxf.jibx.version>1.2.6</cxf.jibx.version>
         <cxf.junit.version>4.12</cxf.junit.version>
         <cxf.maven.core.version>3.0.5</cxf.maven.core.version>
@@ -1008,6 +1010,16 @@
                 <version>${cxf.jetty.version}</version>
             </dependency>
             <dependency>
+                 <groupId>io.undertow</groupId>
+                 <artifactId>undertow-core</artifactId>
+                 <version>${cxf.undertow.version}</version>
+            </dependency>
+            <dependency>
+                 <groupId>io.undertow</groupId>
+                 <artifactId>undertow-servlet</artifactId>
+                 <version>${cxf.undertow.version}</version>
+            </dependency>
+            <dependency>
                 <groupId>xalan</groupId>
                 <artifactId>xalan</artifactId>
                 <version>${cxf.xalan.version}</version>

http://git-wip-us.apache.org/repos/asf/cxf/blob/e61a83d4/rt/transports/http-undertow/pom.xml
----------------------------------------------------------------------
diff --git a/rt/transports/http-undertow/pom.xml b/rt/transports/http-undertow/pom.xml
new file mode 100644
index 0000000..64cc205
--- /dev/null
+++ b/rt/transports/http-undertow/pom.xml
@@ -0,0 +1,184 @@
+<?xml version="1.0"?>
+<!--
+  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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <artifactId>cxf-rt-transports-http-undertow</artifactId>
+    <packaging>bundle</packaging>
+    <name>Apache CXF Runtime HTTP Undertow Transport</name>
+    <description>Apache CXF Runtime HTTP Undertow Transport</description>
+    <url>http://cxf.apache.org</url>
+    <parent>
+        <groupId>org.apache.cxf</groupId>
+        <artifactId>cxf-parent</artifactId>
+        <version>3.2.0-SNAPSHOT</version>
+        <relativePath>../../../parent/pom.xml</relativePath>
+    </parent>
+    <properties>
+        <cxf.bundle.activator>org.apache.cxf.transport.http_undertow.osgi.HTTPUndertowTransportActivator</cxf.bundle.activator>
+        <cxf.osgi.import>
+            javax.servlet*;version="${cxf.osgi.javax.servlet.version}",
+            io.undertow*;version="${cxf.undertow.osgi.version}",
+            org.apache.aries*;version="${cxf.aries.version.range}";resolution:=optional,
+            org.springframework*;resolution:="optional";version="${cxf.osgi.spring.version}"
+        </cxf.osgi.import>
+        <!-- keep in sync with services exported in activator -->
+        <cxf.export.service>
+            org.apache.aries.blueprint.NamespaceHandler;osgi.service.blueprint.namespace="http://cxf.apache.org/transports/http-undertow/configuration"
+        </cxf.export.service>
+    </properties>
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.aries.blueprint</groupId>
+            <artifactId>org.apache.aries.blueprint.core</artifactId>
+            <scope>provided</scope>
+            <optional>true</optional>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.aries.blueprint</groupId>
+            <artifactId>blueprint-parser</artifactId>
+            <scope>provided</scope>
+            <optional>true</optional>
+        </dependency>
+        <dependency>
+            <groupId>org.osgi</groupId>
+            <artifactId>org.osgi.core</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.osgi</groupId>
+            <artifactId>org.osgi.compendium</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.cxf</groupId>
+            <artifactId>cxf-core</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.cxf</groupId>
+            <artifactId>cxf-rt-transports-http</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>io.undertow</groupId>
+            <artifactId>undertow-core</artifactId>
+            <version>1.3.7.Final</version>
+        </dependency>
+        <dependency>
+            <groupId>io.undertow</groupId>
+            <artifactId>undertow-servlet</artifactId>
+            <version>1.3.7.Final</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-servlet_3.0_spec</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-core</artifactId>
+            <optional>true</optional>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-beans</artifactId>
+            <optional>true</optional>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-context</artifactId>
+            <optional>true</optional>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+            <scope>runtime</scope>
+        </dependency>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.easymock</groupId>
+            <artifactId>easymock</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>jcl-over-slf4j</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-jdk14</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.cxf</groupId>
+            <artifactId>cxf-testutils</artifactId>
+            <version>${project.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.cxf</groupId>
+            <artifactId>cxf-rt-wsdl</artifactId>
+            <version>${project.version}</version>
+            <scope>test</scope>
+        </dependency>
+    </dependencies>
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.cxf</groupId>
+                <artifactId>cxf-xjc-plugin</artifactId>
+                <version>${cxf.xjc-utils.version}</version>
+                <executions>
+                    <execution>
+                        <id>generate-sources</id>
+                        <phase>generate-sources</phase>
+                        <configuration>
+                            <extensions>
+                                <extension>org.apache.cxf.xjcplugins:cxf-xjc-bug986:${cxf.xjc-utils.version}</extension>
+                            </extensions>
+                            <sourceRoot>${basedir}/target/generated/src/main/java</sourceRoot>
+                            <xsdOptions>
+                                <xsdOption>
+                                    <extensionArgs>
+                                        <arg>-Xbug986</arg>
+                                    </extensionArgs>
+                                    <xsd>${basedir}/src/main/resources/schemas/configuration/http-undertow.xsd</xsd>
+                                    <catalog>${basedir}/src/main/build-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>
+            </plugin>
+        </plugins>
+    </build>
+</project>

http://git-wip-us.apache.org/repos/asf/cxf/blob/e61a83d4/rt/transports/http-undertow/src/main/build-resources/catalog.cat
----------------------------------------------------------------------
diff --git a/rt/transports/http-undertow/src/main/build-resources/catalog.cat b/rt/transports/http-undertow/src/main/build-resources/catalog.cat
new file mode 100644
index 0000000..6d5bd2a
--- /dev/null
+++ b/rt/transports/http-undertow/src/main/build-resources/catalog.cat
@@ -0,0 +1,25 @@
+--
+  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/" "../../../../../../core/src/main/resources/schemas/wsdl/wsdl.xsd"
+SYSTEM "http://cxf.apache.org/schemas/configuration/security.xsd" "../../../../../../core/src/main/resources/schemas/configuration/security.xsd"
+SYSTEM "http://cxf.apache.org/schemas/configuration/parameterized-types.xsd" "../../../../../../core/src/main/resources/schemas/configuration/parameterized-types.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-undertow.xsd" "schemas/configuration/http-undertow.xsd"

http://git-wip-us.apache.org/repos/asf/cxf/blob/e61a83d4/rt/transports/http-undertow/src/main/java/org/apache/cxf/transport/http_undertow/CXFUndertowHttpHandler.java
----------------------------------------------------------------------
diff --git a/rt/transports/http-undertow/src/main/java/org/apache/cxf/transport/http_undertow/CXFUndertowHttpHandler.java b/rt/transports/http-undertow/src/main/java/org/apache/cxf/transport/http_undertow/CXFUndertowHttpHandler.java
new file mode 100644
index 0000000..607a66a
--- /dev/null
+++ b/rt/transports/http-undertow/src/main/java/org/apache/cxf/transport/http_undertow/CXFUndertowHttpHandler.java
@@ -0,0 +1,26 @@
+/**
+ * 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_undertow;
+
+import io.undertow.server.HttpHandler;
+
+public interface CXFUndertowHttpHandler extends HttpHandler {
+    void setNext(HttpHandler nextHandler);
+}

http://git-wip-us.apache.org/repos/asf/cxf/blob/e61a83d4/rt/transports/http-undertow/src/main/java/org/apache/cxf/transport/http_undertow/CxfUndertwoServlet.java
----------------------------------------------------------------------
diff --git a/rt/transports/http-undertow/src/main/java/org/apache/cxf/transport/http_undertow/CxfUndertwoServlet.java b/rt/transports/http-undertow/src/main/java/org/apache/cxf/transport/http_undertow/CxfUndertwoServlet.java
new file mode 100644
index 0000000..efb60d7
--- /dev/null
+++ b/rt/transports/http-undertow/src/main/java/org/apache/cxf/transport/http_undertow/CxfUndertwoServlet.java
@@ -0,0 +1,58 @@
+/**
+ * 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_undertow;
+
+import java.io.IOException;
+
+import javax.servlet.FilterChain;
+import javax.servlet.ServletException;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.cxf.Bus;
+import org.apache.cxf.transport.servlet.AbstractHTTPServlet;
+
+public class CxfUndertwoServlet extends AbstractHTTPServlet {
+
+    @Override
+    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
+        throws IOException, ServletException {
+  
+    }
+
+    @Override
+    protected Bus getBus() {
+        return null;
+    }
+
+    @Override
+    protected void invoke(HttpServletRequest request, HttpServletResponse response) throws ServletException {
+        UndertowHTTPDestination undertowHTTPDestination = 
+            (UndertowHTTPDestination)request.getAttribute("UNDERTOW_DESTINATION");
+        try {
+            undertowHTTPDestination.doService(request.getServletContext(), request, response);
+        } catch (IOException e) {
+            e.printStackTrace();
+            throw new ServletException(e);
+        }
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/cxf/blob/e61a83d4/rt/transports/http-undertow/src/main/java/org/apache/cxf/transport/http_undertow/Messages.properties
----------------------------------------------------------------------
diff --git a/rt/transports/http-undertow/src/main/java/org/apache/cxf/transport/http_undertow/Messages.properties b/rt/transports/http-undertow/src/main/java/org/apache/cxf/transport/http_undertow/Messages.properties
new file mode 100644
index 0000000..ebacf5d
--- /dev/null
+++ b/rt/transports/http-undertow/src/main/java/org/apache/cxf/transport/http_undertow/Messages.properties
@@ -0,0 +1,85 @@
+#
+#
+#    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.
+#
+#
+START_UP_SERVER_FAILED_MSG = Could not start Undertow server on port {1}: {0}
+ADD_HANDLER_FAILED_MSG = Could not add cxf undertow handler to Undertow server: {0}
+ADD_HANDLER_CONTEXT_IS_USED_MSG = Could not add cxf undertow handler for url {0} to Undertow server, as the path {1} is still in use.
+ADD_HANDLER_CONTEXT_CONFILICT_MSG = Could not add cxf undertow handler for url {0} to Undertow server, as it conflicts with the registered path {1}.
+REMOVE_HANDLER_FAILED_MSG = Could not remove cxf undertow handler from Undertow server: {0}
+CAN_NOT_FIND_HANDLER_MSG = Could not find the handler to remove for context url {0}
+FAILED_TO_SHUTDOWN_ENGINE_MSG = Failed to shutdown Undertow server on port {0,number,####0} because it is still in use
+UNKNOWN_CONNECTOR_MSG = Unknown connector type {0}, can''t set the socket reuseAddress flag.
+INVALID_ENCODING_MSG = Invalid character set {0} in request.
+FALLBACK_THREADING_PARAMETERS_MSG = No explicitly configured threading parameters for port {0}, using fallback values min:{1} max:{2}
+NOT_ENOUGH_THREADS = Not enough threads configured for port {0}.  Need at least {1} ({3} for Undertow selectors and set managers) but only {2} configured.
+NOT_A_QUEUED_THREAD_POOL = {0} is not an instanceof QueuedThreadPool.  Cannot set threading parameters.
+
+SSL_CONTEXT_INIT_FAILURE = Problem initializing ssl for the outbound request, exception reported from security provider is : {0}
+UNKNOWN_SSL_CLIENT_POLICY_DATA = Unknown SSLClientPolicy property : {0}
+UNKNOWN_SSL_SERVER_POLICY_DATA = Unknown SSLServerPolicy property : {0}
+UNSUPPORTED_SSL_CLIENT_POLICY_DATA = Unsupported SSLClientPolicy property : {0}
+UNSUPPORTED_SSL_SERVER_POLICY_DATA = Unsupported SSLServerPolicy property : {0}
+KEY_STORE_NOT_SET = The location of the key store has not been set via a system parameter or through configuration so the default value of {0} will be used.
+KEY_STORE_SET = The keystore location is set to {0}.
+KEY_STORE_SYSTEM_PROPERTY_SET = The keystore location is set via a system property to {0}.
+KEY_STORE_TYPE_NOT_SET = The key store type has not been set in configuration so the default value of {0} will be used.
+KEY_STORE_TYPE_SET = The key store type has been set in configuration to {0}.
+LOADED_KEYSTORE = Successfully loaded keystore, {0}.
+FAILED_TO_LOAD_KEYSTORE = Loading the keystore {0}, failed with the following problem: {1}.
+FAILED_TO_LOAD_KEYSTORE_NULL_PASSWORD = Loading the keystore. {0}, failed because the password is not set.
+TRUST_STORE_NOT_SET = The location of the trust store has not been set via a system parameter or through configuration so the default value of {0} will be used.
+TRUST_STORE_SET = The trust store location has been set in configuration to {0}.
+TRUST_STORE_SYSTEM_PROPERTY_SET = The trust store location has been via a system property to {0}.
+TRUST_STORE_TYPE_NOT_SET = The trust store type has not been set in configuration so the default value of {0} will be used.
+TRUST_STORE_TYPE_SET = The trust store type has been set in configuration to {0}.
+FAILED_TO_LOAD_TRUST_STORE = Loading the truststore, {0}, failed with the following problem: {1}.
+LOADED_TRUST_STORE = Successfully loaded trust store, {0}.
+KEY_STORE_PASSWORD_NOT_SET = The key store password has not been set via a system property or through configuration, reading data from the keystore will fail.
+KEY_STORE_PASSWORD_SET = The key store password was found to be set in configuration and will be used.
+KEY_STORE_PASSWORD_SYSTEM_PROPERTY_SET = The key store password was found to be set as a system property and will be used.
+KEY_PASSWORD_NOT_SET = The key password has not been set via a system property or through configuration, reading data from the keystore will fail.
+KEY_PASSWORD_SET = The key password was found to be set in configuration and will be used.
+KEY_PASSWORD_SYSTEM_PROPERTY_SET = The key  password was found to be set as a system property and will be used.
+SECURE_SOCKET_PROTOCOL_NOT_SET = The secure socket protocol is not set so using default value TLSv1.
+SECURE_SOCKET_PROTOCOL_SET = The secure socket protocol has been set to {0}.
+REQUIRE_CLIENT_AUTHENTICATION_NOT_SET = Require client authentication has not been set explicitly in configuration so defaulting to false.
+REQUIRE_CLIENT_AUTHENTICATION_SET = Require client authentication is set to {0}.
+WANT_CLIENT_AUTHENTICATION_NOT_SET = Want client authentication has not been set explicitly in configuration so defaulting to false.
+WANT_CLIENT_AUTHENTICATION_SET = Want client authentication is set to {0}.
+KEY_PASSWORD_NOT_SAME_KEYSTORE_PASSWORD = The value specified for the keystore password is different to the key password. Currently limitations in JSSE requires that they should be the same. The keystore password value will be used only.
+CIPHERSUITES_SET = The cipher suites have been set to {0}.  
+CIPHERSUITES_NOT_SET = The cipher suites have not been configured, falling back to cipher suite filters.
+CIPHERSUITE_FILTERS_NOT_SET = The cipher suite filters have not been configured, falling back to default filters.
+CIPHERSUITE_FILTER = Ciphersuite filter: 
+CIPHERSUITE_INCLUDED = The {0} cipher suite is included by the filter.
+CIPHERSUITE_EXCLUDED = The {0} cipher suite is excluded by the filter.
+CIPHERSUITE_INCLUDE_FILTER = Ciphersuite include filter: {0}
+CIPHERSUITE_EXCLUDE_FILTER = Ciphersuite exclude filter: {0}
+CIPHERSUITES_FILTERED = The enabled cipher suites have been filtered down to {0}.
+CIPHERSUITES_EXCLUDED = The excluded cipher suites have been filtered down to {0}.  
+SUCCESS_INVOKING_SECURITY_CONFIGURER = The custom security configurer {0} configure method was called successfully.
+ERROR_INVOKING_SECURITY_CONFIGURER = Failure invoking on custom security configurer {0}, exception reported is {1}.
+KEY_STORE_ALGORITHM_NOT_SET = The keystore key manager factory algorithm has not been set in configuration so the default value {0} will be used.
+KEY_STORE_ALGORITHM_SET = The keystore key manager factory algorithm has been set in configuration to {0}.
+TRUST_STORE_ALGORITHM_NOT_SET = The truststore key manager factory algorithm has not been set in configuration so the default value {0} will be used.
+TRUST_STORE_ALGORITHM_SET = The trust store key manager factory algorithm has been set in configuration to {0}.
+COULD_NOT_CREATE_OUTBOUND_REQUEST_SOCKET = Failed to create a connection to host {0} and port {1}, error reported is {2}. 
+PROBLEM_CREATING_OUTBOUND_REQUEST_SOCKET = Failed to create a connection to host {0} and port {1}.
+UNOFFICIAL_SECURITY_CONFIGURER = Use of the security configurer is supported for version 1.0 of Celtix but the API is subject to change in later versions.

http://git-wip-us.apache.org/repos/asf/cxf/blob/e61a83d4/rt/transports/http-undertow/src/main/java/org/apache/cxf/transport/http_undertow/NotFoundHandler.java
----------------------------------------------------------------------
diff --git a/rt/transports/http-undertow/src/main/java/org/apache/cxf/transport/http_undertow/NotFoundHandler.java b/rt/transports/http-undertow/src/main/java/org/apache/cxf/transport/http_undertow/NotFoundHandler.java
new file mode 100644
index 0000000..72a1cb2
--- /dev/null
+++ b/rt/transports/http-undertow/src/main/java/org/apache/cxf/transport/http_undertow/NotFoundHandler.java
@@ -0,0 +1,35 @@
+/**
+ * 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_undertow;
+
+import io.undertow.server.HttpHandler;
+import io.undertow.server.HttpServerExchange;
+import io.undertow.util.Headers;
+
+public class NotFoundHandler implements HttpHandler {
+    
+    @Override
+    public void handleRequest(HttpServerExchange exchange) throws Exception {
+        exchange.setResponseCode(404);
+        exchange.getResponseHeaders().put(Headers.CONTENT_TYPE, "text/plain");
+        exchange.getResponseSender().send("Problem accessing " + exchange.getRequestPath());
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/cxf/blob/e61a83d4/rt/transports/http-undertow/src/main/java/org/apache/cxf/transport/http_undertow/ServerEngine.java
----------------------------------------------------------------------
diff --git a/rt/transports/http-undertow/src/main/java/org/apache/cxf/transport/http_undertow/ServerEngine.java b/rt/transports/http-undertow/src/main/java/org/apache/cxf/transport/http_undertow/ServerEngine.java
new file mode 100644
index 0000000..ce6a6d5
--- /dev/null
+++ b/rt/transports/http-undertow/src/main/java/org/apache/cxf/transport/http_undertow/ServerEngine.java
@@ -0,0 +1,44 @@
+/**
+ * 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_undertow;
+
+import java.net.URL;
+
+
+public interface ServerEngine {
+    
+    void addServant(URL url, UndertowHTTPHandler handler);
+
+    /**
+     * Remove a previously registered servant.
+     *
+     * @param url the URL the servant was registered against.
+     */
+    void removeServant(URL url);
+
+    /**
+     * Get a previously  registered servant.
+     *
+     * @param url the associated URL
+     * @return the HttpHandler if registered
+     */
+    UndertowHTTPHandler getServant(URL url);
+
+}

http://git-wip-us.apache.org/repos/asf/cxf/blob/e61a83d4/rt/transports/http-undertow/src/main/java/org/apache/cxf/transport/http_undertow/SimpleErrorPageHandler.java.bak
----------------------------------------------------------------------
diff --git a/rt/transports/http-undertow/src/main/java/org/apache/cxf/transport/http_undertow/SimpleErrorPageHandler.java.bak b/rt/transports/http-undertow/src/main/java/org/apache/cxf/transport/http_undertow/SimpleErrorPageHandler.java.bak
new file mode 100644
index 0000000..e6936f1
--- /dev/null
+++ b/rt/transports/http-undertow/src/main/java/org/apache/cxf/transport/http_undertow/SimpleErrorPageHandler.java.bak
@@ -0,0 +1,51 @@
+/**
+ * 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_undertow;
+
+import io.undertow.io.Sender;
+import io.undertow.server.HttpHandler;
+import io.undertow.server.HttpServerExchange;
+import io.undertow.util.Headers;
+
+
+public class SimpleErrorPageHandler implements HttpHandler {
+
+    private final HttpHandler next;
+
+    public SimpleErrorPageHandler(final HttpHandler next) {
+        this.next = next;
+    }
+
+    @Override
+    public void handleRequest(final HttpServerExchange exchange) throws Exception {
+        try {
+            next.handleRequest(exchange);
+        } catch (Throwable t) {
+            if(exchange.isResponseChannelAvailable()) {
+                if (exchange.getResponseCode() == 500) {
+                    final String errorPage = "<html><head><title>Error</title></head><body>Internal Error 500</body></html>";
+                    exchange.getResponseHeaders().put(Headers.CONTENT_LENGTH, "" + errorPage.length());
+                    exchange.getResponseHeaders().put(Headers.CONTENT_TYPE, "text/html");
+                    Sender sender = exchange.getResponseSender();
+                    sender.send(errorPage);
+                }
+            }
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/cxf/blob/e61a83d4/rt/transports/http-undertow/src/main/java/org/apache/cxf/transport/http_undertow/ThreadingParameters.java
----------------------------------------------------------------------
diff --git a/rt/transports/http-undertow/src/main/java/org/apache/cxf/transport/http_undertow/ThreadingParameters.java b/rt/transports/http-undertow/src/main/java/org/apache/cxf/transport/http_undertow/ThreadingParameters.java
new file mode 100644
index 0000000..60d6fef
--- /dev/null
+++ b/rt/transports/http-undertow/src/main/java/org/apache/cxf/transport/http_undertow/ThreadingParameters.java
@@ -0,0 +1,84 @@
+/**
+ * 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_undertow;
+
+public class ThreadingParameters {
+    /**
+     * Specify the number of I/O threads to create for the worker.  If not specified, a default will be chosen.
+     * One IO thread per CPU core is a reasonable default.
+     */
+    private int workerIOThreads;
+    
+    /**
+     * Specify the number of "core" threads for the worker task thread pool.
+     * Generally this should be reasonably high, at least 10 per CPU core.
+     */
+    private int minThreads;
+    
+    /**
+     * Specify the maximum number of threads for the worker task thread pool.
+     */
+    private int maxThreads;
+    private boolean workerIOThreadsSet;
+    private boolean minThreadsSet;
+    private boolean maxThreadsSet;
+    
+    public void setWorkerIOThreads(int number) {
+        workerIOThreadsSet = true;
+        workerIOThreads = number;
+    }
+    
+    public void setMinThreads(int number) {
+        minThreadsSet = true;
+        minThreads = number;
+    }
+
+    public void setMaxThreads(int number) {
+        maxThreadsSet = true;
+        maxThreads = number;
+    }
+    
+    public int getWorkerIOThreads() {
+        return workerIOThreads;
+    }
+    
+    public int getMinThreads() {
+        return minThreads;
+    }
+
+    public int getMaxThreads() {
+        return maxThreads;
+    }
+
+    public boolean isWorkerIOThreadsSet() {
+        return workerIOThreadsSet;
+    }
+
+    
+    public boolean isMinThreadsSet() {
+        return minThreadsSet;
+    }
+
+    
+    public boolean isMaxThreadsSet() {
+        return maxThreadsSet;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/cxf/blob/e61a83d4/rt/transports/http-undertow/src/main/java/org/apache/cxf/transport/http_undertow/UndertowDestinationFactory.java
----------------------------------------------------------------------
diff --git a/rt/transports/http-undertow/src/main/java/org/apache/cxf/transport/http_undertow/UndertowDestinationFactory.java b/rt/transports/http-undertow/src/main/java/org/apache/cxf/transport/http_undertow/UndertowDestinationFactory.java
new file mode 100644
index 0000000..a67d6ae
--- /dev/null
+++ b/rt/transports/http-undertow/src/main/java/org/apache/cxf/transport/http_undertow/UndertowDestinationFactory.java
@@ -0,0 +1,42 @@
+/**
+ * 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_undertow;
+
+import java.io.IOException;
+
+import org.apache.cxf.Bus;
+import org.apache.cxf.common.injection.NoJSR250Annotations;
+import org.apache.cxf.service.model.EndpointInfo;
+import org.apache.cxf.transport.http.AbstractHTTPDestination;
+import org.apache.cxf.transport.http.DestinationRegistry;
+import org.apache.cxf.transport.http.HttpDestinationFactory;
+
+
+@NoJSR250Annotations()
+public class UndertowDestinationFactory implements HttpDestinationFactory {
+
+    public AbstractHTTPDestination createDestination(EndpointInfo endpointInfo, Bus bus,
+                                                     DestinationRegistry registry) throws IOException {
+        UndertowHTTPServerEngineFactory serverEngineFactory = bus
+            .getExtension(UndertowHTTPServerEngineFactory.class);
+        return new UndertowHTTPDestination(bus, registry, endpointInfo, serverEngineFactory);
+    }
+
+}
+

http://git-wip-us.apache.org/repos/asf/cxf/blob/e61a83d4/rt/transports/http-undertow/src/main/java/org/apache/cxf/transport/http_undertow/UndertowHTTPDestination.java
----------------------------------------------------------------------
diff --git a/rt/transports/http-undertow/src/main/java/org/apache/cxf/transport/http_undertow/UndertowHTTPDestination.java b/rt/transports/http-undertow/src/main/java/org/apache/cxf/transport/http_undertow/UndertowHTTPDestination.java
new file mode 100644
index 0000000..7b6ae3e
--- /dev/null
+++ b/rt/transports/http-undertow/src/main/java/org/apache/cxf/transport/http_undertow/UndertowHTTPDestination.java
@@ -0,0 +1,250 @@
+/**
+ * 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_undertow;
+
+import java.io.IOException;
+import java.io.OutputStream;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.security.GeneralSecurityException;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import javax.servlet.ServletContext;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.cxf.Bus;
+import org.apache.cxf.BusFactory;
+import org.apache.cxf.common.classloader.ClassLoaderUtils;
+import org.apache.cxf.common.classloader.ClassLoaderUtils.ClassLoaderHolder;
+import org.apache.cxf.common.logging.LogUtils;
+import org.apache.cxf.message.Message;
+import org.apache.cxf.service.model.EndpointInfo;
+
+import org.apache.cxf.transport.http.DestinationRegistry;
+import org.apache.cxf.transport.servlet.ServletDestination;
+import org.apache.cxf.transports.http.configuration.HTTPServerPolicy;
+
+
+
+public class UndertowHTTPDestination extends ServletDestination {
+    
+    private static final Logger LOG =
+        LogUtils.getL7dLogger(UndertowHTTPDestination.class);
+    
+    protected UndertowHTTPServerEngine engine;
+    protected UndertowHTTPServerEngineFactory serverEngineFactory;
+    protected URL nurl;
+    protected ClassLoader loader;
+    protected ServletContext servletContext;
+    /**
+     * This variable signifies that finalizeConfig() has been called.
+     * It gets called after this object has been spring configured.
+     * It is used to automatically reinitialize things when resources
+     * are reset.
+     */
+    private boolean configFinalized;
+
+    /**
+     * Constructor
+     *
+     * @param bus  the associated Bus
+     * @param registry the associated destinationRegistry
+     * @param ei the endpoint info of the destination
+     * @param serverEngineFactory the serverEngineFactory which could be used to create ServerEngine
+     * @throws java.io.IOException
+     */
+    public UndertowHTTPDestination(Bus bus, 
+                                   DestinationRegistry registry, 
+                                   EndpointInfo ei, 
+                                   UndertowHTTPServerEngineFactory serverEngineFactory)
+        throws IOException {
+        //Add the default port if the address is missing it
+        super(bus, registry, ei, getAddressValue(ei, true).getAddress(), true);
+        this.serverEngineFactory = serverEngineFactory;
+        if (serverEngineFactory != null) {
+            nurl = new URL(getAddress(endpointInfo));
+        }
+        loader = bus.getExtension(ClassLoader.class);
+    }
+    
+    @Override
+    protected Logger getLogger() {
+        return LOG;
+    }
+    
+    
+    
+    /**
+     * Post-configure retreival of server engine.
+     */
+    protected void retrieveEngine()
+        throws GeneralSecurityException, 
+               IOException {
+        if (serverEngineFactory == null) {
+            return;
+        }
+        engine = 
+            serverEngineFactory.retrieveUndertowHTTPServerEngine(nurl.getPort());
+        if (engine == null) {
+            engine = serverEngineFactory.
+                createUndertowHTTPServerEngine(nurl.getHost(), nurl.getPort(), nurl.getProtocol());
+        }
+
+        // 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 + "\"");
+        }
+    }
+    
+    /**
+     * This method is used to finalize the configuration
+     * after the configuration items have been set.
+     *
+     */
+    public void finalizeConfig() {
+        assert !configFinalized;
+        
+        try {
+            retrieveEngine();
+        } catch (Exception e) {
+            throw new RuntimeException(e.getMessage(), e);
+        }
+        configFinalized = true;
+    }
+    
+    /**
+     * Activate receipt of incoming messages.
+     */
+    protected void activate() {
+        super.activate();
+        LOG.log(Level.FINE, "Activating receipt of incoming messages");
+                
+        if (engine != null) {
+            UndertowHTTPHandler jhd = createUndertowHTTPHandler(this, contextMatchOnExact());
+            engine.addServant(nurl, jhd);
+        }
+    }
+
+    protected UndertowHTTPHandler createUndertowHTTPHandler(UndertowHTTPDestination jhd,
+                                                    boolean cmExact) {
+        return new UndertowHTTPHandler(jhd, cmExact);
+    }
+
+    /**
+     * Deactivate receipt of incoming messages.
+     */
+    protected void deactivate() {
+        super.deactivate();
+        LOG.log(Level.FINE, "Deactivating receipt of incoming messages");
+        if (engine != null) {
+            engine.removeServant(nurl);
+        }
+    }   
+     
+
+    
+    protected String getBasePathForFullAddress(String addr) {
+        try {
+            return new URL(addr).getPath();
+        } catch (MalformedURLException e) {
+            return null;
+        }
+    }
+    
+     
+    protected void doService(HttpServletRequest req,
+                             HttpServletResponse resp) throws IOException {
+        doService(servletContext, req, resp);
+    }
+        
+    protected void doService(ServletContext context,
+                             HttpServletRequest req,
+                             HttpServletResponse resp) throws IOException {
+        if (context == null) {
+            context = servletContext;
+        }
+        HTTPServerPolicy sp = getServer();
+        if (sp.isSetRedirectURL()) {
+            resp.sendRedirect(sp.getRedirectURL());
+            resp.flushBuffer();
+            return;
+        }
+
+        ClassLoaderHolder origLoader = null;
+        Bus origBus = BusFactory.getAndSetThreadDefaultBus(bus);
+        try {
+            if (loader != null) {
+                origLoader = ClassLoaderUtils.setThreadContextClassloader(loader);
+            }
+            invoke(null, context, req, resp);
+        } finally {
+            if (origBus != bus) {
+                BusFactory.setThreadDefaultBus(origBus);
+            }
+            if (origLoader != null) { 
+                origLoader.reset();
+            }
+        }    
+    }
+    
+    protected void invokeComplete(final ServletContext context, 
+                                  final HttpServletRequest req, 
+                                  final HttpServletResponse resp,
+                                  Message m) throws IOException {
+        resp.flushBuffer();
+        super.invokeComplete(context, req, resp, m);
+    }
+    
+    public void setServletContext(ServletContext sc) {
+        servletContext = sc;
+    }
+    
+    protected Message retrieveFromContinuation(HttpServletRequest req) {
+        return (Message)req.getAttribute(CXF_CONTINUATION_MESSAGE);
+    }
+    
+    protected void setupContinuation(Message inMessage, final HttpServletRequest req,
+                                     final HttpServletResponse resp) {
+        if (engine != null && engine.getContinuationsEnabled()) {
+            super.setupContinuation(inMessage, req, resp);
+        }
+    }
+        
+    protected OutputStream flushHeaders(Message outMessage, boolean getStream) throws IOException {
+        return super.flushHeaders(outMessage, getStream);
+    }
+    
+      
+    protected String getAddress(EndpointInfo endpointInfo) {
+        return endpointInfo.getAddress();
+    }
+    
+    public ServerEngine getEngine() {
+        return engine;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/cxf/blob/e61a83d4/rt/transports/http-undertow/src/main/java/org/apache/cxf/transport/http_undertow/UndertowHTTPHandler.java
----------------------------------------------------------------------
diff --git a/rt/transports/http-undertow/src/main/java/org/apache/cxf/transport/http_undertow/UndertowHTTPHandler.java b/rt/transports/http-undertow/src/main/java/org/apache/cxf/transport/http_undertow/UndertowHTTPHandler.java
new file mode 100644
index 0000000..303bf14
--- /dev/null
+++ b/rt/transports/http-undertow/src/main/java/org/apache/cxf/transport/http_undertow/UndertowHTTPHandler.java
@@ -0,0 +1,131 @@
+/**
+ * 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_undertow;
+
+
+import javax.servlet.ServletContext;
+
+import org.apache.cxf.Bus;
+
+import io.undertow.io.Sender;
+import io.undertow.server.HttpHandler;
+import io.undertow.server.HttpServerExchange;
+import io.undertow.server.SSLSessionInfo;
+import io.undertow.servlet.handlers.ServletRequestContext;
+import io.undertow.servlet.spec.HttpServletRequestImpl;
+import io.undertow.servlet.spec.HttpServletResponseImpl;
+import io.undertow.servlet.spec.ServletContextImpl;
+import io.undertow.util.Headers;
+
+
+
+public class UndertowHTTPHandler implements HttpHandler {
+    
+    private static final String SSL_CIPHER_SUITE_ATTRIBUTE = "javax.servlet.request.cipher_suite";
+    private static final String SSL_PEER_CERT_CHAIN_ATTRIBUTE = "javax.servlet.request.X509Certificate";
+
+    protected UndertowHTTPDestination undertowHTTPDestination;
+    protected ServletContext servletContext;
+    private boolean contextMatchExact;
+    private String urlName;
+    private Bus bus;
+        
+    public UndertowHTTPHandler(UndertowHTTPDestination uhd, boolean cmt) {
+        undertowHTTPDestination = uhd;
+        this.contextMatchExact = cmt;
+    }
+    public UndertowHTTPHandler(Bus bus) {
+        this.bus = bus;
+    }
+    
+    public boolean isContextMatchExact() {
+        return this.contextMatchExact;
+    }
+    
+    public void setServletContext(ServletContext sc) {
+        servletContext = sc;
+        if (undertowHTTPDestination != null) {
+            undertowHTTPDestination.setServletContext(sc);
+        }
+    }
+
+    public void setName(String name) {
+        urlName = name;
+    }
+
+    public String getName() {
+        return urlName;
+    }
+
+   
+    public Bus getBus() {
+        return undertowHTTPDestination != null ? undertowHTTPDestination.getBus() : bus;
+    }
+
+    @Override
+    public void handleRequest(HttpServerExchange undertowExchange) throws Exception {
+        try {
+            // perform blocking operation on exchange
+            if (undertowExchange.isInIoThread()) {
+                undertowExchange.dispatch(this);
+                return;
+            }
+            HttpServletResponseImpl response = new HttpServletResponseImpl(undertowExchange,
+                                                                           (ServletContextImpl)servletContext);
+            HttpServletRequestImpl request = new HttpServletRequestImpl(undertowExchange,
+                                                                        (ServletContextImpl)servletContext);
+
+            ServletRequestContext servletRequestContext = new ServletRequestContext(((ServletContextImpl)servletContext)
+                .getDeployment(), request, response, null);
+            
+             
+            undertowExchange.putAttachment(ServletRequestContext.ATTACHMENT_KEY, servletRequestContext);
+            request.setAttribute("HTTP_HANDLER", this);
+            request.setAttribute("UNDERTOW_DESTINATION", undertowHTTPDestination);
+            SSLSessionInfo ssl = undertowExchange.getConnection().getSslSessionInfo();
+            if (ssl != null) {
+                request.setAttribute(SSL_CIPHER_SUITE_ATTRIBUTE, ssl.getCipherSuite());
+                try {
+                    request.setAttribute(SSL_PEER_CERT_CHAIN_ATTRIBUTE, ssl.getPeerCertificates());
+                } catch (Exception e) {
+                    // for some case won't have the peer certification
+                    // do nothing
+                }
+            }
+            undertowHTTPDestination.doService(servletContext, request, response);
+            
+        } catch (Throwable t) {
+            t.printStackTrace();
+            if (undertowExchange.isResponseChannelAvailable()) {
+                undertowExchange.setResponseCode(500);
+                final String errorPage = "<html><head><title>Error</title>"
+                    + "</head><body>Internal Error 500" + t.getMessage()
+                    + "</body></html>";
+                undertowExchange.getResponseHeaders().put(Headers.CONTENT_LENGTH,
+                                                          "" + errorPage.length());
+                undertowExchange.getResponseHeaders().put(Headers.CONTENT_TYPE, "text/html");
+                Sender sender = undertowExchange.getResponseSender();
+                sender.send(errorPage);
+            }
+        }
+    }
+    
+    
+}

http://git-wip-us.apache.org/repos/asf/cxf/blob/e61a83d4/rt/transports/http-undertow/src/main/java/org/apache/cxf/transport/http_undertow/UndertowHTTPServerEngine.java
----------------------------------------------------------------------
diff --git a/rt/transports/http-undertow/src/main/java/org/apache/cxf/transport/http_undertow/UndertowHTTPServerEngine.java b/rt/transports/http-undertow/src/main/java/org/apache/cxf/transport/http_undertow/UndertowHTTPServerEngine.java
new file mode 100644
index 0000000..b6c772d
--- /dev/null
+++ b/rt/transports/http-undertow/src/main/java/org/apache/cxf/transport/http_undertow/UndertowHTTPServerEngine.java
@@ -0,0 +1,541 @@
+/**
+ * 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_undertow;
+
+
+import java.io.IOException;
+import java.net.URL;
+import java.security.GeneralSecurityException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.concurrent.ConcurrentMap;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import javax.net.ssl.KeyManager;
+import javax.net.ssl.SSLContext;
+import javax.net.ssl.X509KeyManager;
+import javax.servlet.ServletContext;
+import javax.servlet.ServletException;
+
+import org.apache.cxf.Bus;
+import org.apache.cxf.common.i18n.Message;
+import org.apache.cxf.common.logging.LogUtils;
+import org.apache.cxf.common.util.PropertyUtils;
+import org.apache.cxf.common.util.SystemPropertyAction;
+import org.apache.cxf.configuration.jsse.TLSServerParameters;
+import org.apache.cxf.interceptor.Fault;
+import org.apache.cxf.transport.HttpUriMapper;
+import org.apache.cxf.transport.https.AliasedX509ExtendedKeyManager;
+import org.xnio.Options;
+import org.xnio.Sequence;
+import org.xnio.SslClientAuthMode;
+
+import io.undertow.Handlers;
+import io.undertow.Undertow;
+import io.undertow.Undertow.Builder;
+import io.undertow.UndertowOptions;
+import io.undertow.server.HttpHandler;
+import io.undertow.server.handlers.PathHandler;
+import io.undertow.servlet.api.DeploymentInfo;
+import io.undertow.servlet.api.DeploymentManager;
+import io.undertow.servlet.api.ServletContainer;
+import io.undertow.servlet.api.ServletInfo;
+import io.undertow.servlet.core.ServletContainerImpl;
+import io.undertow.servlet.handlers.ServletPathMatches;
+import io.undertow.util.CopyOnWriteMap;
+
+
+public class UndertowHTTPServerEngine implements ServerEngine {
+    
+    public static final String DO_NOT_CHECK_URL_PROP = "org.apache.cxf.transports.http_undertow.DontCheckUrl";
+    
+    private static final Logger LOG = LogUtils.getL7dLogger(UndertowHTTPServerEngine.class);
+    
+    /**
+     * This is the network port for which this engine is allocated.
+     */
+    private int port;
+    
+    /**
+     * This is the network address for which this engine is allocated.
+     */
+    private String host;
+
+    /**
+     * This field holds the protocol for which this engine is 
+     * enabled, i.e. "http" or "https".
+     */
+    private String protocol = "http"; 
+    
+    private int servantCount;
+    
+    private Undertow server;
+    
+    /**
+     * This field holds the TLS ServerParameters that are programatically
+     * configured. The tlsServerParamers (due to JAXB) holds the struct
+     * placed by SpringConfig.
+     */
+    private TLSServerParameters tlsServerParameters;
+    
+    private SSLContext sslContext;
+    
+    /**
+     * This boolean signfies that SpringConfig is over. finalizeConfig
+     * has been called.
+     */
+    private boolean configFinalized;
+    
+    private ConcurrentMap<String, UndertowHTTPHandler> registedPaths = 
+        new CopyOnWriteMap<String, UndertowHTTPHandler>();
+
+    private boolean continuationsEnabled = true;
+
+    private ServletContext servletContext;
+    
+    private PathHandler path;
+    
+    private int maxIdleTime = 200000;
+    
+    private org.apache.cxf.transport.http_undertow.ThreadingParameters threadingParameters;
+    
+    private List<CXFUndertowHttpHandler> handlers;
+
+    public UndertowHTTPServerEngine(String host, int port) {
+        this.host = host;
+        this.port = port;
+    }
+
+    public UndertowHTTPServerEngine() {
+
+    }
+
+    @Override
+    public void addServant(URL url, UndertowHTTPHandler handler) {
+        if (shouldCheckUrl(handler.getBus())) {
+            checkRegistedContext(url);
+        }
+                
+        if (server == null) {
+            try {
+                // create a new undertow server instance if there is no server there
+                String contextName = HttpUriMapper.getContextName(url.getPath());
+                servletContext = buildServletContext(contextName);
+                handler.setServletContext(servletContext);
+                server = createServer(url, handler);
+                server.start();
+            } catch (Exception e) {
+                LOG.log(Level.SEVERE, "START_UP_SERVER_FAILED_MSG", new Object[] {e.getMessage(), port});
+                //problem starting server
+                try {                    
+                    server.stop();
+                } catch (Exception ex) {
+                    //ignore - probably wasn't fully started anyway
+                }
+                server = null;
+                throw new Fault(new Message("START_UP_SERVER_FAILED_MSG", LOG, e.getMessage(), port), e);
+            }
+            
+        } else {
+            String contextName = HttpUriMapper.getContextName(url.getPath());
+            try {
+                servletContext = buildServletContext(contextName);
+            } catch (ServletException e) {
+                throw new Fault(new Message("START_UP_SERVER_FAILED_MSG", LOG, e.getMessage(), port), e);
+            }
+            handler.setServletContext(servletContext);
+            
+            if (handler.isContextMatchExact()) {
+                path.addExactPath(url.getPath(), handler);
+            } else {
+                path.addPrefixPath(url.getPath(), handler);
+            }
+            
+        }
+        
+        final String smap = HttpUriMapper.getResourceBase(url.getPath());
+        handler.setName(smap);
+        registedPaths.put(url.getPath(), handler);
+        servantCount = servantCount + 1;
+    }
+    
+    
+    private ServletContext buildServletContext(String contextName) 
+        throws ServletException {
+        ServletContainer servletContainer = new ServletContainerImpl();
+        DeploymentInfo deploymentInfo = new DeploymentInfo();
+        deploymentInfo.setClassLoader(Thread.currentThread().getContextClassLoader());
+        deploymentInfo.setDeploymentName("cxf-undertow");
+        deploymentInfo.setContextPath(contextName);
+        ServletInfo asyncServlet = new ServletInfo(ServletPathMatches.DEFAULT_SERVLET_NAME, CxfUndertwoServlet.class);
+        deploymentInfo.addServlet(asyncServlet);
+        servletContainer.addDeployment(deploymentInfo);
+        DeploymentManager deploymentManager = servletContainer.getDeployment(deploymentInfo.getDeploymentName());
+        deploymentManager.deploy();
+        deploymentManager.start();
+        return deploymentManager.getDeployment().getServletContext();
+    }
+    
+    private Undertow createServer(URL url, UndertowHTTPHandler undertowHTTPHandler) throws Exception {
+        Undertow.Builder result = Undertow.builder();
+        result.setServerOption(UndertowOptions.IDLE_TIMEOUT, getMaxIdleTime());
+        if (tlsServerParameters != null) { 
+            if (this.sslContext == null) {
+                this.sslContext = createSSLContext();
+            }
+            result = result.addHttpsListener(getPort(), getHost(), this.sslContext);
+        } else {
+            result = result.addHttpListener(getPort(), getHost());
+        }
+        path = Handlers.path(new NotFoundHandler());
+        
+        if (url.getPath().length() == 0) {
+            result = result.setHandler(Handlers.trace(undertowHTTPHandler));
+        } else {
+            if (undertowHTTPHandler.isContextMatchExact()) {
+                path.addExactPath(url.getPath(), undertowHTTPHandler);
+            } else {
+                path.addPrefixPath(url.getPath(), undertowHTTPHandler);
+            }
+            
+            result = result.setHandler(wrapHandler(path));
+        }
+        
+        result = decorateUndertowSocketConnection(result);
+        result = disableSSLv3(result);
+        result = configureThreads(result);
+        return result.build();
+    }
+    
+    private Builder configureThreads(Builder builder) {
+        if (this.threadingParameters != null) {
+            if (this.threadingParameters.isWorkerIOThreadsSet()) {
+                builder = builder.setWorkerOption(Options.WORKER_IO_THREADS, 
+                              this.threadingParameters.getWorkerIOThreads());
+            }
+            if (this.threadingParameters.isMinThreadsSet()) {
+                builder = builder.setWorkerOption(Options.WORKER_TASK_CORE_THREADS, 
+                              this.threadingParameters.getMinThreads());
+            }
+            if (this.threadingParameters.isMaxThreadsSet()) {
+                builder = builder.setWorkerOption(Options.WORKER_TASK_MAX_THREADS, 
+                              this.threadingParameters.getMaxThreads());
+            }
+        }
+        return builder;
+    }
+
+    private HttpHandler wrapHandler(HttpHandler handler) {
+        HttpHandler nextHandler = handler;
+        for (CXFUndertowHttpHandler h : getHandlers()) {
+            h.setNext(nextHandler);
+            nextHandler = h;
+        }
+        return nextHandler;
+    }
+    
+    private Builder disableSSLv3(Builder result) {
+        //SSLv3 isn't safe, disable it by default unless explicitly use it
+        if (tlsServerParameters != null 
+            && ("SSLv3".equals(tlsServerParameters.getSecureSocketProtocol())
+                || !tlsServerParameters.getIncludeProtocols().isEmpty())) {
+            List<String> protocols = new LinkedList<String>(Arrays.asList("TLSv1", "TLSv1.1", "TLSv1.2", "SSLv3"));
+            for (String excludedProtocol : tlsServerParameters.getExcludeProtocols()) {
+                if (protocols.contains(excludedProtocol)) {
+                    protocols.remove(excludedProtocol);
+                }
+            }
+            Sequence<String> supportProtocols = Sequence.of(protocols);
+            return result.setSocketOption(Options.SSL_ENABLED_PROTOCOLS, supportProtocols);
+        } else {
+            Sequence<String> supportProtocols = Sequence.of("TLSv1", "TLSv1.1", "TLSv1.2");
+            return result.setSocketOption(Options.SSL_ENABLED_PROTOCOLS, supportProtocols);
+        }
+    }
+   
+
+    public Undertow.Builder decorateUndertowSocketConnection(Undertow.Builder builder) {
+        if (this.tlsServerParameters != null && this.tlsServerParameters.getClientAuthentication() != null 
+            && this.tlsServerParameters.getClientAuthentication().isRequired()) {
+            builder = builder.setSocketOption(Options.SSL_CLIENT_AUTH_MODE, SslClientAuthMode.REQUIRED);
+        }
+        if (this.tlsServerParameters != null && this.tlsServerParameters.getClientAuthentication() != null 
+            && this.tlsServerParameters.getClientAuthentication().isWant()) {
+            builder = builder.setSocketOption(Options.SSL_CLIENT_AUTH_MODE, SslClientAuthMode.REQUESTED);
+        }
+        return builder;
+    }
+
+    private boolean shouldCheckUrl(Bus bus) {
+        
+        Object prop = null;
+        if (bus != null) {
+            prop = bus.getProperty(DO_NOT_CHECK_URL_PROP);
+        }
+        if (prop == null) {
+            prop = SystemPropertyAction.getPropertyOrNull(DO_NOT_CHECK_URL_PROP);
+        }
+        return !PropertyUtils.isTrue(prop);
+    }
+    
+    protected void checkRegistedContext(URL url) {
+        
+        String urlPath = url.getPath();
+        for (String registedPath : registedPaths.keySet()) {
+            if (urlPath.equals(registedPath)) {
+                throw new Fault(new Message("ADD_HANDLER_CONTEXT_IS_USED_MSG", LOG, url, registedPath));
+            }
+            // There are some context path conflicts which could cause the UndertowHTTPServerEngine 
+            // doesn't route the message to the right UndertowHTTPHandler
+            if (urlPath.equals(HttpUriMapper.getContextName(registedPath))) {
+                throw new Fault(new Message("ADD_HANDLER_CONTEXT_IS_USED_MSG", LOG, url, registedPath));
+            }
+            if (registedPath.equals(HttpUriMapper.getContextName(urlPath))) {
+                throw new Fault(new Message("ADD_HANDLER_CONTEXT_CONFILICT_MSG", LOG, url, registedPath));
+            }
+        }
+        
+    }
+
+    @Override
+    public void removeServant(URL url) {
+        UndertowHTTPHandler handler = registedPaths.remove(url.getPath());
+        if (handler == null) {
+            return;
+        }       
+        --servantCount;
+        if (url.getPath().isEmpty()) {
+            return;
+        }
+        if (handler.isContextMatchExact()) {
+            path.removeExactPath(url.getPath());
+        } else {
+            path.removePrefixPath(url.getPath());
+        }
+    }
+
+    @Override
+    public UndertowHTTPHandler getServant(URL url) {
+        return registedPaths.get(url.getPath());
+    }
+
+    /**
+     * Returns the protocol "http" or "https" for which this engine
+     * was configured.
+     */
+    public String getProtocol() {
+        return protocol;
+    }
+    
+    /**
+     * Returns the port number for which this server engine was configured.
+     * @return
+     */
+    public int getPort() {
+        return port;
+    }
+    
+    /**
+     * Returns the host for which this server engine was configured.
+     * @return
+     */
+    public String getHost() {
+        return host;
+    }
+    
+    public void setPort(int p) {
+        port = p;
+    }
+
+    public void setHost(String host) {
+        this.host = host;
+    }
+
+    public void finalizeConfig() throws GeneralSecurityException,
+        IOException {
+        retrieveListenerFactory();
+        this.configFinalized = true;
+    }
+
+    /**
+     * This method is used to programmatically set the TLSServerParameters.
+     * This method may only be called by the factory.
+     * @throws IOException 
+     */
+    public void setTlsServerParameters(TLSServerParameters params) {
+        
+        tlsServerParameters = params;
+        if (this.configFinalized) {
+            this.retrieveListenerFactory();
+        }
+    }
+    
+    private void retrieveListenerFactory() {
+        if (tlsServerParameters != null) {
+            protocol = "https";
+            
+        } else {
+            protocol = "http";
+        }
+        LOG.fine("Configured port " + port + " for \"" + protocol + "\".");
+    }
+
+    
+    /**
+     * This method returns the programmatically set TLSServerParameters, not
+     * the TLSServerParametersType, which is the JAXB generated type used 
+     * in SpringConfiguration.
+     * @return
+     */
+    public TLSServerParameters getTlsServerParameters() {
+        return tlsServerParameters;
+    } 
+
+        
+    public void stop() {
+        if (this.server != null) {
+            this.server.stop();
+        }
+    }
+
+    /**
+     * This method will shut down the server engine and
+     * remove it from the factory's cache. 
+     */
+    public void shutdown() {
+        registedPaths.clear();
+        if (shouldDestroyPort()) {
+            if (servantCount == 0) {
+                UndertowHTTPServerEngineFactory.destroyForPort(port);
+            } else {
+                LOG.log(Level.WARNING, "FAILED_TO_SHUTDOWN_ENGINE_MSG", port);
+            }
+        }
+    }
+    
+    private boolean shouldDestroyPort() {
+        //if we shutdown the port, on SOME OS's/JVM's, if a client
+        //in the same jvm had been talking to it at some point and keep alives
+        //are on, then the port is held open for about 60 seconds
+        //afterwards and if we restart, connections will then 
+        //get sent into the old stuff where there are 
+        //no longer any servant registered.   They pretty much just hang.
+        
+        //this is most often seen in our unit/system tests that 
+        //test things in the same VM.
+        
+        String s = SystemPropertyAction
+                .getPropertyOrNull("org.apache.cxf.transports.http_undertow.DontClosePort." + port);
+        if (s == null) {
+            s = SystemPropertyAction
+                .getPropertyOrNull("org.apache.cxf.transports.http_undertow.DontClosePort");
+        }
+        return !Boolean.valueOf(s);
+    }
+    
+        
+    protected SSLContext createSSLContext() throws Exception  {
+        String proto = tlsServerParameters.getSecureSocketProtocol() == null
+            ? "TLS" : tlsServerParameters.getSecureSocketProtocol();
+                    
+        SSLContext context = tlsServerParameters.getJsseProvider() == null
+            ? SSLContext.getInstance(proto)
+                : SSLContext.getInstance(proto, tlsServerParameters.getJsseProvider());
+            
+        KeyManager keyManagers[] = tlsServerParameters.getKeyManagers();
+        if (tlsServerParameters.getCertAlias() != null) {
+            keyManagers = getKeyManagersWithCertAlias(keyManagers);
+        }
+        context.init(tlsServerParameters.getKeyManagers(), 
+                     tlsServerParameters.getTrustManagers(),
+                     tlsServerParameters.getSecureRandom());
+
+        return context;
+    }
+    
+    protected KeyManager[] getKeyManagersWithCertAlias(KeyManager keyManagers[]) throws Exception {
+        if (tlsServerParameters.getCertAlias() != null) {
+            for (int idx = 0; idx < keyManagers.length; idx++) {
+                if (keyManagers[idx] instanceof X509KeyManager) {
+                    keyManagers[idx] = new AliasedX509ExtendedKeyManager(
+                        tlsServerParameters.getCertAlias(), (X509KeyManager)keyManagers[idx]);
+                }
+            }
+        }
+        return keyManagers;
+    }
+
+    /**
+     * This method sets the threading parameters for this particular 
+     * server engine.
+     * This method may only be called by the factory.
+     */
+    public void setThreadingParameters(ThreadingParameters params) {        
+        threadingParameters = params;
+    }
+    
+    /**
+     * This method returns whether the threading parameters are set.
+     */
+    public boolean isSetThreadingParameters() {
+        return threadingParameters != null;
+    }
+    
+    /**
+     * This method returns the threading parameters that have been set.
+     * This method may return null, if the threading parameters have not
+     * been set.
+     */
+    public ThreadingParameters getThreadingParameters() {
+        return threadingParameters;
+    }
+
+    public void setContinuationsEnabled(boolean enabled) {
+        continuationsEnabled  = enabled;
+    }
+    
+    public boolean getContinuationsEnabled() {
+        return continuationsEnabled;
+    }
+
+    public int getMaxIdleTime() {
+        return maxIdleTime;
+    }
+
+    public void setMaxIdleTime(int maxIdleTime) {
+        this.maxIdleTime = maxIdleTime;
+    }
+    
+        
+    /**
+     * set the Undertow server's handlers
+     * @param h
+     */
+    
+    public void setHandlers(List<CXFUndertowHttpHandler> h) {
+        handlers = h;
+    }
+    
+    public List<CXFUndertowHttpHandler> getHandlers() {
+        return handlers != null ? handlers : new ArrayList<CXFUndertowHttpHandler>();
+    }
+}


[2/6] cxf git commit: [CXF-6800]add http-undertow transport

Posted by ff...@apache.org.
http://git-wip-us.apache.org/repos/asf/cxf/blob/e61a83d4/systests/transport-undertow/src/test/java/org/apache/cxf/systest/http_undertow/StatefulGreeterImpl.java
----------------------------------------------------------------------
diff --git a/systests/transport-undertow/src/test/java/org/apache/cxf/systest/http_undertow/StatefulGreeterImpl.java b/systests/transport-undertow/src/test/java/org/apache/cxf/systest/http_undertow/StatefulGreeterImpl.java
new file mode 100644
index 0000000..97fc7a5
--- /dev/null
+++ b/systests/transport-undertow/src/test/java/org/apache/cxf/systest/http_undertow/StatefulGreeterImpl.java
@@ -0,0 +1,96 @@
+/**
+ * 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.systest.http_undertow;
+
+import java.util.concurrent.Future;
+
+import javax.jws.WebService;
+import javax.xml.ws.AsyncHandler;
+import javax.xml.ws.Response;
+
+
+import org.apache.cxf.greeter_control.Greeter;
+import org.apache.cxf.greeter_control.types.GreetMeResponse;
+import org.apache.cxf.greeter_control.types.PingMeResponse;
+import org.apache.cxf.greeter_control.types.SayHiResponse;
+
+@WebService(serviceName = "GreeterService",
+            portName = "GreeterPort",
+            endpointInterface = "org.apache.cxf.greeter_control.Greeter", 
+            targetNamespace = "http://cxf.apache.org/greeter_control")
+public class StatefulGreeterImpl implements Greeter {
+    String name;
+    
+    // greetMe will use session to return last called name
+    public String greetMe(String me) {
+        name = me;
+        return "Hello " + me;
+    }
+    
+
+    public String sayHi() {
+        return "Bonjour " + name;
+    }
+    
+    public void pingMe() {
+    }
+
+
+    public Future<?> greetMeAsync(String requestType, AsyncHandler<GreetMeResponse> asyncHandler) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+
+    public Response<GreetMeResponse> greetMeAsync(String requestType) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+
+    public void greetMeOneWay(String requestType) {
+        // TODO Auto-generated method stub
+        
+    }
+
+
+    public Future<?> pingMeAsync(AsyncHandler<PingMeResponse> asyncHandler) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+
+    public Response<PingMeResponse> pingMeAsync() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+
+    public Future<?> sayHiAsync(AsyncHandler<SayHiResponse> asyncHandler) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+
+    public Response<SayHiResponse> sayHiAsync() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/cxf/blob/e61a83d4/systests/transport-undertow/src/test/java/org/apache/cxf/systest/http_undertow/ThreadPoolTest.java
----------------------------------------------------------------------
diff --git a/systests/transport-undertow/src/test/java/org/apache/cxf/systest/http_undertow/ThreadPoolTest.java b/systests/transport-undertow/src/test/java/org/apache/cxf/systest/http_undertow/ThreadPoolTest.java
new file mode 100644
index 0000000..e0c7ba1
--- /dev/null
+++ b/systests/transport-undertow/src/test/java/org/apache/cxf/systest/http_undertow/ThreadPoolTest.java
@@ -0,0 +1,112 @@
+/**
+ * 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.systest.http_undertow;
+
+import java.net.URL;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.BindingProvider;
+
+import org.apache.cxf.testutil.common.AbstractClientServerTestBase;
+import org.apache.hello_world_soap_http.Greeter;
+import org.apache.hello_world_soap_http.SOAPService;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * Tests thread pool config.
+ */
+
+public class ThreadPoolTest extends AbstractClientServerTestBase {
+    private static final String ADDRESS = Server.ADDRESS;
+    private static final QName SERVICE_NAME = 
+        new QName("http://apache.org/hello_world_soap_http", "SOAPServiceAddressing");
+
+    private Greeter greeter;
+
+    @BeforeClass
+    public static void startServers() throws Exception {
+        assertTrue("server did not launch correctly", 
+                   launchServer(Server.class, true));
+    }
+
+    @Before
+    public void setUp() throws Exception {
+        URL wsdl = getClass().getResource("/wsdl/hello_world.wsdl");
+        greeter = new SOAPService(wsdl, SERVICE_NAME).getPort(Greeter.class);
+        BindingProvider bp = (BindingProvider)greeter;
+        bp.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
+                                   ADDRESS);
+    }
+    
+    class TestRunnable implements Runnable {
+        int i;
+        long total;
+        
+        TestRunnable(int i) {
+            this.i = i;
+        }
+        public void run() {
+            long start = System.currentTimeMillis();
+            try {
+                greeter.greetMeLater(1600);
+            } catch (Throwable t) {
+                //ignore
+            }
+            long end = System.currentTimeMillis();
+            total = end - start;
+        }
+        public long getTotal() {
+            return total;
+        }
+    }
+
+
+    @Test
+
+    public void testFallbackThreadPoolConfig() throws Exception {
+        //make sure things are running
+        greeter.greetMeLater(1);
+        greeter.greetMeLater(1);
+        TestRunnable r[] = new TestRunnable[5];
+        Thread[] invokers = new Thread[5];
+        for (int i = 0; i < invokers.length; i++) {
+            r[i] = new TestRunnable(i);
+            invokers[i] = new Thread(r[i]);
+            invokers[i].setDaemon(true);
+            invokers[i].start();
+        }
+        
+        int countLess = 0;
+        int countMore = 0;
+        for (int i = 0; i < invokers.length; i++) {
+            invokers[i].join(6 * 1000);
+            if (r[i].getTotal() > 3000) {
+                countMore++;
+            } else {
+                countLess++;
+            }
+        }
+
+        assertTrue(countLess >= 2 && countLess <= 3);
+        assertTrue(countMore >= 2 && countMore <= 3);
+    }
+}

http://git-wip-us.apache.org/repos/asf/cxf/blob/e61a83d4/systests/transport-undertow/src/test/java/org/apache/cxf/systest/http_undertow/UndertowBasicAuthHandler.java
----------------------------------------------------------------------
diff --git a/systests/transport-undertow/src/test/java/org/apache/cxf/systest/http_undertow/UndertowBasicAuthHandler.java b/systests/transport-undertow/src/test/java/org/apache/cxf/systest/http_undertow/UndertowBasicAuthHandler.java
new file mode 100644
index 0000000..eb39c47
--- /dev/null
+++ b/systests/transport-undertow/src/test/java/org/apache/cxf/systest/http_undertow/UndertowBasicAuthHandler.java
@@ -0,0 +1,80 @@
+/**
+ * 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.systest.http_undertow;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.cxf.transport.http_undertow.CXFUndertowHttpHandler;
+
+import io.undertow.security.api.AuthenticationMechanism;
+import io.undertow.security.api.AuthenticationMode;
+import io.undertow.security.handlers.AuthenticationCallHandler;
+import io.undertow.security.handlers.AuthenticationConstraintHandler;
+import io.undertow.security.handlers.AuthenticationMechanismsHandler;
+import io.undertow.security.handlers.SecurityInitialHandler;
+import io.undertow.security.idm.IdentityManager;
+import io.undertow.security.impl.BasicAuthenticationMechanism;
+import io.undertow.server.HttpHandler;
+import io.undertow.server.HttpServerExchange;
+
+public class UndertowBasicAuthHandler implements CXFUndertowHttpHandler {
+    
+    private HttpHandler next;
+    private HttpHandler securityHandler;
+    private IdentityManager identityManager;
+
+    @Override
+    public void handleRequest(HttpServerExchange exchange) throws Exception {
+        if (identityManager == null) {
+            buildIdMgr();
+        }
+        if (securityHandler == null) {
+            buildSecurityHandler();
+        }
+        this.securityHandler.handleRequest(exchange);
+    }
+
+    private void buildSecurityHandler() {
+        HttpHandler handler = this.next;
+        handler = new AuthenticationCallHandler(handler);
+        handler = new AuthenticationConstraintHandler(handler);
+        final List<AuthenticationMechanism> mechanisms 
+            = Collections.<AuthenticationMechanism>singletonList(new BasicAuthenticationMechanism("My Realm"));
+        handler = new AuthenticationMechanismsHandler(handler, mechanisms);
+        this.securityHandler = new SecurityInitialHandler(AuthenticationMode.PRO_ACTIVE, identityManager, handler);
+        
+    }
+
+    @Override
+    public void setNext(HttpHandler nextHandler) {
+        this.next = nextHandler;
+    }
+    
+    private void buildIdMgr() {
+        final Map<String, char[]> users = new HashMap<>(1);
+        users.put("ffang", "pswd".toCharArray());
+        
+        identityManager = new MapIdentityManager(users);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/cxf/blob/e61a83d4/systests/transport-undertow/src/test/java/org/apache/cxf/systest/http_undertow/UndertowBasicAuthServer.java
----------------------------------------------------------------------
diff --git a/systests/transport-undertow/src/test/java/org/apache/cxf/systest/http_undertow/UndertowBasicAuthServer.java b/systests/transport-undertow/src/test/java/org/apache/cxf/systest/http_undertow/UndertowBasicAuthServer.java
new file mode 100644
index 0000000..616794f
--- /dev/null
+++ b/systests/transport-undertow/src/test/java/org/apache/cxf/systest/http_undertow/UndertowBasicAuthServer.java
@@ -0,0 +1,70 @@
+/**
+ * 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.systest.http_undertow;
+
+
+import java.net.URL;
+
+import javax.xml.ws.Endpoint;
+
+import org.apache.cxf.Bus;
+import org.apache.cxf.bus.spring.SpringBusFactory;
+import org.apache.cxf.interceptor.LoggingInInterceptor;
+import org.apache.cxf.interceptor.LoggingOutInterceptor;
+import org.apache.cxf.testutil.common.AbstractBusTestServerBase;
+
+
+public class UndertowBasicAuthServer extends AbstractBusTestServerBase  {
+    static final String PORT = allocatePort(UndertowBasicAuthServer.class);
+    static final String ADDRESS = "http://localhost:" + PORT + "/SoapContext/SoapPort";
+
+    Endpoint ep;
+    
+    protected void run()  {
+        String configurationFile = "undertowBasicAuthServer.xml";
+        URL configure =
+            UndertowBasicAuthServer.class.getResource(configurationFile);
+        Bus bus = new SpringBusFactory().createBus(configure, true);
+        bus.getInInterceptors().add(new LoggingInInterceptor());
+        bus.getOutInterceptors().add(new LoggingOutInterceptor());
+        SpringBusFactory.setDefaultBus(bus);
+        setBus(bus);
+
+        GreeterImpl implementor = new GreeterImpl();
+        ep = Endpoint.publish(ADDRESS, implementor);
+    }
+    
+    public void tearDown() throws Exception {
+        if (ep != null) {
+            ep.stop();
+            ep = null;
+        }
+    }
+    
+    public static void main(String[] args) {
+        try { 
+            UndertowBasicAuthServer s = new UndertowBasicAuthServer(); 
+            s.start();
+        } catch (Exception ex) {
+            ex.printStackTrace();
+            System.exit(-1);
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/cxf/blob/e61a83d4/systests/transport-undertow/src/test/java/org/apache/cxf/systest/http_undertow/UndertowBasicAuthTest.java
----------------------------------------------------------------------
diff --git a/systests/transport-undertow/src/test/java/org/apache/cxf/systest/http_undertow/UndertowBasicAuthTest.java b/systests/transport-undertow/src/test/java/org/apache/cxf/systest/http_undertow/UndertowBasicAuthTest.java
new file mode 100644
index 0000000..c479789
--- /dev/null
+++ b/systests/transport-undertow/src/test/java/org/apache/cxf/systest/http_undertow/UndertowBasicAuthTest.java
@@ -0,0 +1,102 @@
+/**
+ * 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.systest.http_undertow;
+
+import java.net.URL;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.BindingProvider;
+
+import org.apache.cxf.Bus;
+import org.apache.cxf.BusFactory;
+import org.apache.cxf.bus.CXFBusFactory;
+import org.apache.cxf.configuration.security.AuthorizationPolicy;
+import org.apache.cxf.frontend.ClientProxy;
+import org.apache.cxf.interceptor.LoggingInInterceptor;
+import org.apache.cxf.interceptor.LoggingOutInterceptor;
+import org.apache.cxf.jaxws.endpoint.dynamic.JaxWsDynamicClientFactory;
+import org.apache.cxf.testutil.common.AbstractClientServerTestBase;
+import org.apache.cxf.transport.http.HTTPConduit;
+import org.apache.cxf.transport.http.HTTPConduitConfigurer;
+import org.apache.hello_world_soap_http.Greeter;
+import org.apache.hello_world_soap_http.SOAPService;
+import org.junit.Before;
+import org.junit.BeforeClass;
+
+/**
+ * Tests thread pool config.
+ */
+
+public class UndertowBasicAuthTest extends AbstractClientServerTestBase {
+    private static final String ADDRESS = UndertowBasicAuthServer.ADDRESS;
+    private static final QName SERVICE_NAME = 
+        new QName("http://apache.org/hello_world_soap_http", "SOAPServiceAddressing");
+
+    private Greeter greeter;
+
+    @BeforeClass
+    public static void startServers() throws Exception {
+        assertTrue("server did not launch correctly", 
+                   launchServer(UndertowBasicAuthServer.class, true));
+    }
+
+    @Before
+    public void setUp() throws Exception {
+        URL wsdl = getClass().getResource("/wsdl/hello_world.wsdl");
+        greeter = new SOAPService(wsdl, SERVICE_NAME).getPort(Greeter.class);
+        BindingProvider bp = (BindingProvider)greeter;
+        ClientProxy.getClient(greeter).getInInterceptors().add(new LoggingInInterceptor());
+        ClientProxy.getClient(greeter).getOutInterceptors().add(new LoggingOutInterceptor()); 
+        bp.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
+                                   ADDRESS);
+        bp.getRequestContext().put(BindingProvider.USERNAME_PROPERTY, "ffang");
+        bp.getRequestContext().put(BindingProvider.PASSWORD_PROPERTY, "pswd");
+    }
+
+    @org.junit.Test
+    public void testBasicAuth() throws Exception { 
+        assertEquals("Hello Alice", greeter.greetMe("Alice"));
+    }
+    
+    @org.junit.Test
+    public void testGetWSDL() throws Exception {
+        BusFactory bf = CXFBusFactory.newInstance();
+        Bus bus = bf.createBus();
+        bus.getInInterceptors().add(new LoggingInInterceptor());
+        bus.getOutInterceptors().add(new LoggingOutInterceptor());
+       
+        MyHTTPConduitConfigurer myHttpConduitConfig = new MyHTTPConduitConfigurer();
+        bus.setExtension(myHttpConduitConfig, HTTPConduitConfigurer.class);
+        JaxWsDynamicClientFactory factory = JaxWsDynamicClientFactory.newInstance(bus);
+        factory.createClient(ADDRESS + "?wsdl");
+    }
+
+    private static class MyHTTPConduitConfigurer implements HTTPConduitConfigurer {
+        public void configure(String name, String address, HTTPConduit c) {
+
+            AuthorizationPolicy authorizationPolicy = new AuthorizationPolicy();
+
+            authorizationPolicy.setUserName("ffang");
+            authorizationPolicy.setPassword("pswd");
+            authorizationPolicy.setAuthorizationType("Basic");
+            c.setAuthorization(authorizationPolicy);
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/cxf/blob/e61a83d4/systests/transport-undertow/src/test/java/org/apache/cxf/systest/http_undertow/UndertowDigestAuthHandler.java
----------------------------------------------------------------------
diff --git a/systests/transport-undertow/src/test/java/org/apache/cxf/systest/http_undertow/UndertowDigestAuthHandler.java b/systests/transport-undertow/src/test/java/org/apache/cxf/systest/http_undertow/UndertowDigestAuthHandler.java
new file mode 100644
index 0000000..674aa06
--- /dev/null
+++ b/systests/transport-undertow/src/test/java/org/apache/cxf/systest/http_undertow/UndertowDigestAuthHandler.java
@@ -0,0 +1,81 @@
+/**
+ * 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.systest.http_undertow;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.cxf.transport.http_undertow.CXFUndertowHttpHandler;
+
+import io.undertow.security.api.AuthenticationMechanism;
+import io.undertow.security.api.AuthenticationMode;
+import io.undertow.security.handlers.AuthenticationCallHandler;
+import io.undertow.security.handlers.AuthenticationConstraintHandler;
+import io.undertow.security.handlers.AuthenticationMechanismsHandler;
+import io.undertow.security.handlers.SecurityInitialHandler;
+import io.undertow.security.idm.IdentityManager;
+import io.undertow.security.impl.DigestAuthenticationMechanism;
+import io.undertow.server.HttpHandler;
+import io.undertow.server.HttpServerExchange;
+
+public class UndertowDigestAuthHandler implements CXFUndertowHttpHandler {
+    
+    private HttpHandler next;
+    private HttpHandler securityHandler;
+    private IdentityManager identityManager;
+
+    @Override
+    public void handleRequest(HttpServerExchange exchange) throws Exception {
+        if (identityManager == null) {
+            buildIdMgr();
+        }
+        if (securityHandler == null) {
+            buildSecurityHandler();
+        }
+        this.securityHandler.handleRequest(exchange);
+    }
+
+    private void buildSecurityHandler() {
+        HttpHandler handler = this.next;
+        handler = new AuthenticationCallHandler(handler);
+        handler = new AuthenticationConstraintHandler(handler);
+        final List<AuthenticationMechanism> mechanisms 
+            = Collections.<AuthenticationMechanism>singletonList(
+              new DigestAuthenticationMechanism("WSRealm", "WSDomain", "DIGEST", this.identityManager));
+        handler = new AuthenticationMechanismsHandler(handler, mechanisms);
+        this.securityHandler = new SecurityInitialHandler(AuthenticationMode.PRO_ACTIVE, identityManager, handler);
+        
+    }
+
+    @Override
+    public void setNext(HttpHandler nextHandler) {
+        this.next = nextHandler;
+    }
+    
+    private void buildIdMgr() {
+        final Map<String, char[]> users = new HashMap<>(1);
+        users.put("ffang", "pswd".toCharArray());
+        
+        identityManager = new MapIdentityManager(users);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/cxf/blob/e61a83d4/systests/transport-undertow/src/test/java/org/apache/cxf/systest/http_undertow/UndertowDigestAuthTest.java
----------------------------------------------------------------------
diff --git a/systests/transport-undertow/src/test/java/org/apache/cxf/systest/http_undertow/UndertowDigestAuthTest.java b/systests/transport-undertow/src/test/java/org/apache/cxf/systest/http_undertow/UndertowDigestAuthTest.java
new file mode 100644
index 0000000..cbcbfbf
--- /dev/null
+++ b/systests/transport-undertow/src/test/java/org/apache/cxf/systest/http_undertow/UndertowDigestAuthTest.java
@@ -0,0 +1,202 @@
+/**
+ * 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.systest.http_undertow;
+
+import java.net.URL;
+import java.util.Map;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.BindingProvider;
+import javax.xml.ws.Endpoint;
+import javax.xml.ws.WebServiceException;
+
+import org.apache.cxf.Bus;
+import org.apache.cxf.BusFactory;
+import org.apache.cxf.bus.CXFBusFactory;
+import org.apache.cxf.bus.spring.SpringBusFactory;
+import org.apache.cxf.configuration.security.AuthorizationPolicy;
+import org.apache.cxf.frontend.ClientProxy;
+import org.apache.cxf.helpers.CastUtils;
+import org.apache.cxf.interceptor.Fault;
+import org.apache.cxf.interceptor.LoggingInInterceptor;
+import org.apache.cxf.interceptor.LoggingOutInterceptor;
+import org.apache.cxf.jaxws.endpoint.dynamic.JaxWsDynamicClientFactory;
+import org.apache.cxf.message.Message;
+import org.apache.cxf.phase.AbstractPhaseInterceptor;
+import org.apache.cxf.phase.Phase;
+import org.apache.cxf.testutil.common.AbstractBusTestServerBase;
+import org.apache.cxf.testutil.common.AbstractClientServerTestBase;
+import org.apache.cxf.transport.http.HTTPConduit;
+import org.apache.cxf.transport.http.HTTPConduitConfigurer;
+import org.apache.cxf.transport.http.asyncclient.AsyncHTTPConduit;
+import org.apache.cxf.transport.http.auth.DigestAuthSupplier;
+import org.apache.cxf.transports.http.configuration.HTTPClientPolicy;
+import org.apache.hello_world_soap_http.Greeter;
+import org.apache.hello_world_soap_http.SOAPService;
+import org.apache.http.auth.Credentials;
+import org.apache.http.auth.UsernamePasswordCredentials;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * Tests thread pool config.
+ */
+
+public class UndertowDigestAuthTest extends AbstractClientServerTestBase {
+    private static final String PORT = allocatePort(UndertowDigestAuthTest.class);
+    private static final String ADDRESS = "http://127.0.0.1:" + PORT + "/SoapContext/SoapPort";
+    private static final QName SERVICE_NAME = 
+        new QName("http://apache.org/hello_world_soap_http", "SOAPServiceAddressing");
+
+    private Greeter greeter;
+
+    
+    public static class UndertowDigestServer extends AbstractBusTestServerBase  {
+        Endpoint ep;
+        
+        protected void run()  {
+            String configurationFile = "undertowDigestServer.xml";
+            URL configure =
+                UndertowBasicAuthServer.class.getResource(configurationFile);
+            Bus bus = new SpringBusFactory().createBus(configure, true);
+            //bus.getInInterceptors().add(new LoggingInInterceptor());
+            //bus.getOutInterceptors().add(new LoggingOutInterceptor());
+            SpringBusFactory.setDefaultBus(bus);
+            setBus(bus);
+
+            GreeterImpl implementor = new GreeterImpl();
+            ep = Endpoint.publish(ADDRESS, implementor);
+        }
+        
+        public void tearDown() throws Exception {
+            if (ep != null) {
+                ep.stop();
+                ep = null;
+            }
+        }
+    }
+    
+    
+    @BeforeClass
+    public static void startServers() throws Exception {
+        assertTrue("server did not launch correctly", 
+                   launchServer(UndertowDigestServer.class, true));
+    }
+
+    private HTTPConduit setupClient(boolean async) throws Exception {
+        URL wsdl = getClass().getResource("/wsdl/hello_world.wsdl");
+        greeter = new SOAPService(wsdl, SERVICE_NAME).getPort(Greeter.class);
+        BindingProvider bp = (BindingProvider)greeter;
+        ClientProxy.getClient(greeter).getInInterceptors().add(new LoggingInInterceptor());
+        ClientProxy.getClient(greeter).getOutInterceptors().add(new LoggingOutInterceptor()); 
+        bp.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
+                                   ADDRESS);
+        HTTPConduit cond = (HTTPConduit)ClientProxy.getClient(greeter).getConduit();
+        HTTPClientPolicy client = new HTTPClientPolicy();
+        client.setConnectionTimeout(600000);
+        client.setReceiveTimeout(600000);
+        cond.setClient(client);
+        if (async) {
+            if (cond instanceof AsyncHTTPConduit) {
+                UsernamePasswordCredentials creds = new UsernamePasswordCredentials("ffang", "pswd");
+                bp.getRequestContext().put(Credentials.class.getName(), creds);
+                bp.getRequestContext().put(AsyncHTTPConduit.USE_ASYNC, Boolean.TRUE);
+                client.setAutoRedirect(true);
+            } else {
+                fail("Not an async conduit");
+            }
+        } else {
+            bp.getRequestContext().put(BindingProvider.USERNAME_PROPERTY, "ffang");
+            bp.getRequestContext().put(BindingProvider.PASSWORD_PROPERTY, "pswd");
+            cond.setAuthSupplier(new DigestAuthSupplier());
+        }
+        
+        ClientProxy.getClient(greeter).getOutInterceptors()
+            .add(new AbstractPhaseInterceptor<Message>(Phase.PRE_STREAM_ENDING) {
+                
+                public void handleMessage(Message message) throws Fault {
+                    Map<String, ?> headers = CastUtils.cast((Map<?, ?>)message.get(Message.PROTOCOL_HEADERS));
+                    if (headers.containsKey("Proxy-Authorization")) {
+                        throw new RuntimeException("Should not have Proxy-Authorization");
+                    }
+                }
+            });
+        client.setAllowChunking(false);
+        return cond;
+    }
+
+    @Test
+    public void testDigestAuth() throws Exception {
+        //CXF will handle the auth stuff within it's conduit implementation
+        doTest(false);
+    }
+    @Test
+    public void testDigestAuthAsyncClient() throws Exception {
+        //We'll let HTTP async handle it.  Useful for things like NTLM 
+        //which async client can handle but we cannot.
+        doTest(true);
+    }
+  
+    private void doTest(boolean async) throws Exception {
+        setupClient(async);
+        assertEquals("Hello Alice", greeter.greetMe("Alice"));
+        assertEquals("Hello Bob", greeter.greetMe("Bob"));
+
+        try {
+            BindingProvider bp = (BindingProvider)greeter;
+            if (async) {
+                UsernamePasswordCredentials creds = new UsernamePasswordCredentials("blah", "foo");
+                bp.getRequestContext().put(Credentials.class.getName(), creds);
+            } else {
+                bp.getRequestContext().put(BindingProvider.USERNAME_PROPERTY, "blah");
+                bp.getRequestContext().put(BindingProvider.PASSWORD_PROPERTY, "foo");
+            }
+            greeter.greetMe("Alice");
+            fail("Password was wrong, should have failed");
+        } catch (WebServiceException wse) {
+            //ignore - expected
+        }
+    }
+    
+    @Test
+    public void testGetWSDL() throws Exception {
+        BusFactory bf = CXFBusFactory.newInstance();
+        Bus bus = bf.createBus();
+        bus.getInInterceptors().add(new LoggingInInterceptor());
+        bus.getOutInterceptors().add(new LoggingOutInterceptor());
+       
+        MyHTTPConduitConfigurer myHttpConduitConfig = new MyHTTPConduitConfigurer();
+        bus.setExtension(myHttpConduitConfig, HTTPConduitConfigurer.class);
+        JaxWsDynamicClientFactory factory = JaxWsDynamicClientFactory.newInstance(bus);
+        factory.createClient(ADDRESS + "?wsdl");
+    }
+
+    private static class MyHTTPConduitConfigurer implements HTTPConduitConfigurer {
+        public void configure(String name, String address, HTTPConduit c) {
+
+            AuthorizationPolicy authorizationPolicy = new AuthorizationPolicy();
+
+            authorizationPolicy.setUserName("ffang");
+            authorizationPolicy.setPassword("pswd");
+            authorizationPolicy.setAuthorizationType("Digest");
+            c.setAuthorization(authorizationPolicy);
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/cxf/blob/e61a83d4/systests/transport-undertow/src/test/java/org/apache/cxf/systest/http_undertow/continuations/ClientServerWrappedContinuationTest.java
----------------------------------------------------------------------
diff --git a/systests/transport-undertow/src/test/java/org/apache/cxf/systest/http_undertow/continuations/ClientServerWrappedContinuationTest.java b/systests/transport-undertow/src/test/java/org/apache/cxf/systest/http_undertow/continuations/ClientServerWrappedContinuationTest.java
new file mode 100644
index 0000000..6a976d4
--- /dev/null
+++ b/systests/transport-undertow/src/test/java/org/apache/cxf/systest/http_undertow/continuations/ClientServerWrappedContinuationTest.java
@@ -0,0 +1,159 @@
+/**
+ * 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.systest.http_undertow.continuations;
+
+import java.net.URL;
+import java.util.concurrent.ArrayBlockingQueue;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.ThreadPoolExecutor;
+import java.util.concurrent.TimeUnit;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.Endpoint;
+
+import org.apache.cxf.Bus;
+import org.apache.cxf.BusFactory;
+import org.apache.cxf.bus.spring.SpringBusFactory;
+import org.apache.cxf.frontend.ClientProxy;
+import org.apache.cxf.interceptor.LoggingInInterceptor;
+import org.apache.cxf.interceptor.LoggingOutInterceptor;
+import org.apache.cxf.jaxws.EndpointImpl;
+import org.apache.cxf.testutil.common.AbstractBusTestServerBase;
+import org.apache.cxf.testutil.common.AbstractClientServerTestBase;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+public class ClientServerWrappedContinuationTest extends AbstractClientServerTestBase {
+    public static final String PORT = allocatePort(Server.class);
+    public static final String HTTPS_PORT = allocatePort(Server.class, 1);
+    
+    private static final String CLIENT_CONFIG_FILE =
+        "org/apache/cxf/systest/http_undertow/continuations/cxf.xml";
+    private static final String CLIENT_HTTPS_CONFIG_FILE =
+        "org/apache/cxf/systest/http_undertow/continuations/cxf_https.xml";
+    private static final String SERVER_CONFIG_FILE =
+        "org/apache/cxf/systest/http_undertow/continuations/jaxws-server.xml";
+    
+    public static class Server extends AbstractBusTestServerBase {
+
+        protected void run() {
+            SpringBusFactory bf = new SpringBusFactory();
+            Bus bus = bf.createBus(SERVER_CONFIG_FILE);
+            setBus(bus);
+            BusFactory.setDefaultBus(bus);
+            
+            Object implementor = new HelloImplWithWrapppedContinuation();
+            String address = "http://localhost:" + PORT + "/hellocontinuation";
+            EndpointImpl endpointImpl = (EndpointImpl)Endpoint.publish(address, implementor);
+            endpointImpl.getInInterceptors().add(new LoggingInInterceptor());
+            endpointImpl.getOutInterceptors().add(new LoggingOutInterceptor()); 
+            address = "https://localhost:" + HTTPS_PORT + "/securecontinuation";
+            Endpoint.publish(address, implementor);
+        }
+
+        public static void main(String[] args) {
+            try {
+                Server s = new Server();
+                s.start();
+            } catch (Exception ex) {
+                ex.printStackTrace();
+                System.exit(-1);
+            }
+        }
+    }
+
+    @BeforeClass
+    public static void startServers() throws Exception {
+        assertTrue("server did not launch correctly", launchServer(Server.class));
+    }
+
+    @Test
+    public void testHttpWrappedContinuations() throws Exception {
+        SpringBusFactory bf = new SpringBusFactory();
+        Bus bus = bf.createBus(CLIENT_CONFIG_FILE);
+        BusFactory.setDefaultBus(bus);
+        
+        QName serviceName = new QName("http://cxf.apache.org/systest/jaxws", "HelloContinuationService");
+        
+        URL wsdlURL = new URL("http://localhost:" + PORT + "/hellocontinuation?wsdl");
+        
+        HelloContinuationService service = new HelloContinuationService(wsdlURL, serviceName);
+        assertNotNull(service);
+        final HelloContinuation helloPort = service.getHelloContinuationPort();
+        ClientProxy.getClient(helloPort).getInInterceptors().add(new LoggingInInterceptor());
+        ClientProxy.getClient(helloPort).getOutInterceptors().add(new LoggingOutInterceptor());
+        doTest(helloPort);
+        bus.shutdown(true);
+    }
+        
+    @Test
+    public void testHttpsWrappedContinuations() throws Exception {
+        SpringBusFactory bf = new SpringBusFactory();
+        Bus bus = bf.createBus(CLIENT_HTTPS_CONFIG_FILE);
+        BusFactory.setDefaultBus(bus);
+        
+        QName serviceName = new QName("http://cxf.apache.org/systest/jaxws", "HelloContinuationService");
+        
+        URL wsdlURL = new URL("https://localhost:" + HTTPS_PORT + "/securecontinuation?wsdl");
+        
+        HelloContinuationService service = new HelloContinuationService(wsdlURL, serviceName);
+        assertNotNull(service);
+        final HelloContinuation helloPort = service.getHelloContinuationPort();
+        doTest(helloPort);
+        bus.shutdown(true);
+    }
+
+    private void doTest(final HelloContinuation helloPort) throws Exception {
+        ThreadPoolExecutor executor = new ThreadPoolExecutor(10, 10, 0, TimeUnit.SECONDS,
+                                                             new ArrayBlockingQueue<Runnable>(6));
+        CountDownLatch startSignal = new CountDownLatch(1);
+        CountDownLatch controlDoneSignal = new CountDownLatch(5);
+        CountDownLatch helloDoneSignal = new CountDownLatch(5);
+
+        executor.execute(new ControlWorker(helloPort, "Fred", startSignal, controlDoneSignal));
+        executor.execute(new HelloWorker(helloPort, "Fred", "", startSignal, helloDoneSignal));
+        
+        executor.execute(new ControlWorker(helloPort, "Barry", startSignal, controlDoneSignal));
+        executor.execute(new HelloWorker(helloPort, "Barry", "Jameson", startSignal, helloDoneSignal));
+        
+        executor.execute(new ControlWorker(helloPort, "Harry", startSignal, controlDoneSignal));
+        executor.execute(new HelloWorker(helloPort, "Harry", "", startSignal, helloDoneSignal));
+        
+        executor.execute(new ControlWorker(helloPort, "Rob", startSignal, controlDoneSignal));
+        executor.execute(new HelloWorker(helloPort, "Rob", "Davidson", startSignal, helloDoneSignal));
+        
+        executor.execute(new ControlWorker(helloPort, "James", startSignal, controlDoneSignal));
+        executor.execute(new HelloWorker(helloPort, "James", "ServiceMix", startSignal, helloDoneSignal));
+        
+        startSignal.countDown();
+        
+        controlDoneSignal.await(100, TimeUnit.SECONDS);
+        helloDoneSignal.await(100, TimeUnit.SECONDS);
+        executor.shutdownNow();
+        assertEquals("Not all invocations have been resumed", 0, controlDoneSignal.getCount());
+        assertEquals("Not all invocations have completed", 0, helloDoneSignal.getCount());
+        
+        helloPort.sayHi("Dan1", "to:100");
+        helloPort.sayHi("Dan2", "to:100");
+        helloPort.sayHi("Dan3", "to:100");
+    }
+    
+    
+}

http://git-wip-us.apache.org/repos/asf/cxf/blob/e61a83d4/systests/transport-undertow/src/test/java/org/apache/cxf/systest/http_undertow/continuations/ControlWorker.java
----------------------------------------------------------------------
diff --git a/systests/transport-undertow/src/test/java/org/apache/cxf/systest/http_undertow/continuations/ControlWorker.java b/systests/transport-undertow/src/test/java/org/apache/cxf/systest/http_undertow/continuations/ControlWorker.java
new file mode 100644
index 0000000..f624d73
--- /dev/null
+++ b/systests/transport-undertow/src/test/java/org/apache/cxf/systest/http_undertow/continuations/ControlWorker.java
@@ -0,0 +1,59 @@
+/**
+ * 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.systest.http_undertow.continuations;
+
+import java.util.concurrent.CountDownLatch;
+
+import org.junit.Assert;
+
+public class ControlWorker implements Runnable {
+
+    private HelloContinuation helloPort;
+    private String firstName; 
+    private CountDownLatch startSignal;
+    private CountDownLatch resumeSignal;
+    public ControlWorker(HelloContinuation helloPort,
+                         String firstName,
+                         CountDownLatch startSignal,
+                         CountDownLatch resumeSignal) {
+        this.helloPort = helloPort;
+        this.firstName = firstName;
+        this.startSignal = startSignal;
+        this.resumeSignal = resumeSignal;
+    }
+    
+    public void run() {
+        try {
+            startSignal.await();
+            if (!helloPort.isRequestSuspended(firstName)) {
+                Assert.fail("No suspended invocation for " + firstName);
+            }
+            helloPort.resumeRequest(firstName);
+            resumeSignal.countDown();
+        } catch (InterruptedException ex) {
+            // ignore
+        } catch (RuntimeException ex) {
+            ex.printStackTrace();
+            Assert.fail("Control thread for " + firstName + " failed");
+        }
+        
+    }
+    
+}

http://git-wip-us.apache.org/repos/asf/cxf/blob/e61a83d4/systests/transport-undertow/src/test/java/org/apache/cxf/systest/http_undertow/continuations/HelloContinuation.java
----------------------------------------------------------------------
diff --git a/systests/transport-undertow/src/test/java/org/apache/cxf/systest/http_undertow/continuations/HelloContinuation.java b/systests/transport-undertow/src/test/java/org/apache/cxf/systest/http_undertow/continuations/HelloContinuation.java
new file mode 100644
index 0000000..9df05d7
--- /dev/null
+++ b/systests/transport-undertow/src/test/java/org/apache/cxf/systest/http_undertow/continuations/HelloContinuation.java
@@ -0,0 +1,36 @@
+/**
+ * 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.systest.http_undertow.continuations;
+
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+
+@SOAPBinding(style = SOAPBinding.Style.RPC, use = SOAPBinding.Use.LITERAL)
+@WebService(name = "HelloContinuation", targetNamespace = "http://cxf.apache.org/systest/jaxws")
+public interface HelloContinuation {
+    @WebMethod(operationName = "sayHi", exclude = false)
+    String sayHi(String firstName, String secondName);
+    
+    @WebMethod(operationName = "isRequestSuspended", exclude = false)
+    boolean isRequestSuspended(String name);
+    
+    @WebMethod(operationName = "resumeRequest", exclude = false)
+    void resumeRequest(String name);
+}

http://git-wip-us.apache.org/repos/asf/cxf/blob/e61a83d4/systests/transport-undertow/src/test/java/org/apache/cxf/systest/http_undertow/continuations/HelloContinuationService.java
----------------------------------------------------------------------
diff --git a/systests/transport-undertow/src/test/java/org/apache/cxf/systest/http_undertow/continuations/HelloContinuationService.java b/systests/transport-undertow/src/test/java/org/apache/cxf/systest/http_undertow/continuations/HelloContinuationService.java
new file mode 100644
index 0000000..f7eea8e
--- /dev/null
+++ b/systests/transport-undertow/src/test/java/org/apache/cxf/systest/http_undertow/continuations/HelloContinuationService.java
@@ -0,0 +1,49 @@
+/**
+ * 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.systest.http_undertow.continuations;
+
+import java.net.URL;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+import javax.xml.ws.WebEndpoint;
+import javax.xml.ws.WebServiceClient;
+
+/**
+ * 
+ */
+
+@WebServiceClient(name = "HelloService", 
+                  targetNamespace = "http://cxf.apache.org/systest/jaxws", 
+                  wsdlLocation = "testutils/hello.wsdl")
+public class HelloContinuationService extends Service {
+    static final QName SERVICE = 
+        new QName("http://cxf.apache.org/systest/jaxws", "HelloContinuationService");
+    static final QName HELLO_PORT = 
+        new QName("http://cxf.apache.org/systest/jaxws", "HelloContinuationPort");
+    public HelloContinuationService(URL wsdlLocation, QName serviceName) {
+        super(wsdlLocation, serviceName);
+    }
+
+    @WebEndpoint(name = "HelloContinuationPort")
+    public HelloContinuation getHelloContinuationPort() {
+        return super.getPort(HELLO_PORT, HelloContinuation.class);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/cxf/blob/e61a83d4/systests/transport-undertow/src/test/java/org/apache/cxf/systest/http_undertow/continuations/HelloImplWithWrapppedContinuation.java
----------------------------------------------------------------------
diff --git a/systests/transport-undertow/src/test/java/org/apache/cxf/systest/http_undertow/continuations/HelloImplWithWrapppedContinuation.java b/systests/transport-undertow/src/test/java/org/apache/cxf/systest/http_undertow/continuations/HelloImplWithWrapppedContinuation.java
new file mode 100644
index 0000000..aa067ff
--- /dev/null
+++ b/systests/transport-undertow/src/test/java/org/apache/cxf/systest/http_undertow/continuations/HelloImplWithWrapppedContinuation.java
@@ -0,0 +1,129 @@
+/**
+ * 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.systest.http_undertow.continuations;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.annotation.Resource;
+import javax.jws.WebService;
+import javax.xml.ws.WebServiceContext;
+
+import org.apache.cxf.continuations.Continuation;
+import org.apache.cxf.continuations.ContinuationProvider;
+
+
+@WebService(name = "HelloContinuation", 
+            serviceName = "HelloContinuationService", 
+            portName = "HelloContinuationPort", 
+            targetNamespace = "http://cxf.apache.org/systest/jaxws",
+            endpointInterface = "org.apache.cxf.systest.http_undertow.continuations.HelloContinuation")
+public class HelloImplWithWrapppedContinuation implements HelloContinuation {
+    
+    
+    private Map<String, Continuation> suspended = 
+        new HashMap<String, Continuation>();
+    
+    
+    @Resource
+    private WebServiceContext context;
+    
+    public String sayHi(String firstName, String secondName) {
+        
+        Continuation continuation = getContinuation(firstName);
+        if (continuation == null) {
+            throw new RuntimeException("Failed to get continuation");
+        }
+        synchronized (continuation) {
+            if (continuation.isNew()) {
+                Object userObject = secondName != null && secondName.length() > 0 
+                                    ? secondName : null;
+                continuation.setObject(userObject);
+                long timeout = 20000;
+                if (secondName.startsWith("to:")) {
+                    timeout = Long.parseLong(secondName.substring(3));
+                }
+                suspendInvocation(firstName, continuation, timeout);
+            } else {
+                StringBuilder sb = new StringBuilder();
+                sb.append(firstName);
+                
+                // if the actual parameter is not null 
+                if (secondName != null && secondName.length() > 0) {
+                    String surname = continuation.getObject().toString();
+                    sb.append(' ').append(surname);
+                }
+                // System.out.println("Saying hi to " + sb.toString());
+                return "Hi " + sb.toString();
+            }
+        }
+        // unreachable
+        return null;
+    }
+
+    public boolean isRequestSuspended(String name) {
+        synchronized (suspended) {
+            while (!suspended.containsKey(name)) {
+                try {
+                    suspended.wait(10000);
+                } catch (InterruptedException ex) {
+                    return false;
+                }
+            }
+        }
+        return true;
+    }
+
+    public void resumeRequest(final String name) {
+        
+        Continuation suspendedCont = null;
+        synchronized (suspended) {
+            suspendedCont = suspended.get(name);
+        }
+        
+        if (suspendedCont != null) {
+            synchronized (suspendedCont) {
+                suspendedCont.resume();
+            }
+        }
+    }
+    
+    private void suspendInvocation(String name, Continuation cont, long timeout) {
+        try {
+            cont.suspend(timeout);    
+        } finally {
+            synchronized (suspended) {
+                suspended.put(name, cont);
+                suspended.notifyAll();
+            }
+        }
+    }
+    
+    private Continuation getContinuation(String name) {
+        synchronized (suspended) {
+            Continuation suspendedCont = suspended.remove(name);
+            if (suspendedCont != null) {
+                return suspendedCont;
+            }
+        }
+        
+        ContinuationProvider provider = 
+            (ContinuationProvider)context.getMessageContext().get(ContinuationProvider.class.getName());
+        return provider.getContinuation();
+    }
+}

http://git-wip-us.apache.org/repos/asf/cxf/blob/e61a83d4/systests/transport-undertow/src/test/java/org/apache/cxf/systest/http_undertow/continuations/HelloWorker.java
----------------------------------------------------------------------
diff --git a/systests/transport-undertow/src/test/java/org/apache/cxf/systest/http_undertow/continuations/HelloWorker.java b/systests/transport-undertow/src/test/java/org/apache/cxf/systest/http_undertow/continuations/HelloWorker.java
new file mode 100644
index 0000000..fc85173
--- /dev/null
+++ b/systests/transport-undertow/src/test/java/org/apache/cxf/systest/http_undertow/continuations/HelloWorker.java
@@ -0,0 +1,67 @@
+/**
+ * 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.systest.http_undertow.continuations;
+
+import java.util.concurrent.CountDownLatch;
+
+import org.junit.Assert;
+
+public class HelloWorker implements Runnable {
+
+    private HelloContinuation helloPort;
+    private String firstName;
+    private String secondName;
+    private CountDownLatch startSignal;
+    private CountDownLatch doneSignal;
+    public HelloWorker(HelloContinuation helloPort,
+                       String firstName,
+                       String secondName,
+                       CountDownLatch startSignal,
+                       CountDownLatch doneSignal) {
+        this.helloPort = helloPort;
+        this.firstName = firstName;
+        this.secondName = secondName;
+        this.startSignal = startSignal;
+        this.doneSignal = doneSignal;
+    }
+    
+    public void run() {
+        StringBuilder expected = new StringBuilder();
+        expected.append(firstName);
+        if (secondName != null && secondName.length() > 0) {
+            expected.append(' ').append(secondName);
+        }
+        
+        try {
+            startSignal.await();
+            
+            Assert.assertEquals("Wrong hello", "Hi " + expected.toString(), 
+                                helloPort.sayHi(firstName, secondName));
+            doneSignal.countDown();
+        } catch (InterruptedException ex) {
+            // ignore
+        } catch (RuntimeException ex) {
+            ex.printStackTrace();
+            Assert.fail("Hello thread failed for : " + expected.toString());
+        } 
+        
+    }
+    
+}

http://git-wip-us.apache.org/repos/asf/cxf/blob/e61a83d4/systests/transport-undertow/src/test/resources/keys/Bethal.jks
----------------------------------------------------------------------
diff --git a/systests/transport-undertow/src/test/resources/keys/Bethal.jks b/systests/transport-undertow/src/test/resources/keys/Bethal.jks
new file mode 100644
index 0000000..8da2ad0
Binary files /dev/null and b/systests/transport-undertow/src/test/resources/keys/Bethal.jks differ

http://git-wip-us.apache.org/repos/asf/cxf/blob/e61a83d4/systests/transport-undertow/src/test/resources/keys/Bethal.p12
----------------------------------------------------------------------
diff --git a/systests/transport-undertow/src/test/resources/keys/Bethal.p12 b/systests/transport-undertow/src/test/resources/keys/Bethal.p12
new file mode 100644
index 0000000..5b627c5
Binary files /dev/null and b/systests/transport-undertow/src/test/resources/keys/Bethal.p12 differ

http://git-wip-us.apache.org/repos/asf/cxf/blob/e61a83d4/systests/transport-undertow/src/test/resources/keys/Gordy.jks
----------------------------------------------------------------------
diff --git a/systests/transport-undertow/src/test/resources/keys/Gordy.jks b/systests/transport-undertow/src/test/resources/keys/Gordy.jks
new file mode 100644
index 0000000..8fa8847
Binary files /dev/null and b/systests/transport-undertow/src/test/resources/keys/Gordy.jks differ

http://git-wip-us.apache.org/repos/asf/cxf/blob/e61a83d4/systests/transport-undertow/src/test/resources/keys/Morpit.jks
----------------------------------------------------------------------
diff --git a/systests/transport-undertow/src/test/resources/keys/Morpit.jks b/systests/transport-undertow/src/test/resources/keys/Morpit.jks
new file mode 100644
index 0000000..b179baf
Binary files /dev/null and b/systests/transport-undertow/src/test/resources/keys/Morpit.jks differ

http://git-wip-us.apache.org/repos/asf/cxf/blob/e61a83d4/systests/transport-undertow/src/test/resources/keys/Morpit.p12
----------------------------------------------------------------------
diff --git a/systests/transport-undertow/src/test/resources/keys/Morpit.p12 b/systests/transport-undertow/src/test/resources/keys/Morpit.p12
new file mode 100644
index 0000000..b18c8ed
Binary files /dev/null and b/systests/transport-undertow/src/test/resources/keys/Morpit.p12 differ

http://git-wip-us.apache.org/repos/asf/cxf/blob/e61a83d4/systests/transport-undertow/src/test/resources/keys/Poltim.jks
----------------------------------------------------------------------
diff --git a/systests/transport-undertow/src/test/resources/keys/Poltim.jks b/systests/transport-undertow/src/test/resources/keys/Poltim.jks
new file mode 100644
index 0000000..f3b3e68
Binary files /dev/null and b/systests/transport-undertow/src/test/resources/keys/Poltim.jks differ

http://git-wip-us.apache.org/repos/asf/cxf/blob/e61a83d4/systests/transport-undertow/src/test/resources/keys/Tarpin.jks
----------------------------------------------------------------------
diff --git a/systests/transport-undertow/src/test/resources/keys/Tarpin.jks b/systests/transport-undertow/src/test/resources/keys/Tarpin.jks
new file mode 100644
index 0000000..cf1ceb6
Binary files /dev/null and b/systests/transport-undertow/src/test/resources/keys/Tarpin.jks differ

http://git-wip-us.apache.org/repos/asf/cxf/blob/e61a83d4/systests/transport-undertow/src/test/resources/keys/Truststore.jks
----------------------------------------------------------------------
diff --git a/systests/transport-undertow/src/test/resources/keys/Truststore.jks b/systests/transport-undertow/src/test/resources/keys/Truststore.jks
new file mode 100644
index 0000000..0abd848
Binary files /dev/null and b/systests/transport-undertow/src/test/resources/keys/Truststore.jks differ

http://git-wip-us.apache.org/repos/asf/cxf/blob/e61a83d4/systests/transport-undertow/src/test/resources/keys/Truststore.pem
----------------------------------------------------------------------
diff --git a/systests/transport-undertow/src/test/resources/keys/Truststore.pem b/systests/transport-undertow/src/test/resources/keys/Truststore.pem
new file mode 100644
index 0000000..c04eaf8
--- /dev/null
+++ b/systests/transport-undertow/src/test/resources/keys/Truststore.pem
@@ -0,0 +1,86 @@
+-----BEGIN CERTIFICATE-----
+MIIDSTCCAjGgAwIBAgIEGFcAsjANBgkqhkiG9w0BAQsFADBVMQswCQYDVQQGEwJVUzERMA8GA1UE
+BxMIU3lyYWN1c2UxEzARBgNVBAoTCkFwYWNoZVRlc3QxDjAMBgNVBAsTBUdvcmR5MQ4wDAYDVQQD
+EwVHb3JkeTAeFw0xNTA5MDkxNTUyMzRaFw0yNTA5MDYxNTUyMzRaMFUxCzAJBgNVBAYTAlVTMREw
+DwYDVQQHEwhTeXJhY3VzZTETMBEGA1UEChMKQXBhY2hlVGVzdDEOMAwGA1UECxMFR29yZHkxDjAM
+BgNVBAMTBUdvcmR5MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAuVubnwltwu38Slqe
+ANXNBFkWQ3PV4n/T5tU1PLrkg+g7AEOtaWn/3TDfcxYovDF/TWnkwcYeYDeILdXcLJgoa0mhMO2n
+46JrR3NpLM5jBtw0NVBeBR+HuFfbdlLIABgD90+aalm4kB0Fq8BO1moP4NnbxccSl2vLdP6u9oLE
+xXDog+FpHfwffKvgnyDh0Mc3lYJ7dJpwQNOmPO8docyePR53IbQuAXL8C5rYc+OHU/smj4rvwqP9
+S5zj/yOpl+7tTAq+0kLJetHJ03Cb+KVhpl6Gn/80a5DGjm7c1gAzlEwQpxltY0PkD62WJhPsVOkW
+CtRhvUNWrxq+68i460m4ZwIDAQABoyEwHzAdBgNVHQ4EFgQUSYfZ7HYvl7iTrZaoOOwXMbR80Fow
+DQYJKoZIhvcNAQELBQADggEBAAFJpi0Fu74YK0TZk96ApCgGXKU4+CyRtk5OyBeYUN746ImacDO8
+Qg2idSnOAw08sEZGN0RQnHec9r/3dhIZvULf00uDLybhN+Q9ErqI2seooJo4oF0fsd3gR4jJIU5K
+fVL8UJ0mSqUVMyH7oklyN0e3btKgAjY24ycNt+WTXaX0e1K7phsX0vNc9WMp1ZQN9NjozWXW0mte
+5FsrjiFAdnbRx8Bsj4E25ZkyplibBqDnKmlQxl+VDk1QEdignRexdJIBsjRguJfdyl6u//fSRhp0
+GMFO9ovDEyegHf0ZnWJthq4egYTMLmkzReE2neQDzuN8zYoZLTngbA3ynP+Ghgc=
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIDTTCCAjWgAwIBAgIEOEaECjANBgkqhkiG9w0BAQsFADBXMQswCQYDVQQGEwJVUzERMA8GA1UE
+BxMIU3lyYWN1c2UxEzARBgNVBAoTCkFwYWNoZVRlc3QxDzANBgNVBAsTBkJldGhhbDEPMA0GA1UE
+AxMGQmV0aGFsMB4XDTE1MDkwOTE1NTIwN1oXDTI1MDkwNjE1NTIwN1owVzELMAkGA1UEBhMCVVMx
+ETAPBgNVBAcTCFN5cmFjdXNlMRMwEQYDVQQKEwpBcGFjaGVUZXN0MQ8wDQYDVQQLEwZCZXRoYWwx
+DzANBgNVBAMTBkJldGhhbDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMxgwx2lxVDL
+teM15IOsdgBGff42ozTaLVjr30qHsREbnZrk+1G8KscUtVYUwtCDCEErz64tu/TY2jskUi54q1j2
+tOXCz0awxDRKbE4ddyvnqSqItYC9nB+T/LLFJ65bqyleRbO+Zsqj4Gi+8lGmzgk0kCLoCJ9LTrpt
+VzsHHuBsvEkcBHEX8in5umzbTy6y1jq3zsUdclgA/EV4eyvFd5+8J8XiB6Ac4q7qYJdUaOrDKk5X
+Ns05WuzW3hP/qXDpmyxgS1GQLBMj8yuopVR7/FuGCeDBSJe60cyWtDTxosjTLwjTEYIEB/ySIcgK
+0TU+QxU8XEwwutjMzecKd9PQdpMCAwEAAaMhMB8wHQYDVR0OBBYEFDWt03QU4rqQa91UjYCNkfx0
+tp3HMA0GCSqGSIb3DQEBCwUAA4IBAQCwObHeIssS3e1INNs67T2g0v17Z1+HDEx65dfwph6Wxbex
+hb9yNKEXFUIUk+Z6ZzTmv1fc4DBZ2z0Nbk8rrS2BD6kojWVRwZVnv6pfPDjU82mFL7kHztiNPq8u
+23+lTrhO9HjuQZtVnTW3+Uw9RW5mBu+8QVgze0Q1DjL5PqX3YHq16LCYp6vVjdm0o7fKDQke2Z01
+a4hYtUF17m/Sw6319ocSI2fRA2ppQ7Ts8J3GSkAyygSR52mqaC7jDgD2Oh1eRhRaTgiyxLNLnAHu
+Koxbcr3sGFP2ZYwtP9DlhxwZzzpPcNWwFMqcQ79WPKmRvBMNOQDBdW77P3cxG3DF5KkO
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIDYTCCAkmgAwIBAgIEDV+5sjANBgkqhkiG9w0BAQsFADBhMQswCQYDVQQGEwJVUzERMA8GA1UE
+BxMIU3lyYWN1c2UxEzARBgNVBAoTCkFwYWNoZVRlc3QxDzANBgNVBAsTBk1vcnBpdDEZMBcGA1UE
+AxMQd2hhdGV2ZXJob3N0LmNvbTAeFw0xNTA5MDkxNTUzMTRaFw0yNTA5MDYxNTUzMTRaMGExCzAJ
+BgNVBAYTAlVTMREwDwYDVQQHEwhTeXJhY3VzZTETMBEGA1UEChMKQXBhY2hlVGVzdDEPMA0GA1UE
+CxMGTW9ycGl0MRkwFwYDVQQDExB3aGF0ZXZlcmhvc3QuY29tMIIBIjANBgkqhkiG9w0BAQEFAAOC
+AQ8AMIIBCgKCAQEAjKod4Ne5+B5rPhvl7Dt7//O1fRZYw5GACCgTG6F2Cy8ozF7lfQo7jy3KTjrC
+xOkty6IUxcll5EKZQBfsqfKq2beEWI+tG//ZEfc1paK+4HGrqARtFXYm/azzEC8E66cVKRIej8DM
+yXPHvNsSSN/T7c5QCMBAd5p+uQFCGkHcX6ywiCu5hOBDhxBTr3680lRIOjBoICd3ytlT8pnHqjm7
+VexiG5sPg32f90Tf1UCJQL41Jn1miow4xLjDw0L9pCcoLtoh1jjOwErwISeTXtfp0zMAZ1T0Cwmu
+DQCL2Ek0ysmoDSQlpwL/zi/9XzeZCUY9a4KK2DV6q1WNnGJq6pMu0QIDAQABoyEwHzAdBgNVHQ4E
+FgQULNllc99it0vTugh22XKUn7H3zUkwDQYJKoZIhvcNAQELBQADggEBAFnOo+ghsy59M25gjVBG
+82siBQkhgl0eSzp/wVqa41F/KCY5hY8moKZARelNgOFQQxRpK6gBhj53TjF7B0w834r3S30F37qA
+d+T7yfH9drN5I4mNeTHpxPKeI1KJneZUqKt1PR1iZScwPzHHIfUWRiZ8ilJwNNy2MoZONKh7lhf4
+ILfYclRmMu7UJfb2gFjvTnzUwS5YJ8U0H5EYy7oHZS+7q3GXuL953tFypr1m0kvDYW4kYwyhHRZE
+XcDvDWvmO83BIk1AOQhzQ4ak4JLBpVQJnrPBhGUZOUAmIuRoV9If5WfvjVymH13VuAKoPJR3902u
+Gul/3Uq+ifNDF8btPpw=
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIDTTCCAjWgAwIBAgIEOHEczzANBgkqhkiG9w0BAQsFADBXMQswCQYDVQQGEwJVUzERMA8GA1UE
+BxMIU3lyYWN1c2UxEzARBgNVBAoTCkFwYWNoZVRlc3QxDzANBgNVBAsTBlRhcnBpbjEPMA0GA1UE
+AxMGVGFycGluMB4XDTE1MDkwOTE1NTA1M1oXDTI1MDkwNjE1NTA1M1owVzELMAkGA1UEBhMCVVMx
+ETAPBgNVBAcTCFN5cmFjdXNlMRMwEQYDVQQKEwpBcGFjaGVUZXN0MQ8wDQYDVQQLEwZUYXJwaW4x
+DzANBgNVBAMTBlRhcnBpbjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAJlWtQr06Soq
+QwTIKgvrLXxcqs/i6FNep3OF5nhzi4K7GOuV88UTyD3TBCFOF/sOtnVfR+mPPSfWe0z+avMKsRiw
+szzak+w2eM9cOBofO+3Ag1i9mQLpkjmkMHxflZ45C0GPcwnU/BekOKZvJ0OcJYZU6S8wszpGPinv
+OPeN1V56Wj3ud/lLR3Ll14G4QdbOxbS6tstJ+olL7Xtz7CfARqCNEjGbKx4VceiIjraheqKM0kLE
+RpdQ0DBgefGEI41BW1wogg92t6PQ6Em1RYeu97pDppSYoA/RYBW5xIDj7vz7aTVY6RaHZwAGNF+1
+Yzj8PVgV7Ppgf5VIhcIFiTyaUuECAwEAAaMhMB8wHQYDVR0OBBYEFMhTmGMuJOrPNTUCjKuRLGQ9
+la4gMA0GCSqGSIb3DQEBCwUAA4IBAQA86Rqp0xrNYb/M7dfk8SzVLaCMPyTslnhiZOVIWwQScwu8
+xqfiDXGg1000r/3N9/ACduiMwwmxYRT3OZOK8DhsHsmQXbY1vTBUEAQ3hx+mV7dPMi3WtmdU4vz6
+KtLPbl3G0803Jujxe0qcFk6FzOhlIiqd0jBRQqvMFWqzzRXDjhy64uLeVY2fNtX9w/b3xWUTL1kI
+mR8SpQnOdWunLqZLrksnuzVGU/hutD11ge0JOQRKHhTBoLBSpqGD8PPTjJipR0p7JII8KI8LbDI6
+YesmuRQmkEbpCMqM5FGVjN7VLeLjRSWcf5dT056WjErd/1zRNFrC0Jjf++g37arTOLQn
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIDTTCCAjWgAwIBAgIEUgxbaTANBgkqhkiG9w0BAQsFADBXMQswCQYDVQQGEwJVUzERMA8GA1UE
+BxMIU3lyYWN1c2UxEzARBgNVBAoTCkFwYWNoZVRlc3QxDzANBgNVBAsTBlBvbHRpbTEPMA0GA1UE
+AxMGUG9sdGltMB4XDTE1MDkwOTE1NTM0NFoXDTI1MDkwNjE1NTM0NFowVzELMAkGA1UEBhMCVVMx
+ETAPBgNVBAcTCFN5cmFjdXNlMRMwEQYDVQQKEwpBcGFjaGVUZXN0MQ8wDQYDVQQLEwZQb2x0aW0x
+DzANBgNVBAMTBlBvbHRpbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKxyUZCjOaVe
+IpptbRbdr9Ki+3W/n2G6jmEOp3LJGtQC6JbAh1IprMpC6nbWwp/W0nnBXyCpevYk6Dj5VtLV0NU/
+1pLnzaS5E/EhZKmxL2PXpMozH7js3FsP/8j9FflvIhhMybSa3otw9tmBf1+Tc6mGlcDsZlHRju91
+WdVMRUVEsOBhNPZccKRTd2QK0H83kYSXMrcGc7dmtuWUWzavbVXdq20+UrV6V8Z/aW/Um270d3Zj
+9VFw6Ax4m0IlCmPM7OA/ONA/gzmsT5BVu0EueE4s9RtXCvK+vR+l2o1fwHW0gtIkQShvR8RBGZjf
+9onepE27U/Uya/+CxQWb3K17g+kCAwEAAaMhMB8wHQYDVR0OBBYEFKI4clFM35A+xunrsFmmuN8i
+Rc/gMA0GCSqGSIb3DQEBCwUAA4IBAQCceUMhVspIAMhA4JMdXgdowWhVEY9vhKJhoILRQ4wdorLs
+pQrUZMBxB7juJ2RdOCO+17Y2gYJi4F1HYaPn0q70iZQRAH4AxiSGPpKD9Qxgs4wIHZgzZ5NwCkko
+AXmSM+SyNiDDZBFd01120gmw40Ly8/3HcDR/um6/kx/YAKgJhc6fDGpzQOrLnoTxeyVV1twAmA+R
+PcrmRA6NAS8baWlzUXAYu8pq/xTOl77niKdAvndmtmlEDmsj0BXeXeCURRVODYU8cMTueudHjois
+tj5C6jX6xjGz1/XcXUaZX5Lr34GixSwJRzabrrGYl7S2sKHmEBUUoB4hortyb2Ufedg+
+-----END CERTIFICATE-----

http://git-wip-us.apache.org/repos/asf/cxf/blob/e61a83d4/systests/transport-undertow/src/test/resources/keys/alice.jks
----------------------------------------------------------------------
diff --git a/systests/transport-undertow/src/test/resources/keys/alice.jks b/systests/transport-undertow/src/test/resources/keys/alice.jks
new file mode 100644
index 0000000..213b26c
Binary files /dev/null and b/systests/transport-undertow/src/test/resources/keys/alice.jks differ

http://git-wip-us.apache.org/repos/asf/cxf/blob/e61a83d4/systests/transport-undertow/src/test/resources/keys/bob.jks
----------------------------------------------------------------------
diff --git a/systests/transport-undertow/src/test/resources/keys/bob.jks b/systests/transport-undertow/src/test/resources/keys/bob.jks
new file mode 100644
index 0000000..5550912
Binary files /dev/null and b/systests/transport-undertow/src/test/resources/keys/bob.jks differ

http://git-wip-us.apache.org/repos/asf/cxf/blob/e61a83d4/systests/transport-undertow/src/test/resources/keys/cxfca.jks
----------------------------------------------------------------------
diff --git a/systests/transport-undertow/src/test/resources/keys/cxfca.jks b/systests/transport-undertow/src/test/resources/keys/cxfca.jks
new file mode 100644
index 0000000..53ad239
Binary files /dev/null and b/systests/transport-undertow/src/test/resources/keys/cxfca.jks differ

http://git-wip-us.apache.org/repos/asf/cxf/blob/e61a83d4/systests/transport-undertow/src/test/resources/keys/genkeys.sh
----------------------------------------------------------------------
diff --git a/systests/transport-undertow/src/test/resources/keys/genkeys.sh b/systests/transport-undertow/src/test/resources/keys/genkeys.sh
new file mode 100755
index 0000000..a01a569
--- /dev/null
+++ b/systests/transport-undertow/src/test/resources/keys/genkeys.sh
@@ -0,0 +1,53 @@
+
+# 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.
+
+#
+# This file generates a number of keys/certificates and keystores for 
+# names to be used with corresponding CXF configuration files (*.cxf).
+#
+
+#
+# Start with a clean slate. Remove all keystores.
+#
+rm -f *.jks
+rm -f Truststore.pem
+
+#
+# This function generates a key/self-signed certificate with the following DN.
+#  "CN=$1, OU=$2, O=ApacheTest, L=Syracuse, C=US" and adds it to 
+# the truststore.
+#
+function genkey {
+    keytool -genkey -alias $2 -keystore $2.jks -dname "CN=$1, OU=$2, O=ApacheTest, L=Syracuse, C=US" -keyalg RSA -keypass password -storepass password -storetype jks -validity 10000
+    keytool -export -file $2.cer -alias $2 -keystore $2.jks -storepass password
+    keytool -import -file $2.cer -alias $2 -noprompt -keystore Truststore.jks -storepass password
+}
+
+#
+# We generate keys/certificates with the following CN=<name> OU=<name>
+# The CN used to be "localhost" to conform to the default HostnameVerifier of
+# HttpsURLConnection so it would work for tests. However, we have enhanced
+# the HTTP Conduit logic to accept anything in the CN in favor of the 
+# MessageTrustDecider callback making the verification determination.
+#
+for name in Bethal Gordy Tarpin Poltim Morpit
+do
+   genkey $name $name
+   keytool -export -keystore Truststore.jks -storepass password -alias $i -rfc >> Truststore.pem
+done
+

http://git-wip-us.apache.org/repos/asf/cxf/blob/e61a83d4/systests/transport-undertow/src/test/resources/keys/subjalt.jks
----------------------------------------------------------------------
diff --git a/systests/transport-undertow/src/test/resources/keys/subjalt.jks b/systests/transport-undertow/src/test/resources/keys/subjalt.jks
new file mode 100644
index 0000000..fefac18
Binary files /dev/null and b/systests/transport-undertow/src/test/resources/keys/subjalt.jks differ

http://git-wip-us.apache.org/repos/asf/cxf/blob/e61a83d4/systests/transport-undertow/src/test/resources/org/apache/cxf/systest/http_undertow/SessionServer.xml
----------------------------------------------------------------------
diff --git a/systests/transport-undertow/src/test/resources/org/apache/cxf/systest/http_undertow/SessionServer.xml b/systests/transport-undertow/src/test/resources/org/apache/cxf/systest/http_undertow/SessionServer.xml
new file mode 100644
index 0000000..cf12454
--- /dev/null
+++ b/systests/transport-undertow/src/test/resources/org/apache/cxf/systest/http_undertow/SessionServer.xml
@@ -0,0 +1,46 @@
+<?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.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:sec="http://cxf.apache.org/configuration/security" xmlns:http="http://cxf.apache.org/transports/http/configuration" xmlns:httpu="http://cxf.apache.org/transports/http-undertow/configuration" xmlns:jaxws="http://cxf.apache.org/jaxws" xsi:schemaLocation="                    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-undertow/configuration               http://cxf.apache.org/schemas/configuration/http-undertow.xsd            http://cxf.apache.org/jaxws                    http://cxf.apache.org/schemas/jaxws.xsd            http://www.springframework.org/schema/beans               http://www.springframework.org/
 schema/beans/spring-beans.xsd">
+    <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
+    <httpu:engine-factory bus="cxf">
+        <httpu:engine port="${testutil.ports.SessionServer}">
+        </httpu:engine>
+    </httpu:engine-factory>
+    <jaxws:endpoint address="http://localhost:${testutil.ports.SessionServer}/SoapContext/GreeterPort" implementor="org.apache.cxf.systest.http_undertow.GreeterSessionImpl">
+        <jaxws:properties>
+            <entry key="org.apache.cxf.oneway.robust" value="true"/>
+        </jaxws:properties>
+    </jaxws:endpoint>
+    <jaxws:endpoint address="http://localhost:${testutil.ports.SessionServer}/Stateful1" implementorClass="org.apache.cxf.systest.http_undertow.StatefulGreeterImpl">
+        <jaxws:invoker>
+            <bean class="org.apache.cxf.jaxws.JAXWSMethodInvoker">
+                <constructor-arg>
+                    <bean class="org.apache.cxf.service.invoker.SessionFactory">
+                        <constructor-arg value="org.apache.cxf.systest.http_undertow.StatefulGreeterImpl"/>
+                    </bean>
+                </constructor-arg>
+            </bean>
+        </jaxws:invoker>
+    </jaxws:endpoint>
+    <jaxws:endpoint address="http://localhost:${testutil.ports.SessionServer}/Stateful2" implementorClass="org.apache.cxf.systest.http_undertow.SessionAnnotationGreeterImpl"/>
+    <jaxws:endpoint address="http://localhost:${testutil.ports.SessionServer}/PerRequest" implementorClass="org.apache.cxf.systest.http_undertow.PerRequestAnnotationGreeterImpl"/>
+    <bean id="SpringBean" class="org.apache.cxf.systest.http_undertow.SpringAnnotationGreeterImpl"/>
+    <jaxws:endpoint address="http://localhost:${testutil.ports.SessionServer}/SpringBean" implementorClass="org.apache.cxf.systest.http_undertow.SpringAnnotationGreeterImpl"/>
+</beans>

http://git-wip-us.apache.org/repos/asf/cxf/blob/e61a83d4/systests/transport-undertow/src/test/resources/org/apache/cxf/systest/http_undertow/continuations/cxf.xml
----------------------------------------------------------------------
diff --git a/systests/transport-undertow/src/test/resources/org/apache/cxf/systest/http_undertow/continuations/cxf.xml b/systests/transport-undertow/src/test/resources/org/apache/cxf/systest/http_undertow/continuations/cxf.xml
new file mode 100644
index 0000000..2e67318
--- /dev/null
+++ b/systests/transport-undertow/src/test/resources/org/apache/cxf/systest/http_undertow/continuations/cxf.xml
@@ -0,0 +1,24 @@
+<?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.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:http="http://cxf.apache.org/transports/http/configuration" xmlns:jaxws="http://cxf.apache.org/jaxws" xsi:schemaLocation="        http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.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:conduit name="{http://cxf.apache.org/systest/jaxws}HelloContinuationPort.http-conduit">
+        <http:client ConnectionTimeout="3000000" ReceiveTimeout="3000000"/>
+    </http:conduit>
+</beans>

http://git-wip-us.apache.org/repos/asf/cxf/blob/e61a83d4/systests/transport-undertow/src/test/resources/org/apache/cxf/systest/http_undertow/continuations/cxf_https.xml
----------------------------------------------------------------------
diff --git a/systests/transport-undertow/src/test/resources/org/apache/cxf/systest/http_undertow/continuations/cxf_https.xml b/systests/transport-undertow/src/test/resources/org/apache/cxf/systest/http_undertow/continuations/cxf_https.xml
new file mode 100644
index 0000000..272926c
--- /dev/null
+++ b/systests/transport-undertow/src/test/resources/org/apache/cxf/systest/http_undertow/continuations/cxf_https.xml
@@ -0,0 +1,36 @@
+<?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.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:http="http://cxf.apache.org/transports/http/configuration" xmlns:jaxws="http://cxf.apache.org/jaxws" 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/transports/http/configuration         http://cxf.apache.org/schemas/configuration/http-conf.xsd         http://cxf.apache.org/transports/http-undertow/configuration   http://cxf.apache.org/schemas/configuration/http-undertow.xsd         http://cxf.apache.org/configuration/security                http://cxf.apache.org/schemas/configuration/security.xsd ">
+    <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
+    <!-- -->
+    <!-- HTTP/S configuration for clients -->
+    <!-- -->
+    <http:conduit name="https://localhost:.*">
+        <http:client ConnectionTimeout="3000000" ReceiveTimeout="3000000"/>
+        <http:tlsClientParameters disableCNCheck="true">
+            <sec:keyManagers keyPassword="password">
+                <sec:keyStore type="JKS" password="password" resource="keys/Morpit.jks"/>
+            </sec:keyManagers>
+            <sec:trustManagers>
+                <sec:keyStore type="JKS" password="password" resource="keys/Truststore.jks"/>
+            </sec:trustManagers>
+        </http:tlsClientParameters>
+    </http:conduit>
+</beans>

http://git-wip-us.apache.org/repos/asf/cxf/blob/e61a83d4/systests/transport-undertow/src/test/resources/org/apache/cxf/systest/http_undertow/continuations/jaxws-server.xml
----------------------------------------------------------------------
diff --git a/systests/transport-undertow/src/test/resources/org/apache/cxf/systest/http_undertow/continuations/jaxws-server.xml b/systests/transport-undertow/src/test/resources/org/apache/cxf/systest/http_undertow/continuations/jaxws-server.xml
new file mode 100644
index 0000000..725ba01
--- /dev/null
+++ b/systests/transport-undertow/src/test/resources/org/apache/cxf/systest/http_undertow/continuations/jaxws-server.xml
@@ -0,0 +1,47 @@
+<?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.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:http="http://cxf.apache.org/transports/http/configuration" xmlns:httpu="http://cxf.apache.org/transports/http-undertow/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/transports/http/configuration         http://cxf.apache.org/schemas/configuration/http-conf.xsd         http://cxf.apache.org/transports/http-undertow/configuration   http://cxf.apache.org/schemas/configuration/http-undertow.xsd         http://cxf.apache.org/configuration/security                http://cxf.apache.org/schemas/configuration/security.xsd         ">
+    <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
+    <!-- -->
+    <!-- This Spring config file is designed to represent a minimal -->
+    <!-- configuration for spring-loading a CXF servant, where the -->
+    <!-- servant listens using HTTP/S as the transport protocol. -->
+    <!-- -->
+    <!-- Note that the service endpoint is spring-loaded.  In the -->
+    <!-- scenario in which this config is designed to run, the -->
+    <!-- server application merely instantiates a Bus, and does not -->
+    <!-- publish any services programmatically -->
+    <!-- -->
+    <!-- -->
+    <!-- TLS Port configuration parameters for port 9091 -->
+    <!-- -->
+    <httpu:engine-factory>
+        <httpu:engine port="${testutil.ports.Server.1}">
+            <httpu:tlsServerParameters>
+                <sec:keyManagers keyPassword="password">
+                    <sec:keyStore type="JKS" password="password" resource="keys/Bethal.jks"/>
+                </sec:keyManagers>
+                <sec:trustManagers>
+                    <sec:keyStore type="JKS" password="password" resource="keys/Truststore.jks"/>
+                </sec:trustManagers>
+            </httpu:tlsServerParameters>
+        </httpu:engine>
+    </httpu:engine-factory>
+</beans>