[jbossws-commits] JBossWS SVN: r14924 - in common/branches/JBWS-3343/src/main/java/org/jboss/ws/common: integration and 2 other directories.

jbossws-commits at lists.jboss.org jbossws-commits at lists.jboss.org
Fri Sep 2 01:42:04 EDT 2011


Author: jim.ma
Date: 2011-09-02 01:42:04 -0400 (Fri, 02 Sep 2011)
New Revision: 14924

Modified:
   common/branches/JBWS-3343/src/main/java/org/jboss/ws/common/deployment/ContextRootDeploymentAspect.java
   common/branches/JBWS-3343/src/main/java/org/jboss/ws/common/deployment/DefaultDeployment.java
   common/branches/JBWS-3343/src/main/java/org/jboss/ws/common/deployment/DefaultService.java
   common/branches/JBWS-3343/src/main/java/org/jboss/ws/common/deployment/EndpointAPIDeploymentAspect.java
   common/branches/JBWS-3343/src/main/java/org/jboss/ws/common/deployment/EndpointAddressDeploymentAspect.java
   common/branches/JBWS-3343/src/main/java/org/jboss/ws/common/deployment/EndpointHandlerDeploymentAspect.java
   common/branches/JBWS-3343/src/main/java/org/jboss/ws/common/deployment/EndpointNameDeploymentAspect.java
   common/branches/JBWS-3343/src/main/java/org/jboss/ws/common/deployment/JAXBIntroDeploymentAspect.java
   common/branches/JBWS-3343/src/main/java/org/jboss/ws/common/deployment/URLPatternDeploymentAspect.java
   common/branches/JBWS-3343/src/main/java/org/jboss/ws/common/deployment/VirtualHostDeploymentAspect.java
   common/branches/JBWS-3343/src/main/java/org/jboss/ws/common/integration/WSHelper.java
   common/branches/JBWS-3343/src/main/java/org/jboss/ws/common/servlet/AbstractEndpointServlet.java
   common/branches/JBWS-3343/src/main/java/org/jboss/ws/common/utils/AbstractWSDLFilePublisher.java
Log:
[JBWS-3349]:Remove checkers which relies on DeplymentType in stack agnostic DAs

Modified: common/branches/JBWS-3343/src/main/java/org/jboss/ws/common/deployment/ContextRootDeploymentAspect.java
===================================================================
--- common/branches/JBWS-3343/src/main/java/org/jboss/ws/common/deployment/ContextRootDeploymentAspect.java	2011-09-02 05:40:05 UTC (rev 14923)
+++ common/branches/JBWS-3343/src/main/java/org/jboss/ws/common/deployment/ContextRootDeploymentAspect.java	2011-09-02 05:42:04 UTC (rev 14924)
@@ -46,10 +46,8 @@
    private static final ResourceBundle bundle = BundleUtils.getBundle(ContextRootDeploymentAspect.class);
    @Override
    public void start(Deployment dep)
-   {
-      //TODO: set contextRoot to each endpoint 
-      String contextRoot = null;
-      //dep.getService().getContextRoot();
+   { 
+      String contextRoot = dep.getService().getContextRoot();
       if (contextRoot == null)
       {
          contextRoot = getExplicitContextRoot(dep);
@@ -60,7 +58,7 @@
          if (contextRoot.startsWith("/") == false)
             contextRoot = "/" + contextRoot;
 
-       // dep.getService().setContextRoot(contextRoot);
+         dep.getService().setContextRoot(contextRoot);
       }
    }
 

Modified: common/branches/JBWS-3343/src/main/java/org/jboss/ws/common/deployment/DefaultDeployment.java
===================================================================
--- common/branches/JBWS-3343/src/main/java/org/jboss/ws/common/deployment/DefaultDeployment.java	2011-09-02 05:40:05 UTC (rev 14923)
+++ common/branches/JBWS-3343/src/main/java/org/jboss/ws/common/deployment/DefaultDeployment.java	2011-09-02 05:42:04 UTC (rev 14924)
@@ -39,8 +39,6 @@
    private String simpleName;
    // A deployment has one service
    private Service service;
-   // The type of this deployment
-   private DeploymentType type;
    // The state for this deployment
    private DeploymentState state;
    // The deployment class loader
@@ -107,13 +105,4 @@
       this.state = deploymentState;
    }
 
