[jbossws-commits] JBossWS SVN: r4025 - in trunk: integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42 and 17 other directories.

jbossws-commits at lists.jboss.org jbossws-commits at lists.jboss.org
Mon Jul 30 08:49:32 EDT 2007


Author: thomas.diesler at jboss.com
Date: 2007-07-30 08:49:32 -0400 (Mon, 30 Jul 2007)
New Revision: 4025

Added:
   trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/WebAppDeployingHttpServer.java
   trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/WebAppDeployingHttpServer.java
   trunk/integration/native/src/main/java/org/jboss/wsf/stack/jbws/NativeServerConfig.java
   trunk/integration/native/src/main/java/org/jboss/wsf/stack/jbws/NativeServerConfigMBean.java
   trunk/integration/spi/src/main/java/org/jboss/wsf/framework/management/MBeanServerLocator.java
   trunk/integration/spi/src/main/java/org/jboss/wsf/framework/management/ManagedEndpoint.java
   trunk/integration/spi/src/main/java/org/jboss/wsf/framework/management/ManagedEndpointMBean.java
   trunk/integration/spi/src/main/java/org/jboss/wsf/framework/management/ManagedEndpointRegistry.java
   trunk/integration/spi/src/main/java/org/jboss/wsf/framework/management/ManagedEndpointRegistryMBean.java
   trunk/integration/sunri/src/main/java/org/jboss/wsf/stack/sunri/MetroServerConfig.java
   trunk/integration/sunri/src/main/java/org/jboss/wsf/stack/sunri/MetroServerConfigMBean.java
   trunk/integration/xfire/src/main/java/org/jboss/wsf/stack/xfire/CXFServerConfig.java
   trunk/integration/xfire/src/main/java/org/jboss/wsf/stack/xfire/CXFServerConfigMBean.java
Removed:
   trunk/integration/jboss42/src/main/resources/jbossws-jboss42.jar/META-INF/services/org.jboss.ws.core.server.HttpServer
   trunk/integration/jboss50/src/main/resources/jbossws-jboss50.jar/META-INF/services/org.jboss.ws.core.server.HttpServer
   trunk/integration/native/src/main/java/org/jboss/wsf/stack/jbws/ManagedEndpoint.java
   trunk/integration/native/src/main/java/org/jboss/wsf/stack/jbws/ManagedEndpointMBean.java
   trunk/integration/native/src/main/java/org/jboss/wsf/stack/jbws/ManagedEndpointRegistry.java
   trunk/integration/native/src/main/java/org/jboss/wsf/stack/jbws/ManagedEndpointRegistryMBean.java
   trunk/integration/spi/src/main/java/org/jboss/wsf/framework/http/DefaultHttpServerFactory.java
   trunk/integration/spi/src/main/java/org/jboss/wsf/framework/http/WebAppDeployingHttpServer.java
   trunk/integration/sunri/src/main/java/org/jboss/wsf/stack/sunri/ManagedEndpointRegistry.java
   trunk/integration/sunri/src/main/java/org/jboss/wsf/stack/sunri/ManagedEndpointRegistryMBean.java
   trunk/integration/xfire/src/main/java/org/jboss/wsf/stack/xfire/ManagedEndpointRegistry.java
   trunk/integration/xfire/src/main/java/org/jboss/wsf/stack/xfire/ManagedEndpointRegistryMBean.java
Modified:
   trunk/integration/jboss40/src/main/resources/jbossws-jboss40-config.xml
   trunk/integration/jboss42/src/main/resources/jbossws-jboss42-config.xml
   trunk/integration/jboss50/src/main/resources/jbossws-jboss50.deployer/META-INF/jbossws-deployer-beans.xml
   trunk/integration/native/src/main/resources/jbossws-native-config.xml
   trunk/integration/spi/src/main/java/org/jboss/wsf/framework/management/DefaultServerConfig.java
   trunk/integration/spi/src/main/java/org/jboss/wsf/framework/management/DefaultServerConfigMBean.java
   trunk/integration/spi/src/main/java/org/jboss/wsf/framework/management/ServerConfigFactoryImpl.java
   trunk/integration/spi/src/main/java/org/jboss/wsf/spi/http/HttpServer.java
   trunk/integration/spi/src/main/java/org/jboss/wsf/spi/http/HttpServerFactory.java
   trunk/integration/spi/src/main/java/org/jboss/wsf/spi/management/EndpointRegistry.java
   trunk/integration/sunri/src/main/resources/jbossws-sunri-config.xml
   trunk/integration/xfire/src/main/resources/jbossws-xfire-config.xml
   trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/spi/EndpointImpl.java
   trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/endpoint/EndpointServlet.java
   trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/endpoint/EndpointTestCase.java
Log:
Introduce WSMBeanServerLocator
More work on Endpoint API



Modified: trunk/integration/jboss40/src/main/resources/jbossws-jboss40-config.xml
===================================================================
--- trunk/integration/jboss40/src/main/resources/jbossws-jboss40-config.xml	2007-07-30 07:23:40 UTC (rev 4024)
+++ trunk/integration/jboss40/src/main/resources/jbossws-jboss40-config.xml	2007-07-30 12:49:32 UTC (rev 4025)
@@ -1,3 +1,17 @@
+  
+  <!-- Locate the single instance of the kernel -->  
+  <bean name="WSKernelLocator" class="org.jboss.ws.integration.KernelLocator">
+    <property name="kernel"><inject bean="jboss.kernel:service=Kernel"/></property>
+  </bean>
+
+  <!-- Locate the single instance of the MBeanServer -->  
+  <bean name="WSMBeanServerLocator" class="org.jboss.wsf.framework.management.MBeanServerLocator"/>
+
+  <!-- The HTTPServer used by the JAXWS Endpoint API -->  
+  <bean name="WSHTTPServer" class="org.jboss.wsf.container.jboss42.WebAppDeployingHttpServer">
+    <property name="mbeanServer"><inject bean="WSMBeanServerLocator" property="mbeanServer"/></property>
+  </bean>
+
   <!-- 
     ********************************************************************************************************************* 
     Web Service deployment                                                                                                
@@ -30,11 +44,6 @@
     ********************************************************************************************************************* 
   -->
   
-  <!-- Locate the single instance of the kernel -->  
-  <bean name="WSKernelLocator" class="org.jboss.ws.integration.KernelLocator">
-    <property name="kernel"><inject bean="jboss.kernel:service=Kernel"/></property>
-  </bean>
-  
   <!-- 
     Register DeployerHooks with JBoss deployers 
   -->

Copied: trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/WebAppDeployingHttpServer.java (from rev 4024, trunk/integration/spi/src/main/java/org/jboss/wsf/framework/http/WebAppDeployingHttpServer.java)
===================================================================
--- trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/WebAppDeployingHttpServer.java	                        (rev 0)
+++ trunk/integration/jboss42/src/main/java/org/jboss/wsf/container/jboss42/WebAppDeployingHttpServer.java	2007-07-30 12:49:32 UTC (rev 4025)
@@ -0,0 +1,236 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.wsf.container.jboss42;
+
+//$Id: JBossHttpServer.java 1786 2007-01-04 14:30:04Z thomas.diesler at jboss.com $
+
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.net.URL;
+import java.util.Map;
+
+import javax.management.MBeanServer;
+import javax.management.ObjectName;
+import javax.xml.ws.Endpoint;
+import javax.xml.ws.WebServiceException;
+
+import org.jboss.wsf.common.DOMUtils;
+import org.jboss.wsf.common.DOMWriter;
+import org.jboss.wsf.framework.DefaultExtensible;
+import org.jboss.wsf.spi.SPIProvider;
+import org.jboss.wsf.spi.SPIProviderResolver;
+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.spi.management.ServerConfig;
+import org.jboss.wsf.spi.management.ServerConfigFactory;
+import org.w3c.dom.Element;
+
+/**
+ * A Tomcat HTTP Server
+ *
+ * @author Thomas.Diesler at jboss.org
+ * @since 07-Jul-2006
+ */
+public class WebAppDeployingHttpServer extends DefaultExtensible implements HttpServer
+{
+   private static final String MAIN_DEPLOYER = "jboss.system:service=MainDeployer";
+
+   // The MBeanServer
+   private MBeanServer mbeanServer;
+
+   public MBeanServer getMbeanServer()
+   {
+      return mbeanServer;
+   }
+
+   public void setMbeanServer(MBeanServer mbeanServer)
+   {
+      this.mbeanServer = mbeanServer;
+   }
+
+   /** Start an instance of this HTTP server */
+   public void start()
+   {
+      // verify required properties
+   }
+
+   /** Create an HTTP context */
+   public HttpContext createContext(String contextRoot)
+   {
+      SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
+      HttpContext httpContext = spiProvider.getSPI(HttpContextFactory.class).newHttpContext(this, contextRoot);
+      return httpContext;
+   }
+
+   /** Publish an JAXWS endpoint to the HTTP server */
+   public void publish(HttpContext context, Endpoint endpoint)
+   {
+      Class implClass = getImplementorClass(endpoint);
+      String implName = implClass.getName();
+
+      try
+      {
+         Element webDoc = createWebAppDescriptor(context, endpoint);
+         Element jbossDoc = createJBossWebAppDescriptor(context, endpoint);
+
+         File tmpWar = null;
+         try
+         {
+            SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
+            ServerConfig serverConfig = spiProvider.getSPI(ServerConfigFactory.class).getServerConfig();
+            File tmpDir = new File(serverConfig.getServerTempDir().getCanonicalPath() + "/jbossws");
+            tmpDir.mkdirs();
+
+            String deploymentName = implName.substring(implName.lastIndexOf(".") + 1);
+            tmpWar = File.createTempFile(deploymentName, ".war", tmpDir);
+            tmpWar.delete();
+            File webInf = new File(tmpWar, "WEB-INF");
+            webInf.mkdirs();
+
+            File webXml = new File(webInf, "web.xml");
+            FileWriter fw = new FileWriter(webXml);
+            new DOMWriter(fw).setPrettyprint(true).print(webDoc);
+            fw.close();
+
+            File jbossWebXml = new File(webInf, "jboss-web.xml");
+            fw = new FileWriter(jbossWebXml);
+            new DOMWriter(fw).setPrettyprint(true).print(jbossDoc);
+            fw.close();
+         }
+         catch (IOException e)
+         {
+            throw new WebServiceException("Failed to create webservice war", e);
+         }
+
+         Map<String, Object> epProps = endpoint.getProperties();
+         epProps.put("jbossws-endpoint-war-url", tmpWar);
+
+         URL tmpURL = tmpWar.toURL();
+         getMbeanServer().invoke(new ObjectName(MAIN_DEPLOYER), "deploy", new Object[] { tmpURL }, new String[] { "java.net.URL" });
+      }
+      catch (RuntimeException rte)
+      {
+         throw rte;
+      }
+      catch (Exception ex)
+      {
+         throw new WebServiceException(ex);
+      }
+   }
+
+   /** Destroys an JAXWS endpoint on the HTTP server */
+   public void destroy(HttpContext context, Endpoint endpoint)
+   {
+      Map<String, Object> epProps = endpoint.getProperties();
+      File tmpWar = (File)epProps.get("jbossws-endpoint-war-url");
+      if (tmpWar == null)
+         throw new IllegalStateException("Cannot find endpoint war property");
+
+      try
+      {
+         URL tmpURL = tmpWar.toURL();
+         getMbeanServer().invoke(new ObjectName(MAIN_DEPLOYER), "undeploy", new Object[] { tmpURL }, new String[] { "java.net.URL" });
+
+         tmpWar.delete();
+      }
+      catch (RuntimeException rte)
+      {
+         throw rte;
+      }
+      catch (Exception ex)
+      {
+         throw new WebServiceException(ex);
+      }
+   }
+
+   private Class getImplementorClass(Endpoint endpoint)
+   {
+      Object implementor = endpoint.getImplementor();
+      Class implClass = (implementor instanceof Class ? (Class)implementor : implementor.getClass());
+      return implClass;
+   }
+
+   private Element createWebAppDescriptor(HttpContext context, Endpoint endpoint)
+   {
+      Class implClass = getImplementorClass(endpoint);
+      String implName = implClass.getName();
+
+      Element webApp = DOMUtils.createElement("web-app");
+
+      /*
+       <servlet>
+       <servlet-name>
+       <servlet-class>
+       </servlet>
+       */
+      Element servlet = (Element)webApp.appendChild(DOMUtils.createElement("servlet"));
+      Element servletName = (Element)servlet.appendChild(DOMUtils.createElement("servlet-name"));
+      servletName.appendChild(DOMUtils.createTextNode("JAXWSEndpoint"));
+      Element servletClass = (Element)servlet.appendChild(DOMUtils.createElement("servlet-class"));
+      servletClass.appendChild(DOMUtils.createTextNode(implName));
+
+      /*
+       <servlet-mapping>
+       <servlet-name>
+       <url-pattern>
+       </servlet-mapping>
+       */
+      Element servletMapping = (Element)webApp.appendChild(DOMUtils.createElement("servlet-mapping"));
+      servletName = (Element)servletMapping.appendChild(DOMUtils.createElement("servlet-name"));
+      servletName.appendChild(DOMUtils.createTextNode("JAXWSEndpoint"));
+      Element urlPatternElement = (Element)servletMapping.appendChild(DOMUtils.createElement("url-pattern"));
+
+      String urlPattern = "/*";
+      urlPatternElement.appendChild(DOMUtils.createTextNode(urlPattern));
+
+      // Add security-constraint in generated web.xml for Endpoint API
+      // FIXME: JBWS-1069
+
+      return webApp;
+   }
+
+   private Element createJBossWebAppDescriptor(HttpContext context, Endpoint endpoint)
+   {
+      /* Create a jboss-web
+       <jboss-web>
+       <security-domain>java:/jaas/cts</security-domain>
+       <context-root>/ws/ejbN/</context-root>
+       </jboss-web>
+       */
+      Element jbossWeb = DOMUtils.createElement("jboss-web");
+
+      // Get the context root for this deployment
+      String contextRoot = context.getContextRoot();
+      if (contextRoot == null)
+         throw new WebServiceException("Cannot obtain context root");
+
+      Element root = (Element)jbossWeb.appendChild(DOMUtils.createElement("context-root"));
+      root.appendChild(DOMUtils.createTextNode(contextRoot));
+
+      // Add security-constraint in generated web.xml for Endpoint API
+      // FIXME: JBWS-1069
+
+      return jbossWeb;
+   }
+}
\ No newline at end of file

