Author: richard.opalka(a)jboss.com
Date: 2009-07-29 08:30:31 -0400 (Wed, 29 Jul 2009)
New Revision: 10417
Removed:
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/BackwardCompatibleURLPatternDeploymentAspect.java
Modified:
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/ContextPropertiesDeploymentAspect.java
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/ContextRootDeploymentAspect.java
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/DefaultLifecycleHandler.java
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/DeploymentAspectManagerImpl.java
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/EndpointAPIDeploymentAspect.java
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/EndpointAddressDeploymentAspect.java
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/EndpointHandlerDeploymentAspect.java
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/EndpointLifecycleDeploymentAspect.java
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/EndpointMetricsDeploymentAspect.java
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/EndpointNameDeploymentAspect.java
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/EndpointRecordProcessorDeploymentAspect.java
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/EndpointRegistryDeploymentAspect.java
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/URLPatternDeploymentAspect.java
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/VirtualHostDeploymentAspect.java
framework/trunk/testsuite/test/ant-import/build-testsuite.xml
framework/trunk/testsuite/test/resources/jaxws/jbws1762/WEB-INF/web.xml
Log:
[JBWS-2332] svn merge -r 10171:10396
https://svn.jboss.org/repos/jbossws/framework/branches/ropalka
Deleted:
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/BackwardCompatibleURLPatternDeploymentAspect.java
===================================================================
---
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/BackwardCompatibleURLPatternDeploymentAspect.java 2009-07-29
12:19:07 UTC (rev 10416)
+++
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/BackwardCompatibleURLPatternDeploymentAspect.java 2009-07-29
12:30:31 UTC (rev 10417)
@@ -1,64 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.jboss.wsf.framework.deployment;
-
-import org.jboss.wsf.framework.deployment.URLPatternDeploymentAspect;
-import org.jboss.wsf.spi.deployment.Deployment;
-import org.jboss.wsf.spi.deployment.Endpoint;
-
-import java.util.StringTokenizer;
-
-
-/**
- * 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(a)jboss.org
- * @since 19-May-2007
- */
-public class BackwardCompatibleURLPatternDeploymentAspect extends
URLPatternDeploymentAspect
-{
-
- @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;
-
- StringTokenizer st = new StringTokenizer(urlPattern, "/");
- if (st.countTokens() > 1 && urlPattern.startsWith(contextRoot +
"/"))
- {
- urlPattern = urlPattern.substring(contextRoot.length());
- }
- }
- return urlPattern;
- }
-}
Modified:
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/ContextPropertiesDeploymentAspect.java
===================================================================
---
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/ContextPropertiesDeploymentAspect.java 2009-07-29
12:19:07 UTC (rev 10416)
+++
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/ContextPropertiesDeploymentAspect.java 2009-07-29
12:30:31 UTC (rev 10417)
@@ -49,7 +49,7 @@
}
@Override
- public void create(Deployment dep)
+ public void start(Deployment dep)
{
if (contextProperties != null)
{
Modified:
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/ContextRootDeploymentAspect.java
===================================================================
---
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/ContextRootDeploymentAspect.java 2009-07-29
12:19:07 UTC (rev 10416)
+++
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/ContextRootDeploymentAspect.java 2009-07-29
12:30:31 UTC (rev 10417)
@@ -40,7 +40,7 @@
public class ContextRootDeploymentAspect extends DeploymentAspect
{
@Override
- public void create(Deployment dep)
+ public void start(Deployment dep)
{
String contextRoot = dep.getService().getContextRoot();
if (contextRoot == null)
Modified:
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/DefaultLifecycleHandler.java
===================================================================
---
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/DefaultLifecycleHandler.java 2009-07-29
12:19:07 UTC (rev 10416)
+++
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/DefaultLifecycleHandler.java 2009-07-29
12:30:31 UTC (rev 10417)
@@ -38,25 +38,12 @@
// provide logging
protected final Logger log = Logger.getLogger(getClass());
- public void create(Endpoint ep)
- {
- log.debug("Create: " + ep.getName());
-
- InvocationHandler invHandler = ep.getInvocationHandler();
- if (invHandler == null)
- throw new IllegalStateException("Invocation handler not available");
-
- invHandler.init(ep);
-
- ep.setState(EndpointState.CREATED);
- }
-
public void start(Endpoint ep)
{
log.debug("Start: " + ep.getName());
EndpointState state = ep.getState();
- if (state == EndpointState.UNDEFINED || state == EndpointState.DESTROYED)
+ if (state != EndpointState.UNDEFINED)
{
log.error("Cannot start endpoint in state: " + state);
}
@@ -65,6 +52,11 @@
if (ep.getEndpointMetrics() != null)
ep.getEndpointMetrics().start();
+ InvocationHandler invHandler = ep.getInvocationHandler();
+ if (invHandler == null)
+ throw new IllegalStateException("Invocation handler not
available");
+ invHandler.init(ep);
+
ep.setState(EndpointState.STARTED);
}
}
@@ -87,10 +79,4 @@
}
}
- public void destroy(Endpoint ep)
- {
- log.debug("Destroy: " + ep.getName());
-
- ep.setState(EndpointState.DESTROYED);
- }
}
Modified:
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/DeploymentAspectManagerImpl.java
===================================================================
---
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/DeploymentAspectManagerImpl.java 2009-07-29
12:19:07 UTC (rev 10416)
+++
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/DeploymentAspectManagerImpl.java 2009-07-29
12:30:31 UTC (rev 10417)
@@ -111,14 +111,9 @@
throw new IllegalStateException("Required conditions '" +
aspect.getRequires() + "' not satisfied by '" + providedConditions +
"' for: " + aspect);
*/
- logInvocation(aspect, "Create");
- aspect.create(dep);
-
providedConditions.addAll(aspect.getProvidesAsSet());
}
- dep.setState(DeploymentState.CREATED);
-
// start the deployment
for (int i = 0; i < getDeploymentAspects().size(); i++)
{
@@ -133,7 +128,7 @@
while (i-- >= 0)
{
// destroy the deployment
- failsafeDestroy(aspect, dep);
+ failsafeStop(aspect, dep);
}
throw rte;
}
@@ -144,7 +139,6 @@
public void undeploy(Deployment dep)
{
- // stop the deployment
for (int i = getDeploymentAspects().size(); 0 < i; i--)
{
DeploymentAspect aspect = getDeploymentAspects().get(i - 1);
@@ -152,15 +146,6 @@
}
dep.setState(DeploymentState.STOPPED);
-
- // destroy the deployment
- for (int i = getDeploymentAspects().size(); 0 < i; i--)
- {
- DeploymentAspect aspect = getDeploymentAspects().get(i - 1);
- failsafeDestroy(aspect, dep);
- }
-
- dep.setState(DeploymentState.DESTROYED);
}
private void failsafeStop(DeploymentAspect aspect, Deployment dep)
@@ -176,23 +161,11 @@
}
}
- private void failsafeDestroy(DeploymentAspect aspect, Deployment dep)
- {
- try
- {
- logInvocation(aspect, "Destroy");
- aspect.destroy(dep);
- }
- catch (RuntimeException rte)
- {
- WSFDeploymentException.rethrow(rte);
- }
- }
-
private void logInvocation(DeploymentAspect aspect, String method)
{
String name = aspect.getClass().getName();
name = name.substring(name.lastIndexOf(".") + 1);
- log.debug(name + ":" + method);
+ log.debug("[" + this.name + "]" + name + ":" +
method);
}
+
}
Modified:
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/EndpointAPIDeploymentAspect.java
===================================================================
---
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/EndpointAPIDeploymentAspect.java 2009-07-29
12:19:07 UTC (rev 10416)
+++
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/EndpointAPIDeploymentAspect.java 2009-07-29
12:30:31 UTC (rev 10417)
@@ -35,10 +35,11 @@
* @author Thomas.Diesler(a)jboss.org
* @since 31-Jul-2007
*/
+// TODO: [JBWS-2674] review this deployment aspect once AS IL is rewritten
public class EndpointAPIDeploymentAspect extends DeploymentAspect
{
@Override
- public void create(Deployment dep)
+ public void start(Deployment dep)
{
dep.setType(DeploymentType.JAXWS_JSE);
Modified:
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/EndpointAddressDeploymentAspect.java
===================================================================
---
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/EndpointAddressDeploymentAspect.java 2009-07-29
12:19:07 UTC (rev 10416)
+++
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/EndpointAddressDeploymentAspect.java 2009-07-29
12:30:31 UTC (rev 10417)
@@ -38,7 +38,7 @@
public class EndpointAddressDeploymentAspect extends DeploymentAspect
{
@Override
- public void create(Deployment dep)
+ public void start(Deployment dep)
{
String contextRoot = dep.getService().getContextRoot();
if (contextRoot == null)
Modified:
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/EndpointHandlerDeploymentAspect.java
===================================================================
---
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/EndpointHandlerDeploymentAspect.java 2009-07-29
12:19:07 UTC (rev 10416)
+++
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/EndpointHandlerDeploymentAspect.java 2009-07-29
12:30:31 UTC (rev 10417)
@@ -54,7 +54,7 @@
}
@Override
- public void create(Deployment dep)
+ public void start(Deployment dep)
{
for (Endpoint ep : dep.getService().getEndpoints())
{
Modified:
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/EndpointLifecycleDeploymentAspect.java
===================================================================
---
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/EndpointLifecycleDeploymentAspect.java 2009-07-29
12:19:07 UTC (rev 10416)
+++
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/EndpointLifecycleDeploymentAspect.java 2009-07-29
12:30:31 UTC (rev 10417)
@@ -31,14 +31,6 @@
*/
public class EndpointLifecycleDeploymentAspect extends DeploymentAspect
{
- @Override
- public void create(Deployment dep)
- {
- for (Endpoint ep : dep.getService().getEndpoints())
- {
- getLifecycleHandler(ep, true).create(ep);
- }
- }
@Override
public void start(Deployment dep)
@@ -64,21 +56,6 @@
}
}
- @Override
- public void destroy(Deployment dep)
- {
- Service service = dep.getService();
- if (service != null)
- {
- for (Endpoint ep : service.getEndpoints())
- {
- LifecycleHandler lifecycleHandler = getLifecycleHandler(ep, false);
- if (lifecycleHandler != null)
- lifecycleHandler.destroy(ep);
- }
- }
- }
-
private LifecycleHandler getLifecycleHandler(Endpoint ep, boolean assertHandler)
{
LifecycleHandler lifecycleHandler = ep.getLifecycleHandler();
@@ -87,4 +64,5 @@
return lifecycleHandler;
}
+
}
Modified:
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/EndpointMetricsDeploymentAspect.java
===================================================================
---
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/EndpointMetricsDeploymentAspect.java 2009-07-29
12:19:07 UTC (rev 10416)
+++
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/EndpointMetricsDeploymentAspect.java 2009-07-29
12:30:31 UTC (rev 10417)
@@ -38,7 +38,7 @@
public class EndpointMetricsDeploymentAspect extends DeploymentAspect
{
@Override
- public void create(Deployment dep)
+ public void start(Deployment dep)
{
SPIProvider provider = SPIProviderResolver.getInstance().getProvider();
EndpointMetricsFactory factory = provider.getSPI(EndpointMetricsFactory.class);
Modified:
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/EndpointNameDeploymentAspect.java
===================================================================
---
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/EndpointNameDeploymentAspect.java 2009-07-29
12:19:07 UTC (rev 10416)
+++
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/EndpointNameDeploymentAspect.java 2009-07-29
12:30:31 UTC (rev 10417)
@@ -38,7 +38,7 @@
public class EndpointNameDeploymentAspect extends DeploymentAspect
{
@Override
- public void create(Deployment dep)
+ public void start(Deployment dep)
{
String contextRoot = dep.getService().getContextRoot();
if (contextRoot == null || contextRoot.startsWith("/") == false)
Modified:
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/EndpointRecordProcessorDeploymentAspect.java
===================================================================
---
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/EndpointRecordProcessorDeploymentAspect.java 2009-07-29
12:19:07 UTC (rev 10416)
+++
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/EndpointRecordProcessorDeploymentAspect.java 2009-07-29
12:30:31 UTC (rev 10417)
@@ -77,7 +77,7 @@
}
@Override
- public void destroy(Deployment dep)
+ public void stop(Deployment dep)
{
for (Endpoint ep : dep.getService().getEndpoints())
{
Modified:
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/EndpointRegistryDeploymentAspect.java
===================================================================
---
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/EndpointRegistryDeploymentAspect.java 2009-07-29
12:19:07 UTC (rev 10416)
+++
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/EndpointRegistryDeploymentAspect.java 2009-07-29
12:30:31 UTC (rev 10417)
@@ -38,7 +38,7 @@
{
private EndpointRegistry registry;
- public void create(Deployment dep)
+ public void start(Deployment dep)
{
SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
if (registry == null)
@@ -49,7 +49,7 @@
}
}
- public void destroy(Deployment dep)
+ public void stop(Deployment dep)
{
SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
if (registry == null)
@@ -59,4 +59,5 @@
registry.unregister(ep);
}
}
+
}
Modified:
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/URLPatternDeploymentAspect.java
===================================================================
---
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/URLPatternDeploymentAspect.java 2009-07-29
12:19:07 UTC (rev 10416)
+++
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/URLPatternDeploymentAspect.java 2009-07-29
12:30:31 UTC (rev 10417)
@@ -21,6 +21,8 @@
*/
package org.jboss.wsf.framework.deployment;
+import java.util.StringTokenizer;
+
import org.jboss.wsf.spi.annotation.WebContext;
import org.jboss.wsf.spi.deployment.Deployment;
import org.jboss.wsf.spi.deployment.DeploymentAspect;
@@ -38,7 +40,7 @@
public class URLPatternDeploymentAspect extends DeploymentAspect
{
@Override
- public void create(Deployment dep)
+ public void start(Deployment dep)
{
for (Endpoint ep : dep.getService().getEndpoints())
{
@@ -78,6 +80,19 @@
{
EJBMetaData bmd = appMetaData.getBeanByEjbName(ep.getShortName());
urlPattern = bmd.getPortComponentURI();
+ if (urlPattern != null)
+ {
+ String contextRoot = dep.getService().getContextRoot();
+
+ if (urlPattern.startsWith("/") == false)
+ urlPattern = "/" + urlPattern;
+
+ StringTokenizer st = new StringTokenizer(urlPattern, "/");
+ if (st.countTokens() > 1 && urlPattern.startsWith(contextRoot +
"/"))
+ {
+ urlPattern = urlPattern.substring(contextRoot.length());
+ }
+ }
}
// #3 For EJB use @WebContext.urlPattern
Modified:
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/VirtualHostDeploymentAspect.java
===================================================================
---
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/VirtualHostDeploymentAspect.java 2009-07-29
12:19:07 UTC (rev 10416)
+++
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/VirtualHostDeploymentAspect.java 2009-07-29
12:30:31 UTC (rev 10417)
@@ -28,6 +28,7 @@
import org.jboss.wsf.spi.deployment.Deployment;
import org.jboss.wsf.spi.deployment.DeploymentAspect;
import org.jboss.wsf.spi.deployment.Endpoint;
+import org.jboss.wsf.spi.deployment.Deployment.DeploymentType;
/**
* A deployer that assigns the virtual hosts to the service
@@ -39,14 +40,16 @@
{
@Override
- public void create(Deployment dep)
+ public void start(Deployment dep)
{
- String[] virtualHosts = dep.getService().getVirtualHosts();
- if (virtualHosts == null)
+ if ( DeploymentType.JAXWS_EJB3.equals(dep.getType()))
{
- dep.getService().setVirtualHosts(getExplicitVirtualHosts(dep));
+ String[] virtualHosts = dep.getService().getVirtualHosts();
+ if (virtualHosts == null)
+ {
+ dep.getService().setVirtualHosts(getExplicitVirtualHosts(dep));
+ }
}
-
}
protected String[] getExplicitVirtualHosts(Deployment dep)
Modified: framework/trunk/testsuite/test/ant-import/build-testsuite.xml
===================================================================
--- framework/trunk/testsuite/test/ant-import/build-testsuite.xml 2009-07-29 12:19:07 UTC
(rev 10416)
+++ framework/trunk/testsuite/test/ant-import/build-testsuite.xml 2009-07-29 12:30:31 UTC
(rev 10417)
@@ -489,7 +489,6 @@
<exclude name="jaxrpc/samples-override/**"/>
</fileset>
<filterset>
- <filter token="endpoint.servlet"
value="${endpoint.servlet}"/>
<filter token="java.home" value="${java.home}"/>
<filter token="jboss.bind.address"
value="${node0}"/>
<filter token="tests.output.dir"
value="${tests.output.dir}"/>
Modified: framework/trunk/testsuite/test/resources/jaxws/jbws1762/WEB-INF/web.xml
===================================================================
--- framework/trunk/testsuite/test/resources/jaxws/jbws1762/WEB-INF/web.xml 2009-07-29
12:19:07 UTC (rev 10416)
+++ framework/trunk/testsuite/test/resources/jaxws/jbws1762/WEB-INF/web.xml 2009-07-29
12:30:31 UTC (rev 10417)
@@ -4,11 +4,7 @@
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4">
<servlet>
<servlet-name>POJOBean</servlet-name>
- <servlet-class>@endpoint.servlet(a)</servlet-class>
- <init-param>
- <param-name>jboss.ws.endpoint</param-name>
-
<param-value>org.jboss.test.ws.jaxws.jbws1762.services.POJOBean</param-value>
- </init-param>
+
<servlet-class>org.jboss.test.ws.jaxws.jbws1762.services.POJOBean</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>POJOBean</servlet-name>