[jboss-cvs] JBossAS SVN: r70003 - in trunk: webservices/src/main/org/jboss/wsf/container/jboss50 and 1 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Feb 21 09:17:49 EST 2008


Author: thomas.diesler at jboss.com
Date: 2008-02-21 09:17:49 -0500 (Thu, 21 Feb 2008)
New Revision: 70003

Added:
   trunk/webservices/src/main/org/jboss/wsf/container/jboss50/SecurityHandler.java
   trunk/webservices/src/main/org/jboss/wsf/container/jboss50/SecurityHandlerEJB21.java
   trunk/webservices/src/main/org/jboss/wsf/container/jboss50/SecurityHandlerEJB3.java
   trunk/webservices/src/main/org/jboss/wsf/container/jboss50/WebAppDeploymentAspect.java
   trunk/webservices/src/main/org/jboss/wsf/container/jboss50/WebAppGeneratorDeploymentAspect.java
   trunk/webservices/src/main/org/jboss/wsf/container/jboss50/WebMetaDataModifierImpl.java
Removed:
   trunk/webservices/src/main/org/jboss/wsf/container/jboss50/FileBasedSecurityHandlerEJB21.java
   trunk/webservices/src/main/org/jboss/wsf/container/jboss50/FileBasedSecurityHandlerEJB3.java
   trunk/webservices/src/main/org/jboss/wsf/container/jboss50/FileBasedWebAppGeneratorDeploymentAspect.java
   trunk/webservices/src/main/org/jboss/wsf/container/jboss50/FileBasedWebMetaDataModifier.java
   trunk/webservices/src/main/org/jboss/wsf/container/jboss50/InMemoryWebAppGeneratorDeploymentAspect.java
   trunk/webservices/src/main/org/jboss/wsf/container/jboss50/InMemoryWebMetaDataModifier.java
   trunk/webservices/src/main/org/jboss/wsf/container/jboss50/WebAppDeploymentAspect.java
   trunk/webservices/src/main/org/jboss/wsf/container/jboss50/WebMetaDataSecurityHandler.java
   trunk/webservices/src/main/org/jboss/wsf/container/jboss50/WebMetaDataSecurityHandlerEJB21.java
   trunk/webservices/src/main/org/jboss/wsf/container/jboss50/WebMetaDataSecurityHandlerEJB3.java
Modified:
   trunk/tomcat/src/resources/war-deployers-beans.xml
   trunk/webservices/src/main/org/jboss/wsf/container/jboss50/RuntimeLoaderDeploymentAspect.java
   trunk/webservices/src/main/org/jboss/wsf/container/jboss50/WebServiceDeployerEJB.java
   trunk/webservices/src/resources/jbossws-jboss50.deployer/META-INF/jbossws-deployer-beans.xml
Log:
[JBWS-1967] Get rid of web.xml rewrite

Modified: trunk/tomcat/src/resources/war-deployers-beans.xml
===================================================================
--- trunk/tomcat/src/resources/war-deployers-beans.xml	2008-02-21 14:17:35 UTC (rev 70002)
+++ trunk/tomcat/src/resources/war-deployers-beans.xml	2008-02-21 14:17:49 UTC (rev 70003)
@@ -123,6 +123,7 @@
       <!-- Inject the MainDeployer for resolving cross deployment refs -->
       <property name="mainDeployer"><inject bean="MainDeployer" /></property>
       <property name="type">war</property>
+      <property name="relativeOrder">2003</property>
       <!-- You can configure a set of authenticators keyed by http-auth method
       used. This will apply the same set of authenticators across all web
       applications. You can override the set of authenticators at the web

Deleted: trunk/webservices/src/main/org/jboss/wsf/container/jboss50/FileBasedSecurityHandlerEJB21.java
===================================================================
--- trunk/webservices/src/main/org/jboss/wsf/container/jboss50/FileBasedSecurityHandlerEJB21.java	2008-02-21 14:17:35 UTC (rev 70002)
+++ trunk/webservices/src/main/org/jboss/wsf/container/jboss50/FileBasedSecurityHandlerEJB21.java	2008-02-21 14:17:49 UTC (rev 70003)
@@ -1,81 +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.wsf.container.jboss50;
-
-//$Id: SecurityHandlerEJB21.java 4013 2007-07-27 04:37:52Z thomas.diesler at jboss.com $
-
-import org.dom4j.Element;
-import org.jboss.metadata.common.ejb.IAssemblyDescriptorMetaData;
-import org.jboss.metadata.ejb.jboss.JBossMetaData;
-import org.jboss.metadata.ejb.spec.AssemblyDescriptorMetaData;
-import org.jboss.metadata.ejb.spec.EjbJarMetaData;
-import org.jboss.metadata.javaee.spec.SecurityRolesMetaData;
-import org.jboss.wsf.spi.deployment.Deployment;
-import org.jboss.wsf.spi.deployment.SecurityHandler;
-import org.jboss.wsf.spi.metadata.j2ee.EJBArchiveMetaData;
-
-import java.util.Iterator;
-import java.util.Map;
-
-/**
- * Generate a service endpoint deployment for EJB endpoints 
- * 
- * @author Thomas.Diesler at jboss.org
- * @since 12-May-2006
- */
-public class FileBasedSecurityHandlerEJB21 implements SecurityHandler
-{
-   public void addSecurityDomain(Element jbossWeb, Deployment dep)
-   {
-      EJBArchiveMetaData ejbMetaData = dep.getAttachment(EJBArchiveMetaData.class);
-      if (ejbMetaData == null)
-         throw new IllegalStateException("Cannot obtain application meta data");
-      
-      String securityDomain = ejbMetaData.getSecurityDomain();
-      if (securityDomain != null)
-      {
-         if (securityDomain.startsWith("java:/jaas/") == false)
-            securityDomain = "java:/jaas/" + securityDomain;
-         
-         jbossWeb.addElement("security-domain").addText(securityDomain);
-      }
-   }
-   
-   public void addSecurityRoles(Element webApp, Deployment dep)
-   {
-      // Fix: http://jira.jboss.org/jira/browse/JBWS-309
-      JBossMetaData jbmd = dep.getAttachment(JBossMetaData.class);
-      IAssemblyDescriptorMetaData assemblyDescriptor = jbmd.getAssemblyDescriptor();
-      if (assemblyDescriptor != null)
-      {
-         SecurityRolesMetaData srmd = assemblyDescriptor.getSecurityRoles();
-         if (srmd != null)
-         {
-            Iterator it = srmd.keySet().iterator();
-            while (it.hasNext())
-            {
-               webApp.addElement("security-role").addElement("role-name").addText((String)it.next());
-            }
-         }
-      }
-   }
-}

Deleted: trunk/webservices/src/main/org/jboss/wsf/container/jboss50/FileBasedSecurityHandlerEJB3.java
===================================================================
--- trunk/webservices/src/main/org/jboss/wsf/container/jboss50/FileBasedSecurityHandlerEJB3.java	2008-02-21 14:17:35 UTC (rev 70002)
+++ trunk/webservices/src/main/org/jboss/wsf/container/jboss50/FileBasedSecurityHandlerEJB3.java	2008-02-21 14:17:49 UTC (rev 70003)
@@ -1,96 +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.wsf.container.jboss50;
-
-//$Id: SecurityHandlerEJB3.java 4011 2007-07-27 02:45:35Z thomas.diesler at jboss.com $
-
-import java.util.Iterator;
-
-import javax.annotation.security.RolesAllowed;
-
-import org.dom4j.Element;
-import org.jboss.ejb3.EJBContainer;
-import org.jboss.ejb3.Ejb3Deployment;
-import org.jboss.ejb3.annotation.SecurityDomain;
-import org.jboss.wsf.spi.deployment.Deployment;
-import org.jboss.wsf.spi.deployment.SecurityHandler;
-
-/**
- * Generate a service endpoint deployment for EJB endpoints 
- * 
- * @author Thomas.Diesler at jboss.org
- * @since 12-May-2006
- */
-public class FileBasedSecurityHandlerEJB3 implements SecurityHandler
-{
-   public void addSecurityDomain(Element jbossWeb, Deployment dep)
-   {
-      String securityDomain = null;
-      
-      Ejb3Deployment ejb3Deployment = dep.getAttachment(Ejb3Deployment.class);
-      if (ejb3Deployment != null)
-      {
-         Iterator it = ejb3Deployment.getEjbContainers().values().iterator();
-         while (it.hasNext())
-         {
-            EJBContainer container = (EJBContainer)it.next();
-            SecurityDomain anSecurityDomain = (SecurityDomain)container.resolveAnnotation(SecurityDomain.class);
-            if (anSecurityDomain != null)
-            {
-               if (securityDomain != null && !securityDomain.equals(anSecurityDomain.value()))
-                  throw new IllegalStateException("Multiple security domains not supported");
-               
-               securityDomain = anSecurityDomain.value();
-            }
-         }
-      }
-      
-      if (securityDomain != null)
-      {
-         if (securityDomain.startsWith("java:/jaas/") == false)
-            securityDomain = "java:/jaas/" + securityDomain;
-         
-         jbossWeb.addElement("security-domain").addText(securityDomain);
-      }
-   }
-
-   public void addSecurityRoles(Element webApp, Deployment dep)
-   {
-      Ejb3Deployment ejb3Deployment = dep.getAttachment(Ejb3Deployment.class);
-      if (ejb3Deployment != null)
-      {
-         Iterator it = ejb3Deployment.getEjbContainers().values().iterator();
-         while (it.hasNext())
-         {
-            EJBContainer container = (EJBContainer)it.next();
-            RolesAllowed anRolesAllowed = (RolesAllowed)container.resolveAnnotation(RolesAllowed.class);
-            if (anRolesAllowed != null)
-            {
-               for (String role : anRolesAllowed.value())
-               {
-                  webApp.addElement("security-role").addElement("role-name").addText(role);
-               }
-            }
-         }
-      }
-   }
-}

Deleted: trunk/webservices/src/main/org/jboss/wsf/container/jboss50/FileBasedWebAppGeneratorDeploymentAspect.java
===================================================================
--- trunk/webservices/src/main/org/jboss/wsf/container/jboss50/FileBasedWebAppGeneratorDeploymentAspect.java	2008-02-21 14:17:35 UTC (rev 70002)
+++ trunk/webservices/src/main/org/jboss/wsf/container/jboss50/FileBasedWebAppGeneratorDeploymentAspect.java	2008-02-21 14:17:49 UTC (rev 70003)
@@ -1,54 +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.wsf.container.jboss50;
-
-// $Id: WebAppDeployerDeployer.java 3772 2007-07-01 19:29:13Z thomas.diesler at jboss.com $
-
-import org.dom4j.Document;
-import org.jboss.wsf.framework.deployment.WebAppGeneratorDeploymentAspect;
-import org.jboss.wsf.spi.deployment.Deployment;
-import org.jboss.wsf.spi.deployment.SecurityHandler;
-
-/**
- * Add doctype declarations to the generated descriptors 
- * 
- * @author Thomas.Diesler at jboss.org
- * @since 13-Oct-2007
- */
-public class FileBasedWebAppGeneratorDeploymentAspect extends WebAppGeneratorDeploymentAspect
-{
-   @Override
-   protected Document createWebAppDescriptor(Deployment dep, SecurityHandler securityHandler)
-   {
-      Document document = super.createWebAppDescriptor(dep, securityHandler);
-      document.addDocType("web-app", "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN", "http://java.sun.com/dtd/web-app_2_3.dtd");
-      return document;
-   }
-
-   @Override
-   protected Document createJBossWebAppDescriptor(Deployment dep, SecurityHandler securityHandler)
-   {
-      Document document = super.createJBossWebAppDescriptor(dep, securityHandler);
-      document.addDocType("jboss-web", "-//JBoss//DTD Web Application 5.0//EN", "http://www.jboss.org/j2ee/dtd/jboss-web_5_0.dtd");
-      return document;
-   }
-}