Modified: trunk/integration/jboss42/src/main/resources/jbossws-jboss42-config.xml
===================================================================
--- trunk/integration/jboss42/src/main/resources/jbossws-jboss42-config.xml	2007-07-30 07:23:40 UTC (rev 4024)
+++ trunk/integration/jboss42/src/main/resources/jbossws-jboss42-config.xml	2007-07-30 12:49:32 UTC (rev 4025)
@@ -1,3 +1,17 @@
+
+  <!-- Locate the single instance of the kernel -->  
+  <bean name="WSKernelLocator" class="org.jboss.ws.integration.KernelLocator">
+    <property name="kernel"><inject bean="jboss.kernel:service=Kernel"/></property>
+  </bean>
+  
+  <!-- Locate the single instance of the MBeanServer -->  
+  <bean name="WSMBeanServerLocator" class="org.jboss.wsf.framework.management.MBeanServerLocator"/>
+  
+  <!-- The HTTPServer used by the JAXWS Endpoint API -->  
+  <bean name="WSHTTPServer" class="org.jboss.wsf.container.jboss42.WebAppDeployingHttpServer">
+    <property name="mbeanServer"><inject bean="WSMBeanServerLocator" property="mbeanServer"/></property>
+  </bean>
+
   <!-- 
     ********************************************************************************************************************* 
     Web Service deployment                                                                                                
@@ -30,11 +44,6 @@
     ********************************************************************************************************************* 
   -->
   
-  <!-- Locate the single instance of the kernel -->  
-  <bean name="WSKernelLocator" class="org.jboss.ws.integration.KernelLocator">
-    <property name="kernel"><inject bean="jboss.kernel:service=Kernel"/></property>
-  </bean>
-  
   <!-- 
     Register DeployerHooks with JBoss deployers 
   -->

Deleted: trunk/integration/jboss42/src/main/resources/jbossws-jboss42.jar/META-INF/services/org.jboss.ws.core.server.HttpServer
===================================================================
--- trunk/integration/jboss42/src/main/resources/jbossws-jboss42.jar/META-INF/services/org.jboss.ws.core.server.HttpServer	2007-07-30 07:23:40 UTC (rev 4024)
+++ trunk/integration/jboss42/src/main/resources/jbossws-jboss42.jar/META-INF/services/org.jboss.ws.core.server.HttpServer	2007-07-30 12:49:32 UTC (rev 4025)
@@ -1 +0,0 @@
-org.jboss.ws.integration.jboss42.JBossHttpServer
\ No newline at end of file

Added: trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/WebAppDeployingHttpServer.java
===================================================================
--- trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/WebAppDeployingHttpServer.java	                        (rev 0)
+++ trunk/integration/jboss50/src/main/java/org/jboss/wsf/container/jboss50/WebAppDeployingHttpServer.java	2007-07-30 12:49:32 UTC (rev 4025)
@@ -0,0 +1,247 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.wsf.container.jboss50;
+
+//$Id: JBossHttpServer.java 1786 2007-01-04 14:30:04Z thomas.diesler at jboss.com $
+
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.net.URL;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.xml.ws.Endpoint;
+import javax.xml.ws.WebServiceException;
+
+import org.jboss.deployers.client.spi.DeployerClient;
+import org.jboss.deployers.client.spi.Deployment;
+import org.jboss.deployers.vfs.spi.client.VFSDeploymentFactory;
+import org.jboss.virtual.VFS;
+import org.jboss.virtual.VirtualFile;
+import org.jboss.wsf.common.DOMUtils;
+import org.jboss.wsf.common.DOMWriter;
+import org.jboss.wsf.framework.DefaultExtensible;
+import org.jboss.wsf.spi.SPIProvider;
+import org.jboss.wsf.spi.SPIProviderResolver;
+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.spi.management.ServerConfig;
+import org.jboss.wsf.spi.management.ServerConfigFactory;
+import org.w3c.dom.Element;
+
+/**
+ * A Tomcat HTTP Server
+ *
+ * @author Thomas.Diesler at jboss.org
+ * @since 07-Jul-2006
+ */
+public class WebAppDeployingHttpServer extends DefaultExtensible implements HttpServer
+{
+   private DeployerClient mainDeployer;
+   private Map<String, Deployment> deploymentMap = new HashMap<String, Deployment>();
+
+   public void setMainDeployer(DeployerClient mainDeployer)
+   {
+      this.mainDeployer = mainDeployer;
+   }
+
+   /** Start an instance of this HTTP server */
+   public void start()
+   {
+      // verify required properties
+   }
+
+   /** Create an HTTP context */
+   public HttpContext createContext(String contextRoot)
+   {
+      SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
+      HttpContext httpContext = spiProvider.getSPI(HttpContextFactory.class).newHttpContext(this, contextRoot);
+      return httpContext;
+   }
+
+   /** Publish an JAXWS endpoint to the HTTP server */
+   public void publish(HttpContext context, Endpoint endpoint)
+   {
+      Class implClass = getImplementorClass(endpoint);
+      String implName = implClass.getName();
+
+      try
+      {
+         Element webDoc = createWebAppDescriptor(context, endpoint);
+         Element jbossDoc = createJBossWebAppDescriptor(context, endpoint);
+
+         File tmpWar = null;
+         try
+         {
+            SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
+            ServerConfig serverConfig = spiProvider.getSPI(ServerConfigFactory.class).getServerConfig();
+            File tmpDir = new File(serverConfig.getServerTempDir().getCanonicalPath() + "/jbossws");
+            tmpDir.mkdirs();
+
+            String deploymentName = implName.substring(implName.lastIndexOf(".") + 1);
+            tmpWar = File.createTempFile(deploymentName, ".war", tmpDir);
+            tmpWar.delete();
+            File webInf = new File(tmpWar, "WEB-INF");
+            webInf.mkdirs();
+
+            File webXml = new File(webInf, "web.xml");
+            FileWriter fw = new FileWriter(webXml);
+            new DOMWriter(fw).setPrettyprint(true).print(webDoc);
+            fw.close();
+
+            File jbossWebXml = new File(webInf, "jboss-web.xml");
+            fw = new FileWriter(jbossWebXml);
+            new DOMWriter(fw).setPrettyprint(true).print(jbossDoc);
+            fw.close();
+         }
+         catch (IOException e)
+         {
+            throw new WebServiceException("Failed to create webservice war", e);
+         }
+
+         Map<String, Object> epProps = endpoint.getProperties();
+         epProps.put("jbossws-endpoint-war-url", tmpWar);
+
+         URL tmpURL = tmpWar.toURL();
+         Deployment deployment = createDeploymentContext(tmpURL);
+
+         mainDeployer.deploy(deployment);
+         deploymentMap.put(tmpURL.toExternalForm(), deployment);
+      }
+      catch (RuntimeException rte)
+      {
+         throw rte;
+      }
+      catch (Exception ex)
+      {
+         throw new WebServiceException(ex);
+      }
+   }
+
+   /** Destroys an JAXWS endpoint on the HTTP server */
+   public void destroy(HttpContext context, Endpoint endpoint)
+   {
+      Map<String, Object> epProps = endpoint.getProperties();
+      File tmpWar = (File)epProps.get("jbossws-endpoint-war-url");
+      if (tmpWar == null)
+         throw new IllegalStateException("Cannot find endpoint war property");
+
+      try
+      {
+         URL tmpURL = tmpWar.toURL();
+         Deployment deployment = deploymentMap.get(tmpURL.toExternalForm());
+         if (deployment != null)
+         {
+            mainDeployer.undeploy(deployment);
+            deploymentMap.remove(tmpURL.toExternalForm());
+         }
+
+         tmpWar.delete();
+      }
+      catch (RuntimeException rte)
+      {
+         throw rte;
+      }
+      catch (Exception ex)
+      {
+         throw new WebServiceException(ex);
+      }
+   }
+
+   private Class getImplementorClass(Endpoint endpoint)
+   {
+      Object implementor = endpoint.getImplementor();
+      Class implClass = (implementor instanceof Class ? (Class)implementor : implementor.getClass());
+      return implClass;
+   }
+
+   private Element createWebAppDescriptor(HttpContext context, Endpoint endpoint)
+   {
+      Class implClass = getImplementorClass(endpoint);
+      String implName = implClass.getName();
+
+      Element webApp = DOMUtils.createElement("web-app");
+
+      /*
+       <servlet>
+       <servlet-name>
+       <servlet-class>
+       </servlet>
+       */
+      Element servlet = (Element)webApp.appendChild(DOMUtils.createElement("servlet"));
+      Element servletName = (Element)servlet.appendChild(DOMUtils.createElement("servlet-name"));
+      servletName.appendChild(DOMUtils.createTextNode("JAXWSEndpoint"));
+      Element servletClass = (Element)servlet.appendChild(DOMUtils.createElement("servlet-class"));
+      servletClass.appendChild(DOMUtils.createTextNode(implName));
+
+      /*
+       <servlet-mapping>
+       <servlet-name>
+       <url-pattern>
+       </servlet-mapping>
+       */
+      Element servletMapping = (Element)webApp.appendChild(DOMUtils.createElement("servlet-mapping"));
+      servletName = (Element)servletMapping.appendChild(DOMUtils.createElement("servlet-name"));
+      servletName.appendChild(DOMUtils.createTextNode("JAXWSEndpoint"));
+      Element urlPatternElement = (Element)servletMapping.appendChild(DOMUtils.createElement("url-pattern"));
+
+      String urlPattern = "/*";
+      urlPatternElement.appendChild(DOMUtils.createTextNode(urlPattern));
+
+      // Add security-constraint in generated web.xml for Endpoint API
+      // FIXME: JBWS-1069
+
+      return webApp;
+   }
+
+   private Element createJBossWebAppDescriptor(HttpContext context, Endpoint endpoint)
+   {
+      /* Create a jboss-web
+       <jboss-web>
+       <security-domain>java:/jaas/cts</security-domain>
+       <context-root>/ws/ejbN/</context-root>
+       </jboss-web>
+       */
+      Element jbossWeb = DOMUtils.createElement("jboss-web");
+
+      // Get the context root for this deployment
+      String contextRoot = context.getContextRoot();
+      if (contextRoot == null)
+         throw new WebServiceException("Cannot obtain context root");
+
+      Element root = (Element)jbossWeb.appendChild(DOMUtils.createElement("context-root"));
+      root.appendChild(DOMUtils.createTextNode(contextRoot));
+
+      // Add security-constraint in generated web.xml for Endpoint API
+      // FIXME: JBWS-1069
+
+      return jbossWeb;
+   }
+
+   private Deployment createDeploymentContext(URL warURL) throws Exception
+   {
+      VirtualFile file = VFS.getRoot(warURL);
+      return VFSDeploymentFactory.getInstance().createVFSDeployment(file);
+   }
+}

