[jbossws-commits] JBossWS SVN: r3528 - in branches/jbossws-2.0: integration/native/src/main/resources/jbossws-native50.sar/META-INF and 1 other directories.
jbossws-commits at lists.jboss.org
jbossws-commits at lists.jboss.org
Mon Jun 11 04:29:33 EDT 2007
Author: thomas.diesler at jboss.com
Date: 2007-06-11 04:29:33 -0400 (Mon, 11 Jun 2007)
New Revision: 3528
Added:
branches/jbossws-2.0/jbossws-core/src/main/java/org/jboss/ws/core/server/BackwardCompatibleContextRootDeployer.java
branches/jbossws-2.0/jbossws-core/src/main/java/org/jboss/ws/core/server/BackwardCompatibleURLPatternDeployer.java
Removed:
branches/jbossws-2.0/integration/native/src/main/resources/jbossws-native50.sar/META-INF/jbossws-beans-cts.xml
branches/jbossws-2.0/jbossws-core/src/main/java/org/jboss/ws/core/server/LegacyContextRootDeployer.java
branches/jbossws-2.0/jbossws-core/src/main/java/org/jboss/ws/core/server/LegacyURLPatternDeployer.java
Modified:
branches/jbossws-2.0/integration/native/ant-import/build-deploy.xml
branches/jbossws-2.0/integration/native/src/main/resources/jbossws-native50.sar/META-INF/jbossws-beans.xml
Log:
Install backward compatible context-root,url-pattern deployers by default
Modified: branches/jbossws-2.0/integration/native/ant-import/build-deploy.xml
===================================================================
--- branches/jbossws-2.0/integration/native/ant-import/build-deploy.xml 2007-06-11 06:16:09 UTC (rev 3527)
+++ branches/jbossws-2.0/integration/native/ant-import/build-deploy.xml 2007-06-11 08:29:33 UTC (rev 3528)
@@ -22,20 +22,16 @@
<!-- Deploy jbossws to jboss50 -->
<target name="deploy-jboss50" depends="jars-jboss50,undeploy-jboss50,deploy-jboss50-endorsed" description="Deploy jbossws to jboss50">
-
<macro-deploy-native50
spilibs="${spi.dir}/output/lib"
jbosslibs="${int.jboss50.dir}/output/lib"
corelibs="${core.dir}/output/lib"
stacklibs="${int.native.dir}/output/lib"
thirdpartylibs="${core.dir}/thirdparty"/>
-
<macro-deploy-spi
spilibs="${spi.dir}/output/lib"
thirdpartylibs="${spi.dir}/thirdparty"
jbosshome="${jboss50.home}"/>
-
- <antcall target="deploy-jboss50-cts"/>
</target>
<target name="deploy-jboss50-endorsed" depends="prepare" if="HAVE_JDK_1.6">
@@ -45,11 +41,6 @@
thirdpartylibs="${core.dir}/thirdparty"/>
</target>
- <target name="deploy-jboss50-cts" if="jboss.server.instance.cts">
- <copy tofile="${jboss50.server.deploy}/jbossws.sar/META-INF/jbossws-beans.xml"
- file="${int.native.dir}/src/main/resources/jbossws-native50.sar/META-INF/jbossws-beans-cts.xml"/>
- </target>
-
<!-- Remove jbossws from jboss50 -->
<target name="undeploy-jboss50" depends="prepare,undeploy-jboss50-endorsed" description="Remove jbossws from jboss50">
<macro-undeploy-native50/>
@@ -62,14 +53,12 @@
<!-- Deploy jbossws to jboss42 -->
<target name="deploy-jboss42" depends="jars-jboss42,undeploy-jboss42,deploy-jboss42-endorsed" description="Deploy jbossws to jboss42">
-
<macro-deploy-native42
spilibs="${spi.dir}/output/lib"
jbosslibs="${int.jboss42.dir}/output/lib"
corelibs="${core.dir}/output/lib"
stacklibs="${int.native.dir}/output/lib"
thirdpartylibs="${core.dir}/thirdparty"/>
-
<macro-deploy-spi
spilibs="${spi.dir}/output/lib"
thirdpartylibs="${spi.dir}/thirdparty"
@@ -96,14 +85,12 @@
<target name="deploy-jboss40" depends="jars-jboss40,undeploy-jboss40,deploy-jboss40-no-ejb3" description="Deploy jbossws to jboss40"/>
<target name="deploy-jboss40-ejb3">
-
<macro-deploy-native40
spilibs="${spi.dir}/output/lib"
jbosslibs="${int.jboss40.dir}/output/lib"
corelibs="${core.dir}/output/lib"
stacklibs="${int.native.dir}/output/lib"
thirdpartylibs="${core.dir}/thirdparty"/>
-
<macro-deploy-spi
spilibs="${spi.dir}/output/lib"
thirdpartylibs="${spi.dir}/thirdparty"
Deleted: branches/jbossws-2.0/integration/native/src/main/resources/jbossws-native50.sar/META-INF/jbossws-beans-cts.xml
===================================================================
--- branches/jbossws-2.0/integration/native/src/main/resources/jbossws-native50.sar/META-INF/jbossws-beans-cts.xml 2007-06-11 06:16:09 UTC (rev 3527)
+++ branches/jbossws-2.0/integration/native/src/main/resources/jbossws-native50.sar/META-INF/jbossws-beans-cts.xml 2007-06-11 08:29:33 UTC (rev 3528)
@@ -1,266 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<deployment xmlns="urn:jboss:bean-deployer:2.0">
-
- <!-- An abstraction of server configuration aspects. -->
- <bean name="WSServerConfig" class="org.jboss.wsf.container.jboss50.ManagedServerConfig">
- <!--
- 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.
-
- If the content of <soap:address> is a valid URL, JBossWS will not rewrite it unless 'modifySOAPAddress' is true.
- If the content of <soap:address> is not a valid URL, JBossWS will rewrite it using the attribute values given below.
-
- If 'webServiceHost' is not set, JBossWS uses requesters protocol host and port when rewriting the <soap:address>.
- -->
- <property name="webServiceHost">${jboss.bind.address}</property>
- <property name="modifySOAPAddress">true</property>
-
- <!--
- Set these properties to explicitly define the ports that will be used for rewriting the SOAP address.
- Otherwise the ports will be identified by querying the list of installed connectors.
- If multiple connectors are found the port of the first connector is used.
- <property name="webServiceSecurePort">8443</property>
- <property name="webServicePort">8080</property>
- -->
- </bean>
-
- <!-- The registry for web service endpoints -->
- <bean name="WSEndpointRegistry" class="org.jboss.wsf.stack.jbws.ManagedEndpointRegistry"/>
-
- <!-- A subscription manager for WS-Eventing -->
- <bean name="WSSubscriptionManager" class="org.jboss.ws.extensions.eventing.mgmt.SubscriptionManager">
- <property name="bindAddress">${jboss.bind.address}</property>
- </bean>
-
- <!-- Bind Service objects in client environment context -->
- <bean name="WSServiceRefHandler" class="org.jboss.ws.core.client.ServiceRefHandlerImpl"/>
-
- <!-- 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>
-
- <!--
- *********************************************************************************************************************
- Web Service deployment
-
- There are three deployers registered with the JBoss Main Deployer.
- The order of which is important
-
- 1) EJBDeployer < WebServiceDeployerEJB
- 2) WebServiceDeployerJSE < WarDeployer
- 3) WebServiceMainDeployer
-
- Each WebServiceDeployer has a number of DeployerHooks registerd with it
-
- - WebServiceDeployerEJB
- - WSDeployerHook_JAXRPC_EJB21
- - WSDeployerHook_JAXWS_EJB3
-
- - WebServiceDeployerJSE
- - WSDeployerHook_JAXRPC_JSE
- - WSDeployerHook_JAXWS_JSE
-
- - WebServiceMainDeployer
- - WSMainDeployerHook
-
- Conceptually, each of these hooks implements the following pattern:
-
- DployerHook.deploy(unit)
- if(isWebServiceDeployment)
- Deployment dep = createDeployment(unit)
- DeployerManager.deploy(dep)
-
- DeployerHook.undeploy(unit)
- Deployment dep = getDeployment(unit)
- DeployerManager.undeploy(dep)
-
- Each deployer hook has a web service DeployerManager injected into it.
- A web service DeployerManager maintains a list of Deployers, each of which
- handles a single aspect of web service deployment.
-
- Finally, each Endpoint is registered with the EndpointRegistry.
-
- *********************************************************************************************************************
- -->
-
- <!--
- Each DeploymentManger maintains a list of Deployers
- Each Deployer handles a single aspect of web service deployment.
- -->
- <bean name="WSDeployerManagerJSE" class="org.jboss.wsf.spi.deployment.BasicDeployerManager">
- <property name="deployers">
- <list class="java.util.LinkedList" elementClass="org.jboss.wsf.spi.deployment.Deployer">
- <inject bean="WSUnifiedDeploymentInfoDeployer"/>
- <inject bean="WSContextRootDeployer"/>
- <inject bean="WSURLPatternDeployer"/>
- <inject bean="WSUnifiedMetaDataDeployer"/>
- <inject bean="WSUnifiedMetaDataAssociationDeployer"/>
- <inject bean="WSModifyWebMetaDataDeployer"/>
- </list>
- </property>
- </bean>
- <bean name="WSDeployerManagerEJB" class="org.jboss.wsf.spi.deployment.BasicDeployerManager">
- <property name="deployers">
- <list class="java.util.LinkedList" elementClass="org.jboss.wsf.spi.deployment.Deployer">
- <inject bean="WSUnifiedDeploymentInfoDeployer"/>
- <inject bean="WSContextRootDeployer"/>
- <inject bean="WSURLPatternDeployer"/>
- <inject bean="WSUnifiedMetaDataDeployer"/>
- <inject bean="WSUnifiedMetaDataAssociationDeployer"/>
- <inject bean="WSWebAppGeneratorDeployer"/>
- <inject bean="WSWebAppDeployerDeployer"/>
- </list>
- </property>
- </bean>
- <bean name="WSMainDeployerManager" class="org.jboss.wsf.spi.deployment.BasicDeployerManager">
- <property name="deployers">
- <list class="java.util.LinkedList" elementClass="org.jboss.wsf.spi.deployment.Deployer">
- <inject bean="WSEndpointNameDeployer"/>
- <inject bean="WSEndpointHandlerDeployer"/>
- <inject bean="WSPublishContractDeployer"/>
- <inject bean="WSClassLoaderInjectionDeployer"/>
- <inject bean="WSServiceEndpointInvokerDeployer"/>
- <inject bean="WSEagerInitializeDeployer"/>
- <inject bean="WSEventingDeployer"/>
- <inject bean="WSEndpointRegistryDeployer"/>
- <inject bean="WSEndpointLifecycleDeployer"/>
- </list>
- </property>
- </bean>
-
- <!--
- The Deployers
- Each handles a single aspect of web service deployment
- -->
- <bean name="WSClassLoaderInjectionDeployer" class="org.jboss.wsf.container.jboss50.ClassLoaderInjectionDeployer"/>
- <bean name="WSContextRootDeployer" class="org.jboss.ws.core.server.LegacyContextRootDeployer"/>
- <bean name="WSEagerInitializeDeployer" class="org.jboss.wsf.stack.jbws.EagerInitializeDeployer"/>
- <bean name="WSEndpointHandlerDeployer" class="org.jboss.wsf.spi.deployment.EndpointHandlerDeployer">
- <property name="requestHandler">org.jboss.wsf.stack.jbws.RequestHandlerImpl</property>
- <property name="lifecycleHandler">org.jboss.wsf.stack.jbws.LifecycleHandlerImpl</property>
- <property name="invocationHandler">
- <map keyClass="java.lang.String" valueClass="java.lang.String">
- <entry><key>JAXRPC_JSE</key><value>org.jboss.wsf.stack.jbws.ServiceLifecycleInvocationHandler</value></entry>
- <entry><key>JAXRPC_EJB21</key><value>org.jboss.wsf.container.jboss50.InvocationHandlerEJB21</value></entry>
- <entry><key>JAXWS_JSE</key><value>org.jboss.wsf.spi.invocation.InvocationHandlerJSE</value></entry>
- <entry><key>JAXWS_EJB3</key><value>org.jboss.wsf.container.jboss50.InvocationHandlerEJB3</value></entry>
- </map>
- </property>
- </bean>
- <bean name="WSEndpointLifecycleDeployer" class="org.jboss.wsf.spi.deployment.EndpointLifecycleDeployer"/>
- <bean name="WSEndpointNameDeployer" class="org.jboss.wsf.stack.jbws.EndpointNameDeployer"/>
- <bean name="WSEndpointRegistryDeployer" class="org.jboss.wsf.spi.deployment.EndpointRegistryDeployer"/>
- <bean name="WSEventingDeployer" class="org.jboss.wsf.stack.jbws.EventingDeployer"/>
- <bean name="WSModifyWebMetaDataDeployer" class="org.jboss.wsf.container.jboss50.ModifyWebMetaDataDeployer">
- <property name="servletClass"><inject bean="WSWebAppDesciptorModifier" property="servletClass"/></property>
- </bean>
- <bean name="WSPublishContractDeployer" class="org.jboss.wsf.stack.jbws.PublishContractDeployer"/>
- <bean name="WSServiceEndpointInvokerDeployer" class="org.jboss.wsf.stack.jbws.ServiceEndpointInvokerDeployer"/>
- <bean name="WSUnifiedDeploymentInfoDeployer" class="org.jboss.wsf.container.jboss50.UnifiedDeploymentInfoDeployer"/>
- <bean name="WSUnifiedMetaDataAssociationDeployer" class="org.jboss.wsf.stack.jbws.UnifiedMetaDataAssociationDeployer"/>
- <bean name="WSUnifiedMetaDataDeployer" class="org.jboss.wsf.stack.jbws.UnifiedMetaDataDeployer"/>
- <bean name="WSURLPatternDeployer" class="org.jboss.ws.core.server.LegacyURLPatternDeployer"/>
- <bean name="WSWebAppGeneratorDeployer" class="org.jboss.wsf.spi.deployment.WebAppGeneratorDeployer">
- <property name="securityHandlerEJB21"><inject bean="WSSecurityHandlerEJB21"/></property>
- <property name="securityHandlerEJB3"><inject bean="WSSecurityHandlerEJB3"/></property>
- </bean>
- <bean name="WSWebAppDeployerDeployer" class="org.jboss.wsf.container.jboss50.WebAppDeployerDeployer">
- <property name="webXMLRewriter"><inject bean="WSWebXMLRewriter"/></property>
- <property name="mainDeployer"><inject bean="MainDeployer"/></property>
- </bean>
-
- <!-- Deployer helper beans -->
- <bean name="WSSecurityHandlerEJB21" class="org.jboss.wsf.container.jboss50.SecurityHandlerEJB21"/>
- <bean name="WSSecurityHandlerEJB3" class="org.jboss.wsf.container.jboss50.SecurityHandlerEJB3"/>
- <bean name="WSWebAppDesciptorModifier" class="org.jboss.wsf.stack.jbws.WebAppDesciptorModifierImpl">
- <property name="servletClass">org.jboss.wsf.stack.jbws.ServiceEndpointServlet</property>
- </bean>
- <bean name="WSWebXMLRewriter" class="org.jboss.wsf.spi.deployment.WebXMLRewriter">
- <property name="desciptorModifier"><inject bean="WSWebAppDesciptorModifier"/></property>
- </bean>
-
- <!--
- Register DeployerHooks with JBoss deployers
- -->
- <bean name="WSDeployerHook_JAXRPC_JSE" class="org.jboss.wsf.container.jboss50.JAXRPCDeployerHookJSE">
- <property name="deploymentClass">org.jboss.wsf.stack.jbws.UnifiedMetaDataDeployment</property>
- <property name="endpointClass">org.jboss.wsf.spi.deployment.BasicEndpoint</property>
- <property name="deployerManager"><inject bean="WSDeployerManagerJSE"/></property>
- <install bean="WebServiceDeployerJSE" method="addDeployerHook">
- <parameter>
- <this/>
- </parameter>
- </install>
- <uninstall bean="WebServiceDeployerJSE" method="removeDeployerHook">
- <parameter>
- <this/>
- </parameter>
- </uninstall>
- <depends>WebServiceDeployerJSE</depends>
- </bean>
- <bean name="WSDeployerHook_JAXRPC_EJB21" class="org.jboss.wsf.container.jboss50.JAXRPCDeployerHookEJB21">
- <property name="deploymentClass">org.jboss.wsf.stack.jbws.UnifiedMetaDataDeployment</property>
- <property name="endpointClass">org.jboss.wsf.spi.deployment.BasicEndpoint</property>
- <property name="deployerManager"><inject bean="WSDeployerManagerEJB"/></property>
- <install bean="WebServiceDeployerEJB" method="addDeployerHook">
- <parameter>
- <this/>
- </parameter>
- </install>
- <uninstall bean="WebServiceDeployerEJB" method="removeDeployerHook">
- <parameter>
- <this/>
- </parameter>
- </uninstall>
- <depends>WebServiceDeployerEJB</depends>
- </bean>
- <bean name="WSDeployerHook_JAXWS_JSE" class="org.jboss.wsf.container.jboss50.JAXWSDeployerHookJSE">
- <property name="deploymentClass">org.jboss.wsf.stack.jbws.UnifiedMetaDataDeployment</property>
- <property name="endpointClass">org.jboss.wsf.spi.deployment.BasicEndpoint</property>
- <property name="deployerManager"><inject bean="WSDeployerManagerJSE"/></property>
- <install bean="WebServiceDeployerJSE" method="addDeployerHook">
- <parameter>
- <this/>
- </parameter>
- </install>
- <uninstall bean="WebServiceDeployerJSE" method="removeDeployerHook">
- <parameter>
- <this/>
- </parameter>
- </uninstall>
- <depends>WebServiceDeployerJSE</depends>
- </bean>
- <bean name="WSDeployerHook_JAXWS_EJB3" class="org.jboss.wsf.container.jboss50.JAXWSDeployerHookEJB3">
- <property name="deploymentClass">org.jboss.wsf.stack.jbws.UnifiedMetaDataDeployment</property>
- <property name="endpointClass">org.jboss.wsf.spi.deployment.BasicEndpoint</property>
- <property name="deployerManager"><inject bean="WSDeployerManagerEJB"/></property>
- <install bean="WebServiceDeployerEJB" method="addDeployerHook">
- <parameter>
- <this/>
- </parameter>
- </install>
- <uninstall bean="WebServiceDeployerEJB" method="removeDeployerHook">
- <parameter>
- <this/>
- </parameter>
- </uninstall>
- <depends>WebServiceDeployerEJB</depends>
- </bean>
- <bean name="WSMainDeployerHook" class="org.jboss.wsf.container.jboss50.MainDeployerHook">
- <property name="deployerManager"><inject bean="WSMainDeployerManager"/></property>
- <install bean="WebServiceMainDeployer" method="addDeployerHook">
- <parameter>
- <this/>
- </parameter>
- </install>
- <uninstall bean="WebServiceMainDeployer" method="removeDeployerHook">
- <parameter>
- <this/>
- </parameter>
- </uninstall>
- <depends>WebServiceMainDeployer</depends>
- </bean>
-
-</deployment>
Modified: branches/jbossws-2.0/integration/native/src/main/resources/jbossws-native50.sar/META-INF/jbossws-beans.xml
===================================================================
--- branches/jbossws-2.0/integration/native/src/main/resources/jbossws-native50.sar/META-INF/jbossws-beans.xml 2007-06-11 06:16:09 UTC (rev 3527)
+++ branches/jbossws-2.0/integration/native/src/main/resources/jbossws-native50.sar/META-INF/jbossws-beans.xml 2007-06-11 08:29:33 UTC (rev 3528)
@@ -135,7 +135,7 @@
Each handles a single aspect of web service deployment
-->
<bean name="WSClassLoaderInjectionDeployer" class="org.jboss.wsf.container.jboss50.ClassLoaderInjectionDeployer"/>
- <bean name="WSContextRootDeployer" class="org.jboss.wsf.spi.deployment.ContextRootDeployer"/>
+ <bean name="WSContextRootDeployer" class="org.jboss.ws.core.server.BackwardCompatibleContextRootDeployer"/>
<bean name="WSEagerInitializeDeployer" class="org.jboss.wsf.stack.jbws.EagerInitializeDeployer"/>
<bean name="WSEndpointHandlerDeployer" class="org.jboss.wsf.spi.deployment.EndpointHandlerDeployer">
<property name="requestHandler">org.jboss.wsf.stack.jbws.RequestHandlerImpl</property>
@@ -161,7 +161,7 @@
<bean name="WSUnifiedDeploymentInfoDeployer" class="org.jboss.wsf.container.jboss50.UnifiedDeploymentInfoDeployer"/>
<bean name="WSUnifiedMetaDataAssociationDeployer" class="org.jboss.wsf.stack.jbws.UnifiedMetaDataAssociationDeployer"/>
<bean name="WSUnifiedMetaDataDeployer" class="org.jboss.wsf.stack.jbws.UnifiedMetaDataDeployer"/>
- <bean name="WSURLPatternDeployer" class="org.jboss.wsf.spi.deployment.URLPatternDeployer"/>
+ <bean name="WSURLPatternDeployer" class="org.jboss.ws.core.server.BackwardCompatibleURLPatternDeployer"/>
<bean name="WSWebAppGeneratorDeployer" class="org.jboss.wsf.spi.deployment.WebAppGeneratorDeployer">
<property name="securityHandlerEJB21"><inject bean="WSSecurityHandlerEJB21"/></property>
<property name="securityHandlerEJB3"><inject bean="WSSecurityHandlerEJB3"/></property>
Copied: branches/jbossws-2.0/jbossws-core/src/main/java/org/jboss/ws/core/server/BackwardCompatibleContextRootDeployer.java (from rev 3526, branches/jbossws-2.0/jbossws-core/src/main/java/org/jboss/ws/core/server/LegacyContextRootDeployer.java)
===================================================================
--- branches/jbossws-2.0/jbossws-core/src/main/java/org/jboss/ws/core/server/BackwardCompatibleContextRootDeployer.java (rev 0)
+++ branches/jbossws-2.0/jbossws-core/src/main/java/org/jboss/ws/core/server/BackwardCompatibleContextRootDeployer.java 2007-06-11 08:29:33 UTC (rev 3528)
@@ -0,0 +1,86 @@
+/*
+ * 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.ws.core.server;
+
+//$Id$
+
+import org.jboss.wsf.spi.deployment.ContextRootDeployer;
+import org.jboss.wsf.spi.deployment.Deployment;
+import org.jboss.wsf.spi.deployment.Endpoint;
+import org.jboss.wsf.spi.metadata.j2ee.UnifiedApplicationMetaData;
+import org.jboss.wsf.spi.metadata.j2ee.UnifiedBeanMetaData;
+import org.jboss.wsf.spi.metadata.j2ee.UnifiedEjbPortComponentMetaData;
+
+/**
+ * A deployer that assigns the context root to the service.
+ *
+ * If there is no explicit <context-root>, this deployer uses
+ * the first token from the <port-component-uri> element.
+ *
+ * @author Thomas.Diesler at jboss.org
+ * @since 25-Apr-2007
+ */
+public class BackwardCompatibleContextRootDeployer extends ContextRootDeployer
+{
+ @Override
+ protected String getExplicitContextRoot(Deployment dep)
+ {
+ String contextRoot = super.getExplicitContextRoot(dep);
+ if (contextRoot == null)
+ {
+ for (Endpoint ep : dep.getService().getEndpoints())
+ {
+ String urlPattern = getUrlPattern(dep, ep);
+ if (urlPattern != null)
+ {
+ String[] tokens = urlPattern.split("/");
+ if (tokens.length > 1)
+ {
+ if (contextRoot != null && contextRoot.equals(tokens[0]) == false)
+ throw new IllegalStateException("All endpoints must share the same <context-root>: " + contextRoot + "!=" + tokens[0]);
+
+ contextRoot = tokens[0];
+ }
+ }
+ }
+ }
+ return contextRoot;
+ }
+
+ private String getUrlPattern(Deployment dep, Endpoint ep)
+ {
+ String urlPattern = null;
+
+ UnifiedApplicationMetaData appMetaData = dep.getContext().getAttachment(UnifiedApplicationMetaData.class);
+ if (appMetaData != null && appMetaData.getBeanByEjbName(ep.getShortName()) != null)
+ {
+ UnifiedBeanMetaData bmd = appMetaData.getBeanByEjbName(ep.getShortName());
+ UnifiedEjbPortComponentMetaData pcmd = bmd.getPortComponent();
+ if (pcmd != null)
+ {
+ urlPattern = pcmd.getPortComponentURI();
+ }
+ }
+
+ return urlPattern;
+ }
+}
\ No newline at end of file
Copied: branches/jbossws-2.0/jbossws-core/src/main/java/org/jboss/ws/core/server/BackwardCompatibleURLPatternDeployer.java (from rev 3526, branches/jbossws-2.0/jbossws-core/src/main/java/org/jboss/ws/core/server/LegacyURLPatternDeployer.java)
===================================================================
--- branches/jbossws-2.0/jbossws-core/src/main/java/org/jboss/ws/core/server/BackwardCompatibleURLPatternDeployer.java (rev 0)
+++ branches/jbossws-2.0/jbossws-core/src/main/java/org/jboss/ws/core/server/BackwardCompatibleURLPatternDeployer.java 2007-06-11 08:29:33 UTC (rev 3528)
@@ -0,0 +1,63 @@
+/*
+ * 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.ws.core.server;
+
+//$Id$
+
+import org.jboss.wsf.spi.deployment.Deployment;
+import org.jboss.wsf.spi.deployment.Endpoint;
+import org.jboss.wsf.spi.deployment.URLPatternDeployer;
+
+/**
+ * A deployer that assigns the URLPattern to endpoints.
+ *
+ * This deployer uses the first token from the <port-component-uri>
+ * as the context root.
+ *
+ * @author Thomas.Diesler at jboss.org
+ * @since 19-May-2007
+ */
+public class BackwardCompatibleURLPatternDeployer extends URLPatternDeployer
+{
+
+ @Override
+ protected String getExplicitPattern(Deployment dep, Endpoint ep)
+ {
+ String contextRoot = dep.getService().getContextRoot();
+ if (contextRoot == null)
+ throw new IllegalStateException("Cannot obtain context root");
+
+ String urlPattern = super.getExplicitPattern(dep, ep);
+ if (urlPattern != null)
+ {
+ if (urlPattern.startsWith("/") == false)
+ urlPattern = "/" + urlPattern;
+
+ String[] tokens = urlPattern.split("/");
+ if (tokens.length > 1 && urlPattern.startsWith(contextRoot))
+ {
+ urlPattern = urlPattern.substring(contextRoot.length());
+ }
+ }
+ return urlPattern;
+ }
+}
\ No newline at end of file
Deleted: branches/jbossws-2.0/jbossws-core/src/main/java/org/jboss/ws/core/server/LegacyContextRootDeployer.java
===================================================================
--- branches/jbossws-2.0/jbossws-core/src/main/java/org/jboss/ws/core/server/LegacyContextRootDeployer.java 2007-06-11 06:16:09 UTC (rev 3527)
+++ branches/jbossws-2.0/jbossws-core/src/main/java/org/jboss/ws/core/server/LegacyContextRootDeployer.java 2007-06-11 08:29:33 UTC (rev 3528)
@@ -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.ws.core.server;
-
-//$Id$
-
-import org.jboss.wsf.spi.deployment.ContextRootDeployer;
-import org.jboss.wsf.spi.deployment.Deployment;
-import org.jboss.wsf.spi.deployment.Endpoint;
-import org.jboss.wsf.spi.metadata.j2ee.UnifiedApplicationMetaData;
-import org.jboss.wsf.spi.metadata.j2ee.UnifiedBeanMetaData;
-import org.jboss.wsf.spi.metadata.j2ee.UnifiedEjbPortComponentMetaData;
-
-/**
- * A deployer that assigns the context root to the service.
- *
- * This deployer uses the first token from the <port-component-uri>
- * as the context root.
- *
- * @author Thomas.Diesler at jboss.org
- * @since 25-Apr-2007
- */
-public class LegacyContextRootDeployer extends ContextRootDeployer
-{
- @Override
- protected String getExplicitContextRoot(Deployment dep)
- {
- String contextRoot = super.getExplicitContextRoot(dep);
- if (contextRoot == null)
- {
- for (Endpoint ep : dep.getService().getEndpoints())
- {
- String urlPattern = getUrlPattern(dep, ep);
- if (urlPattern != null)
- {
- String[] tokens = urlPattern.split("/");
- if (tokens.length > 1)
- {
- if (contextRoot != null && contextRoot.equals(tokens[0]) == false)
- throw new IllegalStateException("All endpoints must share the same <context-root>: " + contextRoot + "!=" + tokens[0]);
-
- contextRoot = tokens[0];
- }
- }
- }
- }
- return contextRoot;
- }
-
- private String getUrlPattern(Deployment dep, Endpoint ep)
- {
- String urlPattern = null;
-
- UnifiedApplicationMetaData appMetaData = dep.getContext().getAttachment(UnifiedApplicationMetaData.class);
- if (appMetaData != null && appMetaData.getBeanByEjbName(ep.getShortName()) != null)
- {
- UnifiedBeanMetaData bmd = appMetaData.getBeanByEjbName(ep.getShortName());
- UnifiedEjbPortComponentMetaData pcmd = bmd.getPortComponent();
- if (pcmd != null)
- {
- urlPattern = pcmd.getPortComponentURI();
- }
- }
-
- return urlPattern;
- }
-}
\ No newline at end of file
Deleted: branches/jbossws-2.0/jbossws-core/src/main/java/org/jboss/ws/core/server/LegacyURLPatternDeployer.java
===================================================================
--- branches/jbossws-2.0/jbossws-core/src/main/java/org/jboss/ws/core/server/LegacyURLPatternDeployer.java 2007-06-11 06:16:09 UTC (rev 3527)
+++ branches/jbossws-2.0/jbossws-core/src/main/java/org/jboss/ws/core/server/LegacyURLPatternDeployer.java 2007-06-11 08:29:33 UTC (rev 3528)
@@ -1,63 +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.ws.core.server;
-
-//$Id$
-
-import org.jboss.wsf.spi.deployment.Deployment;
-import org.jboss.wsf.spi.deployment.Endpoint;
-import org.jboss.wsf.spi.deployment.URLPatternDeployer;
-
-/**
- * A deployer that assigns the URLPattern to endpoints.
- *
- * This deployer uses the first token from the <port-component-uri>
- * as the context root.
- *
- * @author Thomas.Diesler at jboss.org
- * @since 19-May-2007
- */
-public class LegacyURLPatternDeployer extends URLPatternDeployer
-{
-
- @Override
- protected String getExplicitPattern(Deployment dep, Endpoint ep)
- {
- String contextRoot = dep.getService().getContextRoot();
- if (contextRoot == null)
- throw new IllegalStateException("Cannot obtain context root");
-
- String urlPattern = super.getExplicitPattern(dep, ep);
- if (urlPattern != null)
- {
- if (urlPattern.startsWith("/") == false)
- urlPattern = "/" + urlPattern;
-
- String[] tokens = urlPattern.split("/");
- if (tokens.length > 1 && urlPattern.startsWith(contextRoot))
- {
- urlPattern = urlPattern.substring(contextRoot.length());
- }
- }
- return urlPattern;
- }
-}
\ No newline at end of file
More information about the jbossws-commits
mailing list