Author: thomas.diesler(a)jboss.com
Date: 2007-08-09 03:14:48 -0400 (Thu, 09 Aug 2007)
New Revision: 4270
Added:
container/jboss50/trunk/src/main/java/org/jboss/wsf/container/jboss50/DeploymentAspectHttpServer.java
Modified:
container/jboss40/trunk/src/main/java/org/jboss/wsf/container/jboss40/DeploymentAspectHttpServer.java
container/jboss40/trunk/src/main/resources/jbossws-jboss40-config.xml
container/jboss42/trunk/src/main/java/org/jboss/wsf/container/jboss42/DeploymentAspectHttpServer.java
container/jboss42/trunk/src/main/resources/jbossws-jboss42-config.xml
container/jboss50/trunk/src/main/resources/jbossws-jboss50.deployer/META-INF/jbossws-deployer-beans.xml
Log:
Fix RuntimeClassLoader with EndpointAPI
Modified:
container/jboss40/trunk/src/main/java/org/jboss/wsf/container/jboss40/DeploymentAspectHttpServer.java
===================================================================
---
container/jboss40/trunk/src/main/java/org/jboss/wsf/container/jboss40/DeploymentAspectHttpServer.java 2007-08-08
19:06:34 UTC (rev 4269)
+++
container/jboss40/trunk/src/main/java/org/jboss/wsf/container/jboss40/DeploymentAspectHttpServer.java 2007-08-09
07:14:48 UTC (rev 4270)
@@ -73,6 +73,7 @@
// Create/Setup the deployment
Deployment dep = depModelFactory.newDeployment("endpoint-deployment",
implClass.getClassLoader());
+ dep.setRuntimeClassLoader(dep.getInitialClassLoader());
// Create/Setup the service
Service service = dep.getService();
Modified: container/jboss40/trunk/src/main/resources/jbossws-jboss40-config.xml
===================================================================
--- container/jboss40/trunk/src/main/resources/jbossws-jboss40-config.xml 2007-08-08
19:06:34 UTC (rev 4269)
+++ container/jboss40/trunk/src/main/resources/jbossws-jboss40-config.xml 2007-08-09
07:14:48 UTC (rev 4270)
@@ -8,9 +8,7 @@
<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.jboss40.WebAppDeployingHttpServer">
- <property name="mbeanServer"><inject
bean="WSMBeanServerLocator"
property="mbeanServer"/></property>
- </bean>
+ <bean name="WSHTTPServer"
class="org.jboss.wsf.container.jboss40.DeploymentAspectHttpServer"/>
<!--
*********************************************************************************************************************
@@ -138,7 +136,7 @@
</bean>
<bean name="WSEndpointAPIDeploymentAspect"
class="org.jboss.wsf.framework.deployment.EndpointAPIDeploymentAspect">
- <property name="provides">ContainerMetaData, URLPattern,
VFSRoot</property>
+ <property name="provides">ContainerMetaData, RuntimeLoader,
URLPattern, VFSRoot</property>
</bean>
<bean name="WSEndpointHandlerDeploymentAspect"
class="org.jboss.wsf.framework.deployment.EndpointHandlerDeploymentAspect">
@@ -262,6 +260,7 @@
</set>
</property>
</bean>
+
<bean name="WSDeploymentAspectInstallerEndpointAPI"
class="org.jboss.wsf.framework.deployment.DeploymentAspectInstaller">
<property name="manager"><inject
bean="WSDeploymentAspectManagerEndpointAPI"/></property>
<property name="sortAspectsOnCreate">false</property>
@@ -274,7 +273,6 @@
<inject bean="WSEndpointMetricsDeploymentAspect"/>
<inject bean="WSEndpointNameDeploymentAspect"/>
<inject bean="WSEndpointRegistryDeploymentAspect"/>
- <inject bean="WSRuntimeLoaderDeploymentAspect"/>
<inject bean="WSWebAppDeploymentAspect"/>
<inject bean="WSWebAppGeneratorDeploymentAspect"/>
</set>
Modified:
container/jboss42/trunk/src/main/java/org/jboss/wsf/container/jboss42/DeploymentAspectHttpServer.java
===================================================================
---
container/jboss42/trunk/src/main/java/org/jboss/wsf/container/jboss42/DeploymentAspectHttpServer.java 2007-08-08
19:06:34 UTC (rev 4269)
+++
container/jboss42/trunk/src/main/java/org/jboss/wsf/container/jboss42/DeploymentAspectHttpServer.java 2007-08-09
07:14:48 UTC (rev 4270)
@@ -73,6 +73,7 @@
// Create/Setup the deployment
Deployment dep = depModelFactory.newDeployment("endpoint-deployment",
implClass.getClassLoader());
+ dep.setRuntimeClassLoader(dep.getInitialClassLoader());
// Create/Setup the service
Service service = dep.getService();
Modified: container/jboss42/trunk/src/main/resources/jbossws-jboss42-config.xml
===================================================================
--- container/jboss42/trunk/src/main/resources/jbossws-jboss42-config.xml 2007-08-08
19:06:34 UTC (rev 4269)
+++ container/jboss42/trunk/src/main/resources/jbossws-jboss42-config.xml 2007-08-09
07:14:48 UTC (rev 4270)
@@ -8,11 +8,7 @@
<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-->
- <bean name="WSHTTPServer"
class="org.jboss.wsf.container.jboss42.DeploymentAspectHttpServer">
- </bean>
+ <bean name="WSHTTPServer"
class="org.jboss.wsf.container.jboss42.DeploymentAspectHttpServer"/>
<!-- Bind Service objects in client environment context -->
<bean name="WSServiceRefHandler"
class="org.jboss.wsf.container.jboss42.serviceref.ServiceRefHandlerImpl"/>
@@ -272,6 +268,7 @@
</set>
</property>
</bean>
+
<bean name="WSDeploymentAspectInstallerEndpointAPI"
class="org.jboss.wsf.framework.deployment.DeploymentAspectInstaller">
<property name="manager"><inject
bean="WSDeploymentAspectManagerEndpointAPI"/></property>
<property name="sortAspectsOnCreate">false</property>
@@ -284,7 +281,6 @@
<inject bean="WSEndpointMetricsDeploymentAspect"/>
<inject bean="WSEndpointNameDeploymentAspect"/>
<inject bean="WSEndpointRegistryDeploymentAspect"/>
- <inject bean="WSRuntimeLoaderDeploymentAspect"/>
<inject bean="WSWebAppDeploymentAspect"/>
<inject bean="WSWebAppGeneratorDeploymentAspect"/>
</set>
Added:
container/jboss50/trunk/src/main/java/org/jboss/wsf/container/jboss50/DeploymentAspectHttpServer.java
===================================================================
---
container/jboss50/trunk/src/main/java/org/jboss/wsf/container/jboss50/DeploymentAspectHttpServer.java
(rev 0)
+++
container/jboss50/trunk/src/main/java/org/jboss/wsf/container/jboss50/DeploymentAspectHttpServer.java 2007-08-09
07:14:48 UTC (rev 4270)
@@ -0,0 +1,123 @@
+/*
+ * 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(a)jboss.com $
+
+import javax.xml.ws.Endpoint;
+import javax.xml.ws.WebServiceException;
+
+import org.jboss.wsf.spi.SPIProvider;
+import org.jboss.wsf.spi.SPIProviderResolver;
+import org.jboss.wsf.spi.deployment.AbstractExtensible;
+import org.jboss.wsf.spi.deployment.Deployment;
+import org.jboss.wsf.spi.deployment.DeploymentAspectManager;
+import org.jboss.wsf.spi.deployment.DeploymentAspectManagerFactory;
+import org.jboss.wsf.spi.deployment.DeploymentModelFactory;
+import org.jboss.wsf.spi.deployment.Service;
+import org.jboss.wsf.spi.http.HttpContext;
+import org.jboss.wsf.spi.http.HttpContextFactory;
+import org.jboss.wsf.spi.http.HttpServer;
+
+/**
+ * A HTTP Server that uses DeploymentAspects
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 07-Jul-2006
+ */
+public class DeploymentAspectHttpServer extends AbstractExtensible implements HttpServer
+{
+ /** 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);
+
+ try
+ {
+ // Get the deployment model factory
+ SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
+ DeploymentModelFactory depModelFactory =
spiProvider.getSPI(DeploymentModelFactory.class);
+
+ // Create/Setup the deployment
+ Deployment dep = depModelFactory.newDeployment("endpoint-deployment",
implClass.getClassLoader());
+ dep.setRuntimeClassLoader(dep.getInitialClassLoader());
+
+ // Create/Setup the service
+ Service service = dep.getService();
+ service.setContextRoot(context.getContextRoot());
+
+ // Create/Setup the endpoint
+ org.jboss.wsf.spi.deployment.Endpoint ep =
depModelFactory.newEndpoint(implClass.getName());
+ service.addEndpoint(ep);
+
+ // Deploy using deployment aspects
+ DeploymentAspectManagerFactory depManagerFactory =
spiProvider.getSPI(DeploymentAspectManagerFactory.class);
+ DeploymentAspectManager depManager =
depManagerFactory.getDeploymentAspectManager("WSDeploymentAspectManagerEndpointAPI");
+ depManager.deploy(dep);
+ }
+ 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)
+ {
+ try
+ {
+ }
+ 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;
+ }
+}
\ No newline at end of file
Modified:
container/jboss50/trunk/src/main/resources/jbossws-jboss50.deployer/META-INF/jbossws-deployer-beans.xml
===================================================================
---
container/jboss50/trunk/src/main/resources/jbossws-jboss50.deployer/META-INF/jbossws-deployer-beans.xml 2007-08-08
19:06:34 UTC (rev 4269)
+++
container/jboss50/trunk/src/main/resources/jbossws-jboss50.deployer/META-INF/jbossws-deployer-beans.xml 2007-08-09
07:14:48 UTC (rev 4270)
@@ -13,9 +13,7 @@
</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>
+ <bean name="WSHTTPServer"
class="org.jboss.wsf.container.jboss50.DeploymentAspectHttpServer"/>
<!--
*********************************************************************************************************************
@@ -216,7 +214,7 @@
</bean>
<bean name="WSEndpointAPIDeploymentAspect"
class="org.jboss.wsf.framework.deployment.EndpointAPIDeploymentAspect">
- <property name="provides">ContainerMetaData, URLPattern,
VFSRoot</property>
+ <property name="provides">ContainerMetaData, RuntimeLoader,
URLPattern, VFSRoot</property>
</bean>
<bean name="WSEndpointHandlerDeploymentAspect"
class="org.jboss.wsf.framework.deployment.EndpointHandlerDeploymentAspect">
@@ -330,6 +328,7 @@
</set>
</property>
</bean>
+
<bean name="WSDeploymentAspectInstallerEndpointAPI"
class="org.jboss.wsf.framework.deployment.DeploymentAspectInstaller">
<property name="manager"><inject
bean="WSDeploymentAspectManagerEndpointAPI"/></property>
<property name="sortAspectsOnCreate">false</property>
@@ -342,7 +341,6 @@
<inject bean="WSEndpointMetricsDeploymentAspect"/>
<inject bean="WSEndpointNameDeploymentAspect"/>
<inject bean="WSEndpointRegistryDeploymentAspect"/>
- <inject bean="WSRuntimeLoaderDeploymentAspect"/>
<inject bean="WSWebAppDeploymentAspect"/>
<inject bean="WSWebAppGeneratorDeploymentAspect"/>
</set>