Modified: trunk/integration/jboss50/src/main/resources/jbossws-jboss50.deployer/META-INF/jbossws-deployer-beans.xml
===================================================================
--- trunk/integration/jboss50/src/main/resources/jbossws-jboss50.deployer/META-INF/jbossws-deployer-beans.xml	2007-07-30 07:23:40 UTC (rev 4024)
+++ trunk/integration/jboss50/src/main/resources/jbossws-jboss50.deployer/META-INF/jbossws-deployer-beans.xml	2007-07-30 12:49:32 UTC (rev 4025)
@@ -2,6 +2,21 @@
 
 <deployment xmlns="urn:jboss:bean-deployer:2.0">
   
+  <!-- Locate the single instance of the kernel -->  
+  <bean name="WSKernelLocator" class="org.jboss.ws.integration.KernelLocator">
+    <property name="kernel"><inject bean="jboss.kernel:service=Kernel"/></property>
+  </bean>
+  
+  <!-- Locate the single instance of the MBeanServer -->  
+  <bean name="WSMBeanServerLocator" class="org.jboss.wsf.framework.management.MBeanServerLocator">
+    <property name="mbeanServer"><inject bean="JMXKernel" property="mbeanServer"/></property>
+  </bean>
+  
+  <!-- The HTTPServer used by the JAXWS Endpoint API -->  
+  <bean name="WSHTTPServer" class="org.jboss.wsf.container.jboss50.WebAppDeployingHttpServer">
+    <property name="mainDeployer"><inject bean="MainDeployer"/></property>
+  </bean>
+  
   <!-- 
     ********************************************************************************************************************* 
     Web Service deployment                                                                                                
@@ -42,11 +57,6 @@
     ********************************************************************************************************************* 
   -->
   
-  <!-- Locate the single instance of the kernel -->  
-  <bean name="WSKernelLocator" class="org.jboss.ws.integration.KernelLocator">
-    <property name="kernel"><inject bean="jboss.kernel:service=Kernel"/></property>
-  </bean>
-  
   <!--
     A web service deployer that hooks in after the EJB deployers
   -->

Deleted: trunk/integration/jboss50/src/main/resources/jbossws-jboss50.jar/META-INF/services/org.jboss.ws.core.server.HttpServer
===================================================================
--- trunk/integration/jboss50/src/main/resources/jbossws-jboss50.jar/META-INF/services/org.jboss.ws.core.server.HttpServer	2007-07-30 07:23:40 UTC (rev 4024)
+++ trunk/integration/jboss50/src/main/resources/jbossws-jboss50.jar/META-INF/services/org.jboss.ws.core.server.HttpServer	2007-07-30 12:49:32 UTC (rev 4025)
@@ -1 +0,0 @@
-org.jboss.ws.integration.jboss50.JBossHttpServer
\ No newline at end of file

Deleted: trunk/integration/native/src/main/java/org/jboss/wsf/stack/jbws/ManagedEndpoint.java
===================================================================
--- trunk/integration/native/src/main/java/org/jboss/wsf/stack/jbws/ManagedEndpoint.java	2007-07-30 07:23:40 UTC (rev 4024)
+++ trunk/integration/native/src/main/java/org/jboss/wsf/stack/jbws/ManagedEndpoint.java	2007-07-30 12:49:32 UTC (rev 4025)
@@ -1,109 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt 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.wsf.stack.jbws;
-
-// $Id: ManagedEndpointRegistry.java 3146 2007-05-18 22:55:26Z thomas.diesler at jboss.com $
-
-import java.util.Date;
-
-import org.jboss.wsf.spi.deployment.Endpoint;
-import org.jboss.wsf.spi.management.EndpointMetrics;
-
-/**
- * The endpoint MBean representation 
- *
- * @author Thomas.Diesler at jboss.org
- * @since 20-Jun-2007
- */
-public class ManagedEndpoint implements ManagedEndpointMBean
-{
-   private Endpoint endpoint;
-
-   public ManagedEndpoint(Endpoint endpoint)
-   {
-      this.endpoint = endpoint;
-   }
-
-   public long getAverageProcessingTime()
-   {
-      EndpointMetrics metrics = endpoint.getEndpointMetrics();
-      return metrics != null ? metrics.getAverageProcessingTime() : 0;
-   }
-
-   public long getFaultCount()
-   {
-      EndpointMetrics metrics = endpoint.getEndpointMetrics();
-      return metrics != null ? metrics.getFaultCount() : 0;
-   }
-
-   public long getMaxProcessingTime()
-   {
-      EndpointMetrics metrics = endpoint.getEndpointMetrics();
-      return metrics != null ? metrics.getMaxProcessingTime() : 0;
-   }
-
-   public long getMinProcessingTime()
-   {
-      EndpointMetrics metrics = endpoint.getEndpointMetrics();
-      return metrics != null ? metrics.getMinProcessingTime() : 0;
-   }
-
-   public long getRequestCount()
-   {
-      EndpointMetrics metrics = endpoint.getEndpointMetrics();
-      return metrics != null ? metrics.getRequestCount() : 0;
-   }
-
-   public long getResponseCount()
-   {
-      EndpointMetrics metrics = endpoint.getEndpointMetrics();
-      return metrics != null ? metrics.getResponseCount() : 0;
-   }
-
-   public Date getStartTime()
-   {
-      EndpointMetrics metrics = endpoint.getEndpointMetrics();
-      return metrics != null ? metrics.getStartTime() : null;
-   }
-
-   public Date getStopTime()
-   {
-      EndpointMetrics metrics = endpoint.getEndpointMetrics();
-      return metrics != null ? metrics.getStopTime() : null;
-   }
-
-   public long getTotalProcessingTime()
-   {
-      EndpointMetrics metrics = endpoint.getEndpointMetrics();
-      return metrics != null ? metrics.getTotalProcessingTime() : 0;
-   }
-
-   public void start()
-   {
-      endpoint.getLifecycleHandler().start(endpoint);
-   }
-
-   public void stop()
-   {
-      endpoint.getLifecycleHandler().stop(endpoint);
-   }
-}

Deleted: trunk/integration/native/src/main/java/org/jboss/wsf/stack/jbws/ManagedEndpointMBean.java
===================================================================
--- trunk/integration/native/src/main/java/org/jboss/wsf/stack/jbws/ManagedEndpointMBean.java	2007-07-30 07:23:40 UTC (rev 4024)
+++ trunk/integration/native/src/main/java/org/jboss/wsf/stack/jbws/ManagedEndpointMBean.java	2007-07-30 12:49:32 UTC (rev 4025)
@@ -1,53 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt 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.wsf.stack.jbws;
-
-import java.util.Date;
-
-/**
- * MBean interface.
- * @since 15-April-2004
- */
-public interface ManagedEndpointMBean
-{
-   void start();
-
-   void stop();
-
-   Date getStartTime();
-
-   Date getStopTime();
-
-   long getMinProcessingTime();
-
-   long getMaxProcessingTime();
-
-   long getAverageProcessingTime();
-
-   long getTotalProcessingTime();
-
-   long getRequestCount();
-
-   long getFaultCount();
-
-   long getResponseCount();
-}

