[jboss-cvs] JBossAS SVN: r57300 - in trunk/server/src/main/org/jboss: metadata metadata/web webservice/metadata/serviceref

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Sat Sep 30 00:27:23 EDT 2006


Author: scott.stark at jboss.org
Date: 2006-09-30 00:27:08 -0400 (Sat, 30 Sep 2006)
New Revision: 57300

Added:
   trunk/server/src/main/org/jboss/metadata/DDObjectFactory.java
   trunk/server/src/main/org/jboss/metadata/InjectionTarget.java
   trunk/server/src/main/org/jboss/metadata/JndiRef.java
   trunk/server/src/main/org/jboss/metadata/Listener.java
   trunk/server/src/main/org/jboss/metadata/NameValuePair.java
   trunk/server/src/main/org/jboss/metadata/PersistenceContextRef.java
   trunk/server/src/main/org/jboss/metadata/PersistenceUnitRef.java
   trunk/server/src/main/org/jboss/metadata/Ref.java
   trunk/server/src/main/org/jboss/metadata/RunAs.java
   trunk/server/src/main/org/jboss/metadata/web/
   trunk/server/src/main/org/jboss/metadata/web/AuthConstraint.java
   trunk/server/src/main/org/jboss/metadata/web/ErrorPage.java
   trunk/server/src/main/org/jboss/metadata/web/Filter.java
   trunk/server/src/main/org/jboss/metadata/web/FilterMapping.java
   trunk/server/src/main/org/jboss/metadata/web/FormLoginConfig.java
   trunk/server/src/main/org/jboss/metadata/web/LoginConfig.java
   trunk/server/src/main/org/jboss/metadata/web/ReplicationConfig.java
   trunk/server/src/main/org/jboss/metadata/web/Servlet.java
   trunk/server/src/main/org/jboss/metadata/web/ServletMapping.java
   trunk/server/src/main/org/jboss/metadata/web/SessionConfig.java
   trunk/server/src/main/org/jboss/metadata/web/UserDataConstraint.java
   trunk/server/src/main/org/jboss/metadata/web/WebMetaDataObjectFactory.java
Modified:
   trunk/server/src/main/org/jboss/metadata/EjbLocalRefMetaData.java
   trunk/server/src/main/org/jboss/metadata/EjbRefMetaData.java
   trunk/server/src/main/org/jboss/metadata/EnvEntryMetaData.java
   trunk/server/src/main/org/jboss/metadata/MessageDestinationMetaData.java
   trunk/server/src/main/org/jboss/metadata/MessageDestinationRefMetaData.java
   trunk/server/src/main/org/jboss/metadata/ResourceEnvRefMetaData.java
   trunk/server/src/main/org/jboss/metadata/ResourceRefMetaData.java
   trunk/server/src/main/org/jboss/metadata/SecurityRoleMetaData.java
   trunk/server/src/main/org/jboss/metadata/SecurityRoleRefMetaData.java
   trunk/server/src/main/org/jboss/metadata/WebMetaData.java
   trunk/server/src/main/org/jboss/metadata/WebSecurityMetaData.java
   trunk/server/src/main/org/jboss/webservice/metadata/serviceref/ServiceRefMetaData.java
Log:
Merge the ejb3 related metadata into org.jboss.metadata and create and ObjectModelFactory for WebMetaData

Added: trunk/server/src/main/org/jboss/metadata/DDObjectFactory.java
===================================================================
--- trunk/server/src/main/org/jboss/metadata/DDObjectFactory.java	2006-09-30 04:21:39 UTC (rev 57299)
+++ trunk/server/src/main/org/jboss/metadata/DDObjectFactory.java	2006-09-30 04:27:08 UTC (rev 57300)
@@ -0,0 +1,583 @@
+/*
+* 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.metadata;
+
+import org.jboss.webservice.metadata.serviceref.ServiceRefMetaData;
+import org.jboss.xb.binding.ObjectModelFactory;
+import org.jboss.xb.binding.UnmarshallingContext;
+
+import org.jboss.logging.Logger;
+import org.xml.sax.Attributes;
+
+import javax.persistence.PersistenceContextType;
+import javax.xml.namespace.QName;
+
+/**
+ * @author <a href="mailto:bdecoste at jboss.com">William DeCoste</a>
+ * @author Scott.Stark at jboss.org
+ * @version <tt>$Revision: 56531 $</tt>
+ */
+public abstract class DDObjectFactory implements ObjectModelFactory
+{
+   private static final Logger log = Logger
+   .getLogger(DDObjectFactory.class);
+
+   public Object newChild(PersistenceUnitRef ref,
+                          UnmarshallingContext navigator, String namespaceURI, String localName,
+                          Attributes attrs)
+   {
+      return newRefChild(ref, localName);
+   }
+
+   public Object newChild(PersistenceContextRef ref,
+                          UnmarshallingContext navigator, String namespaceURI, String localName,
+                          Attributes attrs)
+   {
+      return newRefChild(ref, localName);
+   }
+
+   public Object newChild(EnvEntryMetaData ref,
+                          UnmarshallingContext navigator, String namespaceURI, String localName,
+                          Attributes attrs)
+   {
+      return newRefChild(ref, localName);
+   }
+
+   public Object newChild(EjbRefMetaData ref,
+                          UnmarshallingContext navigator, String namespaceURI, String localName,
+                          Attributes attrs)
+   {
+      return newRefChild(ref, localName);
+   }
+
+   public Object newChild(EjbLocalRefMetaData ref,
+                          UnmarshallingContext navigator, String namespaceURI, String localName,
+                          Attributes attrs)
+   {
+      return newRefChild(ref, localName);
+   }
+
+   public Object newChild(ResourceRefMetaData ref,
+                          UnmarshallingContext navigator, String namespaceURI, String localName,
+                          Attributes attrs)
+   {
+      return newRefChild(ref, localName);
+   }
+
+   public Object newChild(ResourceEnvRefMetaData ref,
+                          UnmarshallingContext navigator, String namespaceURI, String localName,
+                          Attributes attrs)
+   {
+      return newRefChild(ref, localName);
+   }
+
+   public Object newChild(MessageDestinationRefMetaData ref,
+                          UnmarshallingContext navigator, String namespaceURI, String localName,
+                          Attributes attrs)
+   {
+      return newRefChild(ref, localName);
+   }
+
+   public Object newChild(ServiceRefMetaData ref,
+                          UnmarshallingContext navigator, String namespaceURI, String localName,
+                          Attributes attrs)
+   {
+      return newRefChild(ref, localName);
+      //
+      
+   }
+
+   public Object newChild(JndiRef ref,
+                          UnmarshallingContext navigator, String namespaceURI, String localName,
+                          Attributes attrs)
+   {
+      return newRefChild(ref, localName);
+   }
+
+   public void addChild(PersistenceUnitRef parent, InjectionTarget target,
+                        UnmarshallingContext navigator, String namespaceURI, String localName)
+   {
+      parent.setInjectionTarget(target);
+   }
+
+   public void addChild(PersistenceContextRef parent, InjectionTarget target,
+                        UnmarshallingContext navigator, String namespaceURI, String localName)
+   {
+      parent.setInjectionTarget(target);
+   }
+
+   public void addChild(EnvEntryMetaData parent, InjectionTarget target,
+                        UnmarshallingContext navigator, String namespaceURI, String localName)
+   {
+      parent.setInjectionTarget(target);
+   }
+
+   public void addChild(EjbRefMetaData parent, InjectionTarget target,
+                        UnmarshallingContext navigator, String namespaceURI, String localName)
+   {
+      parent.setInjectionTarget(target);
+   }
+
+   public void addChild(EjbLocalRefMetaData parent, InjectionTarget target,
+                        UnmarshallingContext navigator, String namespaceURI, String localName)
+   {
+      parent.setInjectionTarget(target);
+   }
+
+   public void addChild(ResourceRefMetaData parent, InjectionTarget target,
+                        UnmarshallingContext navigator, String namespaceURI, String localName)
+   {
+      parent.setInjectionTarget(target);
+   }
+
+   public void addChild(ResourceEnvRefMetaData parent, InjectionTarget target,
+                        UnmarshallingContext navigator, String namespaceURI, String localName)
+   {
+      parent.setInjectionTarget(target);
+   }
+
+   public void addChild(MessageDestinationRefMetaData parent, InjectionTarget target,
+                        UnmarshallingContext navigator, String namespaceURI, String localName)
+   {
+      parent.setInjectionTarget(target);
+   }
+
+   public void addChild(ServiceRefMetaData parent, InjectionTarget target,
+                        UnmarshallingContext navigator, String namespaceURI, String localName)
+   {
+      parent.setInjectionTarget(target);
+   }
+
+   public void addChild(JndiRef parent, InjectionTarget target,
+                        UnmarshallingContext navigator, String namespaceURI, String localName)
+   {
+      parent.setInjectionTarget(target);
+   }
+
+   public void setValue(EjbLocalRefMetaData ref, UnmarshallingContext navigator,
+                        String namespaceURI, String localName, String value)
+   {
+      if (localName.equals("ejb-ref-name"))
+      {
+         ref.setName(getValue(localName, value));
+      }
+      else if (localName.equals("ejb-ref-type"))
+      {
+         ref.setType(getValue(localName, value));
+      }
+      else if (localName.equals("local-home"))
+      {
+         ref.setLocalHome(getValue(localName, value));
+      }
+      else if (localName.equals("local"))
+      {
+         ref.setLocal(getValue(localName, value));
+      }
+      else if (localName.equals("ejb-link"))
+      {
+         ref.setLink(getValue(localName, value));
+      }
+      else if (localName.equals("mapped-name") || localName.equals("local-jndi-name") || localName.equals("jndi-name"))
+      {
+         ref.setJndiName(getValue(localName, value));
+      }
+      else if (localName.equals("ignore-dependency"))
+      {
+         ref.setIgnoreDependency(true);
+      }
+   }
+
+   public void setValue(EjbRefMetaData ref, UnmarshallingContext navigator,
+                        String namespaceURI, String localName, String value)
+   {
+      if (localName.equals("ejb-ref-name"))
+      {
+         ref.setName(getValue(localName, value));
+      }
+      else if (localName.equals("ejb-ref-type"))
+      {
+         ref.setType(getValue(localName, value));
+      }
+      else if (localName.equals("home"))
+      {
+         ref.setHome(getValue(localName, value));
+      }
+      else if (localName.equals("remote"))
+      {
+         ref.setRemote(getValue(localName, value));
+      }
+      else if (localName.equals("ejb-link"))
+      {
+         ref.setLink(getValue(localName, value));
+      }
+      else if (localName.equals("mapped-name") || localName.equals("jndi-name"))
+      {
+         ref.setJndiName(getValue(localName, value));
+      }
+      else if (localName.equals("ignore-dependency"))
+      {
+         ref.setIgnoreDependency(true);
+      }
+   }
+
+   /**
+    * Called when a child element with simple content is read for DD.
+    */
+   public void setValue(InjectionTarget target, UnmarshallingContext navigator,
+                        String namespaceURI, String localName, String value)
+   {
+      if (localName.equals("injection-target-class"))
+      {
+         target.setTargetClass(getValue(localName, value));
+      }
+      else if (localName.equals("injection-target-name"))
+      {
+         target.setTargetName(getValue(localName, value));
+      }
+   }
+
+   /**
+    * Called when a child element with simple content is read for DD.
+    */
+   public void setValue(MessageDestinationRefMetaData ref, UnmarshallingContext navigator,
+                        String namespaceURI, String localName, String value)
+   {
+      if (localName.equals("description"))
+      {
+         ref.setDescription(getValue(localName, value));
+      }
+      else if (localName.equals("message-destination-ref-name"))
+      {
+         ref.setRefName(getValue(localName, value));
+      }
+      else if (localName.equals("message-destination-type"))
+      {
+         ref.setType(getValue(localName, value));
+      }
+      else if (localName.equals("message-destination-usage"))
+      {
+         ref.setUsage(getValue(localName, value));
+      }
+      else if (localName.equals("message-destination-link"))
+      {
+         ref.setLink(getValue(localName, value));
+      }
+      else if (localName.equals("mapped-name") || localName.equals("jndi-name"))
+      {
+         ref.setJndiName(getValue(localName, value));
+      }
+   }
+
+   public void setValue(EnvEntryMetaData entry, UnmarshallingContext navigator,
+                        String namespaceURI, String localName, String value)
+   {
+      if (localName.equals("description"))
+      {
+         entry.setDescription(getValue(localName, value));
+      }
+      else if (localName.equals("env-entry-name"))
+      {
+         entry.setName(getValue(localName, value));
+      }
+      else if (localName.equals("env-entry-type"))
+      {
+         entry.setType(getValue(localName, value));
+      }
+      else if (localName.equals("env-entry-value"))
+      {
+         entry.setValue(getValue(localName, value));
+      }
+   }
+
+   public void setValue(ResourceEnvRefMetaData envRef, UnmarshallingContext navigator,
+                        String namespaceURI, String localName, String value)
+   {
+      if (localName.equals("res-ref-name")
+              || localName.equals("resource-env-ref-name"))
+      {
+         envRef.setRefName(getValue(localName, value));
+      }
+      else if (localName.equals("res-type")
+              || localName.equals("resource-env-ref-type"))
+      {
+         envRef.setType(getValue(localName, value));
+      }
+      else if (localName.equals("res-auth"))
+      {
+         envRef.setContainerAuth(getValue(localName, value));
+      }
+      else if (localName.equals("res-sharing-scope"))
+      {
+         envRef.setSharable(getValue(localName, value));
+      }
+      else if (localName.equals("mapped-name") || localName.equals("jndi-name"))
+      {
+         envRef.setJndiName(getValue(localName, value));
+      }
+   }
+
+   public void setValue(ResourceRefMetaData ref, UnmarshallingContext navigator,
+                        String namespaceURI, String localName, String value)
+   {
+      if (localName.equals("res-ref-name")
+              || localName.equals("resource-env-ref-name"))
+      {
+         ref.setRefName(getValue(localName, value));
+      }
+      else if (localName.equals("res-type")
+              || localName.equals("resource-env-ref-type"))
+      {
+         ref.setType(getValue(localName, value));
+      }
+      else if (localName.equals("res-auth"))
+      {
+         ref.setContainerAuth(getValue(localName, value));
+      }
+      else if (localName.equals("res-sharing-scope"))
+      {
+         ref.setSharable(getValue(localName, value));
+      }
+      else if (localName.equals("mapped-name") || localName.equals("jndi-name"))
+      {
+         ref.setJndiName(getValue(localName, value));
+      }
+      else if (localName.equals("res-url"))
+      {
+         ref.setResURL(getValue(localName, value));
+      }
+      else if (localName.equals("resource-name"))
+      {
+         ref.setResourceName(getValue(localName, value));
+      }
+   }
+
+   public void setValue(ServiceRefMetaData ref, UnmarshallingContext navigator,
+                        String namespaceURI, String localName, String value)
+   {
+      if (localName.equals("service-ref-name"))
+      {
+         ref.setServiceRefName(getValue(localName, value));
+      }
+      else if (localName.equals("service-res-type"))
+      {
+         ref.setServiceResType(getValue(localName, value));
+      }
+      else if (localName.equals("service-interface"))
+      {
+         ref.setServiceInterface(getValue(localName, value));
+      }
+      else if (localName.equals("service-qname"))
+      {
+         QName serviceQName = new QName(namespaceURI, value);
+         ref.setServiceQName(serviceQName);
+      }
+      else if (localName.equals("wsdl-file"))
+      {
+         ref.setWsdlFile(getValue(localName, value));
+      }
+      else if (localName.equals("jaxrpc-mapping-file"))
+      {
+         ref.setJaxrpcMappingFile(getValue(localName, value));
+      }
+      else if (localName.equals("mapped-name"))
+      {
+         ref.setMappedName(getValue(localName, value));
+      }
+   }
+
+   public void setValue(SecurityRoleMetaData role, UnmarshallingContext navigator,
+                        String namespaceURI, String localName, String value)
+   {
+      if (localName.equals("role-name"))
+      {
+         role.setRoleName(getValue(localName, value));
+      }
+   }
+
+   public void setValue(JndiRef ref, UnmarshallingContext navigator,
+                        String namespaceURI, String localName, String value)
+   {
+      if (localName.equals("mapped-name"))
+      {
+         ref.setMappedName(getValue(localName, value));
+      }
+      else if (localName.equals("jndi-ref-name"))
+      {
+         ref.setJndiRefName(getValue(localName, value));
+      }
+   }
+
+   public void setValue(RunAs runAs, UnmarshallingContext navigator,
+                        String namespaceURI, String localName, String value)
+   {
+      if (localName.equals("role-name"))
+      {
+         runAs.setRoleName(getValue(localName, value));
+      }
+   }
+
+   public void setValue(SecurityRoleRefMetaData ref, UnmarshallingContext navigator,
+                        String namespaceURI, String localName, String value)
+   {
+      if (localName.equals("role-name"))
+      {
+         ref.setName(getValue(localName, value));
+      }
+      else if (localName.equals("role-link"))
+      {
+         ref.setLink(getValue(localName, value));
+      }
+   }
+
+   public void setValue(Listener listener, UnmarshallingContext navigator,
+                        String namespaceURI, String localName, String value)
+   {
+      if (localName.equals("listener-class"))
+      {
+         listener.setListenerClass(getValue(localName, value));
+      }
+   }
+
+   public void setValue(MessageDestinationMetaData destination, UnmarshallingContext navigator,
+                        String namespaceURI, String localName, String value)
+   {
+      if (localName.equals("message-destination-name"))
+      {
+         destination.setName(getValue(localName, value));
+      }
+      else if (localName.equals("mapped-name") || localName.equals("jndi-name"))
+      {
+         destination.setJndiName(getValue(localName, value));
+      }
+   }
+
+   public void setValue(PersistenceUnitRef ref, UnmarshallingContext navigator,
+                        String namespaceURI, String localName, String value)
+   {
+      if (localName.equals("persistence-unit-ref-name"))
+      {
+         ref.setRefName(getValue(localName, value));
+      }
+      else if (localName.equals("persistence-unit-name"))
+      {
+         ref.setUnitName(getValue(localName, value));
+      }
+      else
+      {
+         throw new RuntimeException("INVALID element<" + localName + "> in <persistence-unit-ref>");
+      }
+   }
+
+   protected Object newEnvRefGroupChild(String localName)
+   {
+      Object child = null;
+
+      if (localName.equals("ejb-local-ref"))
+      {
+         child = new EjbLocalRefMetaData();
+      }
+      else if (localName.equals("ejb-ref"))
+      {
+         child = new EjbRefMetaData();
+      }
+      else if (localName.equals("resource-ref"))
+      {
+         child = new ResourceRefMetaData();
+      }
+      else if (localName.equals("resource-env-ref"))
+      {
+         child = new ResourceEnvRefMetaData();
+      }
+      else if (localName.equals("env-entry"))
+      {
+         child = new EnvEntryMetaData();
+      }
+      else if (localName.equals("message-destination-ref"))
+      {
+         child = new MessageDestinationRefMetaData();
+      }
+      else if (localName.equals("service-ref"))
+      {
+         child = new ServiceRefMetaData();
+      }
+      else if (localName.equals("jndi-ref"))
+      {
+         child = new JndiRef();
+      }
+      else if (localName.equals("persistence-unit-ref"))
+      {
+         child = new PersistenceUnitRef();
+      }
+      else if (localName.equals("persistence-context-ref"))
+      {
+         child = new PersistenceContextRef();
+      }
+
+      return child;
+   }
+
+   protected Object newRefChild(Ref ref, String localName)
+   {
+      Object child = null;
+
+      if (localName.equals("ignore-dependency"))
+      {
+         ref.setIgnoreDependency(true);
+      }
+      else if (localName.equals("injection-target"))
+      {
+         InjectionTarget target = new InjectionTarget();
+         child = target;
+      }
+
+      return child;
+   }
+
+   public void setValue(PersistenceContextRef ref, UnmarshallingContext navigator,
+                        String namespaceURI, String localName, String value)
+   {
+      if (localName.equals("persistence-context-ref-name"))
+      {
+         ref.setRefName(getValue(localName, value));
+      }
+      else if (localName.equals("persistence-unit-name"))
+      {
+         ref.setUnitName(getValue(localName, value));
+      }
+      else if(localName.equals("persistence-context-type"))
+      {
+         if (value.toLowerCase().equals("transaction"))
+         {
+            ref.setPersistenceContextType(PersistenceContextType.TRANSACTION);
+         }
+         else
+         {
+            ref.setPersistenceContextType(PersistenceContextType.EXTENDED);
+         }
+      }
+   }
+   
+   protected String getValue(String name, String value)
+   {
+      return value;
+   }
+}