Deleted: trunk/webservices/src/main/org/jboss/wsf/container/jboss50/FileBasedWebMetaDataModifier.java
===================================================================
--- trunk/webservices/src/main/org/jboss/wsf/container/jboss50/FileBasedWebMetaDataModifier.java	2008-02-21 14:17:35 UTC (rev 70002)
+++ trunk/webservices/src/main/org/jboss/wsf/container/jboss50/FileBasedWebMetaDataModifier.java	2008-02-21 14:17:49 UTC (rev 70003)
@@ -1,256 +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.wsf.container.jboss50;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.net.URL;
-import java.util.Iterator;
-import java.util.Map;
-
-import javax.xml.ws.WebServiceException;
-
-import org.dom4j.Document;
-import org.dom4j.Element;
-import org.dom4j.io.OutputFormat;
-import org.dom4j.io.SAXReader;
-import org.dom4j.io.XMLWriter;
-import org.jboss.logging.Logger;
-import org.jboss.util.xml.JBossEntityResolver;
-import org.jboss.wsf.common.IOUtils;
-import org.jboss.wsf.spi.deployment.Deployment;
-import org.jboss.wsf.spi.deployment.Endpoint;
-
-/**
- * The rewriter for web.xml
- *
- * @author Thomas.Diesler at jboss.org
- * @since 19-May-2007
- */
-public class FileBasedWebMetaDataModifier implements WebMetaDataModifier
-{
-   // logging support
-   private static Logger log = Logger.getLogger(FileBasedWebMetaDataModifier.class);
-
-   public RewriteResults modifyMetaData(Deployment dep)
-   {
-      URL warURL = (URL)dep.getProperty(WebMetaDataModifier.PROPERTY_WEBAPP_URL);
-      if (warURL == null)
-         throw new IllegalStateException("Cannot obtain generated webapp URL");
-      
-      File warFile = new File(warURL.getFile());
-      if (warFile.isDirectory() == false)
-         throw new WebServiceException("Expected a war directory: " + warURL);
-
-      File webXML = new File(warURL.getFile() + "/WEB-INF/web.xml");
-      if (webXML.isFile() == false)
-         throw new WebServiceException("Cannot find web.xml: " + webXML);
-
-      try
-      {
-         // After redeployment there might be a stale copy of the original web.xml.org, we delete it
-         File orgWebXML = new File(webXML.getCanonicalPath() + ".org");
-         orgWebXML.delete();
-
-         // Rename the web.xml
-         if (webXML.renameTo(orgWebXML) == false)
-            throw new WebServiceException("Cannot rename web.xml: " + orgWebXML);
-
-         return rewriteWebXml(orgWebXML, webXML, dep);
-      }
-      catch (RuntimeException rte)
-      {
-         throw rte;
-      }
-      catch (Exception e)
-      {
-         throw new WebServiceException(e);
-      }
-   }
-
-   private RewriteResults rewriteWebXml(File input, File destFile, Deployment dep) throws Exception
-   {
-      if (destFile == null)
-      {
-         destFile = File.createTempFile("jbossws-alt-web", "xml", IOUtils.createTempDirectory());
-         destFile.deleteOnExit();
-      }
-
-      FileInputStream inputStream = null;
-      FileOutputStream outputStream = null;
-
-      try
-      {
-         SAXReader reader = new SAXReader();
-         reader.setEntityResolver(new JBossEntityResolver());
-
-         inputStream = new FileInputStream(input);
-         Document document = reader.read(inputStream);
-
-         RewriteResults results = modifyMetaData(dep, document);
-         results.webXML = destFile.toURL();
-
-         outputStream = new FileOutputStream(destFile);
-         OutputFormat format = OutputFormat.createPrettyPrint();
-         XMLWriter writer = new XMLWriter(outputStream, format);
-         writer.write(document);
-         writer.close();
-
-         return results;
-      }
-      finally
-      {
-         if (inputStream != null)
-            inputStream.close();
-
-         if (outputStream != null)
-            outputStream.close();
-      }
-   }
-
-   private RewriteResults modifyMetaData(Deployment dep, Document webXml) throws ClassNotFoundException
-   {
-      RewriteResults results = new RewriteResults();
-
-      Element root = webXml.getRootElement();
-
-      String servletClass = (String)dep.getProperty(PROPERTY_WEBAPP_SERVLET_CLASS);
-      if (servletClass == null)
-         throw new IllegalStateException("Cannot obtain context property: " + PROPERTY_WEBAPP_SERVLET_CLASS);
-
-      Map<String, String> contextParams = (Map<String, String>)dep.getProperty(PROPERTY_WEBAPP_CONTEXT_PARAMETERS);
-      if (contextParams != null)
-      {
-         for (Map.Entry<String, String> entry : contextParams.entrySet())
-         {
-            // Ugly way to insert at position 0
-            Element contextParamTmp = root.addElement("context-param-tmp");
-
-            Element contextParam = (Element)contextParamTmp.clone();
-            contextParam.setName("context-param");
-            contextParam.addElement("param-name").addText(entry.getKey());
-            contextParam.addElement("param-value").addText(entry.getValue());
-            root.content().add(0, contextParam);
-
-            root.remove(contextParamTmp);
-         }
-      }
-
-      String listenerClass = (String)dep.getProperty(PROPERTY_WEBAPP_SERVLET_CONTEXT_LISTENER);
-      if (listenerClass != null)
-      {
-         Element listener = root.addElement("listener");
-         listener.addElement("listener-class").setText(listenerClass);
-      }
-
-      for (Iterator it = root.elementIterator("servlet"); it.hasNext();)
-      {
-         Element servlet = (Element)it.next();
-         String linkName = servlet.element("servlet-name").getTextTrim();
-
-         // find the servlet-class
-         Element classElement = servlet.element("servlet-class");
-
-         // JSP
-         if (classElement == null)
-            continue;
-
-         String orgServletClassName = classElement.getTextTrim();
-
-         // Get the servlet class
-         Class orgServletClass = null;
-         try
-         {
-            ClassLoader loader = dep.getInitialClassLoader();
-            orgServletClass = loader.loadClass(orgServletClassName);
-         }
-         catch (ClassNotFoundException ex)
-         {
-            log.warn("Cannot load servlet class: " + orgServletClassName);
-         }
-
-         String targetBeanName = null;
-
-         // Nothing to do if we have an <init-param>
-         if (isAlreadyModified(servlet))
-         {
-            for (Iterator itParam = servlet.elementIterator("init-param"); itParam.hasNext();)
-            {
-               Element elParam = (Element)itParam.next();
-               String paramName = elParam.element("param-name").getTextTrim();
-               String paramValue = elParam.element("param-value").getTextTrim();
-               if (Endpoint.SEPID_DOMAIN_ENDPOINT.equals(paramName))
-               {
-                  targetBeanName = paramValue;
-               }
-            }
-         }
-         else
-         {
-            // Check if it is a real servlet that we can ignore
-            if (orgServletClass != null && javax.servlet.Servlet.class.isAssignableFrom(orgServletClass))
-            {
-               log.info("Ignore servlet: " + orgServletClassName);
-               continue;
-            }
-            else if (orgServletClassName.endsWith("Servlet"))
-            {
-               log.info("Ignore <servlet-class> that ends with 'Servlet': " + orgServletClassName);
-               continue;
-            }
-
-            classElement.setText(servletClass);
-
-            // add additional init params
-            if (orgServletClassName.equals(servletClass) == false)
-            {
-               targetBeanName = orgServletClassName;
-               Element paramElement = servlet.addElement("init-param");
-               paramElement.addElement("param-name").addText(Endpoint.SEPID_DOMAIN_ENDPOINT);
-               paramElement.addElement("param-value").addText(targetBeanName);
-            }
-         }
-
-         if (targetBeanName == null)
-            throw new IllegalStateException("Cannot obtain service endpoint bean for: " + linkName);
-
-         // remember the target bean name
-         results.sepTargetMap.put(linkName, targetBeanName);
-      }
-
-      return results;
-   }
-
-   // Return true if the web.xml is already modified
-   private boolean isAlreadyModified(Element servlet)
-   {
-      for (Iterator it = servlet.elementIterator("init-param"); it.hasNext();)
-      {
-         Element elParam = (Element)it.next();
-         String paramName = elParam.element("param-name").getTextTrim();
-         if (Endpoint.SEPID_DOMAIN_ENDPOINT.equals(paramName))
-            return true;
-      }
-      return false;
-   }
-}