Deleted: trunk/integration/native/src/main/java/org/jboss/wsf/stack/jbws/ManagedEndpointRegistry.java
===================================================================
--- trunk/integration/native/src/main/java/org/jboss/wsf/stack/jbws/ManagedEndpointRegistry.java	2007-07-30 07:23:40 UTC (rev 4024)
+++ trunk/integration/native/src/main/java/org/jboss/wsf/stack/jbws/ManagedEndpointRegistry.java	2007-07-30 12:49:32 UTC (rev 4025)
@@ -1,129 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt 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.wsf.stack.jbws;
-
-// $Id$
-
-import java.util.ArrayList;
-
-import javax.management.JMException;
-import javax.management.MBeanServer;
-import javax.management.MBeanServerFactory;
-import javax.management.ObjectName;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
-import org.jboss.ws.metadata.umdm.UnifiedMetaData;
-import org.jboss.wsf.spi.deployment.Endpoint;
-import org.jboss.wsf.spi.management.DefaultEndpointRegistry;
-
-/**
- * A Service Endpoint Registry
- *
- * @author Thomas.Diesler at jboss.org
- * @since 04-May-2007
- */
-public class ManagedEndpointRegistry extends DefaultEndpointRegistry implements ManagedEndpointRegistryMBean
-{
-   // provide logging
-   private static final Logger log = Logger.getLogger(ManagedEndpointRegistry.class);
-
-   public String getImplementationTitle()
-   {
-      return getClass().getPackage().getImplementationTitle();
-   }
-
-   public String getImplementationVersion()
-   {
-      return UnifiedMetaData.getImplementationVersion();
-   }
-
-   @Override
-   public void register(Endpoint endpoint)
-   {
-      super.register(endpoint);
-      
-      MBeanServer server = getMBeanServer();
-      if (server != null)
-      {
-         try
-         {
-            ManagedEndpoint jmxEndpoint = new ManagedEndpoint(endpoint);
-            server.registerMBean(jmxEndpoint, endpoint.getName());
-         }
-         catch (JMException ex)
-         {
-            log.error("Cannot register endpoint with JMX server", ex);
-         }
-      }
-   }
-
-   @Override
-   public void unregister(Endpoint endpoint)
-   {
-      super.unregister(endpoint);
-      MBeanServer server = getMBeanServer();
-      if (server != null)
-      {
-         try
-         {
-            server.unregisterMBean(endpoint.getName());
-         }
-         catch (JMException ex)
-         {
-            log.error("Cannot unregister endpoint with JMX server", ex);
-         }
-      }
-   }
-
-   public void create() throws Exception
-   {
-      log.info(getImplementationTitle());
-      log.info(getImplementationVersion());
-      MBeanServer server = getMBeanServer();
-      if (server != null)
-      {
-         server.registerMBean(this, OBJECT_NAME);
-      }
-   }
-
-   public void destroy() throws Exception
-   {
-      log.debug("Destroy service endpoint manager");
-      MBeanServer server = getMBeanServer();
-      if (server != null)
-      {
-         server.unregisterMBean(OBJECT_NAME);
-      }
-   }
-
-   private MBeanServer getMBeanServer()
-   {
-      MBeanServer server = null;
-      ArrayList servers = MBeanServerFactory.findMBeanServer(null);
-      if (servers.size() > 0)
-      {
-         server = (MBeanServer)servers.get(0);
-      }
-      return server;
-   }
-}

Deleted: trunk/integration/native/src/main/java/org/jboss/wsf/stack/jbws/ManagedEndpointRegistryMBean.java
===================================================================
--- trunk/integration/native/src/main/java/org/jboss/wsf/stack/jbws/ManagedEndpointRegistryMBean.java	2007-07-30 07:23:40 UTC (rev 4024)
+++ trunk/integration/native/src/main/java/org/jboss/wsf/stack/jbws/ManagedEndpointRegistryMBean.java	2007-07-30 12:49:32 UTC (rev 4025)
@@ -1,35 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt 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.wsf.stack.jbws;
-
-import org.jboss.wsf.spi.management.EndpointRegistry;
-
-/**
- * MBean interface.
- * @since 15-April-2004
- */
-public interface ManagedEndpointRegistryMBean extends EndpointRegistry
-{
-   String getImplementationTitle();
-
-   String getImplementationVersion();
-}

Added: trunk/integration/native/src/main/java/org/jboss/wsf/stack/jbws/NativeServerConfig.java
===================================================================
--- trunk/integration/native/src/main/java/org/jboss/wsf/stack/jbws/NativeServerConfig.java	                        (rev 0)
+++ trunk/integration/native/src/main/java/org/jboss/wsf/stack/jbws/NativeServerConfig.java	2007-07-30 12:49:32 UTC (rev 4025)
@@ -0,0 +1,55 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.wsf.stack.jbws;
+
+//$Id: DefaultServerConfig.java 4023 2007-07-28 07:14:06Z thomas.diesler at jboss.com $
+
+import org.jboss.logging.Logger;
+import org.jboss.wsf.framework.management.DefaultServerConfig;
+
+/**
+ * Basic implementation of a ServerConfig 
+ *
+ * @author Thomas.Diesler at jboss.org
+ * @since 08-May-2006
+ */
+public class NativeServerConfig extends DefaultServerConfig implements NativeServerConfigMBean
+{
+   private static final Logger log = Logger.getLogger(NativeServerConfig.class);
+   
+   public String getImplementationTitle()
+   {
+      return getClass().getPackage().getImplementationTitle();
+   }
+
+   public String getImplementationVersion()
+   {
+      return getClass().getPackage().getImplementationVersion();
+   }
+   
+   public void create() throws Exception
+   {
+      log.info(getImplementationTitle());
+      log.info(getImplementationVersion());
+      super.create();
+   }
+}

Added: trunk/integration/native/src/main/java/org/jboss/wsf/stack/jbws/NativeServerConfigMBean.java
===================================================================
--- trunk/integration/native/src/main/java/org/jboss/wsf/stack/jbws/NativeServerConfigMBean.java	                        (rev 0)
+++ trunk/integration/native/src/main/java/org/jboss/wsf/stack/jbws/NativeServerConfigMBean.java	2007-07-30 12:49:32 UTC (rev 4025)
@@ -0,0 +1,39 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.wsf.stack.jbws;
+
+//$Id: DefaultServerConfig.java 4023 2007-07-28 07:14:06Z thomas.diesler at jboss.com $
+
+import org.jboss.wsf.framework.management.DefaultServerConfigMBean;
+
+/**
+ * Basic implementation of a ServerConfig 
+ *
+ * @author Thomas.Diesler at jboss.org
+ * @since 08-May-2006
+ */
+public interface NativeServerConfigMBean extends DefaultServerConfigMBean
+{
+   String getImplementationTitle();
+
+   String getImplementationVersion();
+}

Modified: trunk/integration/native/src/main/resources/jbossws-native-config.xml
===================================================================
--- trunk/integration/native/src/main/resources/jbossws-native-config.xml	2007-07-30 07:23:40 UTC (rev 4024)
+++ trunk/integration/native/src/main/resources/jbossws-native-config.xml	2007-07-30 12:49:32 UTC (rev 4025)
@@ -1,6 +1,8 @@
 
   <!-- An abstraction of server configuration aspects. -->  
-  <bean name="WSServerConfig" class="org.jboss.wsf.framework.management.DefaultServerConfig">
+  <bean name="WSServerConfig" class="org.jboss.wsf.stack.jbws.NativeServerConfig">
+    <property name="mbeanServer"><inject bean="WSMBeanServerLocator" property="mbeanServer"/></property>
+    
     <!--
         The WSDL, that is a required deployment artifact for an endpoint, has a <soap:address>
         element which points to the location of the endpoint. JBoss supports rewriting of that SOAP address.
@@ -23,7 +25,9 @@
   </bean>
 
   <!-- The registry for web service endpoints -->
-  <bean name="WSEndpointRegistry" class="org.jboss.wsf.stack.jbws.ManagedEndpointRegistry"/>
+  <bean name="WSEndpointRegistry" class="org.jboss.wsf.framework.management.ManagedEndpointRegistry">
+    <property name="mbeanServer"><inject bean="WSMBeanServerLocator" property="mbeanServer"/></property>
+  </bean>
   
   <!-- A subscription manager for WS-Eventing -->
   <bean name="WSSubscriptionManager" class="org.jboss.ws.extensions.eventing.mgmt.SubscriptionManager">

Deleted: trunk/integration/spi/src/main/java/org/jboss/wsf/framework/http/DefaultHttpServerFactory.java
===================================================================
--- trunk/integration/spi/src/main/java/org/jboss/wsf/framework/http/DefaultHttpServerFactory.java	2007-07-30 07:23:40 UTC (rev 4024)
+++ trunk/integration/spi/src/main/java/org/jboss/wsf/framework/http/DefaultHttpServerFactory.java	2007-07-30 12:49:32 UTC (rev 4025)
@@ -1,41 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt 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.wsf.framework.http;
-
-//$Id: HttpContext.java 1757 2006-12-22 15:40:24Z thomas.diesler at jboss.com $
-
-import org.jboss.wsf.spi.http.HttpServer;
-import org.jboss.wsf.spi.http.HttpServerFactory;
-
-/**
- * A factory for an HTTP Server
- *
- * @author Thomas.Diesler at jboss.org
- * @since 07-Jul-2006
- */
-public class DefaultHttpServerFactory extends HttpServerFactory
-{
-   public HttpServer newHttpServer()
-   {
-      return new WebAppDeployingHttpServer();
-   }
-}

