Author: richard.opalka(a)jboss.com
Date: 2009-07-28 04:47:35 -0400 (Tue, 28 Jul 2009)
New Revision: 10396
Removed:
framework/branches/ropalka/src/main/java/org/jboss/wsf/framework/deployment/BackwardCompatibleURLPatternDeploymentAspect.java
Modified:
framework/branches/ropalka/src/main/java/org/jboss/wsf/framework/deployment/URLPatternDeploymentAspect.java
Log:
[JBWS-2699] fixing issue
Deleted:
framework/branches/ropalka/src/main/java/org/jboss/wsf/framework/deployment/BackwardCompatibleURLPatternDeploymentAspect.java
===================================================================
---
framework/branches/ropalka/src/main/java/org/jboss/wsf/framework/deployment/BackwardCompatibleURLPatternDeploymentAspect.java 2009-07-27
12:49:11 UTC (rev 10395)
+++
framework/branches/ropalka/src/main/java/org/jboss/wsf/framework/deployment/BackwardCompatibleURLPatternDeploymentAspect.java 2009-07-28
08:47:35 UTC (rev 10396)
@@ -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/branches/ropalka/src/main/java/org/jboss/wsf/framework/deployment/URLPatternDeploymentAspect.java
===================================================================
---
framework/branches/ropalka/src/main/java/org/jboss/wsf/framework/deployment/URLPatternDeploymentAspect.java 2009-07-27
12:49:11 UTC (rev 10395)
+++
framework/branches/ropalka/src/main/java/org/jboss/wsf/framework/deployment/URLPatternDeploymentAspect.java 2009-07-28
08:47:35 UTC (rev 10396)
@@ -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;
@@ -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