Deleted: trunk/webservices/src/main/org/jboss/wsf/container/jboss50/InMemoryWebAppGeneratorDeploymentAspect.java
===================================================================
--- trunk/webservices/src/main/org/jboss/wsf/container/jboss50/InMemoryWebAppGeneratorDeploymentAspect.java	2008-02-21 14:17:35 UTC (rev 70002)
+++ trunk/webservices/src/main/org/jboss/wsf/container/jboss50/InMemoryWebAppGeneratorDeploymentAspect.java	2008-02-21 14:17:49 UTC (rev 70003)
@@ -1,264 +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.wsf.container.jboss50;
-
-// $Id$
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import org.jboss.metadata.web.jboss.JBossServletMetaData;
-import org.jboss.metadata.web.jboss.JBossServletsMetaData;
-import org.jboss.metadata.web.jboss.JBossWebMetaData;
-import org.jboss.metadata.web.spec.AuthConstraintMetaData;
-import org.jboss.metadata.web.spec.LoginConfigMetaData;
-import org.jboss.metadata.web.spec.SecurityConstraintMetaData;
-import org.jboss.metadata.web.spec.ServletMappingMetaData;
-import org.jboss.metadata.web.spec.TransportGuaranteeType;
-import org.jboss.metadata.web.spec.UserDataConstraintMetaData;
-import org.jboss.metadata.web.spec.WebResourceCollectionMetaData;
-import org.jboss.metadata.web.spec.WebResourceCollectionsMetaData;
-import org.jboss.wsf.spi.annotation.WebContext;
-import org.jboss.wsf.spi.deployment.ArchiveDeployment;
-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.WSFDeploymentException;
-import org.jboss.wsf.spi.metadata.j2ee.EJBArchiveMetaData;
-import org.jboss.wsf.spi.metadata.j2ee.EJBMetaData;
-import org.jboss.wsf.spi.metadata.j2ee.EJBSecurityMetaData;
-
-/**
- * A deployment aspect that generates a webapp for an EJB endpoint 
- * 
- * @author Thomas.Diesler at jboss.org
- * @since 13-Oct-2007
- */
-public class InMemoryWebAppGeneratorDeploymentAspect extends DeploymentAspect
-{
-   private WebMetaDataSecurityHandler securityHandlerEJB21;
-   private WebMetaDataSecurityHandler securityHandlerEJB3;
-
-   public void setSecurityHandlerEJB21(WebMetaDataSecurityHandler handler)
-   {
-      this.securityHandlerEJB21 = handler;
-   }
-
-   public void setSecurityHandlerEJB3(WebMetaDataSecurityHandler handler)
-   {
-      this.securityHandlerEJB3 = handler;
-   }
-
-   @Override
-   public void create(Deployment dep)
-   {
-      String typeStr = dep.getType().toString();
-      if (typeStr.endsWith("EJB21"))
-      {
-         JBossWebMetaData jbwmd = generatWebDeployment((ArchiveDeployment)dep, securityHandlerEJB21);
-         dep.addAttachment(JBossWebMetaData.class, jbwmd);
-      }
-      else if (typeStr.endsWith("EJB3"))
-      {
-         JBossWebMetaData jbwmd = generatWebDeployment((ArchiveDeployment)dep, securityHandlerEJB3);
-         dep.addAttachment(JBossWebMetaData.class, jbwmd);
-      }
-      else
-      {
-         JBossWebMetaData jbwmd = generatWebDeployment((ArchiveDeployment)dep, null);
-         dep.addAttachment(JBossWebMetaData.class, jbwmd);
-      }
-   }
-
-   protected JBossWebMetaData generatWebDeployment(ArchiveDeployment dep, WebMetaDataSecurityHandler securityHandler)
-   {
-      JBossWebMetaData jbwmd = new JBossWebMetaData();
-      createWebAppDescriptor(dep, jbwmd, securityHandler);
-      createJBossWebAppDescriptor(dep, jbwmd, securityHandler);
-      return jbwmd;
-   }
-
-   protected void createWebAppDescriptor(Deployment dep, JBossWebMetaData jbwmd, WebMetaDataSecurityHandler securityHandler)
-   {
-      /*
-       <servlet>
-       <servlet-name>
-       <servlet-class>
-       </servlet>
-       */
-      JBossServletsMetaData servlets = jbwmd.getServlets();
-      for (Endpoint ep : dep.getService().getEndpoints())
-      {
-         JBossServletMetaData servlet = new JBossServletMetaData();
-         servlet.setServletName(ep.getShortName());
-         servlet.setServletClass(ep.getTargetBeanName());
-         servlets.add(servlet);
-      }
-
-      /*
-       <servlet-mapping>
-       <servlet-name>
-       <url-pattern>
-       </servlet-mapping>
-       */
-      for (Endpoint ep : dep.getService().getEndpoints())
-      {
-         List<ServletMappingMetaData> servletMappings = jbwmd.getServletMappings();
-         if (servletMappings == null)
-         {
-            servletMappings = new ArrayList<ServletMappingMetaData>();
-            jbwmd.setServletMappings(servletMappings);
-         }
-         ServletMappingMetaData servletMapping = new ServletMappingMetaData();
-         servletMapping.setServletName(ep.getShortName());
-         servletMapping.setUrlPatterns(Arrays.asList(new String[] { ep.getURLPattern() }));
-         servletMappings.add(servletMapping);
-      }
-
-      String authMethod = null;
-
-      // Add web-app/security-constraint for each port component
-      for (Endpoint ep : dep.getService().getEndpoints())
-      {
-         String ejbName = ep.getShortName();
-
-         Boolean secureWSDLAccess = null;
-         String transportGuarantee = null;
-         String beanAuthMethod = null;
-
-         WebContext anWebContext = (WebContext)ep.getTargetBeanClass().getAnnotation(WebContext.class);
-         if (anWebContext != null)
-         {
-            if (anWebContext.authMethod().length() > 0)
-               beanAuthMethod = anWebContext.authMethod();
-            if (anWebContext.transportGuarantee().length() > 0)
-               transportGuarantee = anWebContext.transportGuarantee();
-            if (anWebContext.secureWSDLAccess())
-               secureWSDLAccess = anWebContext.secureWSDLAccess();
-         }
-
-         EJBArchiveMetaData appMetaData = dep.getAttachment(EJBArchiveMetaData.class);
-         if (appMetaData != null && appMetaData.getBeanByEjbName(ejbName) != null)
-         {
-            EJBMetaData bmd = appMetaData.getBeanByEjbName(ejbName);
-            EJBSecurityMetaData smd = bmd.getSecurityMetaData();
-            if (smd != null)
-            {
-               beanAuthMethod = smd.getAuthMethod();
-               transportGuarantee = smd.getTransportGuarantee();
-               secureWSDLAccess = smd.getSecureWSDLAccess();
-            }
-         }
-
-         if (beanAuthMethod != null || transportGuarantee != null)
-         {
-            /*
-             <security-constraint>
-             <web-resource-collection>
-             <web-resource-name>TestUnAuthPort</web-resource-name>
-             <url-pattern>/HSTestRoot/TestUnAuth/*</url-pattern>
-             </web-resource-collection>
-             <auth-constraint>
-             <role-name>*</role-name>
-             </auth-constraint>
-             <user-data-constraint>
-             <transport-guarantee>NONE</transport-guarantee>
-             </user-data-constraint>
-             </security-constraint>
-             */
-            List<SecurityConstraintMetaData> securityContraints = jbwmd.getSecurityContraints();
-            if (securityContraints == null)
-            {
-               securityContraints = new ArrayList<SecurityConstraintMetaData>();
-               jbwmd.setSecurityContraints(securityContraints);
-            }
-            SecurityConstraintMetaData securityConstraint = new SecurityConstraintMetaData();
-            WebResourceCollectionsMetaData resourceCollections = securityConstraint.getResourceCollections();
-            if (resourceCollections == null)
-            {
-               resourceCollections = new WebResourceCollectionsMetaData();
-               securityConstraint.setResourceCollections(resourceCollections);
-            }
-            WebResourceCollectionMetaData wrc = new WebResourceCollectionMetaData();
-            wrc.setWebResourceName(ejbName);
-            wrc.setUrlPatterns(Arrays.asList(new String[] { ep.getURLPattern() }));
-            ArrayList<String> httpMethods = new ArrayList<String>();
-            wrc.setHttpMethods(httpMethods);
-            if (Boolean.TRUE.equals(secureWSDLAccess))
-            {
-               httpMethods.add("GET");
-            }
-            httpMethods.add("POST");
-
-            // Optional auth-constraint
-            if (beanAuthMethod != null)
-            {
-               // Only the first auth-method gives the war login-config/auth-method
-               if (authMethod == null)
-                  authMethod = beanAuthMethod;
-
-               AuthConstraintMetaData authConstraint = new AuthConstraintMetaData();
-               authConstraint.setRoleNames(Arrays.asList(new String[] { "*" }));
-               securityConstraint.setAuthConstraint(authConstraint);
-            }
-            // Optional user-data-constraint
-            if (transportGuarantee != null)
-            {
-               UserDataConstraintMetaData userDataConstraint = new UserDataConstraintMetaData();
-               userDataConstraint.setTransportGuarantee(TransportGuaranteeType.valueOf(transportGuarantee));
-               securityConstraint.setUserDataConstraint(userDataConstraint);
-            }
-         }
-      }
-
-      // Optional login-config/auth-method
-      if (authMethod != null && securityHandler != null)
-      {
-         LoginConfigMetaData loginConfig = jbwmd.getLoginConfig();
-         loginConfig.setAuthMethod(authMethod);
-         loginConfig.setRealmName("EJBServiceEndpointServlet Realm");
-
-         securityHandler.addSecurityRoles(jbwmd, dep);
-      }
-   }
-
-   protected void createJBossWebAppDescriptor(Deployment dep, JBossWebMetaData jbwmd, WebMetaDataSecurityHandler securityHandler)
-   {
-      /* Create a jboss-web
-       <jboss-web>
-       <security-domain>java:/jaas/cts</security-domain>
-       <context-root>/ws/ejbN/</context-root>
-       <virtual-host>some.domain.com</virtual-host>
-       </jboss-web>
-       */
-      if (securityHandler != null)
-         securityHandler.addSecurityDomain(jbwmd, dep);
-
-      // Get the context root for this deployment
-      String contextRoot = dep.getService().getContextRoot();
-      if (contextRoot == null)
-         throw new WSFDeploymentException("Cannot obtain context root");
-
-      jbwmd.setContextRoot(contextRoot);
-   }
-}