Deleted: trunk/integration/spi/src/main/java/org/jboss/wsf/framework/http/WebAppDeployingHttpServer.java
===================================================================
--- trunk/integration/spi/src/main/java/org/jboss/wsf/framework/http/WebAppDeployingHttpServer.java	2007-07-30 07:23:40 UTC (rev 4024)
+++ trunk/integration/spi/src/main/java/org/jboss/wsf/framework/http/WebAppDeployingHttpServer.java	2007-07-30 12:49:32 UTC (rev 4025)
@@ -1,234 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt 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.wsf.framework.http;
-
-//$Id: JBossHttpServer.java 1786 2007-01-04 14:30:04Z thomas.diesler at jboss.com $
-
-import java.io.File;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.net.URL;
-import java.util.Map;
-
-import javax.management.MBeanServerConnection;
-import javax.management.ObjectName;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-import javax.xml.ws.Endpoint;
-import javax.xml.ws.WebServiceException;
-
-import org.jboss.wsf.common.DOMUtils;
-import org.jboss.wsf.common.DOMWriter;
-import org.jboss.wsf.framework.DefaultExtensible;
-import org.jboss.wsf.spi.SPIProvider;
-import org.jboss.wsf.spi.SPIProviderResolver;
-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.spi.management.ServerConfig;
-import org.jboss.wsf.spi.management.ServerConfigFactory;
-import org.w3c.dom.Element;
-
-/**
- * A Tomcat HTTP Server
- *
- * @author Thomas.Diesler at jboss.org
- * @since 07-Jul-2006
- */
-public class WebAppDeployingHttpServer extends DefaultExtensible implements HttpServer
-{
-   private static final String MAIN_DEPLOYER = "jboss.system:service=MainDeployer";
-
-   /** Start an instance of this HTTP server */
-   public void start()
-   {
-      // verify required properties
-   }
-
-   /** Create an HTTP context */
-   public HttpContext createContext(String contextRoot)
-   {
-      SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
-      HttpContext httpContext = spiProvider.getSPI(HttpContextFactory.class).newHttpContext(this, contextRoot);
-      return httpContext;
-   }
-
-   /** Publish an JAXWS endpoint to the HTTP server */
-   public void publish(HttpContext context, Endpoint endpoint)
-   {
-      Class implClass = getImplementorClass(endpoint);
-      String implName = implClass.getName();
-
-      try
-      {
-         Element webDoc = createWebAppDescriptor(context, endpoint);
-         Element jbossDoc = createJBossWebAppDescriptor(context, endpoint);
-
-         File tmpWar = null;
-         try
-         {
-            SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
-            ServerConfig serverConfig = spiProvider.getSPI(ServerConfigFactory.class).getServerConfig();
-            File tmpDir = new File(serverConfig.getServerTempDir().getCanonicalPath() + "/jbossws");
-
-            String deploymentName = implName.substring(implName.lastIndexOf(".") + 1);
-            tmpWar = File.createTempFile(deploymentName, ".war", tmpDir);
-            tmpWar.delete();
-            File webInf = new File(tmpWar, "WEB-INF");
-            webInf.mkdirs();
-
-            File webXml = new File(webInf, "web.xml");
-            FileWriter fw = new FileWriter(webXml);
-            new DOMWriter(fw).setPrettyprint(true).print(webDoc);
-            fw.close();
-
-            File jbossWebXml = new File(webInf, "jboss-web.xml");
-            fw = new FileWriter(jbossWebXml);
-            new DOMWriter(fw).setPrettyprint(true).print(jbossDoc);
-            fw.close();
-         }
-         catch (IOException e)
-         {
-            throw new WebServiceException("Failed to create webservice war", e);
-         }
-
-         Map<String, Object> epProps = endpoint.getProperties();
-         epProps.put("jbossws-endpoint-war-url", tmpWar);
-
-         URL tmpURL = tmpWar.toURL();
-         MBeanServerConnection server = getServer();
-         server.invoke(new ObjectName(MAIN_DEPLOYER), "deploy", new Object[] { tmpURL }, new String[] { "java.net.URL" });
-      }
-      catch (RuntimeException rte)
-      {
-         throw rte;
-      }
-      catch (Exception ex)
-      {
-         throw new WebServiceException(ex);
-      }
-   }
-
-   /** Destroys an JAXWS endpoint on the HTTP server */
-   public void destroy(HttpContext context, Endpoint endpoint)
-   {
-      Map<String, Object> epProps = endpoint.getProperties();
-      File tmpWar = (File)epProps.get("jbossws-endpoint-war-url");
-      if (tmpWar == null)
-         throw new IllegalStateException("Cannot find endpoint war property");
-
-      try
-      {
-         URL tmpURL = tmpWar.toURL();
-         MBeanServerConnection server = getServer();
-         server.invoke(new ObjectName(MAIN_DEPLOYER), "undeploy", new Object[] { tmpURL }, new String[] { "java.net.URL" });
-
-         tmpWar.delete();
-      }
-      catch (RuntimeException rte)
-      {
-         throw rte;
-      }
-      catch (Exception ex)
-      {
-         throw new WebServiceException(ex);
-      }
-   }
-
-   private Class getImplementorClass(Endpoint endpoint)
-   {
-      Object implementor = endpoint.getImplementor();
-      Class implClass = (implementor instanceof Class ? (Class)implementor : implementor.getClass());
-      return implClass;
-   }
-
-   private MBeanServerConnection getServer() throws NamingException
-   {
-      InitialContext iniCtx = new InitialContext();
-      MBeanServerConnection server = (MBeanServerConnection)iniCtx.lookup("jmx/invoker/RMIAdaptor");
-      return server;
-   }
-
-   private Element createWebAppDescriptor(HttpContext context, Endpoint endpoint)
-   {
-      Class implClass = getImplementorClass(endpoint);
-      String implName = implClass.getName();
-
-      Element webApp = DOMUtils.createElement("web-app");
-
-      /*
-       <servlet>
-       <servlet-name>
-       <servlet-class>
-       </servlet>
-       */
-      Element servlet = (Element)webApp.appendChild(DOMUtils.createElement("servlet"));
-      Element servletName = (Element)servlet.appendChild(DOMUtils.createElement("servlet-name"));
-      servletName.appendChild(DOMUtils.createTextNode("JAXWSEndpoint"));
-      Element servletClass = (Element)servlet.appendChild(DOMUtils.createElement("servlet-class"));
-      servletClass.appendChild(DOMUtils.createTextNode(implName));
-
-      /*
-       <servlet-mapping>
-       <servlet-name>
-       <url-pattern>
-       </servlet-mapping>
-       */
-      Element servletMapping = (Element)webApp.appendChild(DOMUtils.createElement("servlet-mapping"));
-      servletName = (Element)servletMapping.appendChild(DOMUtils.createElement("servlet-name"));
-      servletName.appendChild(DOMUtils.createTextNode("JAXWSEndpoint"));
-      Element urlPatternElement = (Element)servletMapping.appendChild(DOMUtils.createElement("url-pattern"));
-
-      String urlPattern = "/*";
-      urlPatternElement.appendChild(DOMUtils.createTextNode(urlPattern));
-
-      // Add security-constraint in generated web.xml for Endpoint API
-      // FIXME: JBWS-1069
-
-      return webApp;
-   }
-
-   private Element createJBossWebAppDescriptor(HttpContext context, Endpoint endpoint)
-   {
-      /* Create a jboss-web
-       <jboss-web>
-       <security-domain>java:/jaas/cts</security-domain>
-       <context-root>/ws/ejbN/</context-root>
-       </jboss-web>
-       */
-      Element jbossWeb = DOMUtils.createElement("jboss-web");
-
-      // Get the context root for this deployment
-      String contextRoot = context.getContextRoot();
-      if (contextRoot == null)
-         throw new WebServiceException("Cannot obtain context root");
-
-      Element root = (Element)jbossWeb.appendChild(DOMUtils.createElement("context-root"));
-      root.appendChild(DOMUtils.createTextNode(contextRoot));
-
-      // Add security-constraint in generated web.xml for Endpoint API
-      // FIXME: JBWS-1069
-
-      return jbossWeb;
-   }
-}
-

Modified: trunk/integration/spi/src/main/java/org/jboss/wsf/framework/management/DefaultServerConfig.java
===================================================================
--- trunk/integration/spi/src/main/java/org/jboss/wsf/framework/management/DefaultServerConfig.java	2007-07-30 07:23:40 UTC (rev 4024)
+++ trunk/integration/spi/src/main/java/org/jboss/wsf/framework/management/DefaultServerConfig.java	2007-07-30 12:49:32 UTC (rev 4025)
@@ -26,17 +26,16 @@
 import java.io.File;
 import java.net.InetAddress;
 import java.net.UnknownHostException;
-import java.util.Iterator;
 import java.util.Set;
 
 import javax.management.AttributeNotFoundException;
 import javax.management.JMException;
 import javax.management.MBeanServer;
-import javax.management.MBeanServerFactory;
 import javax.management.ObjectName;
 
 import org.jboss.logging.Logger;
 import org.jboss.wsf.common.ObjectNameFactory;
+import org.jboss.wsf.spi.management.ServerConfig;
 
 /**
  * Basic implementation of a ServerConfig 
@@ -45,10 +44,12 @@
  * @author darran.lofthouse at jboss.com
  * @since 08-May-2006
  */