-   public DeploymentType getType()
-   {
-      return type;
-   }
-
-   public void setType(DeploymentType deploymentType)
-   {
-      this.type = deploymentType;
-   }
 }

Modified: common/branches/JBWS-3343/src/main/java/org/jboss/ws/common/deployment/DefaultService.java
===================================================================
--- common/branches/JBWS-3343/src/main/java/org/jboss/ws/common/deployment/DefaultService.java	2011-09-02 05:40:05 UTC (rev 14923)
+++ common/branches/JBWS-3343/src/main/java/org/jboss/ws/common/deployment/DefaultService.java	2011-09-02 05:42:04 UTC (rev 14924)
@@ -22,6 +22,7 @@
 package org.jboss.ws.common.deployment;
 
 import org.jboss.wsf.spi.deployment.AbstractExtensible;
+import org.jboss.wsf.spi.deployment.Endpoint.EndpointType;
 import org.jboss.wsf.spi.deployment.Service;
 import org.jboss.wsf.spi.deployment.Deployment;
 import org.jboss.wsf.spi.deployment.Endpoint;
@@ -43,6 +44,7 @@
 {
    private Deployment dep;
    private List<Endpoint> endpoints = new LinkedList<Endpoint>();
+   private List<EndpointType> endpointTypes = new LinkedList<EndpointType>();
    private String contextRoot;
    private List<String> virtualHosts;
 
@@ -71,6 +73,16 @@
       return endpoints;
    }
    
