[jbossws-commits] JBossWS SVN: r12795 - in stack/native/trunk/modules: core/src/main/java/org/jboss/ws/core/jaxws/spi and 6 other directories.

jbossws-commits at lists.jboss.org jbossws-commits at lists.jboss.org
Fri Aug 13 08:01:32 EDT 2010


Author: richard.opalka at jboss.com
Date: 2010-08-13 08:01:28 -0400 (Fri, 13 Aug 2010)
New Revision: 12795

Added:
   stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/HttpContext.java
   stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/HttpServer.java
   stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyHandlerDeploymentAspect.java
   stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyHttpContext.java
   stack/native/trunk/modules/core/src/main/resources/META-INF/services/org.jboss.wsf.spi.deployment.DeploymentModelFactory
   stack/native/trunk/modules/core/src/main/resources/META-INF/services/org.jboss.wsf.spi.invocation.InvocationHandlerFactory
Removed:
   stack/native/trunk/modules/client/src/main/resources/META-INF/services/org.jboss.wsf.spi.deployment.DeploymentModelFactory
   stack/native/trunk/modules/client/src/main/resources/META-INF/services/org.jboss.wsf.spi.http.HttpServerFactory
   stack/native/trunk/modules/client/src/main/resources/META-INF/services/org.jboss.wsf.spi.invocation.InvocationHandlerFactory
   stack/native/trunk/modules/client/src/main/resources/META-INF/services/org.jboss.wsf.spi.management.EndpointRegistryFactory
   stack/native/trunk/modules/client/src/main/resources/META-INF/services/org.jboss.wsf.spi.management.ServerConfigFactory
   stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyEndpointRegistryFactory.java
   stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyHttpServerConfigFactory.java
   stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyInvocationHandlerFactory.java
Modified:
   stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/EndpointImpl.java
   stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyCallbackHandlerImpl.java
   stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyHttpServerAdapter.java
   stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyHttpServerConfig.java
   stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyHttpServerFactory.java
   stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/builder/MetaDataBuilder.java
   stack/native/trunk/modules/core/src/main/java/org/jboss/wsf/stack/jbws/RequestHandlerImpl.java
   stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/EndpointServlet.java
   stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/EndpointTestCase.java
   stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/endpoint/WEB-INF/wsdl/TestService.wsdl
Log:
[JBWS-3106] get rid of broken HTTP SPI

Deleted: stack/native/trunk/modules/client/src/main/resources/META-INF/services/org.jboss.wsf.spi.deployment.DeploymentModelFactory
===================================================================
--- stack/native/trunk/modules/client/src/main/resources/META-INF/services/org.jboss.wsf.spi.deployment.DeploymentModelFactory	2010-08-13 11:48:08 UTC (rev 12794)
+++ stack/native/trunk/modules/client/src/main/resources/META-INF/services/org.jboss.wsf.spi.deployment.DeploymentModelFactory	2010-08-13 12:01:28 UTC (rev 12795)
@@ -1 +0,0 @@
-org.jboss.wsf.framework.deployment.ArchiveDeploymentModelFactory
\ No newline at end of file

Deleted: stack/native/trunk/modules/client/src/main/resources/META-INF/services/org.jboss.wsf.spi.http.HttpServerFactory
===================================================================
--- stack/native/trunk/modules/client/src/main/resources/META-INF/services/org.jboss.wsf.spi.http.HttpServerFactory	2010-08-13 11:48:08 UTC (rev 12794)
+++ stack/native/trunk/modules/client/src/main/resources/META-INF/services/org.jboss.wsf.spi.http.HttpServerFactory	2010-08-13 12:01:28 UTC (rev 12795)
@@ -1 +0,0 @@
-org.jboss.ws.core.jaxws.spi.http.NettyHttpServerFactory
\ No newline at end of file