Deleted: trunk/webservices/src/main/org/jboss/wsf/container/jboss50/InMemoryWebMetaDataModifier.java
===================================================================
--- trunk/webservices/src/main/org/jboss/wsf/container/jboss50/InMemoryWebMetaDataModifier.java	2008-02-21 14:17:35 UTC (rev 70002)
+++ trunk/webservices/src/main/org/jboss/wsf/container/jboss50/InMemoryWebMetaDataModifier.java	2008-02-21 14:17:49 UTC (rev 70003)
@@ -1,205 +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.wsf.container.jboss50;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import javax.xml.ws.WebServiceException;
-
-import org.jboss.logging.Logger;
-import org.jboss.metadata.javaee.spec.ParamValueMetaData;
-import org.jboss.metadata.web.jboss.JBossServletMetaData;
-import org.jboss.metadata.web.jboss.JBossWebMetaData;
-import org.jboss.metadata.web.spec.ListenerMetaData;
-import org.jboss.wsf.spi.deployment.Deployment;
-import org.jboss.wsf.spi.deployment.Endpoint;
-
-/**
- * The rewriter for web.xml
- *
- * @author Thomas.Diesler at jboss.org
- * @since 19-May-2007
- */
-public class InMemoryWebMetaDataModifier implements WebMetaDataModifier
-{
-   // logging support
-   private static Logger log = Logger.getLogger(InMemoryWebMetaDataModifier.class);
-
-   public RewriteResults modifyMetaData(Deployment dep)
-   {
-      JBossWebMetaData jbwmd = dep.getAttachment(JBossWebMetaData.class);
-      if (jbwmd == null)
-         throw new WebServiceException("Cannot find web meta data");
-
-      try
-      {
-         RewriteResults results = modifyMetaData(dep, jbwmd);
-         return results;
-      }
-      catch (RuntimeException rte)
-      {
-         throw rte;
-      }
-      catch (Exception e)
-      {
-         throw new WebServiceException(e);
-      }
-   }
-
-   private RewriteResults modifyMetaData(Deployment dep, JBossWebMetaData jbwmd) throws ClassNotFoundException
-   {
-      RewriteResults results = new RewriteResults();
-
-      String servletClass = (String)dep.getProperty(PROPERTY_WEBAPP_SERVLET_CLASS);
-      if (servletClass == null)
-         throw new IllegalStateException("Cannot obtain context property: " + PROPERTY_WEBAPP_SERVLET_CLASS);
-
-      Map<String, String> depCtxParams = (Map<String, String>)dep.getProperty(PROPERTY_WEBAPP_CONTEXT_PARAMETERS);
-      if (depCtxParams != null)
-      {
-         List<ParamValueMetaData> contextParams = jbwmd.getContextParams();
-         if (contextParams == null)
-         {
-            contextParams = new ArrayList<ParamValueMetaData>();
-            jbwmd.setContextParams(contextParams);
-         }
-
-         for (Map.Entry<String, String> entry : depCtxParams.entrySet())
-         {
-            ParamValueMetaData param = new ParamValueMetaData();
-            param.setParamName(entry.getKey());
-            param.setParamValue(entry.getValue());
-            contextParams.add(param);
-         }
-      }
-
-      String listenerClass = (String)dep.getProperty(PROPERTY_WEBAPP_SERVLET_CONTEXT_LISTENER);
-      if (listenerClass != null)
-      {
-         List<ListenerMetaData> listeners = jbwmd.getListeners();
-         if (listeners == null)
-         {
-            listeners = new ArrayList<ListenerMetaData>();
-            jbwmd.setListeners(listeners);
-         }
-         ListenerMetaData listener = new ListenerMetaData();
-         listener.setListenerClass(listenerClass);
-      }
-
-      for (Iterator it = jbwmd.getServlets().iterator(); it.hasNext();)
-      {
-         JBossServletMetaData servlet = (JBossServletMetaData)it.next();
-         List<ParamValueMetaData> initParams = servlet.getInitParam();
-         if (initParams == null)
-         {
-            initParams = new ArrayList<ParamValueMetaData>();
-            servlet.setInitParam(initParams);
-         }
-
-         String linkName = servlet.getServletName();
-
-         // find the servlet-class
-         String orgServletClassName = servlet.getServletClass();
-
-         // JSP
-         if (orgServletClassName == null)
-            continue;
-
-         // Get the servlet class
-         Class orgServletClass = null;
-         try
-         {
-            ClassLoader loader = dep.getInitialClassLoader();
-            orgServletClass = loader.loadClass(orgServletClassName);
-         }
-         catch (ClassNotFoundException ex)
-         {
-            log.warn("Cannot load servlet class: " + orgServletClassName);
-         }
-
-         String targetBeanName = null;
-
-         // Nothing to do if we have an <init-param>
-         if (isAlreadyModified(servlet))
-         {
-            for (ParamValueMetaData initParam : initParams)
-            {
-               String paramName = initParam.getParamName();
-               String paramValue = initParam.getParamValue();
-               if (Endpoint.SEPID_DOMAIN_ENDPOINT.equals(paramName))
-               {
-                  targetBeanName = paramValue;
-               }
-            }
-         }
-         else
-         {
-            // Check if it is a real servlet that we can ignore
-            if (orgServletClass != null && javax.servlet.Servlet.class.isAssignableFrom(orgServletClass))
-            {
-               log.info("Ignore servlet: " + orgServletClassName);
-               continue;
-            }
-            else if (orgServletClassName.endsWith("Servlet"))
-            {
-               log.info("Ignore <servlet-class> that ends with 'Servlet': " + orgServletClassName);
-               continue;
-            }
-
-            servlet.setServletClass(servletClass);
-
-            // add additional init params
-            if (orgServletClassName.equals(servletClass) == false)
-            {
-               targetBeanName = orgServletClassName;
-               ParamValueMetaData initParam = new ParamValueMetaData();
-               initParam.setParamName(Endpoint.SEPID_DOMAIN_ENDPOINT);
-               initParam.setParamValue(targetBeanName);
-               initParams.add(initParam);
-            }
-         }
-
-         if (targetBeanName == null)
-            throw new IllegalStateException("Cannot obtain service endpoint bean for: " + linkName);
-
-         // remember the target bean name
-         results.sepTargetMap.put(linkName, targetBeanName);
-      }
-
-      return results;
-   }
-
-   // Return true if the web.xml is already modified
-   private boolean isAlreadyModified(JBossServletMetaData servlet)
-   {
-      for (ParamValueMetaData initParam : servlet.getInitParam())
-      {
-         String paramName = initParam.getParamName();
-         if (Endpoint.SEPID_DOMAIN_ENDPOINT.equals(paramName))
-            return true;
-      }
-      return false;
-   }
-}

