[jbossws-commits] JBossWS SVN: r18237 - in projects/jaxws-httpserver-httpspi/trunk: src/main/java/org/jboss/ws/httpserver_httpspi and 1 other directories.

jbossws-commits at lists.jboss.org jbossws-commits at lists.jboss.org
Tue Jan 14 08:06:14 EST 2014


Author: asoldano
Date: 2014-01-14 08:06:14 -0500 (Tue, 14 Jan 2014)
New Revision: 18237

Removed:
   projects/jaxws-httpserver-httpspi/trunk/src/main/java/org/jboss/ws/httpserver_httpspi/UndertowHeaderMap.java
   projects/jaxws-httpserver-httpspi/trunk/src/main/java/org/jboss/ws/httpserver_httpspi/UndertowHttpContext.java
   projects/jaxws-httpserver-httpspi/trunk/src/main/java/org/jboss/ws/httpserver_httpspi/UndertowHttpExchange.java
   projects/jaxws-httpserver-httpspi/trunk/src/main/java/org/jboss/ws/httpserver_httpspi/UndertowHttpHandler.java
   projects/jaxws-httpserver-httpspi/trunk/src/main/java/org/jboss/ws/httpserver_httpspi/UndertowServer.java
Modified:
   projects/jaxws-httpserver-httpspi/trunk/pom.xml
   projects/jaxws-httpserver-httpspi/trunk/src/main/java/org/jboss/ws/httpserver_httpspi/HttpContextDelegate.java
   projects/jaxws-httpserver-httpspi/trunk/src/main/java/org/jboss/ws/httpserver_httpspi/HttpExchangeDelegate.java
   projects/jaxws-httpserver-httpspi/trunk/src/main/java/org/jboss/ws/httpserver_httpspi/HttpHandlerDelegate.java
   projects/jaxws-httpserver-httpspi/trunk/src/main/java/org/jboss/ws/httpserver_httpspi/HttpServerContextFactory.java
   projects/jaxws-httpserver-httpspi/trunk/src/main/java/org/jboss/ws/httpserver_httpspi/PathUtils.java
   projects/jaxws-httpserver-httpspi/trunk/src/test/java/org/jboss/ws/httpserver_httpspi/EndpointAPITest.java
Log:
[JBWS-3702] svn merge -r 18231:18230 .


Modified: projects/jaxws-httpserver-httpspi/trunk/pom.xml
===================================================================
--- projects/jaxws-httpserver-httpspi/trunk/pom.xml	2014-01-14 13:00:46 UTC (rev 18236)
+++ projects/jaxws-httpserver-httpspi/trunk/pom.xml	2014-01-14 13:06:14 UTC (rev 18237)
@@ -30,7 +30,6 @@
     <junit.version>4.8.1</junit.version>
     <cxf.version>2.3.0</cxf.version>
     <servlet-api.version>1.0.0.Beta2</servlet-api.version>
-    <io.undertow.version>1.0.0.Beta30</io.undertow.version>
   </properties>
 
   <!-- Dependencies -->
@@ -40,19 +39,6 @@
        <artifactId>jboss-jaxws-api_2.2_spec</artifactId>
        <version>${jaxws.version}</version>
     </dependency> 
-
-    <dependency>
-       <groupId>io.undertow</groupId>
-       <artifactId>undertow-core</artifactId>
-       <version>${io.undertow.version}</version>
-       <exclusions>
-           <exclusion>
-               <groupId>io.undertow</groupId>
-               <artifactId>undertow-build-config</artifactId>
-           </exclusion>
-       </exclusions>
-   </dependency>
-
   
     <!-- test dependencies -->
     <dependency>

Modified: projects/jaxws-httpserver-httpspi/trunk/src/main/java/org/jboss/ws/httpserver_httpspi/HttpContextDelegate.java
===================================================================
--- projects/jaxws-httpserver-httpspi/trunk/src/main/java/org/jboss/ws/httpserver_httpspi/HttpContextDelegate.java	2014-01-14 13:00:46 UTC (rev 18236)
+++ projects/jaxws-httpserver-httpspi/trunk/src/main/java/org/jboss/ws/httpserver_httpspi/HttpContextDelegate.java	2014-01-14 13:06:14 UTC (rev 18237)
@@ -35,6 +35,7 @@
  * @since 22-Aug-2010
  *
  */