Deleted: stack/native/trunk/modules/client/src/main/resources/META-INF/services/org.jboss.wsf.spi.invocation.InvocationHandlerFactory
===================================================================
--- stack/native/trunk/modules/client/src/main/resources/META-INF/services/org.jboss.wsf.spi.invocation.InvocationHandlerFactory	2010-08-13 11:48:08 UTC (rev 12794)
+++ stack/native/trunk/modules/client/src/main/resources/META-INF/services/org.jboss.wsf.spi.invocation.InvocationHandlerFactory	2010-08-13 12:01:28 UTC (rev 12795)
@@ -1 +0,0 @@
-org.jboss.ws.core.jaxws.spi.http.NettyInvocationHandlerFactory
\ No newline at end of file

Deleted: stack/native/trunk/modules/client/src/main/resources/META-INF/services/org.jboss.wsf.spi.management.EndpointRegistryFactory
===================================================================
--- stack/native/trunk/modules/client/src/main/resources/META-INF/services/org.jboss.wsf.spi.management.EndpointRegistryFactory	2010-08-13 11:48:08 UTC (rev 12794)
+++ stack/native/trunk/modules/client/src/main/resources/META-INF/services/org.jboss.wsf.spi.management.EndpointRegistryFactory	2010-08-13 12:01:28 UTC (rev 12795)
@@ -1 +0,0 @@
-org.jboss.ws.core.jaxws.spi.http.NettyEndpointRegistryFactory
\ No newline at end of file

Deleted: stack/native/trunk/modules/client/src/main/resources/META-INF/services/org.jboss.wsf.spi.management.ServerConfigFactory
===================================================================
--- stack/native/trunk/modules/client/src/main/resources/META-INF/services/org.jboss.wsf.spi.management.ServerConfigFactory	2010-08-13 11:48:08 UTC (rev 12794)
+++ stack/native/trunk/modules/client/src/main/resources/META-INF/services/org.jboss.wsf.spi.management.ServerConfigFactory	2010-08-13 12:01:28 UTC (rev 12795)
@@ -1 +0,0 @@
-org.jboss.ws.core.jaxws.spi.http.NettyHttpServerConfigFactory
\ No newline at end of file

Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/EndpointImpl.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/EndpointImpl.java	2010-08-13 11:48:08 UTC (rev 12794)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/EndpointImpl.java	2010-08-13 12:01:28 UTC (rev 12795)
@@ -46,9 +46,9 @@
 import org.jboss.wsf.spi.SPIProvider;
 import org.jboss.wsf.spi.SPIProviderResolver;
 import org.jboss.wsf.spi.deployment.Deployment;
-import org.jboss.wsf.spi.http.HttpContext;
-import org.jboss.wsf.spi.http.HttpServer;
-import org.jboss.wsf.spi.http.HttpServerFactory;
+import org.jboss.ws.core.jaxws.spi.http.HttpContext;
+import org.jboss.ws.core.jaxws.spi.http.HttpServer;
+import org.jboss.ws.core.jaxws.spi.http.NettyHttpServerFactory;
 import org.jboss.wsf.spi.management.ServerConfig;
 import org.jboss.wsf.spi.management.ServerConfigFactory;
 import org.w3c.dom.Element;
@@ -126,12 +126,9 @@
       this.checkPublishEndpointPermission();
 
       // Get HTTP server
-      final SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
-      final HttpServer httpServer = spiProvider.getSPI(HttpServerFactory.class).getHttpServer();
+      final HttpServer httpServer = NettyHttpServerFactory.getHttpServer();
+      final HttpContext context = httpServer.createContext(this.getContextRoot());
 
-      final String contextRoot = this.getContextRoot();
-      final HttpContext context = httpServer.createContext(contextRoot);
-
       this.publish(context);
    }
 

Added: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/HttpContext.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/HttpContext.java	                        (rev 0)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/HttpContext.java	2010-08-13 12:01:28 UTC (rev 12795)
@@ -0,0 +1,37 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, 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.core.jaxws.spi.http;
+
+import org.jboss.wsf.spi.deployment.Extensible;
+
+/**
+ * An abstract HTTP Context
+ *
+ * @author Thomas.Diesler at jboss.org
+ * @since 07-Jul-2006
+ */
+public interface HttpContext extends Extensible
+{
+   HttpServer getHttpServer();
+
+   String getContextRoot();
+}

