[jboss-cvs] JBossAS SVN: r68814 - branches/Branch_4_2/server/src/main/org/jboss/metadata.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Jan 10 05:46:18 EST 2008


Author: thomas.diesler at jboss.com
Date: 2008-01-10 05:46:18 -0500 (Thu, 10 Jan 2008)
New Revision: 68814

Modified:
   branches/Branch_4_2/server/src/main/org/jboss/metadata/WebMetaData.java
Log:
[JBWS-1762] web.xml modified to web.xml.org - Subsequent runs fail

Modified: branches/Branch_4_2/server/src/main/org/jboss/metadata/WebMetaData.java
===================================================================
--- branches/Branch_4_2/server/src/main/org/jboss/metadata/WebMetaData.java	2008-01-10 10:46:12 UTC (rev 68813)
+++ branches/Branch_4_2/server/src/main/org/jboss/metadata/WebMetaData.java	2008-01-10 10:46:18 UTC (rev 68814)
@@ -21,6 +21,8 @@
  */
 package org.jboss.metadata;
 
+// $Id$
+
 import java.net.URLClassLoader;
 import java.util.ArrayList;
 import java.util.Collection;
@@ -60,12 +62,10 @@
 
    /** The web.xml servlet <String, String> */
    private HashMap servletClassNames = new HashMap();
-
-   /** init parameter servletName->Map **/
-   private HashMap servletParams= new HashMap();
-
-   /** The web.xml context-param <String,String> **/
-   private HashMap contextParams= new HashMap();
+   /** The web.xml servlet-param <String,String> */
+   private HashMap servletParams = new HashMap();
+   /** The web.xml context-param <String,String> */
+   private HashMap contextParams = new HashMap();
    /** The web.xml servlet-mapping <String, String> */
    private HashMap servletMappings = new HashMap();
    /** The web.xml resource-refs <String, String> */
@@ -183,10 +183,11 @@
    {
       return environmentEntries.iterator();
    }