Modified: trunk/webservices/src/main/org/jboss/wsf/container/jboss50/RuntimeLoaderDeploymentAspect.java
===================================================================
--- trunk/webservices/src/main/org/jboss/wsf/container/jboss50/RuntimeLoaderDeploymentAspect.java	2008-02-21 14:17:35 UTC (rev 70002)
+++ trunk/webservices/src/main/org/jboss/wsf/container/jboss50/RuntimeLoaderDeploymentAspect.java	2008-02-21 14:17:49 UTC (rev 70003)
@@ -40,27 +40,23 @@
 
    public void create(Deployment dep)
    {
-
-      // JSE endpoints
-      if (dep.getAttachment(JBossWebMetaData.class) != null)
-      {
-         JBossWebMetaData webMetaData = dep.getAttachment(JBossWebMetaData.class);
-         ClassLoader classLoader = webMetaData.getContextLoader();
-         dep.setRuntimeClassLoader(classLoader);
-      }
-
       // EJB3 endpoints
-      else if (dep.getAttachment(Ejb3Deployment.class) != null)
+      if (dep.getAttachment(Ejb3Deployment.class) != null)
       {
          dep.setRuntimeClassLoader(dep.getInitialClassLoader());
       }
-
       // EJB21 endpoints
       else if (dep.getAttachment(JBossMetaData.class) != null)
       {
          dep.setRuntimeClassLoader(dep.getInitialClassLoader());
       }
-
+      // JSE endpoints
+      else if (dep.getAttachment(JBossWebMetaData.class) != null)
+      {
+         JBossWebMetaData webMetaData = dep.getAttachment(JBossWebMetaData.class);
+         ClassLoader classLoader = webMetaData.getContextLoader();
+         dep.setRuntimeClassLoader(classLoader);
+      }
       else
       {
          throw new IllegalArgumentException("Unable to determine runtime loader");

Copied: trunk/webservices/src/main/org/jboss/wsf/container/jboss50/SecurityHandler.java (from rev 69991, trunk/webservices/src/main/org/jboss/wsf/container/jboss50/WebMetaDataSecurityHandler.java)
===================================================================
--- trunk/webservices/src/main/org/jboss/wsf/container/jboss50/SecurityHandler.java	                        (rev 0)
+++ trunk/webservices/src/main/org/jboss/wsf/container/jboss50/SecurityHandler.java	2008-02-21 14:17:49 UTC (rev 70003)
@@ -0,0 +1,42 @@
+/*
+ * 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$
+
+import org.jboss.metadata.web.jboss.JBossWebMetaData;
+import org.jboss.wsf.spi.deployment.Deployment;
+
+/**
+ * Handle web app security meta data 
+ * 
+ * @author Thomas.Diesler at jboss.org
+ * @since 12-May-2006
+ */
+public interface SecurityHandler
+{
+   /** Add the security domain to jboss-web.xml */
+   void addSecurityDomain(JBossWebMetaData jbossWeb, Deployment dep);
+   
+   /** Add the security roles to web.xml */
+   void addSecurityRoles(JBossWebMetaData webApp, Deployment dep);
+}

Copied: trunk/webservices/src/main/org/jboss/wsf/container/jboss50/SecurityHandlerEJB21.java (from rev 69991, trunk/webservices/src/main/org/jboss/wsf/container/jboss50/WebMetaDataSecurityHandlerEJB21.java)
===================================================================
--- trunk/webservices/src/main/org/jboss/wsf/container/jboss50/SecurityHandlerEJB21.java	                        (rev 0)
+++ trunk/webservices/src/main/org/jboss/wsf/container/jboss50/SecurityHandlerEJB21.java	2008-02-21 14:17:49 UTC (rev 70003)
@@ -0,0 +1,68 @@
+/*
+ * 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: SecurityHandlerEJB21.java 4013 2007-07-27 04:37:52Z thomas.diesler at jboss.com $
+
+import org.jboss.metadata.common.ejb.IAssemblyDescriptorMetaData;
+import org.jboss.metadata.ejb.jboss.JBossMetaData;
+import org.jboss.metadata.javaee.spec.SecurityRolesMetaData;
+import org.jboss.metadata.web.jboss.JBossWebMetaData;
+import org.jboss.wsf.spi.deployment.Deployment;
+import org.jboss.wsf.spi.metadata.j2ee.EJBArchiveMetaData;
+
+/**
+ * Handle web app security meta data for EJB21 
+ * 
+ * @author Thomas.Diesler at jboss.org
+ * @since 12-May-2006
+ */
+public class SecurityHandlerEJB21 implements SecurityHandler
+{
+   public void addSecurityDomain(JBossWebMetaData jbossWeb, Deployment dep)
+   {
+      EJBArchiveMetaData ejbMetaData = dep.getAttachment(EJBArchiveMetaData.class);
+      if (ejbMetaData == null)
+         throw new IllegalStateException("Cannot obtain application meta data");
+
+      String securityDomain = ejbMetaData.getSecurityDomain();
+      if (securityDomain != null)
+      {
+         if (securityDomain.startsWith("java:/jaas/") == false)
+            securityDomain = "java:/jaas/" + securityDomain;
+
+         jbossWeb.setSecurityDomain(securityDomain);
+      }
+   }
+
+   public void addSecurityRoles(JBossWebMetaData webApp, Deployment dep)
+   {
+      JBossMetaData jbmd = dep.getAttachment(JBossMetaData.class);
+      IAssemblyDescriptorMetaData assemblyDescriptor = jbmd.getAssemblyDescriptor();
+      if (assemblyDescriptor != null)
+      {
+         SecurityRolesMetaData securityRoles = assemblyDescriptor.getSecurityRoles();
+         if (securityRoles != null)
+            webApp.setSecurityRoles(securityRoles);
+      }
+   }
+}

Copied: trunk/webservices/src/main/org/jboss/wsf/container/jboss50/SecurityHandlerEJB3.java (from rev 69991, trunk/webservices/src/main/org/jboss/wsf/container/jboss50/WebMetaDataSecurityHandlerEJB3.java)
===================================================================
--- trunk/webservices/src/main/org/jboss/wsf/container/jboss50/SecurityHandlerEJB3.java	                        (rev 0)
+++ trunk/webservices/src/main/org/jboss/wsf/container/jboss50/SecurityHandlerEJB3.java	2008-02-21 14:17:49 UTC (rev 70003)
@@ -0,0 +1,100 @@
+/*
+ * 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$
+
+import java.util.Iterator;
+
+import javax.annotation.security.RolesAllowed;
+
+import org.jboss.ejb3.EJBContainer;
+import org.jboss.ejb3.Ejb3Deployment;
+import org.jboss.ejb3.annotation.SecurityDomain;
+import org.jboss.metadata.javaee.spec.SecurityRoleMetaData;
+import org.jboss.metadata.javaee.spec.SecurityRolesMetaData;
+import org.jboss.metadata.web.jboss.JBossWebMetaData;
+import org.jboss.wsf.spi.deployment.Deployment;
+
+/**
+ * Handle web app security meta data for EJB3 
+ * 
+ * @author Thomas.Diesler at jboss.org
+ * @since 12-May-2006
+ */
+public class SecurityHandlerEJB3 implements SecurityHandler
+{
+   public void addSecurityDomain(JBossWebMetaData jbossWeb, Deployment dep)
+   {
+      String securityDomain = null;
+
+      Ejb3Deployment ejb3Deployment = dep.getAttachment(Ejb3Deployment.class);
+      if (ejb3Deployment != null)
+      {
+         Iterator it = ejb3Deployment.getEjbContainers().values().iterator();
+         while (it.hasNext())
+         {
+            EJBContainer container = (EJBContainer)it.next();
+            SecurityDomain anSecurityDomain = (SecurityDomain)container.resolveAnnotation(SecurityDomain.class);
+            if (anSecurityDomain != null)
+            {
+               if (securityDomain != null && !securityDomain.equals(anSecurityDomain.value()))
+                  throw new IllegalStateException("Multiple security domains not supported");
+
+               securityDomain = anSecurityDomain.value();
+            }
+         }
+      }
+
+      if (securityDomain != null)
+      {
+         if (securityDomain.startsWith("java:/jaas/") == false)
+            securityDomain = "java:/jaas/" + securityDomain;
+
+         jbossWeb.setSecurityDomain(securityDomain);
+      }
+   }
+
+   public void addSecurityRoles(JBossWebMetaData webApp, Deployment dep)
+   {
+      Ejb3Deployment ejb3Deployment = dep.getAttachment(Ejb3Deployment.class);
+      if (ejb3Deployment != null)
+      {
+         Iterator it = ejb3Deployment.getEjbContainers().values().iterator();
+         while (it.hasNext())
+         {
+            EJBContainer container = (EJBContainer)it.next();
+            RolesAllowed anRolesAllowed = (RolesAllowed)container.resolveAnnotation(RolesAllowed.class);
+            if (anRolesAllowed != null)
+            {
+               SecurityRolesMetaData securityRoles = webApp.getSecurityRoles();
+               for (String roleName : anRolesAllowed.value())
+               {
+                  SecurityRoleMetaData role = new SecurityRoleMetaData();
+                  role.setRoleName(roleName);
+                  securityRoles.add(role);
+               }
+            }
+         }
+      }
+   }
+}

Deleted: trunk/webservices/src/main/org/jboss/wsf/container/jboss50/WebAppDeploymentAspect.java
===================================================================
--- trunk/webservices/src/main/org/jboss/wsf/container/jboss50/WebAppDeploymentAspect.java	2008-02-21 14:17:35 UTC (rev 70002)
+++ trunk/webservices/src/main/org/jboss/wsf/container/jboss50/WebAppDeploymentAspect.java	2008-02-21 14:17:49 UTC (rev 70003)
@@ -1,121 +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.wsf.container.jboss50;
-
-// $Id: WebAppDeployerDeployer.java 3772 2007-07-01 19:29:13Z thomas.diesler at jboss.com $
-
-import java.net.URL;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.jboss.deployers.client.spi.DeployerClient;
-import org.jboss.deployers.spi.attachments.MutableAttachments;
-import org.jboss.deployers.vfs.spi.client.VFSDeploymentFactory;
-import org.jboss.logging.Logger;
-import org.jboss.virtual.VFS;
-import org.jboss.virtual.VirtualFile;
-import org.jboss.wsf.spi.deployment.Deployment;
-import org.jboss.wsf.spi.deployment.DeploymentAspect;
-import org.jboss.wsf.spi.deployment.WSFDeploymentException;
-
-/**
- * Publish the HTTP service endpoint to Tomcat 
- * 
- * @author Thomas.Diesler at jboss.org
- * @since 12-May-2006
- */
-public class WebAppDeploymentAspect extends DeploymentAspect
-{
-   // provide logging
-   private static Logger log = Logger.getLogger(WebAppDeploymentAspect.class);
-
-   private DeployerClient mainDeployer;
-   private WebMetaDataModifier webMetaDataModifier;
-   private Map<String, org.jboss.deployers.client.spi.Deployment> deploymentMap = new HashMap<String, org.jboss.deployers.client.spi.Deployment>();
-
-   public void setMainDeployer(DeployerClient mainDeployer)
-   {
-      this.mainDeployer = mainDeployer;
-   }
-
-   public void setWebMetaDataModifier(WebMetaDataModifier webMetaDataModifier)
-   {
-      this.webMetaDataModifier = webMetaDataModifier;
-   }
-
-   public void create(Deployment dep)
-   {
-      URL warURL = (URL)dep.getProperty(WebMetaDataModifier.PROPERTY_WEBAPP_URL);
-      if (warURL == null)
-         throw new IllegalStateException("Cannot obtain generated webapp URL");
-
-      log.debug("publishServiceEndpoint: " + warURL);
-      try
-      {
-         webMetaDataModifier.modifyMetaData(dep);
-         org.jboss.deployers.client.spi.Deployment deployment = createDeploymentContext(warURL);
-         
-         // Mark the deployment as generated web app so the JSE deployer hook can ignore it 
-         MutableAttachments attach = (MutableAttachments)deployment.getPredeterminedManagedObjects();
-         attach.addAttachment(WebMetaDataModifier.PROPERTY_GENERATED_WEBAPP, Boolean.TRUE);
-
-         mainDeployer.deploy(deployment);
-
-         deploymentMap.put(warURL.toExternalForm(), deployment);
-      }
-      catch (Exception ex)
-      {
-         WSFDeploymentException.rethrow(ex);
-      }
-   }
-
-   public void destroy(Deployment dep)
-   {
-      URL warURL = (URL)dep.getProperty(WebMetaDataModifier.PROPERTY_WEBAPP_URL);
-      if (warURL == null)
-      {
-         log.error("Cannot obtain generated webapp URL");
-         return;
-      }
-
-      log.debug("destroyServiceEndpoint: " + warURL);
-      try
-      {
-         org.jboss.deployers.client.spi.Deployment deployment = deploymentMap.get(warURL.toExternalForm());
-         if (deployment != null)
-         {
-            mainDeployer.undeploy(deployment);
-            deploymentMap.remove(warURL.toExternalForm());
-         }
-      }
-      catch (Exception ex)
-      {
-         WSFDeploymentException.rethrow(ex);
-      }
-   }
-
-   private org.jboss.deployers.client.spi.Deployment createDeploymentContext(URL warURL) throws Exception
-   {
-      VirtualFile file = VFS.getRoot(warURL);
-      return VFSDeploymentFactory.getInstance().createVFSDeployment(file);
-   }
-}

Added: trunk/webservices/src/main/org/jboss/wsf/container/jboss50/WebAppDeploymentAspect.java
===================================================================
--- trunk/webservices/src/main/org/jboss/wsf/container/jboss50/WebAppDeploymentAspect.java	                        (rev 0)
+++ trunk/webservices/src/main/org/jboss/wsf/container/jboss50/WebAppDeploymentAspect.java	2008-02-21 14:17:49 UTC (rev 70003)
@@ -0,0 +1,74 @@
+/*
+ * 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$
+
+import javax.xml.ws.WebServiceException;
+
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.logging.Logger;
+import org.jboss.metadata.web.jboss.JBossWebMetaData;
+import org.jboss.wsf.spi.deployment.Deployment;
+import org.jboss.wsf.spi.deployment.DeploymentAspect;
+import org.jboss.wsf.spi.deployment.WSFDeploymentException;
+
+/**
+ * Deploy the generated webapp to JBoss
+ * 
+ * @author Thomas.Diesler at jboss.org
+ * @since 12-May-2006
+ */
+public class WebAppDeploymentAspect extends DeploymentAspect
+{
+   // provide logging
+   private static Logger log = Logger.getLogger(WebAppDeploymentAspect.class);
+
+   private WebMetaDataModifier webMetaDataModifier;
+
+   public void setWebMetaDataModifier(WebMetaDataModifier webMetaDataModifier)
+   {
+      this.webMetaDataModifier = webMetaDataModifier;
+   }
+
+   public void create(Deployment dep)
+   {
+      JBossWebMetaData jbwmd = dep.getAttachment(JBossWebMetaData.class);
+      if (jbwmd == null)
+         throw new WebServiceException("Cannot find web meta data");
+
+      try
+      {
+         webMetaDataModifier.modifyMetaData(dep);
+         
+         DeploymentUnit deployment = dep.getAttachment(DeploymentUnit.class);
+         deployment.addAttachment(JBossWebMetaData.class, jbwmd);
+
+         // Mark the deployment as generated web app so the JSE deployer hook can ignore it 
+         deployment.addAttachment(WebMetaDataModifier.PROPERTY_GENERATED_WEBAPP, Boolean.TRUE);
+      }
+      catch (Exception ex)
+      {
+         WSFDeploymentException.rethrow(ex);
+      }
+   }
+}


Property changes on: trunk/webservices/src/main/org/jboss/wsf/container/jboss50/WebAppDeploymentAspect.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Copied: trunk/webservices/src/main/org/jboss/wsf/container/jboss50/WebAppGeneratorDeploymentAspect.java (from rev 69991, trunk/webservices/src/main/org/jboss/wsf/container/jboss50/InMemoryWebAppGeneratorDeploymentAspect.java)
===================================================================
--- trunk/webservices/src/main/org/jboss/wsf/container/jboss50/WebAppGeneratorDeploymentAspect.java	                        (rev 0)
+++ trunk/webservices/src/main/org/jboss/wsf/container/jboss50/WebAppGeneratorDeploymentAspect.java	2008-02-21 14:17:49 UTC (rev 70003)
@@ -0,0 +1,264 @@
+/*
+ * 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$
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.jboss.metadata.web.jboss.JBossServletMetaData;
+import org.jboss.metadata.web.jboss.JBossServletsMetaData;
+import org.jboss.metadata.web.jboss.JBossWebMetaData;
+import org.jboss.metadata.web.spec.AuthConstraintMetaData;
+import org.jboss.metadata.web.spec.LoginConfigMetaData;
+import org.jboss.metadata.web.spec.SecurityConstraintMetaData;
+import org.jboss.metadata.web.spec.ServletMappingMetaData;
+import org.jboss.metadata.web.spec.TransportGuaranteeType;
+import org.jboss.metadata.web.spec.UserDataConstraintMetaData;
+import org.jboss.metadata.web.spec.WebResourceCollectionMetaData;
+import org.jboss.metadata.web.spec.WebResourceCollectionsMetaData;
+import org.jboss.wsf.spi.annotation.WebContext;
+import org.jboss.wsf.spi.deployment.ArchiveDeployment;
+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.WSFDeploymentException;
+import org.jboss.wsf.spi.metadata.j2ee.EJBArchiveMetaData;
+import org.jboss.wsf.spi.metadata.j2ee.EJBMetaData;
+import org.jboss.wsf.spi.metadata.j2ee.EJBSecurityMetaData;
+
+/**
+ * A deployment aspect that generates a webapp for an EJB endpoint 
+ * 
+ * @author Thomas.Diesler at jboss.org
+ * @since 13-Oct-2007
+ */
+public class WebAppGeneratorDeploymentAspect extends DeploymentAspect
+{
+   private SecurityHandler securityHandlerEJB21;
+   private SecurityHandler securityHandlerEJB3;
+
+   public void setSecurityHandlerEJB21(SecurityHandler handler)
+   {
+      this.securityHandlerEJB21 = handler;
+   }
+
+   public void setSecurityHandlerEJB3(SecurityHandler handler)
+   {
+      this.securityHandlerEJB3 = handler;
+   }
+
+   @Override
+   public void create(Deployment dep)
+   {
+      String typeStr = dep.getType().toString();
+      if (typeStr.endsWith("EJB21"))
+      {
+         JBossWebMetaData jbwmd = generatWebDeployment((ArchiveDeployment)dep, securityHandlerEJB21);
+         dep.addAttachment(JBossWebMetaData.class, jbwmd);
+      }
+      else if (typeStr.endsWith("EJB3"))
+      {
+         JBossWebMetaData jbwmd = generatWebDeployment((ArchiveDeployment)dep, securityHandlerEJB3);
+         dep.addAttachment(JBossWebMetaData.class, jbwmd);
+      }
+      else
+      {
+         JBossWebMetaData jbwmd = generatWebDeployment((ArchiveDeployment)dep, null);
+         dep.addAttachment(JBossWebMetaData.class, jbwmd);
+      }
+   }
+
+   protected JBossWebMetaData generatWebDeployment(ArchiveDeployment dep, SecurityHandler securityHandler)
+   {
+      JBossWebMetaData jbwmd = new JBossWebMetaData();
+      createWebAppDescriptor(dep, jbwmd, securityHandler);
+      createJBossWebAppDescriptor(dep, jbwmd, securityHandler);
+      return jbwmd;
+   }
+
+   protected void createWebAppDescriptor(Deployment dep, JBossWebMetaData jbwmd, SecurityHandler securityHandler)
+   {
+      /*
+       <servlet>
+       <servlet-name>
+       <servlet-class>
+       </servlet>
+       */
+      JBossServletsMetaData servlets = jbwmd.getServlets();
+      for (Endpoint ep : dep.getService().getEndpoints())
+      {
+         JBossServletMetaData servlet = new JBossServletMetaData();
+         servlet.setServletName(ep.getShortName());
+         servlet.setServletClass(ep.getTargetBeanName());
+         servlets.add(servlet);
+      }
+
+      /*
+       <servlet-mapping>
+       <servlet-name>
+       <url-pattern>
+       </servlet-mapping>
+       */
+      for (Endpoint ep : dep.getService().getEndpoints())
+      {
+         List<ServletMappingMetaData> servletMappings = jbwmd.getServletMappings();
+         if (servletMappings == null)
+         {
+            servletMappings = new ArrayList<ServletMappingMetaData>();
+            jbwmd.setServletMappings(servletMappings);
+         }
+         ServletMappingMetaData servletMapping = new ServletMappingMetaData();
+         servletMapping.setServletName(ep.getShortName());
+         servletMapping.setUrlPatterns(Arrays.asList(new String[] { ep.getURLPattern() }));
+         servletMappings.add(servletMapping);
+      }
+
+      String authMethod = null;
+
+      // Add web-app/security-constraint for each port component
+      for (Endpoint ep : dep.getService().getEndpoints())
+      {
+         String ejbName = ep.getShortName();
+
+         Boolean secureWSDLAccess = null;
+         String transportGuarantee = null;
+         String beanAuthMethod = null;
+
+         WebContext anWebContext = (WebContext)ep.getTargetBeanClass().getAnnotation(WebContext.class);
+         if (anWebContext != null)
+         {
+            if (anWebContext.authMethod().length() > 0)
+               beanAuthMethod = anWebContext.authMethod();
+            if (anWebContext.transportGuarantee().length() > 0)
+               transportGuarantee = anWebContext.transportGuarantee();
+            if (anWebContext.secureWSDLAccess())
+               secureWSDLAccess = anWebContext.secureWSDLAccess();
+         }
+
+         EJBArchiveMetaData appMetaData = dep.getAttachment(EJBArchiveMetaData.class);
+         if (appMetaData != null && appMetaData.getBeanByEjbName(ejbName) != null)
+         {
+            EJBMetaData bmd = appMetaData.getBeanByEjbName(ejbName);
+            EJBSecurityMetaData smd = bmd.getSecurityMetaData();
+            if (smd != null)
+            {
+               beanAuthMethod = smd.getAuthMethod();
+               transportGuarantee = smd.getTransportGuarantee();
+               secureWSDLAccess = smd.getSecureWSDLAccess();
+            }
+         }
+
+         if (beanAuthMethod != null || transportGuarantee != null)
+         {
+            /*
+             <security-constraint>
+             <web-resource-collection>
+             <web-resource-name>TestUnAuthPort</web-resource-name>
+             <url-pattern>/HSTestRoot/TestUnAuth/*</url-pattern>
+             </web-resource-collection>
+             <auth-constraint>
+             <role-name>*</role-name>
+             </auth-constraint>
+             <user-data-constraint>
+             <transport-guarantee>NONE</transport-guarantee>
+             </user-data-constraint>
+             </security-constraint>
+             */
+            List<SecurityConstraintMetaData> securityContraints = jbwmd.getSecurityContraints();
+            if (securityContraints == null)
+            {
+               securityContraints = new ArrayList<SecurityConstraintMetaData>();
+               jbwmd.setSecurityContraints(securityContraints);
+            }
+            SecurityConstraintMetaData securityConstraint = new SecurityConstraintMetaData();
+            WebResourceCollectionsMetaData resourceCollections = securityConstraint.getResourceCollections();
+            if (resourceCollections == null)
+            {
+               resourceCollections = new WebResourceCollectionsMetaData();
+               securityConstraint.setResourceCollections(resourceCollections);
+            }
+            WebResourceCollectionMetaData wrc = new WebResourceCollectionMetaData();
+            wrc.setWebResourceName(ejbName);
+            wrc.setUrlPatterns(Arrays.asList(new String[] { ep.getURLPattern() }));
+            ArrayList<String> httpMethods = new ArrayList<String>();
+            wrc.setHttpMethods(httpMethods);
+            if (Boolean.TRUE.equals(secureWSDLAccess))
+            {
+               httpMethods.add("GET");
+            }
+            httpMethods.add("POST");
+
+            // Optional auth-constraint
+            if (beanAuthMethod != null)
+            {
+               // Only the first auth-method gives the war login-config/auth-method
+               if (authMethod == null)
+                  authMethod = beanAuthMethod;
+
+               AuthConstraintMetaData authConstraint = new AuthConstraintMetaData();
+               authConstraint.setRoleNames(Arrays.asList(new String[] { "*" }));
+               securityConstraint.setAuthConstraint(authConstraint);
+            }
+            // Optional user-data-constraint
+            if (transportGuarantee != null)
+            {
+               UserDataConstraintMetaData userDataConstraint = new UserDataConstraintMetaData();
+               userDataConstraint.setTransportGuarantee(TransportGuaranteeType.valueOf(transportGuarantee));
+               securityConstraint.setUserDataConstraint(userDataConstraint);
+            }
+         }
+      }
+
+      // Optional login-config/auth-method
+      if (authMethod != null && securityHandler != null)
+      {
+         LoginConfigMetaData loginConfig = jbwmd.getLoginConfig();
+         loginConfig.setAuthMethod(authMethod);
+         loginConfig.setRealmName("EJBServiceEndpointServlet Realm");
+
+         securityHandler.addSecurityRoles(jbwmd, dep);
+      }
+   }
+
+   protected void createJBossWebAppDescriptor(Deployment dep, JBossWebMetaData jbwmd, SecurityHandler securityHandler)
+   {
+      /* Create a jboss-web
+       <jboss-web>
+       <security-domain>java:/jaas/cts</security-domain>
+       <context-root>/ws/ejbN/</context-root>
+       <virtual-host>some.domain.com</virtual-host>
+       </jboss-web>
+       */
+      if (securityHandler != null)
+         securityHandler.addSecurityDomain(jbwmd, dep);
+
+      // Get the context root for this deployment
+      String contextRoot = dep.getService().getContextRoot();
+      if (contextRoot == null)
+         throw new WSFDeploymentException("Cannot obtain context root");
+
+      jbwmd.setContextRoot(contextRoot);
+   }
+}

Copied: trunk/webservices/src/main/org/jboss/wsf/container/jboss50/WebMetaDataModifierImpl.java (from rev 69990, trunk/webservices/src/main/org/jboss/wsf/container/jboss50/InMemoryWebMetaDataModifier.java)
===================================================================
--- trunk/webservices/src/main/org/jboss/wsf/container/jboss50/WebMetaDataModifierImpl.java	                        (rev 0)
+++ trunk/webservices/src/main/org/jboss/wsf/container/jboss50/WebMetaDataModifierImpl.java	2008-02-21 14:17:49 UTC (rev 70003)
@@ -0,0 +1,205 @@
+/*
+ * 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;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import javax.xml.ws.WebServiceException;
+
+import org.jboss.logging.Logger;
+import org.jboss.metadata.javaee.spec.ParamValueMetaData;
+import org.jboss.metadata.web.jboss.JBossServletMetaData;
+import org.jboss.metadata.web.jboss.JBossWebMetaData;
+import org.jboss.metadata.web.spec.ListenerMetaData;
+import org.jboss.wsf.spi.deployment.Deployment;
+import org.jboss.wsf.spi.deployment.Endpoint;
+
+/**
+ * The rewriter for web.xml
+ *
+ * @author Thomas.Diesler at jboss.org
+ * @since 19-May-2007
+ */
+public class WebMetaDataModifierImpl implements WebMetaDataModifier
+{
+   // logging support
+   private static Logger log = Logger.getLogger(WebMetaDataModifierImpl.class);
+
+   public RewriteResults modifyMetaData(Deployment dep)
+   {
+      JBossWebMetaData jbwmd = dep.getAttachment(JBossWebMetaData.class);
+      if (jbwmd == null)
+         throw new WebServiceException("Cannot find web meta data");
+
+      try
+      {
+         RewriteResults results = modifyMetaData(dep, jbwmd);
+         return results;
+      }
+      catch (RuntimeException rte)
+      {
+         throw rte;
+      }
+      catch (Exception e)
+      {
+         throw new WebServiceException(e);
+      }
+   }
+
+   private RewriteResults modifyMetaData(Deployment dep, JBossWebMetaData jbwmd) throws ClassNotFoundException
+   {
+      RewriteResults results = new RewriteResults();
+
+      String servletClass = (String)dep.getProperty(PROPERTY_WEBAPP_SERVLET_CLASS);
+      if (servletClass == null)
+         throw new IllegalStateException("Cannot obtain context property: " + PROPERTY_WEBAPP_SERVLET_CLASS);
+
+      Map<String, String> depCtxParams = (Map<String, String>)dep.getProperty(PROPERTY_WEBAPP_CONTEXT_PARAMETERS);
+      if (depCtxParams != null)
+      {
+         List<ParamValueMetaData> contextParams = jbwmd.getContextParams();
+         if (contextParams == null)
+         {
+            contextParams = new ArrayList<ParamValueMetaData>();
+            jbwmd.setContextParams(contextParams);
+         }
+
+         for (Map.Entry<String, String> entry : depCtxParams.entrySet())
+         {
+            ParamValueMetaData param = new ParamValueMetaData();
+            param.setParamName(entry.getKey());
+            param.setParamValue(entry.getValue());
+            contextParams.add(param);
+         }
+      }
+
+      String listenerClass = (String)dep.getProperty(PROPERTY_WEBAPP_SERVLET_CONTEXT_LISTENER);
+      if (listenerClass != null)
+      {
+         List<ListenerMetaData> listeners = jbwmd.getListeners();
+         if (listeners == null)
+         {
+            listeners = new ArrayList<ListenerMetaData>();
+            jbwmd.setListeners(listeners);
+         }
+         ListenerMetaData listener = new ListenerMetaData();
+         listener.setListenerClass(listenerClass);
+      }
+
+      for (Iterator it = jbwmd.getServlets().iterator(); it.hasNext();)
+      {
+         JBossServletMetaData servlet = (JBossServletMetaData)it.next();
+         List<ParamValueMetaData> initParams = servlet.getInitParam();
+         if (initParams == null)
+         {
+            initParams = new ArrayList<ParamValueMetaData>();
+            servlet.setInitParam(initParams);
+         }
+
+         String linkName = servlet.getServletName();
+
+         // find the servlet-class
+         String orgServletClassName = servlet.getServletClass();
+
+         // JSP
+         if (orgServletClassName == null)
+            continue;
+
+         // Get the servlet class
+         Class orgServletClass = null;
+         try
+         {
+            ClassLoader loader = dep.getInitialClassLoader();
+            orgServletClass = loader.loadClass(orgServletClassName);
+         }
+         catch (ClassNotFoundException ex)
+         {
+            log.warn("Cannot load servlet class: " + orgServletClassName);
+         }
+
+         String targetBeanName = null;
+
+         // Nothing to do if we have an <init-param>
+         if (isAlreadyModified(servlet))
+         {
+            for (ParamValueMetaData initParam : initParams)
+            {
+               String paramName = initParam.getParamName();
+               String paramValue = initParam.getParamValue();
+               if (Endpoint.SEPID_DOMAIN_ENDPOINT.equals(paramName))
+               {
+                  targetBeanName = paramValue;
+               }
+            }
+         }
+         else
+         {
+            // Check if it is a real servlet that we can ignore
+            if (orgServletClass != null && javax.servlet.Servlet.class.isAssignableFrom(orgServletClass))
+            {
+               log.info("Ignore servlet: " + orgServletClassName);
+               continue;
+            }
+            else if (orgServletClassName.endsWith("Servlet"))
+            {
+               log.info("Ignore <servlet-class> that ends with 'Servlet': " + orgServletClassName);
+               continue;
+            }
+
+            servlet.setServletClass(servletClass);
+
+            // add additional init params
+            if (orgServletClassName.equals(servletClass) == false)
+            {
+               targetBeanName = orgServletClassName;
+               ParamValueMetaData initParam = new ParamValueMetaData();
+               initParam.setParamName(Endpoint.SEPID_DOMAIN_ENDPOINT);
+               initParam.setParamValue(targetBeanName);
+               initParams.add(initParam);
+            }
+         }
+
+         if (targetBeanName == null)
+            throw new IllegalStateException("Cannot obtain service endpoint bean for: " + linkName);
+
+         // remember the target bean name
+         results.sepTargetMap.put(linkName, targetBeanName);
+      }
+
+      return results;
+   }
+
+   // Return true if the web.xml is already modified
+   private boolean isAlreadyModified(JBossServletMetaData servlet)
+   {
+      for (ParamValueMetaData initParam : servlet.getInitParam())
+      {
+         String paramName = initParam.getParamName();
+         if (Endpoint.SEPID_DOMAIN_ENDPOINT.equals(paramName))
+            return true;
+      }
+      return false;
+   }
+}

Deleted: trunk/webservices/src/main/org/jboss/wsf/container/jboss50/WebMetaDataSecurityHandler.java
===================================================================
--- trunk/webservices/src/main/org/jboss/wsf/container/jboss50/WebMetaDataSecurityHandler.java	2008-02-21 14:17:35 UTC (rev 70002)
+++ trunk/webservices/src/main/org/jboss/wsf/container/jboss50/WebMetaDataSecurityHandler.java	2008-02-21 14:17:49 UTC (rev 70003)
@@ -1,42 +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.wsf.container.jboss50;
-
-//$Id$
-
-import org.jboss.metadata.web.jboss.JBossWebMetaData;
-import org.jboss.wsf.spi.deployment.Deployment;
-
-/**
- * Handle web app security meta data 
- * 
- * @author Thomas.Diesler at jboss.org
- * @since 12-May-2006
- */
-public interface WebMetaDataSecurityHandler
-{
-   /** Add the security domain to jboss-web.xml */
-   void addSecurityDomain(JBossWebMetaData jbossWeb, Deployment dep);
-   
-   /** Add the security roles to web.xml */
-   void addSecurityRoles(JBossWebMetaData webApp, Deployment dep);
-}

Deleted: trunk/webservices/src/main/org/jboss/wsf/container/jboss50/WebMetaDataSecurityHandlerEJB21.java
===================================================================
--- trunk/webservices/src/main/org/jboss/wsf/container/jboss50/WebMetaDataSecurityHandlerEJB21.java	2008-02-21 14:17:35 UTC (rev 70002)
+++ trunk/webservices/src/main/org/jboss/wsf/container/jboss50/WebMetaDataSecurityHandlerEJB21.java	2008-02-21 14:17:49 UTC (rev 70003)
@@ -1,68 +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.wsf.container.jboss50;
-
-//$Id: SecurityHandlerEJB21.java 4013 2007-07-27 04:37:52Z thomas.diesler at jboss.com $
-
-import org.jboss.metadata.common.ejb.IAssemblyDescriptorMetaData;
-import org.jboss.metadata.ejb.jboss.JBossMetaData;
-import org.jboss.metadata.javaee.spec.SecurityRolesMetaData;
-import org.jboss.metadata.web.jboss.JBossWebMetaData;
-import org.jboss.wsf.spi.deployment.Deployment;
-import org.jboss.wsf.spi.metadata.j2ee.EJBArchiveMetaData;
-
-/**
- * Handle web app security meta data for EJB21 
- * 
- * @author Thomas.Diesler at jboss.org
- * @since 12-May-2006
- */
-public class WebMetaDataSecurityHandlerEJB21 implements WebMetaDataSecurityHandler
-{
-   public void addSecurityDomain(JBossWebMetaData jbossWeb, Deployment dep)
-   {
-      EJBArchiveMetaData ejbMetaData = dep.getAttachment(EJBArchiveMetaData.class);
-      if (ejbMetaData == null)
-         throw new IllegalStateException("Cannot obtain application meta data");
-
-      String securityDomain = ejbMetaData.getSecurityDomain();
-      if (securityDomain != null)
-      {
-         if (securityDomain.startsWith("java:/jaas/") == false)
-            securityDomain = "java:/jaas/" + securityDomain;
-
-         jbossWeb.setSecurityDomain(securityDomain);
-      }
-   }
-
-   public void addSecurityRoles(JBossWebMetaData webApp, Deployment dep)
-   {
-      JBossMetaData jbmd = dep.getAttachment(JBossMetaData.class);
-      IAssemblyDescriptorMetaData assemblyDescriptor = jbmd.getAssemblyDescriptor();
-      if (assemblyDescriptor != null)
-      {
-         SecurityRolesMetaData securityRoles = assemblyDescriptor.getSecurityRoles();
-         if (securityRoles != null)
-            webApp.setSecurityRoles(securityRoles);
-      }
-   }
-}

Deleted: trunk/webservices/src/main/org/jboss/wsf/container/jboss50/WebMetaDataSecurityHandlerEJB3.java
===================================================================
--- trunk/webservices/src/main/org/jboss/wsf/container/jboss50/WebMetaDataSecurityHandlerEJB3.java	2008-02-21 14:17:35 UTC (rev 70002)
+++ trunk/webservices/src/main/org/jboss/wsf/container/jboss50/WebMetaDataSecurityHandlerEJB3.java	2008-02-21 14:17:49 UTC (rev 70003)
@@ -1,100 +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.wsf.container.jboss50;
-
-//$Id$
-
-import java.util.Iterator;
-
-import javax.annotation.security.RolesAllowed;
-
-import org.jboss.ejb3.EJBContainer;
-import org.jboss.ejb3.Ejb3Deployment;
-import org.jboss.ejb3.annotation.SecurityDomain;
-import org.jboss.metadata.javaee.spec.SecurityRoleMetaData;
-import org.jboss.metadata.javaee.spec.SecurityRolesMetaData;
-import org.jboss.metadata.web.jboss.JBossWebMetaData;
-import org.jboss.wsf.spi.deployment.Deployment;
-
-/**
- * Handle web app security meta data for EJB3 
- * 
- * @author Thomas.Diesler at jboss.org
- * @since 12-May-2006
- */
-public class WebMetaDataSecurityHandlerEJB3 implements WebMetaDataSecurityHandler
-{
-   public void addSecurityDomain(JBossWebMetaData jbossWeb, Deployment dep)
-   {
-      String securityDomain = null;
-
-      Ejb3Deployment ejb3Deployment = dep.getAttachment(Ejb3Deployment.class);
-      if (ejb3Deployment != null)
-      {
-         Iterator it = ejb3Deployment.getEjbContainers().values().iterator();
-         while (it.hasNext())
-         {
-            EJBContainer container = (EJBContainer)it.next();
-            SecurityDomain anSecurityDomain = (SecurityDomain)container.resolveAnnotation(SecurityDomain.class);
-            if (anSecurityDomain != null)
-            {
-               if (securityDomain != null && !securityDomain.equals(anSecurityDomain.value()))
-                  throw new IllegalStateException("Multiple security domains not supported");
-
-               securityDomain = anSecurityDomain.value();
-            }
-         }
-      }
-
-      if (securityDomain != null)
-      {
-         if (securityDomain.startsWith("java:/jaas/") == false)
-            securityDomain = "java:/jaas/" + securityDomain;
-
-         jbossWeb.setSecurityDomain(securityDomain);
-      }
-   }
-
-   public void addSecurityRoles(JBossWebMetaData webApp, Deployment dep)
-   {
-      Ejb3Deployment ejb3Deployment = dep.getAttachment(Ejb3Deployment.class);
-      if (ejb3Deployment != null)
-      {
-         Iterator it = ejb3Deployment.getEjbContainers().values().iterator();
-         while (it.hasNext())
-         {
-            EJBContainer container = (EJBContainer)it.next();
-            RolesAllowed anRolesAllowed = (RolesAllowed)container.resolveAnnotation(RolesAllowed.class);
-            if (anRolesAllowed != null)
-            {
-               SecurityRolesMetaData securityRoles = webApp.getSecurityRoles();
-               for (String roleName : anRolesAllowed.value())
-               {
-                  SecurityRoleMetaData role = new SecurityRoleMetaData();
-                  role.setRoleName(roleName);
-                  securityRoles.add(role);
-               }
-            }
-         }
-      }
-   }
-}

Modified: trunk/webservices/src/main/org/jboss/wsf/container/jboss50/WebServiceDeployerEJB.java
===================================================================
--- trunk/webservices/src/main/org/jboss/wsf/container/jboss50/WebServiceDeployerEJB.java	2008-02-21 14:17:35 UTC (rev 70002)
+++ trunk/webservices/src/main/org/jboss/wsf/container/jboss50/WebServiceDeployerEJB.java	2008-02-21 14:17:49 UTC (rev 70003)
@@ -33,6 +33,7 @@
 {
    private int relOrderEJB2x;
    private int relOrderEJB3;
+   private int relOrderWar;
    
    public void setRelOrderEJB2x(int relOrderEJB2x)
    {
@@ -44,10 +45,19 @@
       this.relOrderEJB3 = relOrderEJB3;
    }
    
+   public void setRelOrderWar(int relOrderWar)
+   {
+      this.relOrderWar = relOrderWar;
+   }
+
    @Override
    public int getRelativeOrder()
    {
-      return Math.max(relOrderEJB2x, relOrderEJB3) + 1;
+      int relOrderEJB = Math.max(relOrderEJB2x, relOrderEJB3) + 1;
+      if (relOrderEJB >= relOrderWar)
+         throw new IllegalStateException("relOrderEJB (" + relOrderEJB + ") >= relOrderWar (" + relOrderWar + ")");
+      
+      return relOrderEJB;
    }
    
 }

Modified: trunk/webservices/src/resources/jbossws-jboss50.deployer/META-INF/jbossws-deployer-beans.xml
===================================================================
--- trunk/webservices/src/resources/jbossws-jboss50.deployer/META-INF/jbossws-deployer-beans.xml	2008-02-21 14:17:35 UTC (rev 70002)
+++ trunk/webservices/src/resources/jbossws-jboss50.deployer/META-INF/jbossws-deployer-beans.xml	2008-02-21 14:17:49 UTC (rev 70003)
@@ -4,16 +4,12 @@
   
   <!-- Locate the single instance of the kernel -->
   <bean name="WSKernelLocator" class="org.jboss.wsf.spi.util.KernelLocator">
-    <property name="kernel">
-      <inject bean="jboss.kernel:service=Kernel"/>
-    </property>
+    <property name="kernel"><inject bean="jboss.kernel:service=Kernel"/></property>
   </bean>
   
   <!-- Locate the single instance of the MBeanServer -->
   <bean name="WSMBeanServerLocator" class="org.jboss.wsf.framework.management.MBeanServerLocator">
-    <property name="mbeanServer">
-      <inject bean="JMXKernel" property="mbeanServer"/>
-    </property>
+    <property name="mbeanServer"><inject bean="JMXKernel" property="mbeanServer"/></property>
   </bean>
   
   <!-- The HTTPServer used by the JAXWS Endpoint API -->
@@ -25,7 +21,7 @@
   There are two deployers registered with the JBoss Main Deployer. 
   The order of which is important
   
-  1) EJBDeployer < WebServiceDeployerEJB
+  1) EJBDeployer < WebServiceDeployerEJB < WarDeployer
   2) WebServiceDeployerPreJSE < WarDeployer 
   3) WarDeployer < WebServiceDeployerPostJSE
   