Added: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/HttpServer.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/HttpServer.java	                        (rev 0)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/HttpServer.java	2010-08-13 12:01:28 UTC (rev 12795)
@@ -0,0 +1,42 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, 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.core.jaxws.spi.http;
+
+import javax.xml.ws.Endpoint;
+
+/**
+ * An abstract HTTP Server.
+ *
+ * @author <a href="mailto:tdiesler at redhat.com">Thomas Diesler</a>
+ * @author <a href="mailto:ropalka at redhat.com">Richard Opalka</a>
+ */
+public interface HttpServer
+{
+   /** Create an HTTP context */
+   HttpContext createContext(String string);
+
+   /** Publish an JAXWS endpoint to the HTTP server */
+   void publish(HttpContext context, Endpoint endpoint);
+
+   /** Destroys an JAXWS endpoint on the HTTP server */
+   void destroy(HttpContext context, Endpoint endpoint);
+}

Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyCallbackHandlerImpl.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyCallbackHandlerImpl.java	2010-08-13 11:48:08 UTC (rev 12794)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyCallbackHandlerImpl.java	2010-08-13 12:01:28 UTC (rev 12795)
@@ -32,7 +32,6 @@
 import org.jboss.logging.Logger;
 import org.jboss.ws.WSException;
 import org.jboss.ws.core.server.netty.NettyCallbackHandler;
-import org.jboss.ws.extensions.wsrm.transport.backchannel.RMCallbackHandlerImpl;
 import org.jboss.wsf.common.injection.InjectionHelper;
 import org.jboss.wsf.common.injection.PreDestroyHolder;
 import org.jboss.wsf.spi.SPIProvider;