+
    /**
     * 
     * @param environmentEntries - Collection<EnvEntryMetaData>
-    */ 
+    */
    public void setEnvironmentEntries(Collection environmentEntries)
    {
       this.environmentEntries.clear();
@@ -200,10 +201,11 @@
    {
       return ejbReferences.values().iterator();
    }
+
    /**
     * 
     * @param ejbReferences - Map<String, EjbRefMetaData>
-    */ 
+    */
    public void setEjbReferences(Map ejbReferences)
    {
       this.ejbReferences.clear();
@@ -217,10 +219,11 @@
    {
       return ejbLocalReferences.values().iterator();
    }
+
    /**
     * 
     * @param ejbReferences - Map<String, EjbRefMetaData>
-    */ 
+    */
    public void setEjbLocalReferences(Map ejbReferences)
    {
       this.ejbLocalReferences.clear();
@@ -234,10 +237,11 @@
    {
       return resourceReferences.values().iterator();
    }
+
    /**
     * 
     * @param resourceReferences - Map<String, ResourceRefMetaData>
-    */ 
+    */
    public void setResourceReferences(Map resourceReferences)
    {
       this.resourceReferences.clear();
@@ -251,10 +255,11 @@
    {
       return resourceEnvReferences.values().iterator();
    }
+
    /**
     * 
     * @param resourceReferences - Map<String, ResourceEnvRefMetaData>
-    */ 
+    */
    public void setResourceEnvReferences(Map resourceReferences)
    {
       this.resourceEnvReferences.clear();
@@ -270,10 +275,11 @@
    {
       return messageDestinationReferences.values().iterator();
    }
+
    /**
     * 
     * @param messageDestinationReferences - Map<String, MessageDestinationRefMetaData>
-    */ 
+    */
    public void setMessageDestinationReferences(Map messageDestinationReferences)
    {
       this.messageDestinationReferences.clear();
@@ -290,21 +296,22 @@
    {
       return (MessageDestinationMetaData)messageDestinations.get(name);
    }
+
    /**
     * 
     * @param messageDestinations - Map<String, MessageDestinationMetaData>
-    */ 
+    */
    public void setMessageDestination(Map messageDestinations)
    {
       this.messageDestinations.clear();
       this.messageDestinations.putAll(messageDestinations);
    }
 
-   public Map<String,ServiceRefMetaData> getServiceReferences()
+   public Map<String, ServiceRefMetaData> getServiceReferences()
    {
       return serviceReferences;
    }
-   
+
    public void setServiceReferences(Map<String, ServiceRefMetaData> serviceReferences)
    {
       this.serviceReferences.clear();
@@ -349,10 +356,11 @@
    {
       return (String)wsdlPublishLocationMap.get(name);
    }
+
    /**
     * 
     * @param wsdlPublishLocationMap - Map<String, String>
-    */ 
+    */
    public void setWsdlPublishLocationMap(Map wsdlPublishLocationMap)
    {
       this.wsdlPublishLocationMap.clear();
@@ -396,15 +404,15 @@
    {
       this.securityDomain = securityDomain;
    }
-   
+
    /**
     * JBAS-1824: Specify whether a WebResourcePermission(url,null)
     * needs to be generated by the container
     * @return
     */
-   public boolean isJaccRoleNameStar() 
+   public boolean isJaccRoleNameStar()
    {
-	  return jaccRoleNameStar;
+      return jaccRoleNameStar;
    }
 
    /**
@@ -412,12 +420,12 @@
     * needs to be generated by the container
     * @return
     */
-   public void setJaccRoleNameStar(boolean jaccRoleNameStar) 
+   public void setJaccRoleNameStar(boolean jaccRoleNameStar)
    {
-	  this.jaccRoleNameStar = jaccRoleNameStar;
+      this.jaccRoleNameStar = jaccRoleNameStar;
    }
 
-/** The flag indicating whether the associated security domain cache
+   /** The flag indicating whether the associated security domain cache
     * should be flushed when the session is invalidated.
     * @return true if the flush should occur, false otherwise.
     */
@@ -441,10 +449,11 @@
    {
       return securityContraints.iterator();
    }
+
    /**
     * 
     * @param securityContraints - Collection<WebSecurityMetaData>
-    */ 
+    */
    public void setSecurityConstraints(Collection securityContraints)
    {
       this.securityContraints.clear();
@@ -458,20 +467,22 @@
    {
       return this.securityRoleReferences;
    }
+
    /**
     * 
     * @param servletName
     * @return List<SecurityRoleRefMetaData> for the given servlet name
-    */ 
+    */
    public List getSecurityRoleRefs(String servletName)
    {
-      List roles = (List) this.securityRoleReferences.get(servletName);
+      List roles = (List)this.securityRoleReferences.get(servletName);
       return roles;
    }
+
    /**
     * 
     * @param securityRoleReferences - <String servlet-name, ArrayList<SecurityRoleRefMetaData>>
-    */ 
+    */
    public void setSecurityRoleReferences(Map securityRoleReferences)
    {
       this.securityRoleReferences.clear();
@@ -494,10 +505,11 @@
    {
       return new HashMap(securityRoles);
    }
+
    /**
     * 
     * @param securityRoles - Map<String, SecurityRoleMetaData>
-    */ 
+    */
    public void setSecurityRoles(Map securityRoles)
    {
       this.securityRoles.clear();
@@ -545,14 +557,16 @@
       }
       return runAs;
    }
+
    /**
     * 
     * @return servlet/run-as <String servlet-name, RunAsIdentity>
-    */ 
+    */
    public Map getRunAsIdentity()
    {
       return runAsIdentity;
    }
+
    /** The jboss-web.xml servlet/run-as <String servlet-name, RunAsIdentity>
     */
    public void setRunAsIdentity(Map runAsIdentity)
@@ -589,11 +603,12 @@
    {
       return servletMappings;
    }
+
    /** The web.xml servlet-mapping  */
    /**
     * servlet-mapping/serlvet-name to url-pattern mapping
     * @param servletMappings - Map<String, String>
-    */ 
+    */
    public void setServletMappings(Map servletMappings)
    {
       this.servletMappings.clear();
@@ -610,16 +625,17 @@
    }
 
    /**
-    * Get the init parameter map for a servlet
-    * @param servletName
-    * @return
+    * Get the init parameter map for a servlet or an empty map if there are none.
     */
    public Map getServletParams(String servletName)
    {
-      if(null == servletParams.get(servletName))
-         servletParams.put(servletName, new HashMap());
-
-      return (Map)servletParams.get(servletName);
+      Map params = (Map)servletParams.get(servletName);
+      if (params == null)
+      {
+         params = new HashMap();
+         servletParams.put(servletName, params);
+      }
+      return params;
    }
 
    /**
@@ -663,10 +679,11 @@
    {
       return virtualHosts.iterator();
    }
+
    /**
     * 
     * @param virtualHosts - Collection<String>
-    */ 
+    */
    public void setVirtualHosts(Collection virtualHosts)
    {
       this.virtualHosts.clear();
@@ -681,10 +698,11 @@
    {
       return distributable;
    }
+
    /**
     * Mark the web-app as distributable
     * @param distributable - true for distributable
-    */ 
+    */
    public void setDistributable(boolean distributable)
    {
       this.distributable = distributable;
@@ -697,9 +715,10 @@
    {
       return depends;
    }
+
    /**
     @param depends - Collection<ObjectName> of the web app dependencies
-    */ 
+    */
    public void setDepends(Collection depends)
    {
       this.depends.clear();
@@ -724,6 +743,7 @@
    {
       return useJBossWebLoader;
    }
+
    public void setUseJBossWebLoader(boolean flag)
    {
       useJBossWebLoader = flag;
@@ -764,6 +784,7 @@
    {
       return this.sessionCookies;
    }
+
    public void setSessionCookies(int sessionCookies)
    {
       this.sessionCookies = sessionCookies;
@@ -773,6 +794,7 @@
    {
       return this.invalidateSessionPolicy;
    }
+
    public void setInvalidateSessionPolicy(int invalidateSessionPolicy)
    {
       this.invalidateSessionPolicy = invalidateSessionPolicy;
@@ -787,6 +809,7 @@
    {
       return replicationGranularity;
    }
+
    public void setReplicationGranularity(int replicationGranularity)
    {
       this.replicationGranularity = replicationGranularity;
@@ -827,13 +850,13 @@
          }
 
          Iterator initParams = getChildrenByTagName(servlet, "init-param");
-         while(initParams.hasNext())
+         while (initParams.hasNext())
          {
             Element param = (Element)initParams.next();
             String paramName = getElementContent(getUniqueChild(param, "param-name"));
             String paramValue = getElementContent(getUniqueChild(param, "param-value"));
 
-            if(null == servletParams.get(servletName))
+            if (null == servletParams.get(servletName))
             {
                servletParams.put(servletName, new HashMap());
             }
@@ -860,7 +883,7 @@
             runAsNames.put(servletName, runAsName);
          }
       }
-      
+
       // Parse the web-app/context-param elements
       iterator = getChildrenByTagName(webApp, "context-param");
       while (iterator.hasNext())
@@ -924,8 +947,7 @@
          }
          catch (Throwable t)
          {
-            throw new DeploymentException("Error in web.xml " +
-                    "for message destination: " + t.getMessage());
+            throw new DeploymentException("Error in web.xml " + "for message destination: " + t.getMessage());
          }
       }
 
@@ -1065,17 +1087,16 @@
          Boolean flag = Boolean.valueOf(securityDomainElement.getAttribute("flushOnSessionInvalidation"));
          flushOnSessionInvalidation = flag.booleanValue();
       }
-      
+
       //Parse the jboss-web/jacc-star-role-allow element
       Element jaccStarRoleElement = getOptionalChild(jbossWeb, "jacc-star-role-allow");
       if (jaccStarRoleElement != null)
       {
-         jaccRoleNameStar = "true".equalsIgnoreCase(getElementContent(jaccStarRoleElement)); 
+         jaccRoleNameStar = "true".equalsIgnoreCase(getElementContent(jaccStarRoleElement));
       }
 
       // Parse the jboss-web/virtual-host elements
-      for (Iterator virtualHostElements = getChildrenByTagName(jbossWeb, "virtual-host");
-           virtualHostElements.hasNext();)
+      for (Iterator virtualHostElements = getChildrenByTagName(jbossWeb, "virtual-host"); virtualHostElements.hasNext();)
       {
          Element virtualHostElement = (Element)virtualHostElements.next();
          String virtualHostName = getElementContent(virtualHostElement);
@@ -1091,8 +1112,7 @@
          ResourceRefMetaData refMetaData = (ResourceRefMetaData)resourceReferences.get(resRefName);
          if (refMetaData == null)
          {
-            throw new DeploymentException("resource-ref " + resRefName
-                    + " found in jboss-web.xml but not in web.xml");
+            throw new DeploymentException("resource-ref " + resRefName + " found in jboss-web.xml but not in web.xml");
          }
          refMetaData.importJbossXml(resourceRef);
       }
@@ -1106,8 +1126,7 @@
          ResourceEnvRefMetaData refMetaData = (ResourceEnvRefMetaData)resourceEnvReferences.get(resRefName);
          if (refMetaData == null)
          {
-            throw new DeploymentException("resource-env-ref " + resRefName
-                    + " found in jboss-web.xml but not in web.xml");
+            throw new DeploymentException("resource-env-ref " + resRefName + " found in jboss-web.xml but not in web.xml");
          }
          refMetaData.importJbossXml(resourceRef);
       }
@@ -1139,8 +1158,7 @@
          }
          catch (Throwable t)
          {
-            throw new DeploymentException("Error in web.xml " +
-                    "for message destination: " + t.getMessage());
+            throw new DeploymentException("Error in web.xml " + "for message destination: " + t.getMessage());
          }
       }
 
@@ -1152,8 +1170,7 @@
          String roleName = getElementContent(getUniqueChild(securityRole, "role-name"));
          SecurityRoleMetaData securityRoleMetaData = (SecurityRoleMetaData)securityRoles.get(roleName);
          if (securityRoleMetaData == null)
-            throw new DeploymentException("Security role '" + roleName + "' defined in jboss-web.xml" +
-                    " is not defined in web.xml");
+            throw new DeploymentException("Security role '" + roleName + "' defined in jboss-web.xml" + " is not defined in web.xml");
 
          Iterator itPrincipalNames = getChildrenByTagName(securityRole, "principal-name");
          while (itPrincipalNames.hasNext())
@@ -1172,8 +1189,7 @@
          EjbRefMetaData ejbRefMetaData = (EjbRefMetaData)ejbReferences.get(ejbRefName);
          if (ejbRefMetaData == null)
          {
-            throw new DeploymentException("ejb-ref " + ejbRefName
-                    + " found in jboss-web.xml but not in web.xml");
+            throw new DeploymentException("ejb-ref " + ejbRefName + " found in jboss-web.xml but not in web.xml");
          }
          ejbRefMetaData.importJbossXml(ejbRef);
       }
@@ -1187,8 +1203,7 @@
          EjbLocalRefMetaData ejbLocalRefMetaData = (EjbLocalRefMetaData)ejbLocalReferences.get(ejbLocalRefName);
          if (ejbLocalRefMetaData == null)
          {
-            throw new DeploymentException("ejb-local-ref " + ejbLocalRefName
-                    + " found in jboss-web.xml but not in web.xml");
+            throw new DeploymentException("ejb-local-ref " + ejbLocalRefName + " found in jboss-web.xml but not in web.xml");
          }
          ejbLocalRefMetaData.importJbossXml(ejbLocalRef);
       }
@@ -1202,8 +1217,7 @@
          ServiceRefMetaData refMetaData = (ServiceRefMetaData)serviceReferences.get(serviceRefName);
          if (refMetaData == null)
          {
-            throw new DeploymentException("service-ref " + serviceRefName
-                    + " found in jboss-web.xml but not in web.xml");
+            throw new DeploymentException("service-ref " + serviceRefName + " found in jboss-web.xml but not in web.xml");
          }
          refMetaData.importJBossXml(serviceRef);
       }
@@ -1221,8 +1235,7 @@
       }
 
       // Parse the jboss-web/depends elements
-      for (Iterator dependsElements = getChildrenByTagName(jbossWeb, "depends");
-           dependsElements.hasNext();)
+      for (Iterator dependsElements = getChildrenByTagName(jbossWeb, "depends"); dependsElements.hasNext();)
       {
          Element dependsElement = (Element)dependsElements.next();
          String dependsName = getElementContent(dependsElement);
@@ -1266,7 +1279,7 @@
                this.invalidateSessionPolicy = SESSION_INVALIDATE_SET;
             else
                throw new DeploymentException("replication-trigger value set to a non-valid value: '" + repMethod
-                       + "' (should be ['SET_AND_GET', 'SET_AND_NON_PRIMITIVE_GET', 'SET']) in jboss-web.xml");
+                     + "' (should be ['SET_AND_GET', 'SET_AND_NON_PRIMITIVE_GET', 'SET']) in jboss-web.xml");
          }
 
          // ... then manage "replication-type".
@@ -1280,8 +1293,7 @@
             else if ("ASYNC".equalsIgnoreCase(repType))
                this.replicationType = REPLICATION_TYPE_ASYNC;
             else
-               throw new DeploymentException("replication-type value set to a non-valid value: '" + repType
-                       + "' (should be ['SYNC', 'ASYNC']) in jboss-web.xml");
+               throw new DeploymentException("replication-type value set to a non-valid value: '" + repType + "' (should be ['SYNC', 'ASYNC']) in jboss-web.xml");
          }
 
          // ... then manage "replication-type".
@@ -1298,7 +1310,7 @@
                this.replicationGranularity = REPLICATION_GRANULARITY_FIELD;
             else
                throw new DeploymentException("replication-granularity value set to a non-valid value: '" + repType
-                  + "' (should be ['SESSION', 'ATTRIBUTE', or 'FIELD'']) in jboss-web.xml");
+                     + "' (should be ['SESSION', 'ATTRIBUTE', or 'FIELD'']) in jboss-web.xml");
          }
 
          Element batchModeElement = MetaData.getOptionalChild(sessionReplicationRootElement, "replication-field-batch-mode");
@@ -1347,8 +1359,7 @@
          {
             if (webXmlRunAs == null)
             {
-               throw new DeploymentException("run-as-principal: " + principalName
-                       + " found in jboss-web.xml but there was no run-as in web.xml");
+               throw new DeploymentException("run-as-principal: " + principalName + " found in jboss-web.xml but there was no run-as in web.xml");
             }
             // See if there are any additional roles for this principal
             Set extraRoles = getSecurityRoleNamesByPrincipal(principalName);




More information about the jboss-cvs-commits mailing list