@@ -62,12 +58,9 @@
   A web service deployer that hooks in after the EJB deployers
   -->
   <bean name="WebServiceDeployerEJB" class="org.jboss.wsf.container.jboss50.WebServiceDeployerEJB">
-    <property name="relOrderEJB2x">
-      <inject bean="EJB2xDeployer" property="relativeOrder"/>
-    </property>
-    <property name="relOrderEJB3">
-      <inject bean="Ejb3Deployer" property="relativeOrder"/>
-    </property>
+    <property name="relOrderEJB2x"><inject bean="EJB2xDeployer" property="relativeOrder"/></property>
+    <property name="relOrderEJB3"><inject bean="Ejb3Deployer" property="relativeOrder"/></property>
+    <property name="relOrderWar"><inject bean="WarDeployer" property="relativeOrder"/></property>
     <depends>EJB2xDeployer</depends>
     <depends>Ejb3Deployer</depends>
   </bean>
@@ -76,9 +69,7 @@
   A web service deployer that hooks in before the WAR deployer
   -->
   <bean name="WebServiceDeployerPreJSE" class="org.jboss.wsf.container.jboss50.WebServiceDeployerPreJSE">
-    <property name="relOrderWar">
-      <inject bean="WarDeployer" property="relativeOrder"/>
-    </property>
+    <property name="relOrderWar"><inject bean="WarDeployer" property="relativeOrder"/></property>
     <depends>WebAppParsingDeployer</depends>
   </bean>
   