@@ -55,7 +54,7 @@
 {
 
    /** Logger. */
-   private static final Logger LOGGER = Logger.getLogger(RMCallbackHandlerImpl.class);
+   private static final Logger LOGGER = Logger.getLogger(NettyCallbackHandlerImpl.class);
 
    /** SPI provider instance. */
    private static final SPIProvider SPI_PROVIDER = SPIProviderResolver.getInstance().getProvider();

Deleted: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyEndpointRegistryFactory.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyEndpointRegistryFactory.java	2010-08-13 11:48:08 UTC (rev 12794)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyEndpointRegistryFactory.java	2010-08-13 12:01:28 UTC (rev 12795)
@@ -1,58 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, 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.core.jaxws.spi.http;
-
-import org.jboss.wsf.framework.management.DefaultEndpointRegistry;
-import org.jboss.wsf.spi.management.EndpointRegistry;
-import org.jboss.wsf.spi.management.EndpointRegistryFactory;
-
-/**
- * Netty server endpoint registry factory for JSE environment.
- *
- * @author <a href="mailto:ropalka at redhat.com">Richard Opalka</a>
- */
-public final class NettyEndpointRegistryFactory extends EndpointRegistryFactory
-{
-
-   /** Endpoing registry singleton. */
-   private static final EndpointRegistry ENDPOINT_REGISTRY = new DefaultEndpointRegistry();
-
-   /**
-    * Constructor.
-    */
-   public NettyEndpointRegistryFactory()
-   {
-      super();
-   }
-
-   /**
-    * Returns endpoint registry.
-    * 
-    * @return endpoint registry
-    */
-   @Override
-   public EndpointRegistry getEndpointRegistry()
-   {
-      return NettyEndpointRegistryFactory.ENDPOINT_REGISTRY;
-   }
-
-}

Added: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyHandlerDeploymentAspect.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyHandlerDeploymentAspect.java	                        (rev 0)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyHandlerDeploymentAspect.java	2010-08-13 12:01:28 UTC (rev 12795)
@@ -0,0 +1,79 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, 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.core.jaxws.spi.http;
+
+import org.jboss.wsf.common.integration.AbstractDeploymentAspect;
+import org.jboss.wsf.common.invocation.InvocationHandlerJAXWS;
+import org.jboss.wsf.spi.SPIProvider;
+import org.jboss.wsf.spi.SPIProviderResolver;
+import org.jboss.wsf.spi.deployment.Deployment;
+import org.jboss.wsf.spi.deployment.Endpoint;
+import org.jboss.wsf.spi.deployment.LifecycleHandler;
+import org.jboss.wsf.spi.deployment.LifecycleHandlerFactory;
+import org.jboss.wsf.spi.invocation.InvocationHandler;
+import org.jboss.wsf.spi.invocation.RequestHandler;
+import org.jboss.wsf.spi.management.ServerConfig;
+import org.jboss.wsf.stack.jbws.RequestHandlerImpl;
+
+/**
+ * Netty endpoint handler deployment aspect.
+ *
+ * @author <a href="mailto:ropalka at redhat.com">Richard Opalka</a>
+ */
+public final class NettyHandlerDeploymentAspect extends AbstractDeploymentAspect
+{
+   private SPIProvider spiProvider;
+
+   public NettyHandlerDeploymentAspect()
+   {
+      super();
+      spiProvider = SPIProviderResolver.getInstance().getProvider();
+   }
+
+   @Override
+   public void start(final Deployment dep)
+   {
+      for (final Endpoint ep : dep.getService().getEndpoints())
+      {
+         ep.setRequestHandler(getRequestHandler(dep));
+         ep.setLifecycleHandler(getLifecycleHandler(dep));
+         ep.setInvocationHandler(getInvocationHandler(ep));
+      }
+   }
+
+   private LifecycleHandler getLifecycleHandler(Deployment dep)
+   {
+      return spiProvider.getSPI(LifecycleHandlerFactory.class).newLifecycleHandler();
+   }
+
+   private InvocationHandler getInvocationHandler(final Endpoint ep)
+   {
+      return new InvocationHandlerJAXWS();
+   }
+   
+   private RequestHandler getRequestHandler(final Deployment dep)
+   {
+      dep.addAttachment(ServerConfig.class, NettyHttpServerConfig.SINGLETON);
+      return new RequestHandlerImpl(NettyHttpServerConfig.SINGLETON);
+   }
+}

Added: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyHttpContext.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyHttpContext.java	                        (rev 0)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyHttpContext.java	2010-08-13 12:01:28 UTC (rev 12795)
@@ -0,0 +1,52 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, 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.core.jaxws.spi.http;
+
+import org.jboss.wsf.spi.deployment.AbstractExtensible;
+
+/**
+ * Netty HTTP context.
+ *
+ * @author <a href="mailto:ropalka at redhat.com">Richard Opalka</a>
+ */
+final class NettyHttpContext extends AbstractExtensible implements HttpContext
+{
+   private HttpServer server;
+   private String contextRoot;
+
+   NettyHttpContext(final HttpServer server, final String contextRoot)
+   {
+      this.server = server;
+      this.contextRoot = contextRoot;
+   }
+
+   public HttpServer getHttpServer()
+   {
+      return server;
+   }
+
+   public String getContextRoot()
+   {
+      return contextRoot;
+   }
+}

Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyHttpServerAdapter.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyHttpServerAdapter.java	2010-08-13 11:48:08 UTC (rev 12794)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyHttpServerAdapter.java	2010-08-13 12:01:28 UTC (rev 12795)
@@ -35,7 +35,6 @@
 import org.jboss.wsf.framework.deployment.BackwardCompatibleContextRootDeploymentAspect;
 import org.jboss.wsf.framework.deployment.DeploymentAspectManagerImpl;
 import org.jboss.wsf.framework.deployment.EndpointAddressDeploymentAspect;
-import org.jboss.wsf.framework.deployment.EndpointHandlerDeploymentAspect;
 import org.jboss.wsf.framework.deployment.EndpointLifecycleDeploymentAspect;
 import org.jboss.wsf.framework.deployment.EndpointNameDeploymentAspect;
 import org.jboss.wsf.framework.deployment.EndpointRegistryDeploymentAspect;
@@ -47,9 +46,6 @@
 import org.jboss.wsf.spi.deployment.Deployment.DeploymentType;
 import org.jboss.wsf.spi.deployment.DeploymentAspect;
 import org.jboss.wsf.spi.deployment.DeploymentModelFactory;
-import org.jboss.wsf.spi.http.HttpContext;
-import org.jboss.wsf.spi.http.HttpContextFactory;
-import org.jboss.wsf.spi.http.HttpServer;
 import org.jboss.wsf.stack.jbws.EagerInitializeDeploymentAspect;
 import org.jboss.wsf.stack.jbws.PublishContractDeploymentAspect;
 import org.jboss.wsf.stack.jbws.ServiceEndpointInvokerDeploymentAspect;
@@ -66,10 +62,6 @@
    /** JBossWS SPI provider. */
    private static final SPIProvider SPI_PROVIDER = SPIProviderResolver.getInstance().getProvider();
 
-   /** JBossWS Http Context factory. */
-   private static final HttpContextFactory HTTP_CONTEXT_FACTORY = NettyHttpServerAdapter.SPI_PROVIDER
-         .getSPI(HttpContextFactory.class);
-
    /** Deployment model factory. */
    private static final DeploymentModelFactory DEPLOYMENT_FACTORY = NettyHttpServerAdapter.SPI_PROVIDER
          .getSPI(DeploymentModelFactory.class);
@@ -94,7 +86,7 @@
     */
    public HttpContext createContext(final String ctx)
    {
-      return NettyHttpServerAdapter.HTTP_CONTEXT_FACTORY.newHttpContext(this, ctx);
+      return new NettyHttpContext(this, ctx);
    }
 
    /**
@@ -190,7 +182,7 @@
       final List<DeploymentAspect> retVal = new LinkedList<DeploymentAspect>();
 
       // TODO: native stack can't use framework classes directly
-      retVal.add(new EndpointHandlerDeploymentAspect());
+      retVal.add(new NettyHandlerDeploymentAspect());
       retVal.add(new BackwardCompatibleContextRootDeploymentAspect());
       retVal.add(new URLPatternDeploymentAspect());
       retVal.add(new EndpointAddressDeploymentAspect());

Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyHttpServerConfig.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyHttpServerConfig.java	2010-08-13 11:48:08 UTC (rev 12794)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyHttpServerConfig.java	2010-08-13 12:01:28 UTC (rev 12795)
@@ -36,6 +36,8 @@
 final class NettyHttpServerConfig implements ServerConfig
 {
 
+   static final ServerConfig SINGLETON = new NettyHttpServerConfig();
+   
    /** Temporary directory location. */
    private static File tmpDir;
 

Deleted: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyHttpServerConfigFactory.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyHttpServerConfigFactory.java	2010-08-13 11:48:08 UTC (rev 12794)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyHttpServerConfigFactory.java	2010-08-13 12:01:28 UTC (rev 12795)
@@ -1,57 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, 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.core.jaxws.spi.http;
-
-import org.jboss.wsf.spi.management.ServerConfig;
-import org.jboss.wsf.spi.management.ServerConfigFactory;
-
-/**
- * Netty server configuration factory. 
- *
- * @author <a href="mailto:ropalka at redhat.com">Richard Opalka</a>
- */
-public final class NettyHttpServerConfigFactory extends ServerConfigFactory
-{
-
-   /** Netty config singleton. */
-   private static final ServerConfig NETTY_CONFIG_SINGLETON = new NettyHttpServerConfig();
-
-   /**
-    * Constructor.
-    */
-   public NettyHttpServerConfigFactory()
-   {
-      super();
-   }
-
-   /**
-    * Provides Netty server configuration.
-    * 
-    * @return Netty server configuration
-    */
-   @Override
-   public ServerConfig getServerConfig()
-   {
-      return NettyHttpServerConfigFactory.NETTY_CONFIG_SINGLETON;
-   }
-
-}

Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyHttpServerFactory.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyHttpServerFactory.java	2010-08-13 11:48:08 UTC (rev 12794)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyHttpServerFactory.java	2010-08-13 12:01:28 UTC (rev 12795)
@@ -21,15 +21,12 @@
  */
 package org.jboss.ws.core.jaxws.spi.http;
 
-import org.jboss.wsf.spi.http.HttpServer;
-import org.jboss.wsf.spi.http.HttpServerFactory;
-
 /**
- * @see org.jboss.wsf.spi.http.HttpServerFactory 
+ * Netty server factory. 
  *
  * @author <a href="mailto:ropalka at redhat.com">Richard Opalka</a>
  */
-public final class NettyHttpServerFactory extends HttpServerFactory
+public final class NettyHttpServerFactory
 {
 
    /** Netty HTTP server adapter singleton. */
@@ -38,7 +35,7 @@
    /**
     * Constructor.
     */
-   public NettyHttpServerFactory()
+   private NettyHttpServerFactory()
    {
       super();
    }
@@ -48,8 +45,7 @@
     * 
     * @return Netty based http server adapter
     */
-   @Override
-   public HttpServer getHttpServer()
+   public static HttpServer getHttpServer()
    {
       return NettyHttpServerFactory.NETTY_SERVER_ADAPTER_SINGLETON;
    }

Deleted: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyInvocationHandlerFactory.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyInvocationHandlerFactory.java	2010-08-13 11:48:08 UTC (rev 12794)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/spi/http/NettyInvocationHandlerFactory.java	2010-08-13 12:01:28 UTC (rev 12795)
@@ -1,68 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, 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.core.jaxws.spi.http;
-
-import org.jboss.wsf.common.invocation.InvocationHandlerJAXWS;
-import org.jboss.wsf.spi.invocation.InvocationHandler;
-import org.jboss.wsf.spi.invocation.InvocationHandlerFactory;
-import org.jboss.wsf.spi.invocation.InvocationType;
-
-/**
- * Netty invocation handler factory that supports JAXWS JSE invocation only.
- *
- * @author <a href="mailto:ropalka at redhat.com">Richard Opalka</a>
- */
-public final class NettyInvocationHandlerFactory extends InvocationHandlerFactory
-{
-
-   /**
-    * Constructor.
-    */
-   public NettyInvocationHandlerFactory()
-   {
-      super();
-   }
-
-   /**
-    * Returns invocation handler for specified invocation type.
-    *
-    * @param type invocation type
-    * @return invocation handler
-    */
-   @Override
-   public InvocationHandler newInvocationHandler(final InvocationType type)
-   {
-      InvocationHandler handler = null;
-
-      switch (type)
-      {
-         case JAXWS_JSE :
-            handler = new InvocationHandlerJAXWS();
-            break;
-         default :
-            throw new IllegalArgumentException("Unable to resolve spi.invocation.InvocationHandler for type: " + type);
-      }
-
-      return handler;
-   }
-
-}

Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/builder/MetaDataBuilder.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/builder/MetaDataBuilder.java	2010-08-13 11:48:08 UTC (rev 12794)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/builder/MetaDataBuilder.java	2010-08-13 12:01:28 UTC (rev 12795)
@@ -188,7 +188,7 @@
       sepMetaData.setURLPattern(urlPattern);
 
       String servicePath = contextRoot + urlPattern;
-      sepMetaData.setEndpointAddress(getServiceEndpointAddress(null, servicePath, port));
+      sepMetaData.setEndpointAddress(getServiceEndpointAddress(null, servicePath, port, dep.getAttachment(ServerConfig.class)));
    }
 
    public static ObjectName createServiceEndpointID(Deployment dep, ServerEndpointMetaData sepMetaData)
@@ -227,7 +227,7 @@
 
    /** Get the web service address for a given path
     */
-   public static String getServiceEndpointAddress(String uriScheme, String servicePath, int servicePort)
+   public static String getServiceEndpointAddress(String uriScheme, String servicePath, int servicePort, ServerConfig config)
    {
       if (servicePath == null || servicePath.length() == 0)
          throw new WSException("Service path cannot be null");
@@ -238,8 +238,11 @@
       if (uriScheme == null)
          uriScheme = "http";
 
-      SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
-      ServerConfig config = spiProvider.getSPI(ServerConfigFactory.class).getServerConfig();
+      if (config == null)
+      {
+         SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
+         config = spiProvider.getSPI(ServerConfigFactory.class).getServerConfig();
+      }
 
       String host = config.getWebServiceHost();
 
@@ -341,10 +344,11 @@
                if ("CONFIDENTIAL".equals(transportGuarantee))
                   uriScheme = "https";
 
-               if (requiresRewrite(orgAddress, uriScheme))
+               ServerConfig config = sepMetaData.getEndpoint().getService().getDeployment().getAttachment(ServerConfig.class);
+               if (requiresRewrite(orgAddress, uriScheme, config))
                {
                   String servicePath = sepMetaData.getContextRoot() + sepMetaData.getURLPattern();
-                  String serviceEndpointURL = getServiceEndpointAddress(uriScheme, servicePath, -1);
+                  String serviceEndpointURL = getServiceEndpointAddress(uriScheme, servicePath, -1, config);
 
                   if (log.isDebugEnabled())
                      log.debug("Replace service endpoint address '" + orgAddress + "' with '" + serviceEndpointURL + "'");
@@ -377,7 +381,7 @@
          throw new WSException("Cannot find port in wsdl: " + portName);
    }
    
-   private static boolean requiresRewrite(String orgAddress, String uriScheme)
+   private static boolean requiresRewrite(String orgAddress, String uriScheme, ServerConfig config)
    {
       if (uriScheme != null)
       {
@@ -387,8 +391,11 @@
             return false;
          }
       }
-      SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
-      ServerConfig config = spiProvider.getSPI(ServerConfigFactory.class).getServerConfig();
+      if (config == null)
+      {
+         SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
+         config = spiProvider.getSPI(ServerConfigFactory.class).getServerConfig();
+      }
       boolean alwaysModify = config.isModifySOAPAddress();
       
       return (alwaysModify || uriScheme == null || orgAddress.indexOf("REPLACE_WITH_ACTUAL_URL") >= 0);

Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/wsf/stack/jbws/RequestHandlerImpl.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/wsf/stack/jbws/RequestHandlerImpl.java	2010-08-13 11:48:08 UTC (rev 12794)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/wsf/stack/jbws/RequestHandlerImpl.java	2010-08-13 12:01:28 UTC (rev 12795)
@@ -114,16 +114,31 @@
    // provide logging
    private static final Logger log = Logger.getLogger(RequestHandlerImpl.class);
 
-   private ServerConfig serverConfig;
-   private MessageFactoryImpl msgFactory;
+   protected ServerConfig serverConfig;
+   protected MessageFactoryImpl msgFactory;
 
-   RequestHandlerImpl()
+   public RequestHandlerImpl()
    {
-      SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
-      serverConfig = spiProvider.getSPI(ServerConfigFactory.class).getServerConfig();
-      msgFactory = new MessageFactoryImpl();
+      final SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
+      final ServerConfig serverConfig = spiProvider.getSPI(ServerConfigFactory.class).getServerConfig();
+      
+      this.init(serverConfig);
    }
+   
+   public RequestHandlerImpl(final ServerConfig serverConfig)
+   {
+      if (serverConfig == null) 
+         throw new IllegalArgumentException("server config cannot be null");
+      
+      this.init(serverConfig);
+   }
 
+   private void init(final ServerConfig serverConfig)
+   {
+      this.serverConfig = serverConfig;
+      this.msgFactory = new MessageFactoryImpl();
+   }
+   
    public void handleHttpRequest(Endpoint endpoint, HttpServletRequest req, HttpServletResponse res, ServletContext context) throws ServletException, IOException
    {
       String method = req.getMethod();

Added: stack/native/trunk/modules/core/src/main/resources/META-INF/services/org.jboss.wsf.spi.deployment.DeploymentModelFactory
===================================================================
--- stack/native/trunk/modules/core/src/main/resources/META-INF/services/org.jboss.wsf.spi.deployment.DeploymentModelFactory	                        (rev 0)
+++ stack/native/trunk/modules/core/src/main/resources/META-INF/services/org.jboss.wsf.spi.deployment.DeploymentModelFactory	2010-08-13 12:01:28 UTC (rev 12795)
@@ -0,0 +1 @@
+org.jboss.wsf.framework.deployment.ArchiveDeploymentModelFactory
\ No newline at end of file

Added: stack/native/trunk/modules/core/src/main/resources/META-INF/services/org.jboss.wsf.spi.invocation.InvocationHandlerFactory
===================================================================
--- stack/native/trunk/modules/core/src/main/resources/META-INF/services/org.jboss.wsf.spi.invocation.InvocationHandlerFactory	                        (rev 0)
+++ stack/native/trunk/modules/core/src/main/resources/META-INF/services/org.jboss.wsf.spi.invocation.InvocationHandlerFactory	2010-08-13 12:01:28 UTC (rev 12795)
@@ -0,0 +1 @@
+org.jboss.webservices.integration.invocation.InvocationHandlerFactoryImpl
\ No newline at end of file

Modified: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/EndpointServlet.java
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/EndpointServlet.java	2010-08-13 11:48:08 UTC (rev 12794)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/EndpointServlet.java	2010-08-13 12:01:28 UTC (rev 12795)
@@ -48,6 +48,7 @@
  * @author <a href="mailto:tdiesler at redhat.com">Thomas Diesler</a>
  * @author <a href="mailto:ropalka at redhat.com">Richard Opalka</a>
  */
+ at SuppressWarnings("serial")
 public class EndpointServlet extends HttpServlet
 {
    
@@ -61,8 +62,8 @@
       super.init(config);
       
       endpoint1 = Endpoint.create(SOAPBinding.SOAP11HTTP_BINDING, new EndpointBean());
-      endpoint1.publish("http://localhost:8080/jaxws-endpoint");
-      endpoint2 = Endpoint.publish("http://localhost:8080/jaxws-endpoint2/endpoint/long/path", EndpointBean.class);
+      endpoint1.publish("http://localhost:8081/jaxws-endpoint");
+      endpoint2 = Endpoint.publish("http://localhost:8081/jaxws-endpoint2/endpoint/long/path", EndpointBean.class);
    }
    
    @Override

Modified: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/EndpointTestCase.java
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/EndpointTestCase.java	2010-08-13 11:48:08 UTC (rev 12794)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/EndpointTestCase.java	2010-08-13 12:01:28 UTC (rev 12795)
@@ -53,8 +53,8 @@
 
    public void testWSDLAccess() throws Exception
    {
-      readWSDL(new URL("http://" + getServerHost() + ":8080/jaxws-endpoint?wsdl"));
-      readWSDL(new URL("http://" + getServerHost() + ":8080/jaxws-endpoint2/endpoint/long/path?wsdl"));
+      readWSDL(new URL("http://" + getServerHost() + ":8081/jaxws-endpoint?wsdl"));
+      readWSDL(new URL("http://" + getServerHost() + ":8081/jaxws-endpoint2/endpoint/long/path?wsdl"));
    }
    
    public void testClientAccess() throws Exception

Modified: stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/endpoint/WEB-INF/wsdl/TestService.wsdl
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/endpoint/WEB-INF/wsdl/TestService.wsdl	2010-08-13 11:48:08 UTC (rev 12794)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxws/endpoint/WEB-INF/wsdl/TestService.wsdl	2010-08-13 12:01:28 UTC (rev 12795)
@@ -29,7 +29,7 @@
   </binding>
   <service name="EndpointService">
     <port name="EndpointInterfacePort" binding="tns:EndpointInterfaceBinding">
-      <soap:address location="http://@jboss.bind.address@:8080/jaxws-endpoint"/>
+      <soap:address location="http://@jboss.bind.address@:8081/jaxws-endpoint"/>
     </port>
   </service>
 </definitions>



More information about the jbossws-commits mailing list