+   public void addEndpointType(EndpointType endpointType)
+   {
+      endpointTypes.add(endpointType);
+   }
+
+   public List<EndpointType> getEndpointTypes()
+   {
+      return endpointTypes;
+   }
+   
    public List<Endpoint> getEndpoints(EndpointTypeFilter filter)
    {
       List<Endpoint> result = new LinkedList<Endpoint>();

Modified: common/branches/JBWS-3343/src/main/java/org/jboss/ws/common/deployment/EndpointAPIDeploymentAspect.java
===================================================================
--- common/branches/JBWS-3343/src/main/java/org/jboss/ws/common/deployment/EndpointAPIDeploymentAspect.java	2011-09-02 05:40:05 UTC (rev 14923)
+++ common/branches/JBWS-3343/src/main/java/org/jboss/ws/common/deployment/EndpointAPIDeploymentAspect.java	2011-09-02 05:42:04 UTC (rev 14924)
@@ -28,7 +28,6 @@
 import org.jboss.ws.common.integration.AbstractDeploymentAspect;
 import org.jboss.wsf.spi.deployment.ArchiveDeployment;
 import org.jboss.wsf.spi.deployment.Deployment;
-import org.jboss.wsf.spi.deployment.Deployment.DeploymentType;
 import org.jboss.wsf.spi.deployment.Endpoint;
 import org.jboss.wsf.spi.deployment.HttpEndpoint;
 import org.jboss.wsf.spi.deployment.UnifiedVirtualFile;
@@ -46,7 +45,8 @@
    @Override
    public void start(Deployment dep)
    {
-      dep.setType(DeploymentType.JAXWS_JSE);
+      //TODO:Review why this set JAXWS_JSE type
+      //dep.setType(DeploymentType.JAXWS_JSE);
 
       if (dep instanceof ArchiveDeployment)
       {

Modified: common/branches/JBWS-3343/src/main/java/org/jboss/ws/common/deployment/EndpointAddressDeploymentAspect.java
===================================================================
--- common/branches/JBWS-3343/src/main/java/org/jboss/ws/common/deployment/EndpointAddressDeploymentAspect.java	2011-09-02 05:40:05 UTC (rev 14923)
+++ common/branches/JBWS-3343/src/main/java/org/jboss/ws/common/deployment/EndpointAddressDeploymentAspect.java	2011-09-02 05:42:04 UTC (rev 14924)
@@ -33,8 +33,8 @@
 import org.jboss.wsf.spi.SPIProvider;
 import org.jboss.wsf.spi.SPIProviderResolver;
 import org.jboss.wsf.spi.deployment.Deployment;
-import org.jboss.wsf.spi.deployment.Deployment.DeploymentType;
 import org.jboss.wsf.spi.deployment.Endpoint;
+import org.jboss.wsf.spi.deployment.Endpoint.EndpointType;
 import org.jboss.wsf.spi.deployment.HttpEndpoint;
 import org.jboss.wsf.spi.management.ServerConfig;
 import org.jboss.wsf.spi.management.ServerConfigFactory;
@@ -57,9 +57,7 @@
    @Override
    public void start(Deployment dep)
    {
-      //TODO:set contextRoot to eache endpoint
-      //String contextRoot = dep.getService().getContextRoot();
-      String contextRoot = "";
+      String contextRoot = dep.getService().getContextRoot();
       if (contextRoot == null)
          throw new IllegalStateException(BundleUtils.getMessage(bundle, "CANNOT_OBTAIN_CONTEXT_ROOT"));
       
@@ -123,7 +121,7 @@
    protected boolean isConfidentialTransportGuarantee(Deployment dep, Endpoint ep)
    {
       String transportGuarantee = null;
-      if (DeploymentType.JAXWS_JSE == dep.getType())
+      if (EndpointType.JAXWS_JSE == ep.getType())
       {
          JSEArchiveMetaData webMetaData = dep.getAttachment(JSEArchiveMetaData.class);
          if (webMetaData != null)
@@ -154,7 +152,7 @@
             }
          }
       }
-      else if (DeploymentType.JAXWS_EJB3 == dep.getType())
+      else if (EndpointType.JAXWS_EJB3 == ep.getType())
       {
          //TODO Unify annotation scans
          Class implClass = ep.getTargetBeanClass();

Modified: common/branches/JBWS-3343/src/main/java/org/jboss/ws/common/deployment/EndpointHandlerDeploymentAspect.java
===================================================================
--- common/branches/JBWS-3343/src/main/java/org/jboss/ws/common/deployment/EndpointHandlerDeploymentAspect.java	2011-09-02 05:40:05 UTC (rev 14923)
+++ common/branches/JBWS-3343/src/main/java/org/jboss/ws/common/deployment/EndpointHandlerDeploymentAspect.java	2011-09-02 05:42:04 UTC (rev 14924)
@@ -26,9 +26,9 @@
 import org.jboss.wsf.spi.SPIProviderResolver;
 import org.jboss.wsf.spi.deployment.Deployment;
 import org.jboss.wsf.spi.deployment.Endpoint;
+import org.jboss.wsf.spi.deployment.Endpoint.EndpointType;
 import org.jboss.wsf.spi.deployment.LifecycleHandler;
 import org.jboss.wsf.spi.deployment.LifecycleHandlerFactory;
-import org.jboss.wsf.spi.deployment.Deployment.DeploymentType;
 import org.jboss.wsf.spi.invocation.InvocationHandler;
 import org.jboss.wsf.spi.invocation.InvocationHandlerFactory;
 import org.jboss.wsf.spi.invocation.InvocationType;
@@ -86,21 +86,19 @@
 
    private InvocationHandler getInvocationHandler(Endpoint ep)
    {
-      Deployment dep = ep.getService().getDeployment();
-      DeploymentType depType = dep.getType();
       
-      String key = depType.toString();
+      String key = ep.getType().toString();
 
       // Use a special key for MDB endpoints
-      EJBArchiveMetaData uapp = dep.getAttachment(EJBArchiveMetaData.class);
+      EJBArchiveMetaData uapp = ep.getService().getDeployment().getAttachment(EJBArchiveMetaData.class);
       if (uapp != null)
       {
          EJBMetaData bmd = uapp.getBeanByEjbName(ep.getShortName());
-         if (depType == DeploymentType.JAXRPC_EJB21 && bmd instanceof MDBMetaData)
+         if (ep.getType() == EndpointType.JAXRPC_EJB21 && bmd instanceof MDBMetaData)
          {
             key = InvocationType.JAXRPC_MDB21.toString();
          }
-         else if (depType == DeploymentType.JAXWS_EJB3 && bmd instanceof MDBMetaData)
+         else if (ep.getType() == EndpointType.JAXWS_EJB3 && bmd instanceof MDBMetaData)
          {
             key = InvocationType.JAXWS_MDB3.toString();
          }

Modified: common/branches/JBWS-3343/src/main/java/org/jboss/ws/common/deployment/EndpointNameDeploymentAspect.java
===================================================================
--- common/branches/JBWS-3343/src/main/java/org/jboss/ws/common/deployment/EndpointNameDeploymentAspect.java	2011-09-02 05:40:05 UTC (rev 14923)
+++ common/branches/JBWS-3343/src/main/java/org/jboss/ws/common/deployment/EndpointNameDeploymentAspect.java	2011-09-02 05:42:04 UTC (rev 14924)
@@ -45,8 +45,7 @@
    public void start(Deployment dep)
    {
       //TODO:set contextRoot to eache endpoint
-      //String contextRoot = dep.getService().getContextRoot();
-      String contextRoot = "";
+      String contextRoot = dep.getService().getContextRoot();
       if (contextRoot == null || contextRoot.startsWith("/") == false)
          throw new IllegalStateException(BundleUtils.getMessage(bundle, "CONTEXT_ROOT_EXPECTED_TO_START_WITH_LEADING_SLASH",  contextRoot));
 

Modified: common/branches/JBWS-3343/src/main/java/org/jboss/ws/common/deployment/JAXBIntroDeploymentAspect.java
===================================================================
--- common/branches/JBWS-3343/src/main/java/org/jboss/ws/common/deployment/JAXBIntroDeploymentAspect.java	2011-09-02 05:40:05 UTC (rev 14923)
+++ common/branches/JBWS-3343/src/main/java/org/jboss/ws/common/deployment/JAXBIntroDeploymentAspect.java	2011-09-02 05:42:04 UTC (rev 14924)
@@ -107,8 +107,7 @@
             try {
                introsConfigStream.close();
             } catch (IOException e) {
-               //TODO:logger.error(BundleUtils.getMessage(bundle, "ERROR_CLOSING_JAXB_INTRODUCTIONS",  deployment.getService().getContextRoot() ),  e);
-               logger.error(BundleUtils.getMessage(bundle, "ERROR_CLOSING_JAXB_INTRODUCTIONS",  deployment.getService()),  e);
+               logger.error(BundleUtils.getMessage(bundle, "ERROR_CLOSING_JAXB_INTRODUCTIONS",  deployment.getService().getContextRoot()),  e);
             }
          }
       }

Modified: common/branches/JBWS-3343/src/main/java/org/jboss/ws/common/deployment/URLPatternDeploymentAspect.java
===================================================================
--- common/branches/JBWS-3343/src/main/java/org/jboss/ws/common/deployment/URLPatternDeploymentAspect.java	2011-09-02 05:40:05 UTC (rev 14923)
+++ common/branches/JBWS-3343/src/main/java/org/jboss/ws/common/deployment/URLPatternDeploymentAspect.java	2011-09-02 05:42:04 UTC (rev 14924)
@@ -32,6 +32,7 @@
 import org.jboss.ws.common.integration.AbstractDeploymentAspect;
 import org.jboss.wsf.spi.deployment.Deployment;
 import org.jboss.wsf.spi.deployment.Endpoint;
+import org.jboss.wsf.spi.deployment.Endpoint.EndpointType;
 import org.jboss.wsf.spi.deployment.HttpEndpoint;
 import org.jboss.wsf.spi.metadata.j2ee.EJBArchiveMetaData;
 import org.jboss.wsf.spi.metadata.j2ee.EJBMetaData;
@@ -78,7 +79,7 @@
 
       // #1 For JSE lookup the url-pattern from the servlet mappings 
       JSEArchiveMetaData webMetaData = dep.getAttachment(JSEArchiveMetaData.class);
-      if (webMetaData != null)
+      if (webMetaData != null && ep.getType() == EndpointType.JAXWS_JSE || ep.getType() == EndpointType.JAXRPC_JSE)
       {
          String epName = ep.getShortName();
          urlPattern = webMetaData.getServletMappings().get(epName);
@@ -88,7 +89,8 @@
 
       // #2 Use the explicit urlPattern from port-component/port-component-uri
       EJBArchiveMetaData appMetaData = dep.getAttachment(EJBArchiveMetaData.class);
-      if (appMetaData != null && appMetaData.getBeanByEjbName(ep.getShortName()) != null)
+      //TODO: look at EndpointType.JAXRPC_EJB21
+      if (appMetaData != null && appMetaData.getBeanByEjbName(ep.getShortName()) != null && ep.getType() == EndpointType.JAXWS_EJB3)
       {
          EJBMetaData bmd = appMetaData.getBeanByEjbName(ep.getShortName());
          urlPattern = bmd.getPortComponentURI();

Modified: common/branches/JBWS-3343/src/main/java/org/jboss/ws/common/deployment/VirtualHostDeploymentAspect.java
===================================================================
--- common/branches/JBWS-3343/src/main/java/org/jboss/ws/common/deployment/VirtualHostDeploymentAspect.java	2011-09-02 05:40:05 UTC (rev 14923)
+++ common/branches/JBWS-3343/src/main/java/org/jboss/ws/common/deployment/VirtualHostDeploymentAspect.java	2011-09-02 05:42:04 UTC (rev 14924)
@@ -29,8 +29,8 @@
 import org.jboss.ws.api.annotation.WebContext;
 import org.jboss.ws.api.util.BundleUtils;
 import org.jboss.ws.common.integration.AbstractDeploymentAspect;
+import org.jboss.ws.common.integration.WSHelper;
 import org.jboss.wsf.spi.deployment.Deployment;
-import org.jboss.wsf.spi.deployment.Deployment.DeploymentType;
 import org.jboss.wsf.spi.deployment.Endpoint;
 
 /**
@@ -46,7 +46,7 @@
    @Override
    public void start(Deployment dep)
    {
-      if ( DeploymentType.JAXWS_EJB3.equals(dep.getType()))
+      if (WSHelper.isEjbDeployment(dep) && !WSHelper.isJaxwsJseDeployment(dep))
       {
          dep.getService().setVirtualHosts(getExplicitVirtualHosts(dep));
       }

Modified: common/branches/JBWS-3343/src/main/java/org/jboss/ws/common/integration/WSHelper.java
===================================================================
--- common/branches/JBWS-3343/src/main/java/org/jboss/ws/common/integration/WSHelper.java	2011-09-02 05:40:05 UTC (rev 14923)
+++ common/branches/JBWS-3343/src/main/java/org/jboss/ws/common/integration/WSHelper.java	2011-09-02 05:42:04 UTC (rev 14924)
@@ -26,7 +26,8 @@
 import org.jboss.logging.Logger;
 import org.jboss.ws.api.util.BundleUtils;
 import org.jboss.wsf.spi.deployment.Deployment;
-import org.jboss.wsf.spi.deployment.Deployment.DeploymentType;
+import org.jboss.wsf.spi.deployment.Endpoint.EndpointType;
+import org.jboss.wsf.spi.deployment.EndpointTypeFilter;
 
 /**
  * Cross WS stack and JBoss AS integration helper.
@@ -102,7 +103,14 @@
     */
    public static boolean isJaxrpcEjbDeployment( final Deployment dep )
    {
-      return DeploymentType.JAXRPC_EJB21.equals( dep.getType() );
+      return dep.getService().getEndpoints(new EndpointTypeFilter() {
+         public boolean accept(EndpointType type) {
+            if (type == EndpointType.JAXRPC_EJB21) {
+               return true;
+            }
+            return false;
+         }
+      }).size() > 0;
    }
 
    /**
@@ -113,7 +121,14 @@
     */
    public static boolean isJaxrpcJseDeployment( final Deployment dep )
    {
-      return DeploymentType.JAXRPC_JSE.equals( dep.getType() );
+      return dep.getService().getEndpoints(new EndpointTypeFilter() {
+         public boolean accept(EndpointType type) {
+            if (type == EndpointType.JAXRPC_JSE) {
+               return true;
+            }
+            return false;
+         }
+      }).size() > 0;
    }
 
    /**
@@ -124,7 +139,15 @@
     */
    public static boolean isJaxwsEjbDeployment( final Deployment dep )
    {
-      return DeploymentType.JAXWS_EJB3.equals( dep.getType() );
+     return dep.getService().getEndpoints(new EndpointTypeFilter() {
+         public boolean accept(EndpointType type) {
+            if (type == EndpointType.JAXWS_EJB3) {
+               return true;
+            }
+            return false;
+         }
+         
+      }).size() > 0;
    }
 
    /**
@@ -135,7 +158,14 @@
     */
    public static boolean isJaxwsJseDeployment( final Deployment dep )
    {
-      return DeploymentType.JAXWS_JSE.equals( dep.getType() );
+      return dep.getService().getEndpoints(new EndpointTypeFilter() {
+         public boolean accept(EndpointType type) {
+            if (type == EndpointType.JAXWS_JSE || type == EndpointType.JAXWS_JMS) {
+               return true;
+            }
+            return false;
+         }
+      }).size() > 0;
    }
    
    /**

Modified: common/branches/JBWS-3343/src/main/java/org/jboss/ws/common/servlet/AbstractEndpointServlet.java
===================================================================
--- common/branches/JBWS-3343/src/main/java/org/jboss/ws/common/servlet/AbstractEndpointServlet.java	2011-09-02 05:40:05 UTC (rev 14923)
+++ common/branches/JBWS-3343/src/main/java/org/jboss/ws/common/servlet/AbstractEndpointServlet.java	2011-09-02 05:42:04 UTC (rev 14924)
@@ -36,6 +36,7 @@
 
 import org.jboss.ws.api.util.BundleUtils;
 import org.jboss.ws.common.ObjectNameFactory;
+import org.jboss.ws.common.integration.WSHelper;
 import org.jboss.wsf.spi.SPIProvider;
 import org.jboss.wsf.spi.SPIProviderResolver;
 import org.jboss.wsf.spi.classloading.ClassLoaderProvider;
@@ -166,8 +167,8 @@
    private void setRuntimeLoader()
    {
       final Deployment dep = endpoint.getService().getDeployment();
-      final boolean isJaxrpcJse = dep.getType() == Deployment.DeploymentType.JAXRPC_JSE;
-      final boolean isJaxwsJse = dep.getType() == Deployment.DeploymentType.JAXWS_JSE;
+      final boolean isJaxrpcJse = WSHelper.isJaxrpcJseDeployment(dep);
+      final boolean isJaxwsJse = WSHelper.isJaxwsJseDeployment(dep);
 
       if (isJaxrpcJse || isJaxwsJse)
       {

Modified: common/branches/JBWS-3343/src/main/java/org/jboss/ws/common/utils/AbstractWSDLFilePublisher.java
===================================================================
--- common/branches/JBWS-3343/src/main/java/org/jboss/ws/common/utils/AbstractWSDLFilePublisher.java	2011-09-02 05:40:05 UTC (rev 14923)
+++ common/branches/JBWS-3343/src/main/java/org/jboss/ws/common/utils/AbstractWSDLFilePublisher.java	2011-09-02 05:42:04 UTC (rev 14924)
@@ -39,6 +39,7 @@
 import org.jboss.ws.api.util.BundleUtils;
 import org.jboss.ws.common.DOMUtils;
 import org.jboss.ws.common.IOUtils;
+import org.jboss.ws.common.integration.WSHelper;
 import org.jboss.wsf.spi.SPIProvider;
 import org.jboss.wsf.spi.SPIProviderResolver;
 import org.jboss.wsf.spi.deployment.ArchiveDeployment;
@@ -76,7 +77,7 @@
          serverConfig = spiProvider.getSPI(ServerConfigFactory.class).getServerConfig();
       }
       
-      if (dep.getType().toString().endsWith("JSE"))
+      if (WSHelper.isJseDeployment(dep))
       {
          expLocation = "WEB-INF/wsdl/";
       }



More information about the jbossws-commits mailing list