Modified: trunk/server/src/main/org/jboss/metadata/EjbLocalRefMetaData.java
===================================================================
--- trunk/server/src/main/org/jboss/metadata/EjbLocalRefMetaData.java	2006-09-30 04:21:39 UTC (rev 57299)
+++ trunk/server/src/main/org/jboss/metadata/EjbLocalRefMetaData.java	2006-09-30 04:27:08 UTC (rev 57300)
@@ -1,24 +1,24 @@
 /*
-* 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.
-*/
+ * 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.metadata;
 
 import java.util.HashMap;
@@ -27,69 +27,119 @@
 import org.jboss.deployment.DeploymentException;
 
 /**
- *   <description> 
- *      
- *   @see <related>
- *   @author <a href="mailto:docodan at mvcsoft.com">Daniel OConnor</a>
+ * An ejb-local-ref representation
+ * 
+ * @author <a href="mailto:docodan at mvcsoft.com">Daniel OConnor</a>
+ * @author Scott.Stark at jboss.org
+ * @version $Revision$
  */
-public class EjbLocalRefMetaData extends MetaData {
-    // Constants -----------------------------------------------------
-    
-    // Attributes ----------------------------------------------------
-	
+public class EjbLocalRefMetaData extends Ref
+{
+   // Constants -----------------------------------------------------
+
+   // Attributes ----------------------------------------------------
+
    // the name used in the bean code
    private String name;
-	
+
    // entity or session
    private String type;
-	
-	// the 2 interfaces
+
+   // the 2 interfaces
    private String localHome;
+
    private String local;
-	
-	// internal link: map name to link
+
+   // internal link: map name to link
    private String link;
 
    // external link: map name to jndiName
    private String jndiName;
-	
+
    private HashMap invokerMap = new HashMap();
 
-    // Static --------------------------------------------------------
-    
-    // Constructors --------------------------------------------------
-	
-    // Public --------------------------------------------------------
-	
-   public String getName() { return name; }
-	
-   public String getType() { return type; }
-	
-   public String getLocalHome() { return localHome; }
-	
-   public String getLocal() { return local; }
-	
-   public String getLink() { return link; }
+   // Static --------------------------------------------------------
 
-   public String getJndiName() { return jndiName; }
+   // Constructors --------------------------------------------------
 
-   public String getInvokerBinding(String bindingName) { return (String)invokerMap.get(bindingName); }
+   // Public --------------------------------------------------------
 
-    public void importEjbJarXml(Element element) throws DeploymentException {
-      name = getElementContent(getUniqueChild(element, "ejb-ref-name"));
-      type = getElementContent(getUniqueChild(element, "ejb-ref-type"));
-      localHome = getElementContent(getUniqueChild(element, "local-home"));
-      local = getElementContent(getUniqueChild(element, "local"));
-      link = getElementContent(getOptionalChild(element, "ejb-link"));
+   public String getName()
+   {
+      return name;
    }
-	
+   public void setName(String name)
+   {
+      this.name = name;
+   }
+
+   public String getType()
+   {
+      return type;
+   }
+
+   public void setType(String type)
+   {
+      this.type = type;
+   }
+
+   public String getLocalHome()
+   {
+      return localHome;
+   }
+   public void setLocalHome(String localHome)
+   {
+      this.localHome = localHome;
+   }
+
+   public String getLocal()
+   {
+      return local;
+   }
+   public void setLocal(String local)
+   {
+      this.local = local;
+   }
+
+   public String getLink()
+   {
+      return link;
+   }
+   public void setLink(String link)
+   {
+      this.link = link;
+   }
+
+   public String getJndiName()
+   {
+      return jndiName;
+   }
+   public void setJndiName(String jndiName)
+   {
+      this.jndiName = jndiName;
+   }
+
+   public String getInvokerBinding(String bindingName)
+   {
+      return (String) invokerMap.get(bindingName);
+   }
+
+   public void importEjbJarXml(Element element) throws DeploymentException
+   {
+      name = MetaData.getElementContent(MetaData.getUniqueChild(element, "ejb-ref-name"));
+      type = MetaData.getElementContent(MetaData.getUniqueChild(element, "ejb-ref-type"));
+      localHome = MetaData.getElementContent(MetaData.getUniqueChild(element, "local-home"));
+      local = MetaData.getElementContent(MetaData.getUniqueChild(element, "local"));
+      link = MetaData.getElementContent(MetaData.getOptionalChild(element, "ejb-link"));
+   }
+   
    public void importJbossXml(Element element) throws DeploymentException {
-      jndiName = getElementContent(getOptionalChild(element, "local-jndi-name"));
+      jndiName = MetaData.getElementContent(MetaData.getOptionalChild(element, "local-jndi-name"));
    }
-	
+   
     public void importJbossXml(String invokerBinding, Element element) throws DeploymentException 
     {
-      String refJndiName = getElementContent(getOptionalChild(element, "local-jndi-name"));
+      String refJndiName = MetaData.getElementContent(MetaData.getOptionalChild(element, "local-jndi-name"));
       invokerMap.put(invokerBinding, refJndiName);
-    }   
+    } 
 }

Modified: trunk/server/src/main/org/jboss/metadata/EjbRefMetaData.java
===================================================================
--- trunk/server/src/main/org/jboss/metadata/EjbRefMetaData.java	2006-09-30 04:21:39 UTC (rev 57299)
+++ trunk/server/src/main/org/jboss/metadata/EjbRefMetaData.java	2006-09-30 04:27:08 UTC (rev 57300)
@@ -1,84 +1,150 @@
 /*
-* 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.
-*/
+ * 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.metadata;
 
+import java.util.HashMap;
+
 import org.w3c.dom.Element;
 
 import org.jboss.deployment.DeploymentException;
+import static org.jboss.metadata.MetaData.*;
 
-import java.util.HashMap;
-
 /**
- *   <description> 
- *      
- *   @see <related>
- *   @author <a href="mailto:sebastien.alborini at m4x.org">Sebastien Alborini</a>
- *   @version $Revision$
+ * An ejb-ref encapsulation
+ * 
+ * @author <a href="mailto:sebastien.alborini at m4x.org">Sebastien Alborini</a>
+ * @author Scott.Stark at jboss.org
+ * @version $Revision$
  */
-public class EjbRefMetaData extends MetaData {
+public class EjbRefMetaData extends Ref
+{
    // Constants -----------------------------------------------------
-    
+
    // Attributes ----------------------------------------------------
-	
+
    // the name used in the bean code
    private String name;
-	
+
    // entity or session
    private String type;
-	
+
    // the 2 interfaces
    private String home;
+
    private String remote;
-	
+
    // internal link: map name to link
    private String link;
-	
+
    // external link: map name to jndiName
    private String jndiName;
 
    private HashMap invokerMap = new HashMap();
-	
+
    // Static --------------------------------------------------------
-    
+
    // Constructors --------------------------------------------------
-   public EjbRefMetaData () {
+   public EjbRefMetaData()
+   {
    }
-	
+
    // Public --------------------------------------------------------
-	
-   public String getName() { return name; }
-	
-   public String getType() { return type; }
-	
-   public String getHome() { return home; }
-	
-   public String getRemote() { return remote; }
-	
-   public String getLink() { return link; }
 
-   public String getJndiName() { return jndiName; }
 
-   public String getInvokerBinding(String bindingName) { return (String)invokerMap.get(bindingName); }
+   public String getHome()
+   {
+      return home;
+   }
 
+   public void setHome(String home)
+   {
+      this.home = home;
+   }
+
+   public HashMap getInvokerMap()
+   {
+      return invokerMap;
+   }
+
+   public void setInvokerMap(HashMap invokerMap)
+   {
+      this.invokerMap = invokerMap;
+   }
+
+   public String getJndiName()
+   {
+      return jndiName;
+   }
+
+   public void setJndiName(String jndiName)
+   {
+      this.jndiName = jndiName;
+   }
+
+   public String getLink()
+   {
+      return link;
+   }
+
+   public void setLink(String link)
+   {
+      this.link = link;
+   }
+
+   public String getName()
+   {
+      return name;
+   }
+
+   public void setName(String name)
+   {
+      this.name = name;
+   }
+
+   public String getRemote()
+   {
+      return remote;
+   }
+
+   public void setRemote(String remote)
+   {
+      this.remote = remote;
+   }
+
+   public String getType()
+   {
+      return type;
+   }
+
+   public void setType(String type)
+   {
+      this.type = type;
+   }
+
+   public String getInvokerBinding(String bindingName)
+   {
+      return (String) invokerMap.get(bindingName);
+   }
+
    public void importEjbJarXml(Element element) throws DeploymentException {
       name = getElementContent(getUniqueChild(element, "ejb-ref-name"));
       type = getElementContent(getUniqueChild(element, "ejb-ref-type"));
@@ -98,10 +164,10 @@
    }
 	
    // Package protected ---------------------------------------------
-    
+
    // Protected -----------------------------------------------------
-    
+
    // Private -------------------------------------------------------
-    
+
    // Inner classes -------------------------------------------------
 }

Modified: trunk/server/src/main/org/jboss/metadata/EnvEntryMetaData.java
===================================================================
--- trunk/server/src/main/org/jboss/metadata/EnvEntryMetaData.java	2006-09-30 04:21:39 UTC (rev 57299)
+++ trunk/server/src/main/org/jboss/metadata/EnvEntryMetaData.java	2006-09-30 04:27:08 UTC (rev 57300)
@@ -36,7 +36,7 @@
  * @author <a href="mailto:sebastien.alborini at m4x.org">Sebastien Alborini </a>
  * @version $Revision$
  */
-public class EnvEntryMetaData extends MetaData
+public class EnvEntryMetaData extends Ref
 {
 	// Constants -----------------------------------------------------
 
@@ -56,31 +56,48 @@
 
 	// Public --------------------------------------------------------
 
+
 	public String getName()
-	{
-		return name;
-	}
+   {
+      return name;
+   }
 
-	public String getType()
-	{
-		return type;
-	}
+   public void setName(String name)
+   {
+      this.name = name;
+   }
 
-	public String getValue()
-	{
-		return value;
-	}
+   public String getType()
+   {
+      return type;
+   }
 
-	public void importEjbJarXml(Element element) throws DeploymentException
-	{
-		name = getElementContent(getUniqueChild(element, "env-entry-name"));
-		type = getElementContent(getUniqueChild(element, "env-entry-type"));
-		// Strip any surrounding spaces
-		type = type.trim();
-		value = getElementContent(getUniqueChild(element, "env-entry-value"));
-	}
+   public void setType(String type)
+   {
+      this.type = type;
+   }
 
-	public static void bindEnvEntry(Context ctx, EnvEntryMetaData entry) throws ClassNotFoundException, NamingException
+   public String getValue()
+   {
+      return value;
+   }
+
+   public void setValue(String value)
+   {
+      this.value = value;
+   }
+
+   public void importEjbJarXml(Element element) throws DeploymentException
+   {
+      name = MetaData.getElementContent(MetaData.getUniqueChild(element, "env-entry-name"));
+      type = MetaData.getElementContent(MetaData.getUniqueChild(element, "env-entry-type"));
+      // Strip any surrounding spaces
+      type = type.trim();
+      value = MetaData.getElementContent(MetaData.getUniqueChild(element, "env-entry-value"));
+   }
+
+   public static void bindEnvEntry(Context ctx, EnvEntryMetaData entry)
+      throws ClassNotFoundException, NamingException
 	{
 		ClassLoader loader = EnvEntryMetaData.class.getClassLoader();
 		Class type = loader.loadClass(entry.getType());
@@ -118,9 +135,6 @@
 			}
 			else
 			{
-				if (input.length() > 1)
-					// TODO: Add deployment context
-					log.warn("Warning character env-entry is too long: binding=" + entry.getName() + " value=" + input);
 				value = new Character(input.charAt(0));
 			}
 			Util.bind(ctx, entry.getName(), value);

Added: trunk/server/src/main/org/jboss/metadata/InjectionTarget.java
===================================================================
--- trunk/server/src/main/org/jboss/metadata/InjectionTarget.java	2006-09-30 04:21:39 UTC (rev 57299)
+++ trunk/server/src/main/org/jboss/metadata/InjectionTarget.java	2006-09-30 04:27:08 UTC (rev 57300)
@@ -0,0 +1,64 @@
+/*
+  * 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.metadata;
+
+/**
+ * Comment
+ *
+ * @author <a href="mailto:bill at jboss.org">Bill Burke</a>
+ * @version $Revision: 45240 $
+ */
+public class InjectionTarget
+{
+   private String targetClass;
+   private String targetName;
+
+   public String getTargetClass()
+   {
+      return targetClass;
+   }
+
+   public void setTargetClass(String targetClass)
+   {
+      this.targetClass = targetClass;
+   }
+
+   public String getTargetName()
+   {
+      return targetName;
+   }
+
+   public void setTargetName(String targetName)
+   {
+      this.targetName = targetName;
+   }
+   
+   public String toString()
+   {
+      StringBuffer buffer = new StringBuffer(100);
+      buffer.append("[InjectionTarget:targetClass=" + targetClass);
+      buffer.append(", targetName=" + targetName);
+      buffer.append("]");
+      
+      return buffer.toString();
+   }
+}

Added: trunk/server/src/main/org/jboss/metadata/JndiRef.java
===================================================================
--- trunk/server/src/main/org/jboss/metadata/JndiRef.java	2006-09-30 04:21:39 UTC (rev 57299)
+++ trunk/server/src/main/org/jboss/metadata/JndiRef.java	2006-09-30 04:27:08 UTC (rev 57300)
@@ -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.metadata;
+
+import org.jboss.logging.Logger;
+
+/**
+ * Represents a <jndi-ref> element of the jboss.xml deployment descriptor
+ *
+ * @author <a href="mailto:bdecoste at jboss.com">William DeCoste</a>
+ * @version <tt>$Revision: 45249 $</tt>
+ */
+public class JndiRef extends Ref
+{
+   private static final Logger log = Logger.getLogger(JndiRef.class);
+   
+   private String jndiRefName;
+   
+   private String mappedName;
+   
+   public String getJndiRefName()
+   {
+      return jndiRefName;
+   }
+
+   public void setJndiRefName(String jndiRefName)
+   {
+      this.jndiRefName = jndiRefName;
+   }
+
+   public String getMappedName()
+   {
+      return mappedName;
+   }
+
+   public void setMappedName(String mappedName)
+   {
+      this.mappedName = mappedName;
+   }
+
+   public String toString()
+   {
+      StringBuffer sb = new StringBuffer(100);
+      sb.append("[" + this.getClass().getName() + ": ");
+      sb.append("mappedName=").append(mappedName);
+      sb.append("]");
+      return sb.toString();
+   }
+}

Added: trunk/server/src/main/org/jboss/metadata/Listener.java
===================================================================
--- trunk/server/src/main/org/jboss/metadata/Listener.java	2006-09-30 04:21:39 UTC (rev 57299)
+++ trunk/server/src/main/org/jboss/metadata/Listener.java	2006-09-30 04:27:08 UTC (rev 57300)
@@ -0,0 +1,53 @@
+/*
+* 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.metadata;
+
+import org.jboss.logging.Logger;
+
+/**
+ * Represents a <listener> element of the deployment descriptor
+ *
+ * @author <a href="mailto:bdecoste at jboss.com">William DeCoste</a>
+ * @version <tt>$Revision: 45409 $</tt>
+ */
+public class Listener
+{
+   private static final Logger log = Logger.getLogger(Listener.class);
+   
+   protected String clazz;
+   
+   public String getListenerClass()
+   {
+      return clazz;
+   }
+   
+   public void setListenerClass(String clazz)
+   {
+      this.clazz = clazz;
+   }
+
+   public String toString()
+   {
+      StringBuffer sb = new StringBuffer(100);
+      return sb.toString();
+   }
+}

Modified: trunk/server/src/main/org/jboss/metadata/MessageDestinationMetaData.java
===================================================================
--- trunk/server/src/main/org/jboss/metadata/MessageDestinationMetaData.java	2006-09-30 04:21:39 UTC (rev 57299)
+++ trunk/server/src/main/org/jboss/metadata/MessageDestinationMetaData.java	2006-09-30 04:27:08 UTC (rev 57300)
@@ -39,7 +39,7 @@
 
    /** The destination name */
    private String name;
-   
+
    /** The jndi name */
    private String jndiName;
 
@@ -57,11 +57,31 @@
    {
       return name;
    }
+   public void setName(String name)
+   {
+      this.name = name;
+   }
 
+   public String getJndiName()
+   {
+      return jndiName;
+   }
+   public void setJndiName(String name)
+   {
+      this.jndiName = name;
+   }
+   /**
+    * compatibitly method mapped to jndiName
+    * @return
+    */
    public String getJNDIName()
    {
       return jndiName;
    }
+   public String getMappedName()
+   {     
+      return getJndiName();
+   }
 
    public void importEjbJarXml(Element element) throws DeploymentException
    {

Modified: trunk/server/src/main/org/jboss/metadata/MessageDestinationRefMetaData.java
===================================================================
--- trunk/server/src/main/org/jboss/metadata/MessageDestinationRefMetaData.java	2006-09-30 04:21:39 UTC (rev 57299)
+++ trunk/server/src/main/org/jboss/metadata/MessageDestinationRefMetaData.java	2006-09-30 04:27:08 UTC (rev 57300)
@@ -31,7 +31,7 @@
  * @author <a href="mailto:adrian at jboss.com">Adrian Brock</a>.
  * @version $Revision$
  */
-public class MessageDestinationRefMetaData extends MetaData
+public class MessageDestinationRefMetaData extends Ref
 {
    // Constants -----------------------------------------------------
 
@@ -66,38 +66,80 @@
 
    // Public --------------------------------------------------------
 
+   public String getJndiName()
+   {
+      return jndiName;
+   }
+
+   public void setJndiName(String jndiName)
+   {
+      this.jndiName = jndiName;
+   }
+   /**
+    * compatibitly method mapped to jndiName
+    * @return
+    */
+   public String getJNDIName()
+   {
+      return jndiName;
+   }
+
+   public String getLink()
+   {
+      return link;
+   }
+
+   public void setLink(String link)
+   {
+      this.link = link;
+   }
+
    public String getRefName()
    {
       return refName;
    }
 
+   public void setRefName(String refName)
+   {
+      this.refName = refName;
+   }
+
    public String getType()
    {
       return type;
    }
 
+   public void setType(String type)
+   {
+      this.type = type;
+   }
+
    public int getUsage()
    {
       return usage;
    }
 
-   public String getLink()
+   public void setUsage(int usage)
    {
-      return link;
+      this.usage = usage;
    }
-
-   public String getJNDIName()
+   public void setUsage(String usageValue)
    {
-      return jndiName;
+      if (usageValue.equalsIgnoreCase("Consumes"))
+         usage = CONSUMES;
+      else if (usageValue.equalsIgnoreCase("Produces"))
+         usage = PRODUCES;
+      else if (usageValue.equalsIgnoreCase("ConsumesProduces"))
+         usage = CONSUMESPRODUCES;      
    }
 
    public void importEjbJarXml(Element element) throws DeploymentException
    {
-      refName = getElementContent(getUniqueChild(element, "message-destination-ref-name"));
+      refName = MetaData.getElementContent(MetaData.getUniqueChild(element, "message-destination-ref-name"));
 
-      type = getElementContent(getUniqueChild(element, "message-destination-type"));
+      type = MetaData.getElementContent(MetaData.getUniqueChild(element, "message-destination-type"));
 
-      String usageValue = getElementContent(getUniqueChild(element, "message-destination-usage"));
+      String usageValue = MetaData.getElementContent(MetaData.getUniqueChild(element, "message-destination-usage"));
       usageValue = usageValue.trim();
       if (usageValue.equalsIgnoreCase("Consumes"))
          usage = CONSUMES;
@@ -108,14 +150,14 @@
       else
          throw new DeploymentException("message-destination-usage should be one of Consumes, Produces, ConsumesProduces");
 
-      Element child = getOptionalChild(element, "message-destination-link");
+      Element child = MetaData.getOptionalChild(element, "message-destination-link");
       if (child != null)
-         link = getElementContent(child);
+         link = MetaData.getElementContent(child);
    }
 
    public void importJbossXml(Element element) throws DeploymentException
    {
-      jndiName = getElementContent(getUniqueChild(element, "jndi-name"));
+      jndiName = MetaData.getElementContent(MetaData.getUniqueChild(element, "jndi-name"));
    }
 
    // Package protected ---------------------------------------------

Added: trunk/server/src/main/org/jboss/metadata/NameValuePair.java
===================================================================
--- trunk/server/src/main/org/jboss/metadata/NameValuePair.java	2006-09-30 04:21:39 UTC (rev 57299)
+++ trunk/server/src/main/org/jboss/metadata/NameValuePair.java	2006-09-30 04:27:08 UTC (rev 57300)
@@ -0,0 +1,66 @@
+/*
+  * 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.metadata;
+
+import org.jboss.logging.Logger;
+
+/**
+ * @author <a href="mailto:bdecoste at jboss.com">William DeCoste</a>
+ * @version <tt>$Revision: 45409 $</tt>
+ */
+public class NameValuePair
+{
+   private static final Logger log = Logger.getLogger(NameValuePair.class);
+
+   private String name;
+   private String value;
+
+   public String getName()
+   {
+      return name;
+   }
+
+   public void setName(String name)
+   {
+      this.name = name;
+   }
+   
+   public String getValue()
+   {
+      return value;
+   }
+
+   public void setValue(String value)
+   {
+      this.value = value;
+   }
+
+   public String toString()
+   {
+      StringBuffer sb = new StringBuffer(100);
+      sb.append('[');
+      sb.append("name=").append(name);
+      sb.append(", value=").append(value);
+      sb.append(']');
+      return sb.toString();
+   }
+}

Added: trunk/server/src/main/org/jboss/metadata/PersistenceContextRef.java
===================================================================
--- trunk/server/src/main/org/jboss/metadata/PersistenceContextRef.java	2006-09-30 04:21:39 UTC (rev 57299)
+++ trunk/server/src/main/org/jboss/metadata/PersistenceContextRef.java	2006-09-30 04:27:08 UTC (rev 57300)
@@ -0,0 +1,67 @@
+/*
+* 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.metadata;
+
+import javax.persistence.PersistenceContextType;
+
+/**
+ * Comment
+ *
+ * @author <a href="mailto:bill at jboss.org">Bill Burke</a>
+ * @version $Revision: 46506 $
+ */
+public class PersistenceContextRef extends Ref
+{
+   private String refName;
+   private String unitName;
+   private PersistenceContextType persistenceContextType;
+
+   public String getRefName()
+   {
+      return refName;
+   }
+
+   public void setRefName(String refName)
+   {
+      this.refName = refName;
+   }
+
+   public String getUnitName()
+   {
+      return unitName;
+   }
+
+   public void setUnitName(String unitName)
+   {
+      this.unitName = unitName;
+   }
+
+   public PersistenceContextType getPersistenceContextType()
+   {
+      return persistenceContextType;
+   }
+
+   public void setPersistenceContextType(PersistenceContextType persistenceContextType)
+   {
+      this.persistenceContextType = persistenceContextType;
+   }
+}

Added: trunk/server/src/main/org/jboss/metadata/PersistenceUnitRef.java
===================================================================
--- trunk/server/src/main/org/jboss/metadata/PersistenceUnitRef.java	2006-09-30 04:21:39 UTC (rev 57299)
+++ trunk/server/src/main/org/jboss/metadata/PersistenceUnitRef.java	2006-09-30 04:27:08 UTC (rev 57300)
@@ -0,0 +1,65 @@
+/*
+* 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.metadata;
+
+/**
+ * Comment
+ *
+ * @author <a href="mailto:bill at jboss.org">Bill Burke</a>
+ * @version $Revision: 45712 $
+ */
+public class PersistenceUnitRef extends Ref
+{
+   private String refName;
+   private String unitName;
+
+   public String getRefName()
+   {
+      return refName;
+   }
+
+   public void setRefName(String refName)
+   {
+      this.refName = refName;
+   }
+
+   public String getUnitName()
+   {
+      return unitName;
+   }
+
+   public void setUnitName(String unitName)
+   {
+      this.unitName = unitName;
+   }
+   
+   public String toString()
+   {
+      StringBuffer sb = new StringBuffer(100);
+      sb.append("[" + this.getClass().getName() + ": ");
+      sb.append("refName=").append(refName);
+      sb.append(", unitName=").append(unitName);
+      sb.append(", unitName=").append(unitName);
+      sb.append(", " + super.toString());
+      return sb.toString();
+   }
+}

Added: trunk/server/src/main/org/jboss/metadata/Ref.java
===================================================================
--- trunk/server/src/main/org/jboss/metadata/Ref.java	2006-09-30 04:21:39 UTC (rev 57299)
+++ trunk/server/src/main/org/jboss/metadata/Ref.java	2006-09-30 04:27:08 UTC (rev 57300)
@@ -0,0 +1,72 @@
+/*
+  * 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.metadata;
+
+/**
+ * @author <a href="mailto:bdecoste at jboss.com">William DeCoste</a>
+ * @author Scott.Stark at jboss.org
+ * @version <tt>$Revision: 45790 $</tt>
+ */
+public abstract class Ref
+{
+   protected InjectionTarget injectionTarget;
+   private String description;
+   private boolean ignoreDependency;
+
+   public String getDescription()
+   {
+      return description;
+   }
+   public void setDescription(String description)
+   {
+      this.description = description;
+   }
+
+   public InjectionTarget getInjectionTarget()
+   {
+      return injectionTarget;
+   }
+
+   public void setInjectionTarget(InjectionTarget injectionTarget)
+   {
+      this.injectionTarget = injectionTarget;
+   }
+
+   public String toString()
+   {
+      StringBuffer sb = new StringBuffer(100);
+      sb.append("[");
+      sb.append(", injectionTarget=").append(injectionTarget);
+      sb.append("]");
+      return sb.toString();
+   }
+
+   public boolean isIgnoreDependency()
+   {
+      return ignoreDependency;
+   }
+
+   public void setIgnoreDependency(boolean ignoreDependency)
+   {
+      this.ignoreDependency = ignoreDependency;
+   }
+}

Modified: trunk/server/src/main/org/jboss/metadata/ResourceEnvRefMetaData.java
===================================================================
--- trunk/server/src/main/org/jboss/metadata/ResourceEnvRefMetaData.java	2006-09-30 04:21:39 UTC (rev 57299)
+++ trunk/server/src/main/org/jboss/metadata/ResourceEnvRefMetaData.java	2006-09-30 04:27:08 UTC (rev 57300)
@@ -45,7 +45,7 @@
  * @author <a href="mailto:Scott_Stark at displayscape.com">Scott Stark</a>.
  * @version $Revision$
  */
-public class ResourceEnvRefMetaData extends MetaData
+public class ResourceEnvRefMetaData extends Ref
 {
    /**
     * The (application-client|ejb-jar|web-app)/../resource-env-ref/resource-env-ref-name
@@ -70,15 +70,57 @@
    /** The message-destination-ref-name/message-destination-link
     */ 
    private String link;
+   /** The resource-ref/res-auth value.
+   The res-auth element specifies whether the enterprise bean code signs
+   on programmatically to the resource manager, or whether the Container
+   will sign on to the resource manager on behalf of the enterprise bean.
+   In the latter case, the Container uses information that is supplied by
+   the Deployer.
+   The value of this element must be one of the following for EJB2.0,
+   Servlet 2.3:
+   <res-auth>Application</res-auth>
+   <res-auth>Container</res-auth>
+   */
+   private boolean containerAuth;
+   /** The resource-ref/res-sharing-scope value
+   The res-sharing-scope element specifies whether connections obtained
+   through the given resource manager connection factory reference can
+   be shared. The value of this element, if specified, must be one of the
+   two following:
+   <res-sharing-scope>Shareable</res-sharing-scope>
+   <res-sharing-scope>Unshareable</res-sharing-scope>
+   The default value is Shareable.
+   */
+  private boolean isShareable;
 
+   public String getJndiName()
+   {
+      return jndiName;
+   }
+
+   public void setJndiName(String jndiName)
+   {
+      this.jndiName = jndiName;
+   }
+
+   public String getLink()
+   {
+      return link;
+   }
+
+   public void setLink(String link)
+   {
+      this.link = link;
+   }
+
    public String getRefName()
    {
       return refName;
    }
 
-   public String getJndiName()
+   public void setRefName(String refName)
    {
-      return jndiName;
+      this.refName = refName;
    }
 
    public String getType()
@@ -86,11 +128,33 @@
       return type;
    }
 
-   public String getLink()
+   public void setType(String type)
    {
-      return link;
+      this.type = type;
    }
 
+   public boolean isContainerAuth()
+   {
+      return containerAuth;
+   }
+   public void setContainerAuth(boolean flag)
+   {
+      this.containerAuth = flag;
+   }
+   public void setContainerAuth(String value)
+   {
+      this.containerAuth = value.equalsIgnoreCase("Container");
+   }
+
+   public boolean isShareable()
+   {
+      return isShareable;
+   }
+   public void setSharable(String value)
+   {
+      this.isShareable = value.equalsIgnoreCase("Shareable");
+   }
+
    /**
     * Parse the application-client|ejb-jar|web-app child element
     *
@@ -101,14 +165,14 @@
       String name = element.getLocalName();
       if (name.equals("resource-env-ref"))
       {
-         refName = getElementContent(getUniqueChild(element, "resource-env-ref-name"));
-         type = getElementContent(getUniqueChild(element, "resource-env-ref-type"));
+         refName = MetaData.getElementContent(MetaData.getUniqueChild(element, "resource-env-ref-name"));
+         type = MetaData.getElementContent(MetaData.getUniqueChild(element, "resource-env-ref-type"));
       }
       else if( name.equals("message-destination-ref") )
       {
-         refName = getElementContent(getUniqueChild(element, "message-destination-ref-name"));
-         type = getElementContent(getUniqueChild(element, "message-destination-type"));
-         link = getElementContent(getOptionalChild(element, "message-destination-link"));
+         refName = MetaData.getElementContent(MetaData.getUniqueChild(element, "message-destination-ref-name"));
+         type = MetaData.getElementContent(MetaData.getUniqueChild(element, "message-destination-type"));
+         link = MetaData.getElementContent(MetaData.getOptionalChild(element, "message-destination-link"));
          // Don't care about the message-destination-usage
       }
    }
@@ -120,6 +184,6 @@
     */
    public void importJbossXml(Element element) throws DeploymentException
    {
-      jndiName = getElementContent(getUniqueChild(element, "jndi-name"));
+      jndiName = MetaData.getElementContent(MetaData.getUniqueChild(element, "jndi-name"));
    }
 }

Modified: trunk/server/src/main/org/jboss/metadata/ResourceRefMetaData.java
===================================================================
--- trunk/server/src/main/org/jboss/metadata/ResourceRefMetaData.java	2006-09-30 04:21:39 UTC (rev 57299)
+++ trunk/server/src/main/org/jboss/metadata/ResourceRefMetaData.java	2006-09-30 04:27:08 UTC (rev 57300)
@@ -21,10 +21,10 @@
 */
 package org.jboss.metadata;
 
+import org.jboss.deployment.DeploymentException;
 import org.w3c.dom.Element;
+import static org.jboss.metadata.MetaData.*;
 
-import org.jboss.deployment.DeploymentException;
-
 /** The meta data information for a resource-ref element.
  The resource-ref element contains a declaration of enterprise bean�s
  reference to an external resource. It consists of an optional description,
@@ -39,7 +39,7 @@
  *   @author <a href="mailto:Scott.Stark at jboss.org">Scott Stark</a>.
  *   @version $Revision$
  */
-public class ResourceRefMetaData extends MetaData
+public class ResourceRefMetaData extends Ref
 {
    // Constants -----------------------------------------------------
 
@@ -101,11 +101,56 @@
 
    // Public --------------------------------------------------------
 
+   public String getJndiName()
+   {
+      return jndiName;
+   }
+
+   public void setJndiName(String jndiName)
+   {
+      this.jndiName = jndiName;
+   }
+
+   public String getName()
+   {
+      return name;
+   }
+
+   public void setName(String name)
+   {
+      this.name = name;
+   }
+
    public String getRefName()
    {
       return refName;
    }
 
+   public void setRefName(String refName)
+   {
+      this.refName = refName;
+   }
+
+   public String getResURL()
+   {
+      return resURL;
+   }
+
+   public void setResURL(String resURL)
+   {
+      this.resURL = resURL;
+   }
+
+   public String getType()
+   {
+      return type;
+   }
+
+   public void setType(String type)
+   {
+      this.type = type;
+   }
+
    public String getResourceName()
    {
       if (name == null)
@@ -121,28 +166,31 @@
       name = resName;
    }
 
-   public String getJndiName()
+   public boolean isContainerAuth()
    {
-      return jndiName;
+      return containerAuth;
    }
-   public String getResURL()
+   public void setContainerAuth(String value)
    {
-      return resURL;
+      this.containerAuth = value.equalsIgnoreCase("Container");
    }
-   public String getType()
+   public void setContainerAuth(boolean flag)
    {
-      return type;
+      this.containerAuth = flag;
    }
 
-   public boolean isContainerAuth()
-   {
-      return containerAuth;
-   }
-
    public boolean isShareable()
    {
       return isShareable;
    }
+   public void setSharable(String value)
+   {
+      this.isShareable = value.equalsIgnoreCase("Shareable");
+   }
+   public void setSharable(boolean flag)
+   {
+      this.isShareable = flag;
+   }
 
    public void importEjbJarXml(Element element) throws DeploymentException
    {

Added: trunk/server/src/main/org/jboss/metadata/RunAs.java
===================================================================
--- trunk/server/src/main/org/jboss/metadata/RunAs.java	2006-09-30 04:21:39 UTC (rev 57299)
+++ trunk/server/src/main/org/jboss/metadata/RunAs.java	2006-09-30 04:27:08 UTC (rev 57300)
@@ -0,0 +1,56 @@
+/*
+  * 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.metadata;
+
+import org.jboss.logging.Logger;
+
+/**
+ * Represents a <run-as> element
+ *
+ * @author <a href="mailto:bdecoste at jboss.com">William DeCoste</a>
+ * @version <tt>$Revision: 45409 $</tt>
+ */
+public class RunAs
+{
+   private static final Logger log = Logger.getLogger(RunAs.class);
+   
+   private String roleName;
+    
+   public String getRoleName()
+   {
+      return roleName;
+   }
+
+   public void setRoleName(String roleName)
+   {
+      this.roleName = roleName;
+   }
+
+   public String toString()
+   {
+      StringBuffer sb = new StringBuffer(100);
+      sb.append("[" + this.getClass().getName() + ": ");
+      sb.append("roleName=").append(roleName);
+      sb.append("]");
+      return sb.toString();
+   }
+}

Modified: trunk/server/src/main/org/jboss/metadata/SecurityRoleMetaData.java
===================================================================
--- trunk/server/src/main/org/jboss/metadata/SecurityRoleMetaData.java	2006-09-30 04:21:39 UTC (rev 57299)
+++ trunk/server/src/main/org/jboss/metadata/SecurityRoleMetaData.java	2006-09-30 04:27:08 UTC (rev 57300)
@@ -37,12 +37,16 @@
 public class SecurityRoleMetaData extends MetaData
 {
    private String roleName;
-   private Set principals;
+   private Set<String> principals;
 
+   public SecurityRoleMetaData()
+   {
+      this(null);
+   }
    public SecurityRoleMetaData(String roleName)
    {
       this.roleName = roleName;
-      this.principals = new HashSet();
+      this.principals = new HashSet<String>();
    }
 
    public void addPrincipalName(String principalName)
@@ -50,7 +54,7 @@
       principals.add(principalName);
    }
 
-   public void addPrincipalNames(Set principalNames)
+   public void addPrincipalNames(Set<String> principalNames)
    {
       principals.addAll(principalNames);
    }
@@ -59,8 +63,12 @@
    {
       return roleName;
    }
+   public void setRoleName(String roleName)
+   {
+      this.roleName = roleName;
+   }
 
-   public Set getPrincipals()
+   public Set<String> getPrincipals()
    {
       return principals;
    }

Modified: trunk/server/src/main/org/jboss/metadata/SecurityRoleRefMetaData.java
===================================================================
--- trunk/server/src/main/org/jboss/metadata/SecurityRoleRefMetaData.java	2006-09-30 04:21:39 UTC (rev 57299)
+++ trunk/server/src/main/org/jboss/metadata/SecurityRoleRefMetaData.java	2006-09-30 04:27:08 UTC (rev 57300)
@@ -1,71 +1,101 @@
 /*
-* 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.
-*/
+ * 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.metadata;
 
 import org.w3c.dom.Element;
 
 import org.jboss.deployment.DeploymentException;
 
-/** The metadata object for the security-role-ref element.
-The security-role-ref element contains the declaration of a security
-role reference in the enterprise bean’s code. The declaration con-sists
-of an optional description, the security role name used in the
-code, and an optional link to a defined security role.
-The value of the role-name element must be the String used as the
-parameter to the EJBContext.isCallerInRole(String roleName) method.
-The value of the role-link element must be the name of one of the
-security roles defined in the security-role elements.
+/**
+ * The metadata object for the security-role-ref element. The security-role-ref
+ * element contains the declaration of a security role reference in the
+ * enterprise bean�s code. The declaration con-sists of an optional description,
+ * the security role name used in the code, and an optional link to a defined
+ * security role. The value of the role-name element must be the String used as
+ * the parameter to the EJBContext.isCallerInRole(String roleName) method. The
+ * value of the role-link element must be the name of one of the security roles
+ * defined in the security-role elements.
+ * 
+ * Used in: entity and session
+ * 
+ * @author <a href="mailto:sebastien.alborini at m4x.org">Sebastien Alborini</a>
+ * @author Scott.Stark at jboss.org
+ * @version $Revision$
+ */
+public class SecurityRoleRefMetaData extends MetaData
+{
+   // Constants -----------------------------------------------------
 
-Used in: entity and session
+   // Attributes ----------------------------------------------------
+   private String name;
 
- *   @author <a href="mailto:sebastien.alborini at m4x.org">Sebastien Alborini</a>
- *   @author <a href="mailto:Scott_Stark at displayscape.com">Scott Stark</a>.
- *   @version $Revision$
- */
-public class SecurityRoleRefMetaData extends MetaData {
-    // Constants -----------------------------------------------------
-    
-    // Attributes ----------------------------------------------------
-	private String name;
-    private String link;
-    private String description;
-	
-    // Static --------------------------------------------------------
-    
-    // Constructors --------------------------------------------------
-    public SecurityRoleRefMetaData () {
-	}
-	
-    // Public --------------------------------------------------------
-	
-	public String getName() { return name; }
-	
-	public String getLink() { return link; }
-	public String getDescription() { return description; }
+   private String link;
 
-    public void importEjbJarXml(Element element) throws DeploymentException {
-		name = getElementContent(getUniqueChild(element, "role-name"));
-		link = getElementContent(getOptionalChild(element, "role-link"));
-		description = getElementContent(getOptionalChild(element, "description"));
-	}		
+   private String description;
 
+   // Static --------------------------------------------------------
+
+   // Constructors --------------------------------------------------
+   public SecurityRoleRefMetaData()
+   {
+   }
+
+   // Public --------------------------------------------------------
+
+   public String getDescription()
+   {
+      return description;
+   }
+
+   public void setDescription(String description)
+   {
+      this.description = description;
+   }
+
+   public String getLink()
+   {
+      return link;
+   }
+
+   public void setLink(String link)
+   {
+      this.link = link;
+   }
+
+   public String getName()
+   {
+      return name;
+   }
+
+   public void setName(String name)
+   {
+      this.name = name;
+   }
+
+   public void importEjbJarXml(Element element) throws DeploymentException
+   {
+      name = getElementContent(getUniqueChild(element, "role-name"));
+      link = getElementContent(getOptionalChild(element, "role-link"));
+      description = getElementContent(getOptionalChild(element, "description"));
+   }
+
 }

Modified: trunk/server/src/main/org/jboss/metadata/WebMetaData.java
===================================================================
--- trunk/server/src/main/org/jboss/metadata/WebMetaData.java	2006-09-30 04:21:39 UTC (rev 57299)
+++ trunk/server/src/main/org/jboss/metadata/WebMetaData.java	2006-09-30 04:27:08 UTC (rev 57300)
@@ -35,6 +35,14 @@
 
 import org.jboss.deployment.DeploymentException;
 import org.jboss.logging.Logger;
+import org.jboss.metadata.web.ErrorPage;
+import org.jboss.metadata.web.Filter;
+import org.jboss.metadata.web.FilterMapping;
+import org.jboss.metadata.web.LoginConfig;
+import org.jboss.metadata.web.ReplicationConfig;
+import org.jboss.metadata.web.Servlet;
+import org.jboss.metadata.web.ServletMapping;
+import org.jboss.metadata.web.SessionConfig;
 import org.jboss.webservice.metadata.serviceref.ServiceRefMetaData;
 import org.jboss.mx.loading.LoaderRepositoryFactory;
 import org.jboss.mx.loading.LoaderRepositoryFactory.LoaderRepositoryConfig;
@@ -56,24 +64,42 @@
 {
    private static Logger log = Logger.getLogger(WebMetaData.class);
 
-   /** The web.xml servlet <String, String> */
-   private HashMap servletClassNames = new HashMap();
+   /** The web.xml servlet to class mapping */
+   private HashMap<String, String> servletClassNames = new HashMap<String, String>();
+   private HashMap<String, Servlet> servlets = new HashMap<String, Servlet>();
    /** The web.xml servlet-mapping <String, String> */
-   private HashMap servletMappings = new HashMap();
-   /** The web.xml resource-refs <String, String> */
-   private HashMap resourceReferences = new HashMap();
-   /** The web.xml resource-env-refs <String, String> */
-   private HashMap resourceEnvReferences = new HashMap();
-   /** The web.xml message-destination-refs <String, MessageDestinationRefMetaData> */
-   private HashMap messageDestinationReferences = new HashMap();
-   /** The web.xml message-destination <String, MessageDestinationMetaData> */
-   private HashMap messageDestinations = new HashMap();
+   private HashMap<String, ServletMapping> servletMappings = new HashMap<String, ServletMapping>();
+   /** The web.xml resource-refs */
+   private HashMap<String, ResourceRefMetaData> resourceReferences =
+      new HashMap<String, ResourceRefMetaData>();
+   /** The web.xml resource-env-refs */
+   private HashMap<String, ResourceEnvRefMetaData> resourceEnvReferences =
+      new HashMap<String, ResourceEnvRefMetaData>();
+   /** The web.xml message-destination-refs */
+   private HashMap<String, MessageDestinationRefMetaData> messageDestinationReferences
+      = new HashMap<String, MessageDestinationRefMetaData>();
+   /** The web.xml message-destination */
+   private HashMap<String, MessageDestinationMetaData> messageDestinations =
+         new HashMap<String, MessageDestinationMetaData>();
+   /** web-app/filter */
+   protected HashMap<String, Filter> filters = new HashMap<String, Filter>();
+   /** web-app/filter-mapping */
+   protected HashMap<String, FilterMapping> filterMappings =
+      new HashMap<String, FilterMapping>();
+   protected HashMap listeners = new HashMap();
+   protected List<SessionConfig> sessionConfigs = new ArrayList<SessionConfig>();
+   /** web.xml security-constraint */
+   protected List<WebSecurityMetaData> securityConstraints =
+      new ArrayList<WebSecurityMetaData>();
+   protected LoginConfig loginConfig;
+   protected HashMap<String, ErrorPage> errorPages = new HashMap<String, ErrorPage>();
+   protected List<String> dependencies = new ArrayList<String>();
+   protected ReplicationConfig replicationConfig;
+
    /** web.xml env-entrys */
-   private ArrayList environmentEntries = new ArrayList();
-   /** web.xml security-constraint <WebSecurityMetaData> */
-   private ArrayList securityContraints = new ArrayList();
-   /** The HashMap<String, SecurityRoleMetaData> for the security-roles */
-   private HashMap securityRoles = new HashMap();
+   private ArrayList<EnvEntryMetaData> environmentEntries = new ArrayList<EnvEntryMetaData>();
+   /** The HashMap for the security-roles */
+   private HashMap<String, SecurityRoleMetaData> securityRoles = new HashMap<String, SecurityRoleMetaData>();
    /** web.xml ejb-refs */
    private HashMap ejbReferences = new HashMap();
    /** web.xml ejb-local-refs */
@@ -200,6 +226,194 @@
       this.resourceCl = resourceCl;
    }
 
+   public void addFilter(Filter filter)
+   {
+      filters.put(filter.getName(), filter);
+   }
+   
+   public Collection getFilterMappings()
+   {
+      return filterMappings.values();
+   }
+
+   public void addFilterMapping(FilterMapping mapping)
+   {
+      filterMappings.put(mapping.getFilterName(), mapping);
+   }
+   
+   public Collection getListeners()
+   {
+      return listeners.values();
+   }
+
+   public void addListener(Listener listener)
+   {
+      listeners.put(listener.getListenerClass(), listener);
+   }
+   
+   public Collection getServlets()
+   {
+      return servlets.values();
+   }
+
+   public void addServlet(Servlet servlet)
+   {
+      String servletName = servlet.getName();
+      servlets.put(servletName, servlet);
+      // Need to see where this mapping is used
+      String servletClass = servlet.getServletClass();
+      this.servletClassNames.put(servletName, servletClass);
+   }
+   
+   public void updateServlet(Servlet updatedServlet)
+   {
+      Servlet servlet = (Servlet)servlets.get(updatedServlet.getName());
+      if (servlet != null)
+      {
+         servlet.setRunAsPrincipals(updatedServlet.getRunAsPrincipals());
+      }
+      else
+      {
+         servlets.put(updatedServlet.getName(), updatedServlet);
+      }
+   }
+   
+   public Collection getServletMappings()
+   {
+      return servletMappings.values();
+   }
+
+   public void addServletMapping(ServletMapping mapping)
+   {
+      servletMappings.put(mapping.getName(), mapping);
+   }
+   
+   public Collection getSessionConfigs()
+   {
+      return sessionConfigs;
+   }
+
+   public void addSessionConfig(SessionConfig config)
+   {
+      sessionConfigs.add(config);
+   }
+   
+   public void addSecurityRole(SecurityRoleMetaData securityRole)
+   {
+      securityRoles.put(securityRole.getRoleName(), securityRole);
+   }
+   
+   public void updateSecurityRole(SecurityRoleMetaData updatedRole)
+   {
+      SecurityRoleMetaData role = securityRoles.get(updatedRole.getRoleName());
+      if (role != null)
+      {
+         role.setRoleName(updatedRole.getRoleName());
+      }
+      else
+      {
+         securityRoles.put(updatedRole.getRoleName(), updatedRole);
+      }
+   }
+   
+   public Collection getSecurityConstraints()
+   {
+      return securityConstraints;
+   }
+
+   public void addSecurityConstraint(WebSecurityMetaData constraint)
+   {
+      securityConstraints.add(constraint);
+   }
+   
+   public LoginConfig getLoginConfig()
+   {
+      return loginConfig;
+   }
+   
+   public void setLoginConfig(LoginConfig loginConfig)
+   {
+      this.loginConfig = loginConfig;
+   }
+   
+   public Collection getErrorPages()
+   {
+      return errorPages.values();
+   }
+
+   public void addErrorPage(ErrorPage errorPage)
+   {
+      errorPages.put(errorPage.getErrorCode(), errorPage);
+   }
+   
+   public Collection getMessageDestinations()
+   {
+      return messageDestinations.values();
+   }
+
+   public void addEjbLocalRef(EjbLocalRefMetaData ref)
+   {
+      this.ejbLocalReferences.put(ref.getName(), ref);
+   }
+   public void addEjbRef(EjbRefMetaData ref)
+   {
+      this.ejbReferences.put(ref.getName(), ref);
+   }
+   public void addEnvEntry(EnvEntryMetaData ref)
+   {
+      this.environmentEntries.add(ref);
+   }
+   public void addMessageDestinationRef(MessageDestinationRefMetaData ref)
+   {
+      this.messageDestinationReferences.put(ref.getRefName(), ref);
+   }
+   public void addMessageDestination(MessageDestinationMetaData destination)
+   {
+      log.debug("addMessageDestination, "+destination);
+      messageDestinations.put(destination.getName(), destination);
+   }
+   public void updateMessageDestination(MessageDestinationMetaData updatedDestination)
+   {
+      MessageDestinationMetaData destination = (MessageDestinationMetaData)
+         messageDestinations.get(updatedDestination.getName());
+      if (destination != null)
+      {
+         destination.setJndiName(updatedDestination.getMappedName());
+      }
+      else
+      {
+         messageDestinations.put(updatedDestination.getName(), updatedDestination);
+      }
+   }
+   public void addResourceEnvRef(ResourceEnvRefMetaData ref)
+   {
+      this.resourceEnvReferences.put(ref.getRefName(), ref);
+   }
+   public void addResourceRef(ResourceRefMetaData ref)
+   {
+      this.resourceReferences.put(ref.getRefName(), ref);
+   }
+   public void addDependency(String depends)
+   {
+      dependencies.add(depends);
+   }
+
+   public Collection getDependencies()
+   {
+      return dependencies;
+   }
+   
+   public ReplicationConfig getReplicationConfig()
+   {
+      return replicationConfig;
+   }
+   
+   public void setReplicationConfig(ReplicationConfig replicationConfig)
+   {
+      this.replicationConfig = replicationConfig;
+   }
+
+
    /** Return an iterator of the env-entry mappings.
     @return Iterator of EnvEntryMetaData objects.
     */
@@ -449,19 +663,19 @@
 
    /** Get the security-constraint settings
     */
-   public Iterator getSecurityContraints()
+   public Iterator<WebSecurityMetaData> getSecurityContraints()
    {
-      return securityContraints.iterator();
+      return securityConstraints.iterator();
    }
 
    /**
     *
     * @param securityContraints - Collection<WebSecurityMetaData>
     */
-   public void setSecurityConstraints(Collection securityContraints)
+   public void setSecurityConstraints(Collection<WebSecurityMetaData> securityContraints)
    {
-      this.securityContraints.clear();
-      this.securityContraints.addAll(securityContraints);
+      this.securityConstraints.clear();
+      this.securityConstraints.addAll(securityContraints);
    }
 
    /**
@@ -578,25 +792,6 @@
     * Get the servlet-name values from the web.xml descriptor
     * @return Set<String> of the servlet-names from the servlet-mappings
     */
-   public HashMap getServletMappings()
-   {
-      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();
-      this.servletMappings.putAll(servletMappings);
-   }
-
-   /**
-    * Get the servlet-name values from the web.xml descriptor
-    * @return Set<String> of the servlet-names from the servlet-mappings
-    */
    public Set getServletNames()
    {
       return new HashSet(servletMappings.keySet());
@@ -615,15 +810,15 @@
     * Merge the security role/principal mapping defined in jboss-web.xml
     * with the one defined at jboss-app.xml.
     */
-   public void mergeSecurityRoles(Map applRoles)
+   public void mergeSecurityRoles(Map<String, SecurityRoleMetaData> applRoles)
    {
-      Iterator it = applRoles.entrySet().iterator();
+      Iterator<Map.Entry<String, SecurityRoleMetaData>> it = applRoles.entrySet().iterator();
       while (it.hasNext())
       {
-         Map.Entry entry = (Map.Entry) it.next();
-         String roleName = (String)entry.getKey();
-         SecurityRoleMetaData appRole = (SecurityRoleMetaData)entry.getValue();
-         SecurityRoleMetaData srMetaData = (SecurityRoleMetaData)securityRoles.get(roleName);
+         Map.Entry<String, SecurityRoleMetaData> entry = it.next();
+         String roleName = entry.getKey();
+         SecurityRoleMetaData appRole = entry.getValue();
+         SecurityRoleMetaData srMetaData = securityRoles.get(roleName);
          if (srMetaData != null)
          {
             Set principalNames = appRole.getPrincipals();
@@ -805,231 +1000,6 @@
       this.maxActiveSessions = maxActive;
    }
 
-   public void importXml(Element element) throws DeploymentException
-   {
-      String rootTag = element.getOwnerDocument().getDocumentElement().getTagName();
-      if( rootTag.equals("web-app") )
-      {
-         importWebXml(element);
-      }
-      else if( rootTag.equals("jboss-web") )
-      {
-         importJBossWebXml(element);
-      }
-   }
-
-   /** Parse the elements of the web-app element used by the integration layer.
-    */
-   protected void importWebXml(Element webApp) throws DeploymentException
-   {
-      // Parse the web-app/servlet/security-role-ref + run-as elements
-      Iterator iterator = getChildrenByTagName(webApp, "servlet");
-      while( iterator.hasNext() )
-      {
-         Element servlet = (Element) iterator.next();
-         String servletName = getElementContent(getUniqueChild(servlet, "servlet-name"));
-         String servletClass = getElementContent(getOptionalChild(servlet, "servlet-class"));
-         if (servletClass != null)
-         {
-            servletClassNames.put(servletName, servletClass);
-         }
-
-         Iterator roleRefs = getChildrenByTagName(servlet, "security-role-ref");
-         ArrayList roleNames = new ArrayList();
-         while( roleRefs.hasNext() )
-         {
-            Element roleRefElem = (Element) roleRefs.next();
-            SecurityRoleRefMetaData roleRef = new SecurityRoleRefMetaData();
-            roleRef.importEjbJarXml(roleRefElem);
-            roleNames.add(roleRef);
-         }
-         securityRoleReferences.put(servletName, roleNames);
-
-         // Check for a run-as/role-name
-         Element runAs = getOptionalChild(servlet, "run-as");
-         if( runAs != null )
-         {
-            String runAsName = getElementContent(getOptionalChild(runAs, "role-name"));
-            runAsNames.put(servletName, runAsName);
-         }
-      }
-
-      // Parse the web-app/servlet-mapping elements
-      iterator = getChildrenByTagName(webApp, "servlet-mapping");
-      while( iterator.hasNext() )
-      {
-         Element servletMapping = (Element) iterator.next();
-         String servletName = getElementContent(getUniqueChild(servletMapping, "servlet-name"));
-         String urlPattern = getElementContent(getUniqueChild(servletMapping, "url-pattern"));
-         servletMappings.put(servletName, urlPattern);
-      }
-
-      // Parse the web-app/resource-ref elements
-      iterator = getChildrenByTagName(webApp, "resource-ref");
-      while( iterator.hasNext() )
-      {
-         Element resourceRef = (Element) iterator.next();
-         ResourceRefMetaData resourceRefMetaData = new ResourceRefMetaData();
-         resourceRefMetaData.importEjbJarXml(resourceRef);
-         resourceReferences.put(resourceRefMetaData.getRefName(), resourceRefMetaData);
-      }
-
-      // Parse the resource-env-ref elements
-      iterator = getChildrenByTagName(webApp, "resource-env-ref");
-      while (iterator.hasNext())
-      {
-         Element resourceRef = (Element) iterator.next();
-         ResourceEnvRefMetaData refMetaData = new ResourceEnvRefMetaData();
-         refMetaData.importEjbJarXml(resourceRef);
-         resourceEnvReferences.put(refMetaData.getRefName(), refMetaData);
-      }
-
-      // set the message destination references
-      iterator = getChildrenByTagName(webApp, "message-destination-ref");
-      while (iterator.hasNext())
-      {
-         Element messageDestinationRef = (Element) iterator.next();
-         MessageDestinationRefMetaData messageDestinationRefMetaData = new MessageDestinationRefMetaData();
-         messageDestinationRefMetaData.importEjbJarXml(messageDestinationRef);
-         messageDestinationReferences.put(messageDestinationRefMetaData.getRefName(), messageDestinationRefMetaData);
-      }
-
-      // set the message destinations (optional)
-      iterator = getChildrenByTagName(webApp, "message-destination");
-      while (iterator.hasNext())
-      {
-         Element messageDestination = (Element) iterator.next();
-         try
-         {
-            MessageDestinationMetaData messageDestinationMetaData = new MessageDestinationMetaData();
-            messageDestinationMetaData.importEjbJarXml(messageDestination);
-            messageDestinations.put(messageDestinationMetaData.getName(), messageDestinationMetaData);
-         }
-         catch (Throwable t)
-         {
-            throw new DeploymentException("Error in web.xml " +
-               "for message destination: " + t.getMessage());
-         }
-      }
-
-      // Parse the web-app/env-entry elements
-      iterator = getChildrenByTagName(webApp, "env-entry");
-      while( iterator.hasNext() )
-      {
-         Element envEntry = (Element) iterator.next();
-         EnvEntryMetaData envEntryMetaData = new EnvEntryMetaData();
-         envEntryMetaData.importEjbJarXml(envEntry);
-         environmentEntries.add(envEntryMetaData);
-      }
-
-      // Get the security-constraints
-      iterator = getChildrenByTagName(webApp, "security-constraint");
-      while (iterator.hasNext())
-      {
-         Element contraints = (Element) iterator.next();
-         WebSecurityMetaData wsmd = new WebSecurityMetaData();
-         securityContraints.add(wsmd);
-         // Process the web-resource-collections
-         Iterator iter2 = getChildrenByTagName(contraints, "web-resource-collection");
-         while( iter2.hasNext() )
-         {
-            Element wrcElement = (Element) iter2.next();
-            Element wrName = getUniqueChild(wrcElement, "web-resource-name");
-            String name = getElementContent(wrName);
-            WebSecurityMetaData.WebResourceCollection wrc = wsmd.addWebResource(name);
-            Iterator iter21 = getChildrenByTagName(wrcElement, "url-pattern");
-            while( iter21.hasNext() )
-            {
-               Element urlPattern = (Element) iter21.next();
-               String pattern = getElementContent(urlPattern);
-               wrc.addPattern(pattern);
-            }
-
-            Iterator iter22 = getChildrenByTagName(wrcElement, "http-method");
-            while( iter22.hasNext() )
-            {
-               Element httpMethod = (Element) iter22.next();
-               String method = getElementContent(httpMethod);
-               wrc.addHttpMethod(method);
-            }
-         }
-
-         // Process the auth-constraints
-         Element authContraint = getOptionalChild(contraints, "auth-constraint");
-         if( authContraint != null )
-         {
-            Iterator iter3 = getChildrenByTagName(authContraint, "role-name");
-            while( iter3.hasNext() )
-            {
-               Element roleName = (Element) iter3.next();
-               String name = getElementContent(roleName);
-               wsmd.addRole(name);
-            }
-            if( wsmd.getRoles().size() == 0 )
-               wsmd.setExcluded(true);
-         }
-         else
-         {
-            wsmd.setUnchecked(true);
-         }
-
-         // Process the user-data-constraint
-         Element userData = getOptionalChild(contraints, "user-data-constraint");
-         if( userData != null )
-         {
-            Element transport = getUniqueChild(userData, "transport-guarantee");
-            String type = getElementContent(transport);
-            wsmd.setTransportGuarantee(type);
-         }
-      }
-
-      // Get the web-app/security-role elements (optional)
-      iterator = getChildrenByTagName(webApp, "security-role");
-      while (iterator.hasNext())
-      {
-         Element securityRole = (Element) iterator.next();
-         String roleName = getElementContent(getUniqueChild(securityRole, "role-name"));
-         securityRoles.put(roleName, new SecurityRoleMetaData(roleName));
-      }
-
-      // Parse the web-app/ejb-ref elements
-      iterator = getChildrenByTagName(webApp, "ejb-ref");
-      while( iterator.hasNext() )
-      {
-         Element ejbRef = (Element) iterator.next();
-         EjbRefMetaData ejbRefMetaData = new EjbRefMetaData();
-         ejbRefMetaData.importEjbJarXml(ejbRef);
-         ejbReferences.put(ejbRefMetaData.getName(), ejbRefMetaData);
-      }
-
-      // Parse the web-app/ejb-local-ref elements
-      iterator = getChildrenByTagName(webApp, "ejb-local-ref");
-      while( iterator.hasNext() )
-      {
-         Element ejbRef = (Element) iterator.next();
-         EjbLocalRefMetaData ejbRefMetaData = new EjbLocalRefMetaData();
-         ejbRefMetaData.importEjbJarXml(ejbRef);
-         ejbLocalReferences.put(ejbRefMetaData.getName(), ejbRefMetaData);
-      }
-
-      // Parse the service-ref elements
-      iterator = MetaData.getChildrenByTagName(webApp, "service-ref");
-      while (iterator.hasNext())
-      {
-         Element serviceRef = (Element) iterator.next();
-         ServiceRefMetaData refMetaData = new ServiceRefMetaData(resourceCl);
-         refMetaData.importStandardXml(serviceRef);
-         serviceReferences.put(refMetaData.getServiceRefName(), refMetaData);
-      }
-
-      // Is the web-app marked distributable?
-      iterator = getChildrenByTagName(webApp, "distributable");
-      if(iterator.hasNext())
-      {
-         distributable=true;
-      }
-   }
-
    /** Parse the elements of the jboss-web element used by the integration layer.
     */
    protected void importJBossWebXml(Element jbossWeb) throws DeploymentException
@@ -1381,4 +1351,5 @@
          }
       }
    }
+
 }

Modified: trunk/server/src/main/org/jboss/metadata/WebSecurityMetaData.java
===================================================================
--- trunk/server/src/main/org/jboss/metadata/WebSecurityMetaData.java	2006-09-30 04:21:39 UTC (rev 57299)
+++ trunk/server/src/main/org/jboss/metadata/WebSecurityMetaData.java	2006-09-30 04:27:08 UTC (rev 57300)
@@ -23,11 +23,14 @@
 
 import java.util.HashMap;
 import java.util.HashSet;
+import java.util.Map;
 import java.util.Set;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.TreeSet;
 
+import org.jboss.metadata.web.AuthConstraint;
+
 /** Encapsulation of the web.xml security-constraints
  * 
  * @author Scott.Stark at jboss.org
@@ -57,7 +60,8 @@
    /** The HashMap<String, WebResourceCollection> for the
     * security-constraint/web-resource-collection elements
     */ 
-   private HashMap webResources = new HashMap();
+   private HashMap<String, WebResourceCollection> webResources =
+      new HashMap<String, WebResourceCollection>();
    /** Set<String> of the allowed role names defined by the
     * security-constraint/auth-constraint elements
     */
@@ -72,6 +76,8 @@
     security-constraint/auth-constraint element
     */
    private boolean excluded = false;
+   /** security-constraint/auth-constraint element */
+   private AuthConstraint authConstraint;
 
    public static String[] getMissingHttpMethods(HashSet httpMethods)
    {
@@ -97,10 +103,14 @@
       webResources.put(name, webrc);
       return webrc;
    }
-   public HashMap getWebResources()
+   public Map<String, WebResourceCollection> getWebResources()
    {
       return webResources;
    }
+   public void setWebResources(WebResourceCollection collection)
+   {
+      
+   }
 
    public void addRole(String name)
    {
@@ -148,6 +158,17 @@
       this.excluded = flag;
    }
 
+   public AuthConstraint getAuthConstraint()
+   {
+      return authConstraint;
+   }
+   public void setAuthConstraint(AuthConstraint authConstraint)
+   {
+      this.authConstraint = authConstraint;
+      if( authConstraint.getRoleNames().size() == 0 )
+         setExcluded(true);
+   }
+
    /** The security-constraint/web-resource-collection child element container
     * 
     */
@@ -160,6 +181,10 @@
       /** The optional http-method element(s) */
       private ArrayList httpMethods = new ArrayList();
 
+      public WebResourceCollection()
+      {
+         this(null);
+      }
       public WebResourceCollection(String name)
       {
          this.name = name;
@@ -169,6 +194,10 @@
       {
          return name;
       }
+      public void setName(String name)
+      {
+         this.name = name;
+      }
       public void addPattern(String pattern)
       {
          urlPatterns.add(pattern);

Added: trunk/server/src/main/org/jboss/metadata/web/AuthConstraint.java
===================================================================
--- trunk/server/src/main/org/jboss/metadata/web/AuthConstraint.java	2006-09-30 04:21:39 UTC (rev 57299)
+++ trunk/server/src/main/org/jboss/metadata/web/AuthConstraint.java	2006-09-30 04:27:08 UTC (rev 57300)
@@ -0,0 +1,60 @@
+/*
+* 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.metadata.web;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import org.jboss.logging.Logger;
+
+/**
+ * Represents a <auth-constraint> element of the web.xml deployment descriptor for the
+ * 2.5 schema
+ *
+ * @author <a href="mailto:bdecoste at jboss.com">William DeCoste</a>
+ * @version <tt>$Revision: 45409 $</tt>
+ */
+public class AuthConstraint
+{
+   private static final Logger log = Logger.getLogger(AuthConstraint.class);
+   
+   private Set<String> roleNames = new HashSet<String>();
+   
+   public Set<String> getRoleNames()
+   {
+      return roleNames;
+   }
+   public void setRoleNames(Set<String> roleNames)
+   {
+      this.roleNames = roleNames;
+   }
+   public boolean addRoleName(String name)
+   {
+      return roleNames.add(name);
+   }
+
+   public String toString()
+   {
+      StringBuffer sb = new StringBuffer(100);
+      return sb.toString();
+   }
+}

Added: trunk/server/src/main/org/jboss/metadata/web/ErrorPage.java
===================================================================
--- trunk/server/src/main/org/jboss/metadata/web/ErrorPage.java	2006-09-30 04:21:39 UTC (rev 57299)
+++ trunk/server/src/main/org/jboss/metadata/web/ErrorPage.java	2006-09-30 04:27:08 UTC (rev 57300)
@@ -0,0 +1,65 @@
+/*
+* 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.metadata.web;
+
+import org.jboss.logging.Logger;
+
+/**
+ * Represents a <error-page> element of the web.xml deployment descriptor for the
+ * 2.5 schema
+ *
+ * @author <a href="mailto:bdecoste at jboss.com">William DeCoste</a>
+ * @version <tt>$Revision: 45409 $</tt>
+ */
+public class ErrorPage
+{
+   private static final Logger log = Logger.getLogger(ErrorPage.class);
+   
+   protected String errorCode;
+   protected String location;
+   
+   public String getErrorCode()
+   {
+      return errorCode;
+   }
+   
+   public void setErrorCode(String errorCode)
+   {
+      this.errorCode = errorCode;
+   }
+   
+   public String getLocation()
+   {
+      return location;
+   }
+   
+   public void setLocation(String location)
+   {
+      this.location = location;
+   }
+   
+   public String toString()
+   {
+      StringBuffer sb = new StringBuffer(100);
+      return sb.toString();
+   }
+}

Added: trunk/server/src/main/org/jboss/metadata/web/Filter.java
===================================================================
--- trunk/server/src/main/org/jboss/metadata/web/Filter.java	2006-09-30 04:21:39 UTC (rev 57299)
+++ trunk/server/src/main/org/jboss/metadata/web/Filter.java	2006-09-30 04:27:08 UTC (rev 57300)
@@ -0,0 +1,80 @@
+/*
+* 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.metadata.web;
+
+import java.util.Collection;
+import java.util.HashMap;
+
+import org.jboss.logging.Logger;
+import org.jboss.metadata.NameValuePair;
+
+/**
+ * Represents a <filter> element of the web.xml deployment descriptor for the
+ * 2.5 schema
+ *
+ * @author <a href="mailto:bdecoste at jboss.com">William DeCoste</a>
+ * @version <tt>$Revision: 45409 $</tt>
+ */
+public class Filter
+{
+   private static final Logger log = Logger.getLogger(Filter.class);
+   
+   protected String name;
+   protected String clazz;
+   protected HashMap initParams = new HashMap();
+   
+   public String getName()
+   {
+      return name;
+   }
+   
+   public void setName(String name)
+   {
+      this.name = name;
+   }
+   
+   public String getFilterClass()
+   {
+      return clazz;
+   }
+   
+   public void setFilterClass(String clazz)
+   {
+      this.clazz = clazz;
+   }
+   
+   public Collection getInitParams()
+   {
+      return initParams.values();
+   }
+   
+   public void addInitParam(NameValuePair param)
+   {
+      initParams.put(param.getName(), param);
+   }
+
+   public String toString()
+   {
+      StringBuffer sb = new StringBuffer(100);
+      return sb.toString();
+   }
+}

Added: trunk/server/src/main/org/jboss/metadata/web/FilterMapping.java
===================================================================
--- trunk/server/src/main/org/jboss/metadata/web/FilterMapping.java	2006-09-30 04:21:39 UTC (rev 57299)
+++ trunk/server/src/main/org/jboss/metadata/web/FilterMapping.java	2006-09-30 04:27:08 UTC (rev 57300)
@@ -0,0 +1,76 @@
+/*
+* 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.metadata.web;
+
+import org.jboss.logging.Logger;
+
+/**
+ * Represents a <filter-mapping> element of the web.xml deployment descriptor for the
+ * 2.5 schema
+ *
+ * @author <a href="mailto:bdecoste at jboss.com">William DeCoste</a>
+ * @version <tt>$Revision: 45409 $</tt>
+ */
+public class FilterMapping
+{
+   private static final Logger log = Logger.getLogger(FilterMapping.class);
+   
+   protected String filterName;
+   protected String urlPattern;
+   protected String servletName;
+   
+   public String getFilterName()
+   {
+      return filterName;
+   }
+   
+   public void setFilterName(String filterName)
+   {
+      this.filterName = filterName;
+   }
+   
+   public String getUrlPattern()
+   {
+      return urlPattern;
+   }
+   
+   public void setUrlPattern(String urlPattern)
+   {
+      this.urlPattern = urlPattern;
+   }
+   
+   public String getServletName()
+   {
+      return servletName;
+   }
+   
+   public void setServletName(String servletName)
+   {
+      this.servletName = servletName;
+   }
+
+   public String toString()
+   {
+      StringBuffer sb = new StringBuffer(100);
+      return sb.toString();
+   }
+}

Added: trunk/server/src/main/org/jboss/metadata/web/FormLoginConfig.java
===================================================================
--- trunk/server/src/main/org/jboss/metadata/web/FormLoginConfig.java	2006-09-30 04:21:39 UTC (rev 57299)
+++ trunk/server/src/main/org/jboss/metadata/web/FormLoginConfig.java	2006-09-30 04:27:08 UTC (rev 57300)
@@ -0,0 +1,65 @@
+/*
+* 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.metadata.web;
+
+import org.jboss.logging.Logger;
+
+/**
+ * Represents a <form-login-config> element of the web.xml deployment descriptor for the
+ * 2.5 schema
+ *
+ * @author <a href="mailto:bdecoste at jboss.com">William DeCoste</a>
+ * @version <tt>$Revision: 45409 $</tt>
+ */
+public class FormLoginConfig
+{
+   private static final Logger log = Logger.getLogger(FormLoginConfig.class);
+   
+   protected String loginPage;
+   protected String errorPage;
+   
+   public String getLoginPage()
+   {
+      return loginPage;
+   }
+   
+   public void setLoginPage(String loginPage)
+   {
+      this.loginPage = loginPage;
+   }
+   
+   public String getErrorPage()
+   {
+      return errorPage;
+   }
+   
+   public void setErrorPage(String errorPage)
+   {
+      this.errorPage = errorPage;
+   }
+
+   public String toString()
+   {
+      StringBuffer sb = new StringBuffer(100);
+      return sb.toString();
+   }
+}

Added: trunk/server/src/main/org/jboss/metadata/web/LoginConfig.java
===================================================================
--- trunk/server/src/main/org/jboss/metadata/web/LoginConfig.java	2006-09-30 04:21:39 UTC (rev 57299)
+++ trunk/server/src/main/org/jboss/metadata/web/LoginConfig.java	2006-09-30 04:27:08 UTC (rev 57300)
@@ -0,0 +1,76 @@
+/*
+* 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.metadata.web;
+
+import org.jboss.logging.Logger;
+
+/**
+ * Represents a <login-config> element of the web.xml deployment descriptor for the
+ * 2.5 schema
+ *
+ * @author <a href="mailto:bdecoste at jboss.com">William DeCoste</a>
+ * @version <tt>$Revision: 45409 $</tt>
+ */
+public class LoginConfig
+{
+   private static final Logger log = Logger.getLogger(LoginConfig.class);
+   
+   protected String authMethod;
+   protected String realmName;
+   protected FormLoginConfig formLoginConfig;
+   
+   public String getAuthMethod()
+   {
+      return authMethod;
+   }
+   
+   public void setAuthMethod(String authMethod)
+   {
+      this.authMethod = authMethod;
+   }
+   
+   public String getRealmName()
+   {
+      return realmName;
+   }
+   
+   public void setRealmName(String realmName)
+   {
+      this.realmName = realmName;
+   }
+   
+   public FormLoginConfig getFormLoginConfig()
+   {
+      return formLoginConfig;
+   }
+   
+   public void setFormLoginConfig(FormLoginConfig formLoginConfig)
+   {
+      this.formLoginConfig = formLoginConfig;
+   }
+
+   public String toString()
+   {
+      StringBuffer sb = new StringBuffer(100);
+      return sb.toString();
+   }
+}

Added: trunk/server/src/main/org/jboss/metadata/web/ReplicationConfig.java
===================================================================
--- trunk/server/src/main/org/jboss/metadata/web/ReplicationConfig.java	2006-09-30 04:21:39 UTC (rev 57299)
+++ trunk/server/src/main/org/jboss/metadata/web/ReplicationConfig.java	2006-09-30 04:27:08 UTC (rev 57300)
@@ -0,0 +1,75 @@
+/*
+* 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.metadata.web;
+
+import org.jboss.logging.Logger;
+
+/**
+ * Represents a <replication-config> element of the jboss-web.xml deployment descriptor 
+ *
+ * @author <a href="mailto:bdecoste at jboss.com">William DeCoste</a>
+ * @version <tt>$Revision: 45417 $</tt>
+ */
+public class ReplicationConfig
+{
+   private static final Logger log = Logger.getLogger(ReplicationConfig.class);
+
+   protected String trigger;
+   protected String granularity;
+   protected String fieldBatchMode;
+   
+   public String getTrigger()
+   {
+      return trigger;
+   }
+   
+   public void setTrigger(String trigger)
+   {
+      this.trigger = trigger;
+   }
+   
+   public String getGranularity()
+   {
+      return granularity;
+   }
+   
+   public void setGranularity(String granularity)
+   {
+      this.granularity = granularity;
+   }
+   
+   public String getFieldBatchMode()
+   {
+      return fieldBatchMode;
+   }
+   
+   public void setFieldBatchMode(String fieldBatchMode)
+   {
+      this.fieldBatchMode = fieldBatchMode;
+   }
+
+   public String toString()
+   {
+      StringBuffer sb = new StringBuffer(100);
+      return sb.toString();
+   }
+}

Added: trunk/server/src/main/org/jboss/metadata/web/Servlet.java
===================================================================
--- trunk/server/src/main/org/jboss/metadata/web/Servlet.java	2006-09-30 04:21:39 UTC (rev 57299)
+++ trunk/server/src/main/org/jboss/metadata/web/Servlet.java	2006-09-30 04:27:08 UTC (rev 57300)
@@ -0,0 +1,140 @@
+package org.jboss.metadata.web;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+
+import org.jboss.logging.Logger;
+import org.jboss.metadata.NameValuePair;
+import org.jboss.metadata.RunAs;
+import org.jboss.metadata.SecurityRoleRefMetaData;
+
+/**
+ * Represents a <servlet> element of the web.xml deployment descriptor
+ *
+ * @author <a href="mailto:bdecoste at jboss.com">William DeCoste</a>
+ * @author Scott.Stark at jboss.org
+ * @version <tt>$Revision: 45417 $</tt>
+ */
+public class Servlet
+{
+   private static final Logger log = Logger.getLogger(Servlet.class);
+   
+   private String name;
+   private String displayName;
+   private String clazz;
+   private String jspFile;
+   private HashMap initParams = new HashMap();
+   private int loadOnStartup;
+   private RunAs runAs;
+   private HashMap<String, SecurityRoleRefMetaData> securityRoleRefs =
+      new HashMap<String, SecurityRoleRefMetaData>();
+   private Collection<String> runAsPrincipals = new ArrayList<String>();
+
+   public String getName()
+   {
+      return name;
+   }
+   
+   public void setName(String name)
+   {
+      this.name = name;
+   }
+   
+   public String getDisplayName()
+   {
+      return displayName;
+   }
+
+   public void setDisplayName(String displayName)
+   {
+      this.displayName = displayName;
+   }
+
+   public String getServletClass()
+   {
+      return clazz;
+   }
+   
+   public void setServletClass(String clazz)
+   {
+      this.clazz = clazz;
+   }
+   
+   public void setJspFile(String jspFile)
+   {
+      this.jspFile = jspFile;
+   }
+   
+   public String getJspFile()
+   {
+      return jspFile;
+   }
+   
+   public Collection getInitParams()
+   {
+      return initParams.values();
+   }
+   
+   public void addInitParam(NameValuePair param)
+   {
+      initParams.put(param.getName(), param);
+   }
+   
+   public int getLoadOnStartup()
+   {
+      return loadOnStartup;
+   }
+   
+   public void setLoadOnStartup(int loadOnStartup)
+   {
+      this.loadOnStartup = loadOnStartup;
+   }
+   
+   public RunAs getRunAs()
+   {
+      return runAs;
+   }
+   
+   public void setRunAs(RunAs runAs)
+   {
+      this.runAs = runAs;
+   }
+   
+   public Collection getSecurityRoleRefs()
+   {
+      return securityRoleRefs.values();
+   }
+   
+   public void addSecurityRoleRef(SecurityRoleRefMetaData ref)
+   {
+      securityRoleRefs.put(ref.getName(), ref);
+   }
+   
+   public Collection getRunAsPrincipals()
+   {
+      return runAsPrincipals;
+   }
+   
+   public void setRunAsPrincipals(Collection runAsPrincipals)
+   {
+      this.runAsPrincipals = runAsPrincipals;
+   }
+   
+   public void addRunAsPrincipal(String principal)
+   {
+      runAsPrincipals.add(principal);
+   }
+   
+   public String toString()
+   {
+      StringBuffer sb = new StringBuffer(100);
+      sb.append('[');
+      sb.append("name=" + name);
+      sb.append(", class=" + clazz);
+      sb.append(", jspFile=" + jspFile);
+      sb.append(']');
+      return sb.toString();
+   }
+
+}

Added: trunk/server/src/main/org/jboss/metadata/web/ServletMapping.java
===================================================================
--- trunk/server/src/main/org/jboss/metadata/web/ServletMapping.java	2006-09-30 04:21:39 UTC (rev 57299)
+++ trunk/server/src/main/org/jboss/metadata/web/ServletMapping.java	2006-09-30 04:27:08 UTC (rev 57300)
@@ -0,0 +1,65 @@
+/*
+* 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.metadata.web;
+
+import org.jboss.logging.Logger;
+
+/**
+ * Represents a <servlet-mapping> element of the web.xml deployment descriptor for the
+ * 2.5 schema
+ *
+ * @author <a href="mailto:bdecoste at jboss.com">William DeCoste</a>
+ * @version <tt>$Revision: 45241 $</tt>
+ */
+public class ServletMapping
+{
+   private static final Logger log = Logger.getLogger(ServletMapping.class);
+   
+   protected String name;
+   protected String urlPattern;
+   
+   public String getName()
+   {
+      return name;
+   }
+   
+   public void setName(String name)
+   {
+      this.name = name;
+   }
+   
+   public String getUrlPattern()
+   {
+      return urlPattern;
+   }
+   
+   public void setUrlPattern(String urlPattern)
+   {
+      this.urlPattern = urlPattern;
+   }
+
+   public String toString()
+   {
+      StringBuffer sb = new StringBuffer(100);
+      return sb.toString();
+   }
+}

Added: trunk/server/src/main/org/jboss/metadata/web/SessionConfig.java
===================================================================
--- trunk/server/src/main/org/jboss/metadata/web/SessionConfig.java	2006-09-30 04:21:39 UTC (rev 57299)
+++ trunk/server/src/main/org/jboss/metadata/web/SessionConfig.java	2006-09-30 04:27:08 UTC (rev 57300)
@@ -0,0 +1,54 @@
+/*
+* 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.metadata.web;
+
+import org.jboss.logging.Logger;
+
+/**
+ * Represents a <session-config> element of the web.xml deployment descriptor for the
+ * 2.5 schema
+ *
+ * @author <a href="mailto:bdecoste at jboss.com">William DeCoste</a>
+ * @version <tt>$Revision: 45409 $</tt>
+ */
+public class SessionConfig
+{
+   private static final Logger log = Logger.getLogger(SessionConfig.class);
+   
+   protected String sessionTimeout;
+   
+   public String getSessionTimeout()
+   {
+      return sessionTimeout;
+   }
+   
+   public void setSessionTimeout(String sessionTimeout)
+   {
+      this.sessionTimeout = sessionTimeout;
+   }
+
+   public String toString()
+   {
+      StringBuffer sb = new StringBuffer(100);
+      return sb.toString();
+   }
+}

Added: trunk/server/src/main/org/jboss/metadata/web/UserDataConstraint.java
===================================================================
--- trunk/server/src/main/org/jboss/metadata/web/UserDataConstraint.java	2006-09-30 04:21:39 UTC (rev 57299)
+++ trunk/server/src/main/org/jboss/metadata/web/UserDataConstraint.java	2006-09-30 04:27:08 UTC (rev 57300)
@@ -0,0 +1,54 @@
+/*
+* 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.metadata.web;
+
+import org.jboss.logging.Logger;
+
+/**
+ * Represents a <session-config> element of the web.xml deployment descriptor for the
+ * 2.5 schema
+ *
+ * @author <a href="mailto:bdecoste at jboss.com">William DeCoste</a>
+ * @version <tt>$Revision: 45409 $</tt>
+ */
+public class UserDataConstraint
+{
+   private static final Logger log = Logger.getLogger(UserDataConstraint.class);
+   
+   protected String transportGuarantee;
+   
+   public String getTransportGuarantee()
+   {
+      return transportGuarantee;
+   }
+   
+   public void setTransportGuarantee(String transportGuarantee)
+   {
+      this.transportGuarantee = transportGuarantee;
+   }
+
+   public String toString()
+   {
+      StringBuffer sb = new StringBuffer(100);
+      return sb.toString();
+   }
+}

Added: trunk/server/src/main/org/jboss/metadata/web/WebMetaDataObjectFactory.java
===================================================================
--- trunk/server/src/main/org/jboss/metadata/web/WebMetaDataObjectFactory.java	2006-09-30 04:21:39 UTC (rev 57299)
+++ trunk/server/src/main/org/jboss/metadata/web/WebMetaDataObjectFactory.java	2006-09-30 04:27:08 UTC (rev 57300)
@@ -0,0 +1,536 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * 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.metadata.web;
+
+import org.jboss.logging.Logger;
+import org.jboss.metadata.DDObjectFactory;
+import org.jboss.metadata.EjbLocalRefMetaData;
+import org.jboss.metadata.EjbRefMetaData;
+import org.jboss.metadata.EnvEntryMetaData;
+import org.jboss.metadata.Listener;
+import org.jboss.metadata.MessageDestinationMetaData;
+import org.jboss.metadata.MessageDestinationRefMetaData;
+import org.jboss.metadata.NameValuePair;
+import org.jboss.metadata.ResourceEnvRefMetaData;
+import org.jboss.metadata.ResourceRefMetaData;
+import org.jboss.metadata.RunAs;
+import org.jboss.metadata.SecurityRoleMetaData;
+import org.jboss.metadata.SecurityRoleRefMetaData;
+import org.jboss.metadata.WebMetaData;
+import org.jboss.metadata.WebSecurityMetaData;
+import org.jboss.metadata.WebSecurityMetaData.WebResourceCollection;
+import org.jboss.webservice.metadata.serviceref.ServiceRefMetaData;
+import org.jboss.xb.binding.UnmarshallingContext;
+import org.xml.sax.Attributes;
+
+/**
+ * @author Scott.Stark at jboss.org
+ * @version $Revision:$
+ */
+public class WebMetaDataObjectFactory extends DDObjectFactory
+{
+   private static Logger log = Logger.getLogger(WebMetaDataObjectFactory.class);
+
+   /** The current WebMetaData being parsed */
+   private static final ThreadLocal<WebMetaData> activeMetaData = new ThreadLocal<WebMetaData>();
+
+   public WebMetaData newRoot(Object root, UnmarshallingContext navigator,
+         String namespaceURI, String localName, Attributes attrs)
+   {
+      WebMetaData metaData = null;
+      if (root != null)
+         metaData = (WebMetaData) root;
+      else
+         metaData = new WebMetaData();
+      activeMetaData.set(metaData);
+      String version = attrs.getValue("version");
+      return metaData;
+   }
+
+   public Object completeRoot(Object root, UnmarshallingContext ctx,
+         String uri, String name)
+   {
+      activeMetaData.set(null);
+      return root;
+   }
+
+   /**
+    * Create the web-app child elements
+    * 
+    * @param dd
+    * @param navigator
+    * @param namespaceURI
+    * @param localName
+    * @param attrs
+    * @return
+    */
+   public Object newChild(WebMetaData dd, UnmarshallingContext navigator,
+         String namespaceURI, String localName, Attributes attrs)
+   {
+      Object child = null;
+      log.debug("newChild, " + localName);
+      // Handle the *-ref elements
+      if ((child = newEnvRefGroupChild(localName)) != null)
+         return child;
+
+      else if (localName.equals("distributable"))
+         dd.setDistributable(true);
+      else if (localName.equals("security-role"))
+         child = new SecurityRoleMetaData();
+      else if (localName.equals("servlet"))
+         child = new Servlet();
+      else if (localName.equals("replication-config"))
+         child = new ReplicationConfig();
+      else if (localName.equals("message-destination"))
+         child = new MessageDestinationMetaData();
+      else if (localName.equals("filter"))
+      {
+         child = new Filter();
+      }
+      else if (localName.equals("filter-mapping"))
+      {
+         child = new FilterMapping();
+      }
+      else if (localName.equals("listener"))
+      {
+         child = new Listener();
+      }
+      else if (localName.equals("servlet-mapping"))
+      {
+         child = new ServletMapping();
+      }
+      else if (localName.equals("session-config"))
+      {
+         child = new SessionConfig();
+      }
+      else if (localName.equals("error-page"))
+      {
+         child = new ErrorPage();
+      }
+      else if (localName.equals("security-role"))
+      {
+         child = new SecurityRoleMetaData();
+      }
+      else if (localName.equals("security-constraint"))
+      {
+         child = new WebSecurityMetaData();
+      }
+      else if (localName.equals("login-config"))
+      {
+         child = new LoginConfig();
+      }
+      else if (localName.equals("message-destination"))
+      {
+         child = new MessageDestinationMetaData();
+      }
+      /*
+       * Currently unhandled web-app child elements: mime-mapping
+       * welcome-file-list jsp-config locale-encoding-mapping-list
+       */
+      else if (log.isTraceEnabled())
+      {
+         log.trace("Ignoring: " + localName);
+      }
+      return child;
+   }
+
+   /**
+    * web-app/servlet children
+    * 
+    * @param servlet
+    * @param navigator
+    * @param namespaceURI
+    * @param localName
+    * @param attrs
+    * @return
+    */
+   public Object newChild(Servlet servlet, UnmarshallingContext navigator,
+         String namespaceURI, String localName, Attributes attrs)
+   {
+      Object child = null;
+      if (localName.equals("init-param"))
+      {
+         child = new NameValuePair();
+      }
+      else if (localName.equals("run-as"))
+      {
+         child = new RunAs();
+      }
+      else if (localName.equals("security-role-ref"))
+      {
+         child = new SecurityRoleRefMetaData();
+      }
+      return child;
+   }
+
+   public Object newChild(WebSecurityMetaData constraint,
+         UnmarshallingContext navigator, String namespaceURI, String localName,
+         Attributes attrs)
+   {
+      Object child = null;
+
+      if (localName.equals("web-resource-collection"))
+      {
+         child = new WebResourceCollection();
+      }
+      else if (localName.equals("auth-constraint"))
+      {
+         child = new AuthConstraint();
+      }
+      else if (localName.equals("user-data-constraint"))
+      {
+         child = new UserDataConstraint();
+      }
+
+      return child;
+   }
+
+   public void addChild(WebMetaData parent, Filter filter,
+         UnmarshallingContext navigator, String namespaceURI, String localName)
+   {
+      parent.addFilter(filter);
+   }
+
+   public void addChild(WebMetaData parent, FilterMapping mapping,
+         UnmarshallingContext navigator, String namespaceURI, String localName)
+   {
+      parent.addFilterMapping(mapping);
+   }
+
+   public void addChild(WebMetaData parent, Listener listener,
+         UnmarshallingContext navigator, String namespaceURI, String localName)
+   {
+      parent.addListener(listener);
+   }
+
+   public void addChild(WebMetaData parent, Servlet servlet,
+         UnmarshallingContext navigator, String namespaceURI, String localName)
+   {
+      parent.addServlet(servlet);
+   }
+
+   public void addChild(WebMetaData parent, ServletMapping mapping,
+         UnmarshallingContext navigator, String namespaceURI, String localName)
+   {
+      parent.addServletMapping(mapping);
+   }
+
+   public void addChild(WebMetaData parent, SessionConfig config,
+         UnmarshallingContext navigator, String namespaceURI, String localName)
+   {
+      parent.addSessionConfig(config);
+   }
+
+   public void addChild(WebMetaData parent, WebSecurityMetaData constraint,
+         UnmarshallingContext navigator, String namespaceURI, String localName)
+   {
+      parent.addSecurityConstraint(constraint);
+   }
+
+   public void addChild(WebMetaData parent, ErrorPage page,
+         UnmarshallingContext navigator, String namespaceURI, String localName)
+   {
+      parent.addErrorPage(page);
+   }
+
+   public void addChild(WebMetaData parent, SecurityRoleMetaData role,
+         UnmarshallingContext navigator, String namespaceURI, String localName)
+   {
+      parent.addSecurityRole(role);
+   }
+
+   public void addChild(WebMetaData parent, EjbLocalRefMetaData ref,
+         UnmarshallingContext navigator, String namespaceURI, String localName)
+   {
+      parent.addEjbLocalRef(ref);
+   }
+
+   public void addChild(WebMetaData parent, EjbRefMetaData ref,
+         UnmarshallingContext navigator, String namespaceURI, String localName)
+   {
+      parent.addEjbRef(ref);
+   }
+
+   public void addChild(WebMetaData parent, EnvEntryMetaData ref,
+         UnmarshallingContext navigator, String namespaceURI, String localName)
+   {
+      parent.addEnvEntry(ref);
+   }
+
+   public void addChild(WebMetaData parent, MessageDestinationRefMetaData ref,
+         UnmarshallingContext navigator, String namespaceURI, String localName)
+   {
+      parent.addMessageDestinationRef(ref);
+   }
+
+   public void addChild(WebMetaData parent, ResourceEnvRefMetaData ref,
+         UnmarshallingContext navigator, String namespaceURI, String localName)
+   {
+      parent.addResourceEnvRef(ref);
+   }
+
+   public void addChild(WebMetaData parent, ResourceRefMetaData ref,
+         UnmarshallingContext navigator, String namespaceURI, String localName)
+   {
+      parent.addResourceRef(ref);
+   }
+
+   public void addChild(WebMetaData parent, LoginConfig config,
+         UnmarshallingContext navigator, String namespaceURI, String localName)
+   {
+      parent.setLoginConfig(config);
+   }
+
+   public void addChild(WebMetaData parent,
+         MessageDestinationMetaData destination,
+         UnmarshallingContext navigator, String namespaceURI, String localName)
+   {
+      parent.addMessageDestination(destination);
+   }
+
+   public void addChild(Filter parent, NameValuePair param,
+         UnmarshallingContext navigator, String namespaceURI, String localName)
+   {
+      parent.addInitParam(param);
+   }
+
+   public void addChild(Servlet parent, NameValuePair param,
+         UnmarshallingContext navigator, String namespaceURI, String localName)
+   {
+      parent.addInitParam(param);
+   }
+
+   public void addChild(Servlet parent, RunAs runAs,
+         UnmarshallingContext navigator, String namespaceURI, String localName)
+   {
+      parent.setRunAs(runAs);
+   }
+
+   public void addChild(Servlet parent, SecurityRoleRefMetaData ref,
+         UnmarshallingContext navigator, String namespaceURI, String localName)
+   {
+      parent.addSecurityRoleRef(ref);
+   }
+
+   public void addChild(WebSecurityMetaData parent,
+         WebResourceCollection collection, UnmarshallingContext navigator,
+         String namespaceURI, String localName)
+   {
+      parent.setWebResources(collection);
+   }
+
+   public void addChild(WebSecurityMetaData parent, AuthConstraint constraint,
+         UnmarshallingContext navigator, String namespaceURI, String localName)
+   {
+      parent.setAuthConstraint(constraint);
+   }
+   public void addChild(WebSecurityMetaData parent, UserDataConstraint constraint,
+         UnmarshallingContext navigator, String namespaceURI, String localName)
+   {
+      parent.setTransportGuarantee(constraint.getTransportGuarantee());
+   }
+
+   public void addChild(LoginConfig parent, FormLoginConfig config,
+         UnmarshallingContext navigator, String namespaceURI, String localName)
+   {
+      parent.setFormLoginConfig(config);
+   }
+
+   public void setValue(Filter filter, UnmarshallingContext navigator,
+         String namespaceURI, String localName, String value)
+   {
+      if (localName.equals("filter-name"))
+      {
+         filter.setName(value);
+      }
+      else if (localName.equals("filter-class"))
+      {
+         filter.setFilterClass(value);
+      }
+   }
+
+   public void setValue(FilterMapping mapping, UnmarshallingContext navigator,
+         String namespaceURI, String localName, String value)
+   {
+      if (localName.equals("filter-name"))
+      {
+         mapping.setFilterName(value);
+      }
+      else if (localName.equals("url-pattern"))
+      {
+         mapping.setUrlPattern(value);
+      }
+      else if (localName.equals("servlet-name"))
+      {
+         mapping.setServletName(value);
+      }
+   }
+
+   public void setValue(ServletMapping mapping, UnmarshallingContext navigator,
+         String namespaceURI, String localName, String value)
+   {
+      if (localName.equals("servlet-name"))
+      {
+         mapping.setName(value);
+      }
+      else if (localName.equals("url-pattern"))
+      {
+         mapping.setUrlPattern(value);
+      }
+   }
+
+   public void setValue(ErrorPage page, UnmarshallingContext navigator,
+         String namespaceURI, String localName, String value)
+   {
+      if (localName.equals("error-code"))
+      {
+         page.setErrorCode(value);
+      }
+      else if (localName.equals("location"))
+      {
+         page.setLocation(value);
+      }
+   }
+
+   public void setValue(SessionConfig config, UnmarshallingContext navigator,
+         String namespaceURI, String localName, String value)
+   {
+      if (localName.equals("session-timeout"))
+      {
+         config.setSessionTimeout(value);
+      }
+   }
+
+   public void setValue(NameValuePair param, UnmarshallingContext navigator,
+         String namespaceURI, String localName, String value)
+   {
+      if (localName.equals("param-name"))
+      {
+         param.setName(value);
+      }
+      else if (localName.equals("param-value"))
+      {
+         param.setValue(value);
+      }
+   }
+
+   public void setValue(WebResourceCollection collection,
+         UnmarshallingContext navigator, String namespaceURI, String localName,
+         String value)
+   {
+      if (localName.equals("web-resource-name"))
+      {
+         collection.setName(value);
+      }
+      else if (localName.equals("http-pattern"))
+      {
+         collection.addHttpMethod(value);
+      }
+      else if (localName.equals("url-pattern"))
+      {
+         collection.addPattern(value);
+      }
+   }
+
+   public void setValue(AuthConstraint contraint,
+         UnmarshallingContext navigator, String namespaceURI, String localName,
+         String value)
+   {
+      if (localName.equals("role-name"))
+      {
+         contraint.addRoleName(value);
+      }
+   }
+
+   public void setValue(UserDataConstraint contraint, UnmarshallingContext navigator,
+         String namespaceURI, String localName, String value)
+   {
+      if (localName.equals("transport-guarantee"))
+      {
+         contraint.setTransportGuarantee(value);
+      }
+   }
+   public void setValue(LoginConfig config, UnmarshallingContext navigator,
+         String namespaceURI, String localName, String value)
+   {
+      if (localName.equals("auth-method"))
+      {
+         config.setAuthMethod(value);
+      }
+      else if (localName.equals("realm-name"))
+      {
+         config.setRealmName(value);
+      }
+   }
+
+   public void setValue(FormLoginConfig config, UnmarshallingContext navigator,
+         String namespaceURI, String localName, String value)
+   {
+      if (localName.equals("form-login-page"))
+      {
+         config.setLoginPage(value);
+      }
+      else if (localName.equals("form-error-page"))
+      {
+         config.setErrorPage(value);
+      }
+   }
+
+   /**
+    * Set values from text servlet/* child elements
+    * 
+    * @param servlet
+    * @param navigator
+    * @param namespaceURI
+    * @param localName
+    * @param value
+    */
+   public void setValue(Servlet servlet, UnmarshallingContext navigator,
+         String namespaceURI, String localName, String value)
+   {
+      if (localName.equals("servlet-name"))
+      {
+         servlet.setName(value);
+      }
+      else if (localName.equals("display-name"))
+      {
+         servlet.setDisplayName(value);
+      }
+      else if (localName.equals("servlet-class"))
+      {
+         servlet.setServletClass(value);
+      }
+      else if (localName.equals("run-as-principal"))
+      {
+         servlet.addRunAsPrincipal(value);
+      }
+      else if (localName.equals("jsp-file"))
+      {
+         servlet.setJspFile(value);
+      }
+      else if (localName.equals("load-on-startup"))
+      {
+         int i = Integer.decode(value);
+         servlet.setLoadOnStartup(i);
+      }
+   }
+}

Modified: trunk/server/src/main/org/jboss/webservice/metadata/serviceref/ServiceRefMetaData.java
===================================================================
--- trunk/server/src/main/org/jboss/webservice/metadata/serviceref/ServiceRefMetaData.java	2006-09-30 04:21:39 UTC (rev 57299)
+++ trunk/server/src/main/org/jboss/webservice/metadata/serviceref/ServiceRefMetaData.java	2006-09-30 04:27:08 UTC (rev 57300)
@@ -39,6 +39,7 @@
 
 import org.jboss.deployment.DeploymentException;
 import org.jboss.metadata.MetaData;
+import org.jboss.metadata.Ref;
 import org.jboss.xb.QNameBuilder;
 import org.w3c.dom.Element;
 
@@ -48,7 +49,8 @@
  * @author Thomas.Diesler at jboss.org
  * @version $Revision$
  */
-public class ServiceRefMetaData implements Serializable
+public class ServiceRefMetaData extends Ref
+   implements Serializable
 {
    private static final long serialVersionUID = -3723577995017108437L;
 
@@ -56,6 +58,8 @@
    private String serviceRefName;
    // The required <service-interface> element
    private String serviceInterface;
+   // service-res-type
+   private String serviceResType;
    // The optional <wsdl-file> element
    private String wsdlFile;
    // The optional <jaxrpc-mapping-file> element
@@ -75,6 +79,7 @@
    private URL wsdlOverride;
    /** Arbitrary proxy properties given by <call-property> */
    private Properties callProperties;
+   private String mappedName;
 
    /** The ClassLoader to load additional resources */
    private transient URLClassLoader resourceCL;
@@ -122,6 +127,10 @@
    {
       return jaxrpcMappingFile;
    }
+   public void setJaxrpcMappingFile(String file)
+   {
+      this.jaxrpcMappingFile = jaxrpcMappingFile;
+   }
 
    public URL getJavaWsdlMappingURL()
    {
@@ -153,21 +162,46 @@
    {
       return serviceInterface;
    }
+   public void setServiceInterface(String serviceInterface)
+   {
+      this.serviceInterface = serviceInterface;
+   }
 
    public QName getServiceQName()
    {
       return serviceQName;
    }
+   public void setServiceQName(QName serviceQName)
+   {
+      this.serviceQName = serviceQName;
+   }
 
    public String getServiceRefName()
    {
       return serviceRefName;
    }
+   public void setServiceRefName(String serviceRefName)
+   {
+      this.serviceRefName = serviceRefName;
+   }
 
+   public String getServiceResType()
+   {
+      return serviceResType;
+   }
+   public void setServiceResType(String serviceResType)
+   {
+      this.serviceResType = serviceResType;
+   }
+
    public String getWsdlFile()
    {
       return wsdlFile;
    }
+   public void setWsdlFile(String file)
+   {
+      this.wsdlFile = file;
+   }
 
    public String getConfigFile()
    {
@@ -184,6 +218,16 @@
       return configName;
    }
 
+   public String getMappedName()
+   {
+      return mappedName;
+   }
+
+   public void setMappedName(String mappedName)
+   {
+      this.mappedName = mappedName;
+   }
+
    public void setConfigName(String configName)
    {
       this.configName = configName;




More information about the jboss-cvs-commits mailing list