+ at SuppressWarnings("restriction")
 public class HttpContextDelegate extends HttpContext
 {
    private com.sun.net.httpserver.HttpContext delegate;

Modified: projects/jaxws-httpserver-httpspi/trunk/src/main/java/org/jboss/ws/httpserver_httpspi/HttpExchangeDelegate.java
===================================================================
--- projects/jaxws-httpserver-httpspi/trunk/src/main/java/org/jboss/ws/httpserver_httpspi/HttpExchangeDelegate.java	2014-01-14 13:00:46 UTC (rev 18236)
+++ projects/jaxws-httpserver-httpspi/trunk/src/main/java/org/jboss/ws/httpserver_httpspi/HttpExchangeDelegate.java	2014-01-14 13:06:14 UTC (rev 18237)
@@ -45,6 +45,7 @@
  * @since 22-Aug-2010
  *
  */
+ at SuppressWarnings("restriction")
 public class HttpExchangeDelegate extends HttpExchange
 {
    private com.sun.net.httpserver.HttpExchange delegate;

Modified: projects/jaxws-httpserver-httpspi/trunk/src/main/java/org/jboss/ws/httpserver_httpspi/HttpHandlerDelegate.java
===================================================================
--- projects/jaxws-httpserver-httpspi/trunk/src/main/java/org/jboss/ws/httpserver_httpspi/HttpHandlerDelegate.java	2014-01-14 13:00:46 UTC (rev 18236)
+++ projects/jaxws-httpserver-httpspi/trunk/src/main/java/org/jboss/ws/httpserver_httpspi/HttpHandlerDelegate.java	2014-01-14 13:06:14 UTC (rev 18237)
@@ -34,6 +34,7 @@
  * @sine 22-Aug-2010
  *
  */
+ at SuppressWarnings("restriction")
 public class HttpHandlerDelegate implements HttpHandler {
 
    private javax.xml.ws.spi.http.HttpHandler delegate;

Modified: projects/jaxws-httpserver-httpspi/trunk/src/main/java/org/jboss/ws/httpserver_httpspi/HttpServerContextFactory.java
===================================================================
--- projects/jaxws-httpserver-httpspi/trunk/src/main/java/org/jboss/ws/httpserver_httpspi/HttpServerContextFactory.java	2014-01-14 13:00:46 UTC (rev 18236)
+++ projects/jaxws-httpserver-httpspi/trunk/src/main/java/org/jboss/ws/httpserver_httpspi/HttpServerContextFactory.java	2014-01-14 13:06:14 UTC (rev 18237)
@@ -21,10 +21,9 @@
  */
 package org.jboss.ws.httpserver_httpspi;
 
+import com.sun.net.httpserver.HttpServer;
 import javax.xml.ws.spi.http.HttpContext;
 
-import com.sun.net.httpserver.HttpServer;
-
 /**
  * A factory for building JDK6 httpserver' flavor of 
  * 
@@ -32,15 +31,11 @@
  * @since 22-Aug-2010
  *
  */
+ at SuppressWarnings("restriction")
 public class HttpServerContextFactory
 {
    public static HttpContext createHttpContext(HttpServer server, String contextPath, String path)
    {
       return new HttpContextDelegate(server.createContext(contextPath + path), path);
    }
-   
-   public static HttpContext createHttpContext(UndertowServer server, String contextPath, String path)
-   {
-     return new UndertowHttpContext(server.getPathHandler(), contextPath, path); 
-   }
 }

Modified: projects/jaxws-httpserver-httpspi/trunk/src/main/java/org/jboss/ws/httpserver_httpspi/PathUtils.java
===================================================================
--- projects/jaxws-httpserver-httpspi/trunk/src/main/java/org/jboss/ws/httpserver_httpspi/PathUtils.java	2014-01-14 13:00:46 UTC (rev 18236)
+++ projects/jaxws-httpserver-httpspi/trunk/src/main/java/org/jboss/ws/httpserver_httpspi/PathUtils.java	2014-01-14 13:06:14 UTC (rev 18237)
@@ -44,11 +44,6 @@
       return getPathInternal(addr.getPath());
    }
    
-   public static String getPathFromRequest(String requestPath)
-   {
-      return getPathInternal(requestPath);
-   }
-
    private static String getPathInternal(String rawpath)
    {
       String path = removeTrailingSlash(rawpath);
@@ -71,11 +66,6 @@
       return getContextPathInternal(getPathFromString(addr));
    }
    
-   public static String getContextPathFromRequest(String requestPath)
-   {
-      return getContextPathInternal(requestPath);
-   }
-   
    public static String getContextPath(URI addr)
    {
       return getContextPathInternal(addr.getPath());
@@ -106,7 +96,7 @@
       return path;
    }
    
-   public static String removeTrailingSlash(String path)
+   private static String removeTrailingSlash(String path)
    {
       if (path != null && path.length() > 0 && path.lastIndexOf('/') == path.length() - 1)
       {

Deleted: projects/jaxws-httpserver-httpspi/trunk/src/main/java/org/jboss/ws/httpserver_httpspi/UndertowHeaderMap.java
===================================================================
--- projects/jaxws-httpserver-httpspi/trunk/src/main/java/org/jboss/ws/httpserver_httpspi/UndertowHeaderMap.java	2014-01-14 13:00:46 UTC (rev 18236)
+++ projects/jaxws-httpserver-httpspi/trunk/src/main/java/org/jboss/ws/httpserver_httpspi/UndertowHeaderMap.java	2014-01-14 13:06:14 UTC (rev 18237)
@@ -1,208 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2014, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ws.httpserver_httpspi;
-
-import io.undertow.util.HeaderMap;
-import io.undertow.util.HeaderValues;
-import io.undertow.util.HttpString;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-
-
-public class UndertowHeaderMap implements Map<String, List<String>>
-{
-
-   private HeaderMap headerMap;
-
-   public UndertowHeaderMap(HeaderMap headerMap) {
-      this.headerMap = headerMap;
-   }
-
-   @Override
-   public int size()
-   {
-      return headerMap.size();
-   }
-
-   @Override
-   public boolean isEmpty()
-   {
-      return headerMap.size() > 0;
-   }
-
-   @Override
-   public boolean containsKey(Object key)
-   {
-      return headerMap.contains(key.toString());
-   }
-
-   @Override
-   public boolean containsValue(Object value)
-   {
-      Iterator<HeaderValues> ite = headerMap.iterator();
-      while (ite.hasNext())
-      {
-         HeaderValues values = ite.next();
-         if (values.contains(value))
-         {
-            return true;
-         }
-      }
-      return false;
-   }
-
-   @Override
-   public List<String> get(Object key)
-   {
-      HeaderValues values = headerMap.get(key.toString());
-      List<String> result = new ArrayList<String>();
-      if (values != null)
-      {
-         for (String value : values.toArray())
-         {
-            result.add(value);
-         }
-      }
-      return result;
-   }
-
-   @Override
-   public List<String> put(String key, List<String> value)
-   {
-      List<String> previous = get(key);
-      if (previous.isEmpty())
-      {
-         previous = null;
-      }
-      headerMap.addAll(new HttpString(key), value);
-      return previous;
-
-   }
-
-   @Override
-   public List<String> remove(Object key)
-   {
-      List<String> previous = get(key);
-      if (previous.isEmpty())
-      {
-         previous = null;
-      }
-      headerMap.remove(key.toString());
-      return previous;
-   }
-
-   @Override
-   public void putAll(Map<? extends String, ? extends List<String>> m)
-   {
-      for (String key : m.keySet())
-      {
-         headerMap.putAll(new HttpString(key), m.get(key));
-      }
-
-   }
-
-   @Override
-   public void clear()
-   {
-      headerMap.clear();
-
-   }
-
-   @Override
-   public Set<String> keySet()
-   {
-      Set<String> result = new HashSet<String>();
-      for (HeaderValues value : headerMap)
-      {
-         result.add(value.getHeaderName().toString());
-      }
-      return result;
-   }
-
-   @Override
-   public Collection<List<String>> values()
-   {
-      List<List<String>> collections = new ArrayList<List<String>>();
-      for (HeaderValues value : headerMap)
-      {
-         List<String> values = new ArrayList<String>();
-         for (String headerValue : value)
-         {
-            values.add(headerValue);
-         }
-         collections.add(values);
-      }
-      return collections;
-   }
-
-   @Override
-   public Set<java.util.Map.Entry<String, List<String>>> entrySet()
-   {
-      Set<java.util.Map.Entry<String, List<String>>> result = new HashSet<java.util.Map.Entry<String, List<String>>>();
-      for (HeaderValues headerValues : headerMap)
-      {
-         final String key = headerValues.getHeaderName().toString();
-         final List<String> headerValueList = new ArrayList<String>();
-         for (String value : headerValues)
-         {
-            headerValueList.add(value);
-         }
-         result.add(new Entry<String, List<String>>() {
-
-            @Override
-            public String getKey()
-            {
-               return key;
-            }
-
-            @Override
-            public List<String> getValue()
-            {
-               return headerValueList;
-            }
-
-            @Override
-            public List<String> setValue(List<String> value)
-            {
-               List<String> previous = headerMap.get(key);
-               if (previous.isEmpty())
-               {
-                  previous = null;
-               }
-               headerMap.addAll(new HttpString(key), value);
-
-               return previous;
-
-            }
-         });
-      }
-      return result;
-   }
-
-}

Deleted: projects/jaxws-httpserver-httpspi/trunk/src/main/java/org/jboss/ws/httpserver_httpspi/UndertowHttpContext.java
===================================================================
--- projects/jaxws-httpserver-httpspi/trunk/src/main/java/org/jboss/ws/httpserver_httpspi/UndertowHttpContext.java	2014-01-14 13:00:46 UTC (rev 18236)
+++ projects/jaxws-httpserver-httpspi/trunk/src/main/java/org/jboss/ws/httpserver_httpspi/UndertowHttpContext.java	2014-01-14 13:06:14 UTC (rev 18237)
@@ -1,75 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2014, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ws.httpserver_httpspi;
-
-import io.undertow.server.handlers.PathHandler;
-
-import java.util.Set;
-
-import javax.xml.ws.spi.http.HttpContext;
-import javax.xml.ws.spi.http.HttpHandler;
-
-/**
- * @author <a href="mailto:ema at redhat.com">Jim Ma</a>
- *
- */
-//TODO:Look at HttpHandlerImpl - avoid to create duplicate UndertowHttpContext to publish endpoint
-public class UndertowHttpContext extends HttpContext
-{
-   private String handlerpath;
-   private PathHandler pathHandler;
-   private String path;
-
-   public UndertowHttpContext(PathHandler pathHandler, String contextPath, String path)
-   {
-      this.pathHandler = pathHandler;
-      this.path = path;
-      this.handlerpath = contextPath + path;
-   }
-
-   @Override
-   public void setHandler(HttpHandler handler)
-   {
-      pathHandler.addExactPath(handlerpath, new UndertowHttpHandler(handler));
-   }
-
-   @Override
-   public String getPath()
-   {
-      return this.path;
-   }
-
-   @Override
-   public Object getAttribute(String name)
-   {
-      // TODO 
-      return null;
-   }
-
-   @Override
-   public Set<String> getAttributeNames()
-   {
-      // TODO 
-      return null;
-   }
-
-}

Deleted: projects/jaxws-httpserver-httpspi/trunk/src/main/java/org/jboss/ws/httpserver_httpspi/UndertowHttpExchange.java
===================================================================
--- projects/jaxws-httpserver-httpspi/trunk/src/main/java/org/jboss/ws/httpserver_httpspi/UndertowHttpExchange.java	2014-01-14 13:00:46 UTC (rev 18236)
+++ projects/jaxws-httpserver-httpspi/trunk/src/main/java/org/jboss/ws/httpserver_httpspi/UndertowHttpExchange.java	2014-01-14 13:06:14 UTC (rev 18237)
@@ -1,209 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2014, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ws.httpserver_httpspi;
-
-import io.undertow.server.HttpServerExchange;
-import io.undertow.server.handlers.PathHandler;
-import io.undertow.util.HeaderValues;
-import io.undertow.util.HttpString;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.net.InetSocketAddress;
-import java.security.Principal;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import javax.xml.ws.spi.http.HttpContext;
-import javax.xml.ws.spi.http.HttpExchange;
-
-/**
- * @author <a href="mailto:ema at redhat.com">Jim Ma</a>
- *
- */
-public class UndertowHttpExchange extends HttpExchange
-{
-   private HttpServerExchange undertowExchange;
-
-   private UndertowHttpContext context;
-
-   public UndertowHttpExchange(HttpServerExchange serverExchange)
-   {
-      undertowExchange = serverExchange;
-   }
-
-   @Override
-   public Map<String, List<String>> getRequestHeaders()
-   {
-      return new UndertowHeaderMap(undertowExchange.getRequestHeaders());
-   }
-
-   @Override
-   public String getRequestHeader(String name)
-   {
-      HeaderValues headerValues = undertowExchange.getRequestHeaders().get(name);
-      if (headerValues != null && headerValues.size() > 0)
-      {
-         String result = "";
-         for (String headerValue : headerValues)
-         {
-            result = result + headerValue;
-         }
-         return result;
-      }
-      return null;
-   }
-
-   @Override
-   public Map<String, List<String>> getResponseHeaders()
-   {
-      return new UndertowHeaderMap(undertowExchange.getResponseHeaders());
-   }
-
-   @Override
-   public void addResponseHeader(String name, String value)
-   {
-      undertowExchange.getResponseHeaders().add(new HttpString(name), value);
-
-   }
-
-   @Override
-   public String getRequestURI()
-   {
-      return undertowExchange.getRequestURI();
-   }
-
-   @Override
-   public String getContextPath()
-   {
-      return PathUtils.getContextPathFromRequest(undertowExchange.getRequestPath());
-   }
-
-   @Override
-   public String getRequestMethod()
-   {
-      return undertowExchange.getRequestMethod().toString();
-   }
-
-   @Override
-   public HttpContext getHttpContext()
-   {
-      if (context == null)
-      {
-         context = new UndertowHttpContext(new PathHandler(), PathUtils.getContextPathFromRequest(undertowExchange.getRequestPath()),
-               PathUtils.getPathFromRequest(undertowExchange.getRequestPath()));
-      }
-      return context;
-   }
-
-   @Override
-   public void close() throws IOException
-   {
-      undertowExchange.endExchange();
-   }
-
-   @Override
-   public InputStream getRequestBody() throws IOException
-   {
-      return undertowExchange.getInputStream();
-   }
-
-   @Override
-   public OutputStream getResponseBody() throws IOException
-   {
-      return undertowExchange.getOutputStream();
-   }
-
-   @Override
-   public void setStatus(int status)
-   {
-      undertowExchange.setResponseCode(status);
-
-   }
-
-   @Override
-   public InetSocketAddress getRemoteAddress()
-   {
-      return undertowExchange.getSourceAddress();
-   }
-
-   @Override
-   public InetSocketAddress getLocalAddress()
-   {
-      return undertowExchange.getDestinationAddress();
-   }
-
-   @Override
-   public String getProtocol()
-   {
-      return undertowExchange.getProtocol().toString();
-   }
-
-   @Override
-   public String getScheme()
-   {
-      return undertowExchange.getRequestScheme();
-   }
-
-   @Override
-   public String getPathInfo()
-   {
-      return undertowExchange.getRequestPath();
-   }
-
-   @Override
-   public String getQueryString()
-   {
-      return undertowExchange.getQueryString();
-   }
-
-   @Override
-   public Object getAttribute(String name)
-   {
-      // TODO
-      return null;
-   }
-
-   @Override
-   public Set<String> getAttributeNames()
-   {
-      // TODO 
-      return null;
-   }
-
-   @Override
-   public Principal getUserPrincipal()
-   {
-      //TODO
-      return null;
-   }
-
-   @Override
-   public boolean isUserInRole(String role)
-   {
-      //TODO
-      return false;
-   }
-
-}

Deleted: projects/jaxws-httpserver-httpspi/trunk/src/main/java/org/jboss/ws/httpserver_httpspi/UndertowHttpHandler.java
===================================================================
--- projects/jaxws-httpserver-httpspi/trunk/src/main/java/org/jboss/ws/httpserver_httpspi/UndertowHttpHandler.java	2014-01-14 13:00:46 UTC (rev 18236)
+++ projects/jaxws-httpserver-httpspi/trunk/src/main/java/org/jboss/ws/httpserver_httpspi/UndertowHttpHandler.java	2014-01-14 13:06:14 UTC (rev 18237)
@@ -1,47 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2014, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ws.httpserver_httpspi;
-
-import io.undertow.server.HttpHandler;
-import io.undertow.server.HttpServerExchange;
-
-/**
- * @author <a href="mailto:ema at redhat.com">Jim Ma</a>
- *
- */
-public class UndertowHttpHandler implements HttpHandler
-{
-
-   private javax.xml.ws.spi.http.HttpHandler spihandler;
-
-   public UndertowHttpHandler(javax.xml.ws.spi.http.HttpHandler handler)
-   {
-      spihandler = handler;
-   }
-
-   @Override
-   public void handleRequest(HttpServerExchange exchange) throws Exception
-   {
-      spihandler.handle(new UndertowHttpExchange(exchange));
-   }
-
-}

Deleted: projects/jaxws-httpserver-httpspi/trunk/src/main/java/org/jboss/ws/httpserver_httpspi/UndertowServer.java
===================================================================
--- projects/jaxws-httpserver-httpspi/trunk/src/main/java/org/jboss/ws/httpserver_httpspi/UndertowServer.java	2014-01-14 13:00:46 UTC (rev 18236)
+++ projects/jaxws-httpserver-httpspi/trunk/src/main/java/org/jboss/ws/httpserver_httpspi/UndertowServer.java	2014-01-14 13:06:14 UTC (rev 18237)
@@ -1,69 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2014, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ws.httpserver_httpspi;
-
-import io.undertow.Undertow;
-import io.undertow.Undertow.Builder;
-import io.undertow.server.handlers.BlockingHandler;
-import io.undertow.server.handlers.PathHandler;
-
-/**
- * @author <a href="mailto:ema at redhat.com">Jim Ma</a>
- *
- */
-public class UndertowServer
-{
-   private Builder builder;
-   private PathHandler pathHandler;
-   private Undertow undertow;
-
-   public UndertowServer(int port, String host)
-   {
-      builder = Undertow.builder().addListener(port, host);
-      pathHandler = new PathHandler();
-   }
-
-   public Builder getBuilder()
-   {
-      return builder;
-   }
-
-   public PathHandler getPathHandler()
-   {
-      return pathHandler;
-   }
-
-   public void start()
-   {
-      undertow = builder.setHandler(new BlockingHandler(pathHandler)).build();
-      undertow.start();
-   }
-
-   public void stop()
-   {
-      if (undertow != null)
-      {
-         undertow.stop();
-      }
-   }
-
-}

Modified: projects/jaxws-httpserver-httpspi/trunk/src/test/java/org/jboss/ws/httpserver_httpspi/EndpointAPITest.java
===================================================================
--- projects/jaxws-httpserver-httpspi/trunk/src/test/java/org/jboss/ws/httpserver_httpspi/EndpointAPITest.java	2014-01-14 13:00:46 UTC (rev 18236)
+++ projects/jaxws-httpserver-httpspi/trunk/src/test/java/org/jboss/ws/httpserver_httpspi/EndpointAPITest.java	2014-01-14 13:06:14 UTC (rev 18237)
@@ -25,6 +25,7 @@
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
+import java.net.InetSocketAddress;
 import java.net.URL;
 
 import javax.activation.DataHandler;
@@ -48,24 +49,25 @@
  * @since 22-Aug-2010
  *
  */
+ at SuppressWarnings("restriction")
 public class EndpointAPITest extends Assert
 {
 
    private static int currentPort = 9876;
 
-   private UndertowServer server;
+   private com.sun.net.httpserver.HttpServer server;
 
    @Before
    public void setUp() throws IOException
    {
       currentPort++;
-      server = new UndertowServer(currentPort, "localhost");
+      server = com.sun.net.httpserver.HttpServer.create(new InetSocketAddress(currentPort), 0);
    }
 
    @After
    public void tearDown()
    {
-      server.stop();
+      server.stop(0);
       server = null;
    }
 
@@ -106,6 +108,7 @@
          invokeEndpoint(address);
 
          endpoint.stop();
+         server.removeContext(contextPath + path);
       }
    }
    



More information about the jbossws-commits mailing list