@@ -87,9 +78,7 @@
   This deployer depends on the RuntimeClassloader being available.
   -->
   <bean name="WebServiceDeployerPostJSE" class="org.jboss.wsf.container.jboss50.WebServiceDeployerPostJSE">
-    <property name="relOrderWar">
-      <inject bean="WarDeployer" property="relativeOrder"/>
-    </property>
+    <property name="relOrderWar"><inject bean="WarDeployer" property="relativeOrder"/></property>
     <depends>WebAppParsingDeployer</depends>
   </bean>
   
@@ -196,9 +185,7 @@
     <property name="name">WSDeploymentAspectManagerPreJSE</property>
   </bean>
   <bean name="WSDeploymentAspectManagerPostJSE" class="org.jboss.wsf.framework.deployment.DeploymentAspectManagerImpl">
-    <property name="parent">
-      <inject bean="WSDeploymentAspectManagerPreJSE"/>
-    </property>
+    <property name="parent"><inject bean="WSDeploymentAspectManagerPreJSE"/></property>
     <property name="name">WSDeploymentAspectManagerPostJSE</property>
   </bean>
   <bean name="WSDeploymentAspectManagerEJB" class="org.jboss.wsf.framework.deployment.DeploymentAspectManagerImpl">
@@ -254,9 +241,7 @@
   
   <bean name="WSModifyWebMetaDataDeploymentAspect" class="org.jboss.wsf.container.jboss50.ModifyWebMetaDataDeploymentAspect">
     <property name="requires">ContextProperties, StackDescriptor</property>