-public class DefaultServerConfig implements DefaultServerConfigMBean
+public class DefaultServerConfig implements DefaultServerConfigMBean, ServerConfig
 {
    private static final Logger log = Logger.getLogger(DefaultServerConfig.class);
 
+   // The MBeanServer
+   private MBeanServer mbeanServer;
    // The webservice host name that will be used when updating the wsdl
    private String webServiceHost = UNDEFINED_HOSTNAME;
    // The webservice port that will be used when updating the wsdl
@@ -57,9 +58,17 @@
    private int webServiceSecurePort;
    // Whether we should always modify the soap address to the deployed endpoing location
    private boolean modifySOAPAddress;
-   // The MBeanServer
-   private MBeanServer server;
 
+   public MBeanServer getMbeanServer()
+   {
+      return mbeanServer;
+   }
+
+   public void setMbeanServer(MBeanServer mbeanServer)
+   {
+      this.mbeanServer = mbeanServer;
+   }
+
    public String getWebServiceHost()
    {
       return webServiceHost;
@@ -105,9 +114,8 @@
    {
       try
       {
-         MBeanServer server = getMBeanServer();
          ObjectName oname = ObjectNameFactory.create("jboss.system:type=ServerConfig");
-         File tmpdir = (File)server.getAttribute(oname, "ServerTempDir");
+         File tmpdir = (File)getMbeanServer().getAttribute(oname, "ServerTempDir");
          return tmpdir;
       }
       catch (JMException e)
@@ -120,9 +128,8 @@
    {
       try
       {
-         MBeanServer server = getMBeanServer();
          ObjectName oname = ObjectNameFactory.create("jboss.system:type=ServerConfig");
-         File tmpdir = (File)server.getAttribute(oname, "ServerDataDir");
+         File tmpdir = (File)getMbeanServer().getAttribute(oname, "ServerDataDir");
          return tmpdir;
       }
       catch (JMException e)
@@ -165,20 +172,12 @@
 
    public void create() throws Exception
    {
-      MBeanServer server = getMBeanServer();
-      if (server != null)
-      {
-         server.registerMBean(this, DefaultServerConfigMBean.OBJECT_NAME);
-      }
+      getMbeanServer().registerMBean(this, DefaultServerConfigMBean.OBJECT_NAME);
    }
 
    public void destroy() throws Exception
    {
-      MBeanServer server = getMBeanServer();
-      if (server != null)
-      {
-         server.unregisterMBean(DefaultServerConfigMBean.OBJECT_NAME);
-      }
+      getMbeanServer().unregisterMBean(DefaultServerConfigMBean.OBJECT_NAME);
    }
 
    private int getConnectorPort(final String protocol, final boolean secure)
@@ -187,19 +186,18 @@
 
       try
       {
-         MBeanServer server = getMBeanServer();
          ObjectName connectors = new ObjectName("jboss.web:type=Connector,*");
 
-         Set connectorNames = server.queryNames(connectors, null);
+         Set connectorNames = getMbeanServer().queryNames(connectors, null);
          for (Object current : connectorNames)
          {
             ObjectName currentName = (ObjectName)current;
 
             try
             {
-               int connectorPort = (Integer)server.getAttribute(currentName, "port");
-               boolean connectorSecure = (Boolean)server.getAttribute(currentName, "secure");
-               String connectorProtocol = (String)server.getAttribute(currentName, "protocol");
+               int connectorPort = (Integer)getMbeanServer().getAttribute(currentName, "port");
+               boolean connectorSecure = (Boolean)getMbeanServer().getAttribute(currentName, "secure");
+               String connectorProtocol = (String)getMbeanServer().getAttribute(currentName, "protocol");
 
                if (protocol.equals(connectorProtocol) && secure == connectorSecure)
                {
@@ -225,16 +223,4 @@
          return -1;
       }
    }
-
-   private MBeanServer getMBeanServer()
-   {
-      if (server == null)
-      {
-         for (Iterator i = MBeanServerFactory.findMBeanServer(null).iterator(); i.hasNext();)
-         {
-            server = (MBeanServer)i.next();
-         }
-      }
-      return server;
-   }
 }

Modified: trunk/integration/spi/src/main/java/org/jboss/wsf/framework/management/DefaultServerConfigMBean.java
===================================================================
--- trunk/integration/spi/src/main/java/org/jboss/wsf/framework/management/DefaultServerConfigMBean.java	2007-07-30 07:23:40 UTC (rev 4024)
+++ trunk/integration/spi/src/main/java/org/jboss/wsf/framework/management/DefaultServerConfigMBean.java	2007-07-30 12:49:32 UTC (rev 4025)
@@ -23,8 +23,8 @@
 
 import javax.management.ObjectName;
 
+import org.jboss.wsf.common.ObjectNameFactory;
 import org.jboss.wsf.spi.management.ServerConfig;
-import org.jboss.wsf.common.ObjectNameFactory;
 
 public interface DefaultServerConfigMBean extends ServerConfig
 {

Added: trunk/integration/spi/src/main/java/org/jboss/wsf/framework/management/MBeanServerLocator.java
===================================================================
--- trunk/integration/spi/src/main/java/org/jboss/wsf/framework/management/MBeanServerLocator.java	                        (rev 0)
+++ trunk/integration/spi/src/main/java/org/jboss/wsf/framework/management/MBeanServerLocator.java	2007-07-30 12:49:32 UTC (rev 4025)
@@ -0,0 +1,59 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.wsf.framework.management;
+
+//$Id: KernelLocator.java 3137 2007-05-18 13:41:57Z thomas.diesler at jboss.com $
+
+import java.util.Iterator;
+
+import javax.management.MBeanServer;
+import javax.management.MBeanServerFactory;
+
+/**
+ * Locate the single instance of the MBeanServer 
+ * 
+ * @author Thomas.Diesler at jboss.org
+ * @since 30-Jul-2007
+ */
+public class MBeanServerLocator
+{
+   private MBeanServer mbeanServer;
+
+   public MBeanServer getMbeanServer()
+   {
+      // In jboss-4.2 the MBeanServer cannot be injected
+      if (mbeanServer == null)
+      {
+         for (Iterator i = MBeanServerFactory.findMBeanServer(null).iterator(); i.hasNext();)
+         {
+            mbeanServer = (MBeanServer)i.next();
+            break;
+         }
+      }
+      return mbeanServer;
+   }
+
+   public void setMbeanServer(MBeanServer mbeanServer)
+   {
+      this.mbeanServer = mbeanServer;
+   }
+}

Copied: trunk/integration/spi/src/main/java/org/jboss/wsf/framework/management/ManagedEndpoint.java (from rev 4024, trunk/integration/native/src/main/java/org/jboss/wsf/stack/jbws/ManagedEndpoint.java)
===================================================================
--- trunk/integration/spi/src/main/java/org/jboss/wsf/framework/management/ManagedEndpoint.java	                        (rev 0)
+++ trunk/integration/spi/src/main/java/org/jboss/wsf/framework/management/ManagedEndpoint.java	2007-07-30 12:49:32 UTC (rev 4025)
@@ -0,0 +1,109 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.wsf.framework.management;
+
+// $Id: ManagedEndpointRegistry.java 3146 2007-05-18 22:55:26Z thomas.diesler at jboss.com $
+
+import java.util.Date;
+
+import org.jboss.wsf.spi.deployment.Endpoint;
+import org.jboss.wsf.spi.management.EndpointMetrics;
+
+/**
+ * The endpoint MBean representation 
+ *
+ * @author Thomas.Diesler at jboss.org
+ * @since 20-Jun-2007
+ */
+public class ManagedEndpoint implements ManagedEndpointMBean
+{
+   private Endpoint endpoint;
+
+   public ManagedEndpoint(Endpoint endpoint)
+   {
+      this.endpoint = endpoint;
+   }
+
+   public long getAverageProcessingTime()
+   {
+      EndpointMetrics metrics = endpoint.getEndpointMetrics();
+      return metrics != null ? metrics.getAverageProcessingTime() : 0;
+   }
+
+   public long getFaultCount()
+   {
+      EndpointMetrics metrics = endpoint.getEndpointMetrics();
+      return metrics != null ? metrics.getFaultCount() : 0;
+   }
+
+   public long getMaxProcessingTime()
+   {
+      EndpointMetrics metrics = endpoint.getEndpointMetrics();
+      return metrics != null ? metrics.getMaxProcessingTime() : 0;
+   }
+
+   public long getMinProcessingTime()
+   {
+      EndpointMetrics metrics = endpoint.getEndpointMetrics();
+      return metrics != null ? metrics.getMinProcessingTime() : 0;
+   }
+
+   public long getRequestCount()
+   {
+      EndpointMetrics metrics = endpoint.getEndpointMetrics();
+      return metrics != null ? metrics.getRequestCount() : 0;
+   }
+
+   public long getResponseCount()
+   {
+      EndpointMetrics metrics = endpoint.getEndpointMetrics();
+      return metrics != null ? metrics.getResponseCount() : 0;
+   }
+
+   public Date getStartTime()
+   {
+      EndpointMetrics metrics = endpoint.getEndpointMetrics();
+      return metrics != null ? metrics.getStartTime() : null;
+   }
+
+   public Date getStopTime()
+   {
+      EndpointMetrics metrics = endpoint.getEndpointMetrics();
+      return metrics != null ? metrics.getStopTime() : null;
+   }
+
+   public long getTotalProcessingTime()
+   {
+      EndpointMetrics metrics = endpoint.getEndpointMetrics();
+      return metrics != null ? metrics.getTotalProcessingTime() : 0;
+   }
+
+   public void start()
+   {
+      endpoint.getLifecycleHandler().start(endpoint);
+   }
+
+   public void stop()
+   {
+      endpoint.getLifecycleHandler().stop(endpoint);
+   }
+}

Copied: trunk/integration/spi/src/main/java/org/jboss/wsf/framework/management/ManagedEndpointMBean.java (from rev 4024, trunk/integration/native/src/main/java/org/jboss/wsf/stack/jbws/ManagedEndpointMBean.java)
===================================================================
--- trunk/integration/spi/src/main/java/org/jboss/wsf/framework/management/ManagedEndpointMBean.java	                        (rev 0)
+++ trunk/integration/spi/src/main/java/org/jboss/wsf/framework/management/ManagedEndpointMBean.java	2007-07-30 12:49:32 UTC (rev 4025)
@@ -0,0 +1,53 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.wsf.framework.management;
+
+import java.util.Date;
+
+/**
+ * MBean interface.
+ * @since 15-April-2004
+ */
+public interface ManagedEndpointMBean
+{
+   void start();
+
+   void stop();
+
+   Date getStartTime();
+
+   Date getStopTime();
+
+   long getMinProcessingTime();
+
+   long getMaxProcessingTime();
+
+   long getAverageProcessingTime();
+
+   long getTotalProcessingTime();
+
+   long getRequestCount();
+
+   long getFaultCount();
+
+   long getResponseCount();
+}

Copied: trunk/integration/spi/src/main/java/org/jboss/wsf/framework/management/ManagedEndpointRegistry.java (from rev 4024, trunk/integration/native/src/main/java/org/jboss/wsf/stack/jbws/ManagedEndpointRegistry.java)
===================================================================
--- trunk/integration/spi/src/main/java/org/jboss/wsf/framework/management/ManagedEndpointRegistry.java	                        (rev 0)
+++ trunk/integration/spi/src/main/java/org/jboss/wsf/framework/management/ManagedEndpointRegistry.java	2007-07-30 12:49:32 UTC (rev 4025)
@@ -0,0 +1,107 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.wsf.framework.management;
+
+// $Id$
+
+import javax.management.JMException;
+import javax.management.MBeanServer;
+
+import org.jboss.logging.Logger;
+import org.jboss.wsf.spi.deployment.Endpoint;
+import org.jboss.wsf.spi.management.DefaultEndpointRegistry;
+
+/**
+ * A Service Endpoint Registry
+ *
+ * @author Thomas.Diesler at jboss.org
+ * @since 04-May-2007
+ */
+public class ManagedEndpointRegistry extends DefaultEndpointRegistry implements ManagedEndpointRegistryMBean
+{
+   // provide logging
+   private static final Logger log = Logger.getLogger(ManagedEndpointRegistry.class);
+
+   // The MBeanServer
+   private MBeanServer mbeanServer;
+
+   public MBeanServer getMbeanServer()
+   {
+      return mbeanServer;
+   }
+
+   public void setMbeanServer(MBeanServer mbeanServer)
+   {
+      this.mbeanServer = mbeanServer;
+   }
+
+   @Override
+   public void register(Endpoint endpoint)
+   {
+      super.register(endpoint);
+
+      try
+      {
+         ManagedEndpoint jmxEndpoint = new ManagedEndpoint(endpoint);
+         getMbeanServer().registerMBean(jmxEndpoint, endpoint.getName());
+      }
+      catch (JMException ex)
+      {
+         log.error("Cannot register endpoint with JMX server", ex);
+      }
+   }
+
+   @Override
+   public void unregister(Endpoint endpoint)
+   {
+      super.unregister(endpoint);
+      try
+      {
+         getMbeanServer().unregisterMBean(endpoint.getName());
+      }
+      catch (JMException ex)
+      {
+         log.error("Cannot unregister endpoint with JMX server", ex);
+      }
+   }
+
+   /*
+    * Currently there are no meaningful attributes/operations exposed via JMX 
+    * 
+    public void create() throws Exception
+    {
+    if (mbeanServer != null)
+    {
+    getMbeanServer().registerMBean(this, OBJECT_NAME);
+    }
+    }
+
+    public void destroy() throws Exception
+    {
+    log.debug("Destroy service endpoint manager");
+    if (mbeanServer != null)
+    {
+    getMbeanServer().unregisterMBean(OBJECT_NAME);
+    }
+    }
+    */
+}

Copied: trunk/integration/spi/src/main/java/org/jboss/wsf/framework/management/ManagedEndpointRegistryMBean.java (from rev 4024, trunk/integration/native/src/main/java/org/jboss/wsf/stack/jbws/ManagedEndpointRegistryMBean.java)
===================================================================
--- trunk/integration/spi/src/main/java/org/jboss/wsf/framework/management/ManagedEndpointRegistryMBean.java	                        (rev 0)
+++ trunk/integration/spi/src/main/java/org/jboss/wsf/framework/management/ManagedEndpointRegistryMBean.java	2007-07-30 12:49:32 UTC (rev 4025)
@@ -0,0 +1,36 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.wsf.framework.management;
+
+import javax.management.ObjectName;
+
+import org.jboss.wsf.common.ObjectNameFactory;
+
+/**
+ * MBean interface.
+ * @since 15-April-2004
+ */
+public interface ManagedEndpointRegistryMBean
+{
+   /** The object name in the MBean server */
+   ObjectName OBJECT_NAME = ObjectNameFactory.create("jboss.ws:service=EndpointRegistry");
+}

Modified: trunk/integration/spi/src/main/java/org/jboss/wsf/framework/management/ServerConfigFactoryImpl.java
===================================================================
--- trunk/integration/spi/src/main/java/org/jboss/wsf/framework/management/ServerConfigFactoryImpl.java	2007-07-30 07:23:40 UTC (rev 4024)
+++ trunk/integration/spi/src/main/java/org/jboss/wsf/framework/management/ServerConfigFactoryImpl.java	2007-07-30 12:49:32 UTC (rev 4025)
@@ -21,9 +21,9 @@
  */
 package org.jboss.wsf.framework.management;
 
-import org.jboss.wsf.spi.management.ServerConfigFactory;
-import org.jboss.wsf.spi.management.ServerConfig;
 import org.jboss.wsf.common.KernelAwareSPIFactory;
+import org.jboss.wsf.spi.management.ServerConfig;
+import org.jboss.wsf.spi.management.ServerConfigFactory;
 
 /**
  * @author Heiko.Braun at jboss.com
@@ -33,8 +33,6 @@
 {
    public ServerConfig getServerConfig()
    {
-      return new KernelAwareSPIFactory().getKernelProvidedSPI(
-        ServerConfig.BEAN_NAME, ServerConfig.class
-      );
+      return new KernelAwareSPIFactory().getKernelProvidedSPI(ServerConfig.BEAN_NAME, ServerConfig.class);
    }
 }

Modified: trunk/integration/spi/src/main/java/org/jboss/wsf/spi/http/HttpServer.java
===================================================================
--- trunk/integration/spi/src/main/java/org/jboss/wsf/spi/http/HttpServer.java	2007-07-30 07:23:40 UTC (rev 4024)
+++ trunk/integration/spi/src/main/java/org/jboss/wsf/spi/http/HttpServer.java	2007-07-30 12:49:32 UTC (rev 4025)
@@ -35,6 +35,9 @@
  */
 public interface HttpServer extends Extensible
 {
+   /** The default bean name */
+   String BEAN_NAME = "WSHTTPServer";
+
    /** Start an instance of this HTTP server */
    void start();
 

Modified: trunk/integration/spi/src/main/java/org/jboss/wsf/spi/http/HttpServerFactory.java
===================================================================
--- trunk/integration/spi/src/main/java/org/jboss/wsf/spi/http/HttpServerFactory.java	2007-07-30 07:23:40 UTC (rev 4024)
+++ trunk/integration/spi/src/main/java/org/jboss/wsf/spi/http/HttpServerFactory.java	2007-07-30 12:49:32 UTC (rev 4025)
@@ -33,5 +33,5 @@
  */
 public abstract class HttpServerFactory implements SPIView
 {
-   public abstract HttpServer newHttpServer();
+   public abstract HttpServer getHttpServer();
 }

Modified: trunk/integration/spi/src/main/java/org/jboss/wsf/spi/management/EndpointRegistry.java
===================================================================
--- trunk/integration/spi/src/main/java/org/jboss/wsf/spi/management/EndpointRegistry.java	2007-07-30 07:23:40 UTC (rev 4024)
+++ trunk/integration/spi/src/main/java/org/jboss/wsf/spi/management/EndpointRegistry.java	2007-07-30 12:49:32 UTC (rev 4025)
@@ -28,7 +28,6 @@
 import javax.management.ObjectName;
 
 import org.jboss.wsf.spi.deployment.Endpoint;
-import org.jboss.wsf.common.ObjectNameFactory;
 
 /**
  * A general endpoint registry.
@@ -42,9 +41,6 @@
 {
    /** The bean name in the kernel registry */
    String BEAN_NAME = "WSEndpointRegistry";
-   
-   /** The object name in the MBean server */
-   ObjectName OBJECT_NAME = ObjectNameFactory.create("jboss.ws:service=EndpointRegistry");
 
    /** Get the list of registered endpoints */
    Set<ObjectName> getEndpoints();
@@ -54,13 +50,13 @@
 
    /** Resolve endpoints thrrough a resolve instance **/
    Endpoint resolve(EndpointResolver resolver);
-   
+
    /** True is an endpoint for that name is registered */
    boolean isRegistered(ObjectName epName);
-   
+
    /** Register an endpoint */
    void register(Endpoint endpoint);
-   
+
    /** Unregister an endpoint */
    void unregister(Endpoint endpoint);
 }

Deleted: trunk/integration/sunri/src/main/java/org/jboss/wsf/stack/sunri/ManagedEndpointRegistry.java
===================================================================
--- trunk/integration/sunri/src/main/java/org/jboss/wsf/stack/sunri/ManagedEndpointRegistry.java	2007-07-30 07:23:40 UTC (rev 4024)
+++ trunk/integration/sunri/src/main/java/org/jboss/wsf/stack/sunri/ManagedEndpointRegistry.java	2007-07-30 12:49:32 UTC (rev 4025)
@@ -1,86 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt 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.wsf.stack.sunri;
-
-// $Id$
-
-import java.util.ArrayList;
-
-import javax.management.MBeanServer;
-import javax.management.MBeanServerFactory;
-
-import org.jboss.logging.Logger;
-import org.jboss.wsf.spi.management.DefaultEndpointRegistry;
-
-/**
- * A Service Endpoint Registry
- *
- * @author Thomas.Diesler at jboss.org
- * @since 04-May-2007
- */
-public class ManagedEndpointRegistry extends DefaultEndpointRegistry implements ManagedEndpointRegistryMBean
-{
-   // provide logging
-   private static final Logger log = Logger.getLogger(ManagedEndpointRegistry.class);
-
-   public String getImplementationTitle()
-   {
-      return getClass().getPackage().getImplementationTitle();
-   }
-
-   public String getImplementationVersion()
-   {
-      return getClass().getPackage().getImplementationVersion();
-   }
-
-   public void create() throws Exception
-   {
-      log.info(getImplementationTitle());
-      log.info(getImplementationVersion());
-      MBeanServer server = getMBeanServer();
-      if (server != null)
-      {
-         server.registerMBean(this, OBJECT_NAME);
-      }
-   }
-
-   public void destroy() throws Exception
-   {
-      log.debug("Destroy service endpoint manager");
-      MBeanServer server = getMBeanServer();
-      if (server != null)
-      {
-         server.unregisterMBean(OBJECT_NAME);
-      }
-   }
-
-   private MBeanServer getMBeanServer()
-   {
-      MBeanServer server = null;
-      ArrayList servers = MBeanServerFactory.findMBeanServer(null);
-      if (servers.size() > 0)
-      {
-         server = (MBeanServer)servers.get(0);
-      }
-      return server;
-   }
-}

Deleted: trunk/integration/sunri/src/main/java/org/jboss/wsf/stack/sunri/ManagedEndpointRegistryMBean.java
===================================================================
--- trunk/integration/sunri/src/main/java/org/jboss/wsf/stack/sunri/ManagedEndpointRegistryMBean.java	2007-07-30 07:23:40 UTC (rev 4024)
+++ trunk/integration/sunri/src/main/java/org/jboss/wsf/stack/sunri/ManagedEndpointRegistryMBean.java	2007-07-30 12:49:32 UTC (rev 4025)
@@ -1,35 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt 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.wsf.stack.sunri;
-
-import org.jboss.wsf.spi.management.EndpointRegistry;
-
-/**
- * MBean interface.
- * @since 15-April-2004
- */
-public interface ManagedEndpointRegistryMBean extends EndpointRegistry
-{
-   String getImplementationTitle();
-
-   String getImplementationVersion();
-}

Added: trunk/integration/sunri/src/main/java/org/jboss/wsf/stack/sunri/MetroServerConfig.java
===================================================================
--- trunk/integration/sunri/src/main/java/org/jboss/wsf/stack/sunri/MetroServerConfig.java	                        (rev 0)
+++ trunk/integration/sunri/src/main/java/org/jboss/wsf/stack/sunri/MetroServerConfig.java	2007-07-30 12:49:32 UTC (rev 4025)
@@ -0,0 +1,55 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.wsf.stack.sunri;
+
+//$Id: DefaultServerConfig.java 4023 2007-07-28 07:14:06Z thomas.diesler at jboss.com $
+
+import org.jboss.logging.Logger;
+import org.jboss.wsf.framework.management.DefaultServerConfig;
+
+/**
+ * Basic implementation of a ServerConfig 
+ *
+ * @author Thomas.Diesler at jboss.org
+ * @since 08-May-2006
+ */
+public class MetroServerConfig extends DefaultServerConfig implements MetroServerConfigMBean
+{
+   private static final Logger log = Logger.getLogger(MetroServerConfig.class);
+   
+   public String getImplementationTitle()
+   {
+      return getClass().getPackage().getImplementationTitle();
+   }
+
+   public String getImplementationVersion()
+   {
+      return getClass().getPackage().getImplementationVersion();
+   }
+   
+   public void create() throws Exception
+   {
+      log.info(getImplementationTitle());
+      log.info(getImplementationVersion());
+      super.create();
+   }
+}

Added: trunk/integration/sunri/src/main/java/org/jboss/wsf/stack/sunri/MetroServerConfigMBean.java
===================================================================
--- trunk/integration/sunri/src/main/java/org/jboss/wsf/stack/sunri/MetroServerConfigMBean.java	                        (rev 0)
+++ trunk/integration/sunri/src/main/java/org/jboss/wsf/stack/sunri/MetroServerConfigMBean.java	2007-07-30 12:49:32 UTC (rev 4025)
@@ -0,0 +1,39 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.wsf.stack.sunri;
+
+//$Id: DefaultServerConfig.java 4023 2007-07-28 07:14:06Z thomas.diesler at jboss.com $
+
+import org.jboss.wsf.framework.management.DefaultServerConfigMBean;
+
+/**
+ * Basic implementation of a ServerConfig 
+ *
+ * @author Thomas.Diesler at jboss.org
+ * @since 08-May-2006
+ */
+public interface MetroServerConfigMBean extends DefaultServerConfigMBean
+{
+   String getImplementationTitle();
+
+   String getImplementationVersion();
+}

Modified: trunk/integration/sunri/src/main/resources/jbossws-sunri-config.xml
===================================================================
--- trunk/integration/sunri/src/main/resources/jbossws-sunri-config.xml	2007-07-30 07:23:40 UTC (rev 4024)
+++ trunk/integration/sunri/src/main/resources/jbossws-sunri-config.xml	2007-07-30 12:49:32 UTC (rev 4025)
@@ -1,6 +1,8 @@
 
   <!-- An abstraction of server configuration aspects. -->  
-  <bean name="WSServerConfig" class="org.jboss.wsf.framework.management.DefaultServerConfig">
+  <bean name="WSServerConfig" class="org.jboss.wsf.stack.sunri.MetroServerConfig">
+    <property name="mbeanServer"><inject bean="WSMBeanServerLocator" property="mbeanServer"/></property>
+    
     <!--
         The WSDL, that is a required deployment artifact for an endpoint, has a <soap:address>
         element which points to the location of the endpoint. JBoss supports rewriting of that SOAP address.
@@ -23,7 +25,9 @@
   </bean>
 
   <!-- The registry for web service endpoints -->
-  <bean name="WSEndpointRegistry" class="org.jboss.wsf.stack.sunri.ManagedEndpointRegistry"/>
+  <bean name="WSEndpointRegistry" class="org.jboss.wsf.framework.management.ManagedEndpointRegistry">
+    <property name="mbeanServer"><inject bean="WSMBeanServerLocator" property="mbeanServer"/></property>
+  </bean>
   
   <!-- Bind Service objects in client environment context  -->
   <bean name="WSServiceRefHandler" class="org.jboss.ws.integration.ServiceRefHandlerImpl">

Added: trunk/integration/xfire/src/main/java/org/jboss/wsf/stack/xfire/CXFServerConfig.java
===================================================================
--- trunk/integration/xfire/src/main/java/org/jboss/wsf/stack/xfire/CXFServerConfig.java	                        (rev 0)
+++ trunk/integration/xfire/src/main/java/org/jboss/wsf/stack/xfire/CXFServerConfig.java	2007-07-30 12:49:32 UTC (rev 4025)
@@ -0,0 +1,55 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.wsf.stack.xfire;
+
+//$Id: DefaultServerConfig.java 4023 2007-07-28 07:14:06Z thomas.diesler at jboss.com $
+
+import org.jboss.logging.Logger;
+import org.jboss.wsf.framework.management.DefaultServerConfig;
+
+/**
+ * Basic implementation of a ServerConfig 
+ *
+ * @author Thomas.Diesler at jboss.org
+ * @since 08-May-2006
+ */
+public class CXFServerConfig extends DefaultServerConfig implements CXFServerConfigMBean
+{
+   private static final Logger log = Logger.getLogger(CXFServerConfig.class);
+   
+   public String getImplementationTitle()
+   {
+      return getClass().getPackage().getImplementationTitle();
+   }
+
+   public String getImplementationVersion()
+   {
+      return getClass().getPackage().getImplementationVersion();
+   }
+   
+   public void create() throws Exception
+   {
+      log.info(getImplementationTitle());
+      log.info(getImplementationVersion());
+      super.create();
+   }
+}

Added: trunk/integration/xfire/src/main/java/org/jboss/wsf/stack/xfire/CXFServerConfigMBean.java
===================================================================
--- trunk/integration/xfire/src/main/java/org/jboss/wsf/stack/xfire/CXFServerConfigMBean.java	                        (rev 0)
+++ trunk/integration/xfire/src/main/java/org/jboss/wsf/stack/xfire/CXFServerConfigMBean.java	2007-07-30 12:49:32 UTC (rev 4025)
@@ -0,0 +1,39 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.wsf.stack.xfire;
+
+//$Id: DefaultServerConfig.java 4023 2007-07-28 07:14:06Z thomas.diesler at jboss.com $
+
+import org.jboss.wsf.framework.management.DefaultServerConfigMBean;
+
+/**
+ * Basic implementation of a ServerConfig 
+ *
+ * @author Thomas.Diesler at jboss.org
+ * @since 08-May-2006
+ */
+public interface CXFServerConfigMBean extends DefaultServerConfigMBean
+{
+   String getImplementationTitle();
+
+   String getImplementationVersion();
+}

Deleted: trunk/integration/xfire/src/main/java/org/jboss/wsf/stack/xfire/ManagedEndpointRegistry.java
===================================================================
--- trunk/integration/xfire/src/main/java/org/jboss/wsf/stack/xfire/ManagedEndpointRegistry.java	2007-07-30 07:23:40 UTC (rev 4024)
+++ trunk/integration/xfire/src/main/java/org/jboss/wsf/stack/xfire/ManagedEndpointRegistry.java	2007-07-30 12:49:32 UTC (rev 4025)
@@ -1,86 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt 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.wsf.stack.xfire;
-
-// $Id$
-
-import java.util.ArrayList;
-
-import javax.management.MBeanServer;
-import javax.management.MBeanServerFactory;
-
-import org.jboss.logging.Logger;
-import org.jboss.wsf.spi.management.DefaultEndpointRegistry;
-
-/**
- * A Service Endpoint Registry
- *
- * @author Thomas.Diesler at jboss.org
- * @since 04-May-2007
- */
-public class ManagedEndpointRegistry extends DefaultEndpointRegistry implements ManagedEndpointRegistryMBean
-{
-   // provide logging
-   private static final Logger log = Logger.getLogger(ManagedEndpointRegistry.class);
-
-   public String getImplementationTitle()
-   {
-      return getClass().getPackage().getImplementationTitle();
-   }
-
-   public String getImplementationVersion()
-   {
-      return getClass().getPackage().getImplementationVersion();
-   }
-
-   public void create() throws Exception
-   {
-      log.info(getImplementationTitle());
-      log.info(getImplementationVersion());
-      MBeanServer server = getMBeanServer();
-      if (server != null)
-      {
-         server.registerMBean(this, OBJECT_NAME);
-      }
-   }
-
-   public void destroy() throws Exception
-   {
-      log.debug("Destroy service endpoint manager");
-      MBeanServer server = getMBeanServer();
-      if (server != null)
-      {
-         server.unregisterMBean(OBJECT_NAME);
-      }
-   }
-
-   private MBeanServer getMBeanServer()
-   {
-      MBeanServer server = null;
-      ArrayList servers = MBeanServerFactory.findMBeanServer(null);
-      if (servers.size() > 0)
-      {
-         server = (MBeanServer)servers.get(0);
-      }
-      return server;
-   }
-}

Deleted: trunk/integration/xfire/src/main/java/org/jboss/wsf/stack/xfire/ManagedEndpointRegistryMBean.java
===================================================================
--- trunk/integration/xfire/src/main/java/org/jboss/wsf/stack/xfire/ManagedEndpointRegistryMBean.java	2007-07-30 07:23:40 UTC (rev 4024)
+++ trunk/integration/xfire/src/main/java/org/jboss/wsf/stack/xfire/ManagedEndpointRegistryMBean.java	2007-07-30 12:49:32 UTC (rev 4025)
@@ -1,35 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt 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.wsf.stack.xfire;
-
-import org.jboss.wsf.spi.management.EndpointRegistry;
-
-/**
- * MBean interface.
- * @since 15-April-2004
- */
-public interface ManagedEndpointRegistryMBean extends EndpointRegistry
-{
-   String getImplementationTitle();
-
-   String getImplementationVersion();
-}

Modified: trunk/integration/xfire/src/main/resources/jbossws-xfire-config.xml
===================================================================
--- trunk/integration/xfire/src/main/resources/jbossws-xfire-config.xml	2007-07-30 07:23:40 UTC (rev 4024)
+++ trunk/integration/xfire/src/main/resources/jbossws-xfire-config.xml	2007-07-30 12:49:32 UTC (rev 4025)
@@ -1,6 +1,8 @@
   
   <!-- An abstraction of server configuration aspects. -->  
-  <bean name="WSServerConfig" class="org.jboss.wsf.framework.management.DefaultServerConfig">
+  <bean name="WSServerConfig" class="org.jboss.wsf.stack.xfire.CXFServerConfig">
+    <property name="mbeanServer"><inject bean="WSMBeanServerLocator" property="mbeanServer"/></property>
+    
     <!--
         The WSDL, that is a required deployment artifact for an endpoint, has a <soap:address>
         element which points to the location of the endpoint. JBoss supports rewriting of that SOAP address.
@@ -23,7 +25,9 @@
   </bean>
 
   <!-- The registry for web service endpoints -->
-  <bean name="WSEndpointRegistry" class="org.jboss.wsf.stack.xfire.ManagedEndpointRegistry"/>
+  <bean name="WSEndpointRegistry" class="org.jboss.wsf.framework.management.ManagedEndpointRegistry">
+    <property name="mbeanServer"><inject bean="WSMBeanServerLocator" property="mbeanServer"/></property>
+  </bean>
   
   <!-- 
     The stack specific deployment aspects

Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/spi/EndpointImpl.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/spi/EndpointImpl.java	2007-07-30 07:23:40 UTC (rev 4024)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/spi/EndpointImpl.java	2007-07-30 12:49:32 UTC (rev 4025)
@@ -123,7 +123,7 @@
 
       // Create and start the HTTP server
       SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
-      HttpServer httpServer = spiProvider.getSPI(HttpServerFactory.class).newHttpServer();
+      HttpServer httpServer = spiProvider.getSPI(HttpServerFactory.class).getHttpServer();
       httpServer.setProperties(properties);
       httpServer.start();
 

Modified: trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/endpoint/EndpointServlet.java
===================================================================
--- trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/endpoint/EndpointServlet.java	2007-07-30 07:23:40 UTC (rev 4024)
+++ trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/endpoint/EndpointServlet.java	2007-07-30 12:49:32 UTC (rev 4025)
@@ -62,7 +62,7 @@
 
       // Create and start the HTTP server
       SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
-      HttpServer httpServer = spiProvider.getSPI(HttpServerFactory.class).newHttpServer();
+      HttpServer httpServer = spiProvider.getSPI(HttpServerFactory.class).getHttpServer();
       httpServer.start();
       
       // Create the context and publish the endpoint

Modified: trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/endpoint/EndpointTestCase.java
===================================================================
--- trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/endpoint/EndpointTestCase.java	2007-07-30 07:23:40 UTC (rev 4024)
+++ trunk/jbossws-core/src/test/java/org/jboss/test/ws/jaxws/endpoint/EndpointTestCase.java	2007-07-30 12:49:32 UTC (rev 4025)
@@ -79,8 +79,8 @@
    {
       if (isTargetJBoss50())
       {
-         System.out.println("FIXME: [JBWEB-68] Servlet.init(ServletConfig) not called");
-         //return;
+         System.out.println("FIXME: [JBWEB-1770] Fix Endpoint API for jboss-5.0.0.Beta3");
+         return;
       }
       
       URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jaxws-endpoint?wsdl");
@@ -93,8 +93,8 @@
    {
       if (isTargetJBoss50())
       {
-         System.out.println("FIXME: [JBWEB-68] Servlet.init(ServletConfig) not called");
-         //return;
+         System.out.println("FIXME: [JBWEB-1770] Fix Endpoint API for jboss-5.0.0.Beta3");
+         return;
       }
       
       // Create the port
@@ -112,8 +112,8 @@
    {
       if (isTargetJBoss50())
       {
-         System.out.println("FIXME: [JBWEB-68] Servlet.init(ServletConfig) not called");
-         //return;
+         System.out.println("FIXME: [JBWEB-1770] Fix Endpoint API for jboss-5.0.0.Beta3");
+         return;
       }
 
       URL url = new URL("http://" + getServerHost() + ":8080/jaxws-endpoint-servlet?param=hello-world");




More information about the jbossws-commits mailing list