-    <property name="webMetaDataModifier">
-      <inject bean="WSMemoryWebMetaDataModifier"/>
-    </property>
+    <property name="webMetaDataModifier"><inject bean="WSWebMetaDataModifier"/></property>
   </bean>
   
   <bean name="WSRuntimeLoaderDeploymentAspect" class="org.jboss.wsf.container.jboss50.RuntimeLoaderDeploymentAspect">
@@ -271,38 +256,26 @@
   
   <bean name="WSWebAppDeploymentAspect" class="org.jboss.wsf.container.jboss50.WebAppDeploymentAspect">
     <property name="requires">WebMetaData, ContextProperties</property>
-    <property name="webMetaDataModifier">
-      <inject bean="WSFileWebMetaDataModifier"/>
-    </property>
-    <property name="mainDeployer">
-      <inject bean="MainDeployer"/>
-    </property>
+    <property name="webMetaDataModifier"><inject bean="WSWebMetaDataModifier"/></property>
   </bean>
   
-  <bean name="WSWebAppGeneratorDeploymentAspect" class="org.jboss.wsf.container.jboss50.FileBasedWebAppGeneratorDeploymentAspect">
+  <bean name="WSWebAppGeneratorDeploymentAspect" class="org.jboss.wsf.container.jboss50.WebAppGeneratorDeploymentAspect">
     <property name="requires">URLPattern</property>
     <property name="provides">WebMetaData</property>
-    <property name="securityHandlerEJB21">
-      <inject bean="WSSecurityHandlerEJB21"/>
-    </property>
-    <property name="securityHandlerEJB3">
-      <inject bean="WSSecurityHandlerEJB3"/>
-    </property>
+    <property name="securityHandlerEJB21"><inject bean="WSSecurityHandlerEJB21"/></property>
+    <property name="securityHandlerEJB3"><inject bean="WSSecurityHandlerEJB3"/></property>
   </bean>
   
   <!-- Deployment aspect helper beans -->
-  <bean name="WSSecurityHandlerEJB21" class="org.jboss.wsf.container.jboss50.FileBasedSecurityHandlerEJB21"/>
-  <bean name="WSSecurityHandlerEJB3" class="org.jboss.wsf.container.jboss50.FileBasedSecurityHandlerEJB3"/>
-  <bean name="WSFileWebMetaDataModifier" class="org.jboss.wsf.container.jboss50.FileBasedWebMetaDataModifier"/>
-  <bean name="WSMemoryWebMetaDataModifier" class="org.jboss.wsf.container.jboss50.InMemoryWebMetaDataModifier"/>
+  <bean name="WSSecurityHandlerEJB21" class="org.jboss.wsf.container.jboss50.SecurityHandlerEJB21"/>
+  <bean name="WSSecurityHandlerEJB3" class="org.jboss.wsf.container.jboss50.SecurityHandlerEJB3"/>
+  <bean name="WSWebMetaDataModifier" class="org.jboss.wsf.container.jboss50.WebMetaDataModifierImpl"/>
   
   <!-- Deployment aspect installers -->
   
   <!-- Phase 1 -->
   <bean name="WSDeploymentAspectInstallerPreJSE" class="org.jboss.wsf.framework.deployment.DeploymentAspectInstaller">
-    <property name="manager">
-      <inject bean="WSDeploymentAspectManagerPreJSE"/>
-    </property>
+    <property name="manager"><inject bean="WSDeploymentAspectManagerPreJSE"/></property>
     <property name="sortAspectsOnCreate">false</property>
     <property name="aspects">
       <set class="java.util.HashSet" elementClass="org.jboss.wsf.spi.deployment.DeploymentAspect">
@@ -321,9 +294,7 @@
   
   <!-- Phase 2 -->
   <bean name="WSDeploymentAspectInstallerPostJSE" class="org.jboss.wsf.framework.deployment.DeploymentAspectInstaller">
-    <property name="manager">
-      <inject bean="WSDeploymentAspectManagerPostJSE"/>
-    </property>
+    <property name="manager"><inject bean="WSDeploymentAspectManagerPostJSE"/></property>
     <property name="sortAspectsOnCreate">false</property>
     <property name="aspects">
       <set class="java.util.HashSet" elementClass="org.jboss.wsf.spi.deployment.DeploymentAspect">
@@ -334,9 +305,7 @@
   </bean>
   
   <bean name="WSDeploymentAspectInstallerEJB" class="org.jboss.wsf.framework.deployment.DeploymentAspectInstaller">
-    <property name="manager">
-      <inject bean="WSDeploymentAspectManagerEJB"/>
-    </property>
+    <property name="manager"><inject bean="WSDeploymentAspectManagerEJB"/></property>
     <property name="sortAspectsOnCreate">false</property>
     <property name="aspects">
       <set class="java.util.HashSet" elementClass="org.jboss.wsf.spi.deployment.DeploymentAspect">
@@ -357,9 +326,7 @@
   </bean>
   
   <bean name="WSDeploymentAspectInstallerEndpointAPI" class="org.jboss.wsf.framework.deployment.DeploymentAspectInstaller">
-    <property name="manager">
-      <inject bean="WSDeploymentAspectManagerEndpointAPI"/>
-    </property>
+    <property name="manager"><inject bean="WSDeploymentAspectManagerEndpointAPI"/></property>
     <property name="sortAspectsOnCreate">false</property>
     <property name="aspects">
       <set class="java.util.HashSet" elementClass="org.jboss.wsf.spi.deployment.DeploymentAspect">




More information about the jboss-cvs-commits mailing list