[jboss-cvs] JBossAS SVN: r95624 - in projects/metadata/common/trunk/src/main: java/org/jboss/metadata/ejb/jboss and 3 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Oct 27 14:06:19 EDT 2009


Author: remy.maucherat at jboss.com
Date: 2009-10-27 14:06:19 -0400 (Tue, 27 Oct 2009)
New Revision: 95624

Added:
   projects/metadata/common/trunk/src/main/java/org/jboss/metadata/javaee/spec/DataSourceMetaData.java
   projects/metadata/common/trunk/src/main/java/org/jboss/metadata/javaee/spec/DataSourcesMetaData.java
   projects/metadata/common/trunk/src/main/java/org/jboss/metadata/javaee/spec/IsolationLevelType.java
   projects/metadata/common/trunk/src/main/java/org/jboss/metadata/javaee/support/AugmentableMetaData.java
   projects/metadata/common/trunk/src/main/resources/schema/jboss-common_6_0.xsd
Modified:
   projects/metadata/common/trunk/src/main/java/org/jboss/metadata/annotation/creator/AbstractComponentProcessor.java
   projects/metadata/common/trunk/src/main/java/org/jboss/metadata/ejb/jboss/JBossEnvironmentRefsGroupMetaData.java
   projects/metadata/common/trunk/src/main/java/org/jboss/metadata/javaee/spec/EJBLocalReferenceMetaData.java
   projects/metadata/common/trunk/src/main/java/org/jboss/metadata/javaee/spec/Environment.java
   projects/metadata/common/trunk/src/main/java/org/jboss/metadata/javaee/spec/EnvironmentRefsGroupMetaData.java
   projects/metadata/common/trunk/src/main/java/org/jboss/metadata/javaee/spec/MessageDestinationMetaData.java
   projects/metadata/common/trunk/src/main/java/org/jboss/metadata/javaee/spec/MessageDestinationsMetaData.java
   projects/metadata/common/trunk/src/main/java/org/jboss/metadata/javaee/spec/MutableEnvironment.java
   projects/metadata/common/trunk/src/main/java/org/jboss/metadata/javaee/spec/RemoteEnvironmentRefsGroupMetaData.java
   projects/metadata/common/trunk/src/main/resources/schema/javaee_6.xsd
Log:
- Add the augment() Servlet 3.0 specific meta data merge as an interface.
- Add the EE 6 data-source meta data.
- Update the JBoss commnon xsd for EE 6.
- Add lookup name to message destination.

Modified: projects/metadata/common/trunk/src/main/java/org/jboss/metadata/annotation/creator/AbstractComponentProcessor.java
===================================================================
--- projects/metadata/common/trunk/src/main/java/org/jboss/metadata/annotation/creator/AbstractComponentProcessor.java	2009-10-27 17:56:25 UTC (rev 95623)
+++ projects/metadata/common/trunk/src/main/java/org/jboss/metadata/annotation/creator/AbstractComponentProcessor.java	2009-10-27 18:06:19 UTC (rev 95624)
@@ -79,6 +79,7 @@
       addFieldProcessor(new WebServiceRefFieldProcessor(finder));  
       addTypeProcessor(new WebServiceRefClassProcessor(finder));
       addTypeProcessor(new WebServiceRefsClassProcessor(finder));
+      // TODO: @DataSourceDefinitions/@DataSourceDefinition
    }
 
    /**

Modified: projects/metadata/common/trunk/src/main/java/org/jboss/metadata/ejb/jboss/JBossEnvironmentRefsGroupMetaData.java
===================================================================
--- projects/metadata/common/trunk/src/main/java/org/jboss/metadata/ejb/jboss/JBossEnvironmentRefsGroupMetaData.java	2009-10-27 17:56:25 UTC (rev 95623)
+++ projects/metadata/common/trunk/src/main/java/org/jboss/metadata/ejb/jboss/JBossEnvironmentRefsGroupMetaData.java	2009-10-27 18:06:19 UTC (rev 95624)
@@ -27,6 +27,8 @@
 
 import org.jboss.metadata.javaee.jboss.JBossServiceReferenceMetaData;
 import org.jboss.metadata.javaee.jboss.JBossServiceReferencesMetaData;
+import org.jboss.metadata.javaee.spec.DataSourceMetaData;
+import org.jboss.metadata.javaee.spec.DataSourcesMetaData;
 import org.jboss.metadata.javaee.spec.EJBLocalReferenceMetaData;
 import org.jboss.metadata.javaee.spec.EJBLocalReferencesMetaData;
 import org.jboss.metadata.javaee.spec.Environment;
@@ -37,6 +39,7 @@
 import org.jboss.metadata.javaee.spec.ResourceReferenceMetaData;
 import org.jboss.metadata.javaee.spec.ResourceReferencesMetaData;
 import org.jboss.metadata.javaee.spec.ServiceReferencesMetaData;
+import org.jboss.metadata.javaee.support.AbstractMappedMetaData;
 import org.jboss.xb.annotations.JBossXmlCollection;
 import org.jboss.xb.annotations.JBossXmlModelGroup;
 
@@ -67,6 +70,9 @@
    /** The persistence context reference */
    private PersistenceContextReferencesMetaData persistenceContextRefs;
 
+   /** The data sources */
+   private DataSourcesMetaData dataSources;
+   
    /**
     * Merge an environment
     * 
@@ -140,6 +146,20 @@
       this.persistenceContextRefs = persistenceContextRefs;
    }
 
+   public DataSourcesMetaData getDataSources()
+   {
+      return dataSources;
+   }
+   @XmlElement(name="data-source")
+   public void setDataSources(DataSourcesMetaData dataSources)
+   {
+      this.dataSources = dataSources;
+   }
+   
+   public DataSourceMetaData getDataSourceByName(String name)
+   {
+      return AbstractMappedMetaData.getByName(name, dataSources);
+   }
 
    /**
     * Merge an environment
@@ -217,18 +237,22 @@
       
       EJBLocalReferencesMetaData originalLocalRefs = null;
       PersistenceContextReferencesMetaData originalPctxRefs = null;
+      DataSourcesMetaData originalDataSources = null;
       if(original != null)
       {
          originalLocalRefs = original.ejbLocalReferences;
          originalPctxRefs = original.persistenceContextRefs;
+         originalDataSources = original.dataSources;
       }
       
       EJBLocalReferencesMetaData overrideLocalRefs = null;
       PersistenceContextReferencesMetaData overridePctxRefs = null;
+      DataSourcesMetaData overrideDataSources = null;
       if(override != null)
       {
          overrideLocalRefs = override.ejbLocalReferences;
          overridePctxRefs = override.persistenceContextRefs;
+         overrideDataSources = override.dataSources;
       }
 
       EJBLocalReferencesMetaData mergedEjbLocalRefs = EJBLocalReferencesMetaData.merge(overrideLocalRefs, originalLocalRefs, null, "jboss.xml");
@@ -239,6 +263,10 @@
       if(mergedPctxRefs != null)
          this.setPersistenceContextRefs(mergedPctxRefs);
 
+      DataSourcesMetaData mergedDataSources = DataSourcesMetaData.merge(overrideDataSources, originalDataSources, null, "jboss.xml");
+      if(mergedDataSources != null)
+         this.setDataSources(mergedDataSources);
+
       // Need to set the jndi name from resource mgr if referenced
       ResourceReferencesMetaData jbossResRefs = getResourceReferences();
       if(resourceManagers != null && jbossResRefs != null)

Added: projects/metadata/common/trunk/src/main/java/org/jboss/metadata/javaee/spec/DataSourceMetaData.java
===================================================================
--- projects/metadata/common/trunk/src/main/java/org/jboss/metadata/javaee/spec/DataSourceMetaData.java	                        (rev 0)
+++ projects/metadata/common/trunk/src/main/java/org/jboss/metadata/javaee/spec/DataSourceMetaData.java	2009-10-27 18:06:19 UTC (rev 95624)
@@ -0,0 +1,283 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, 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.javaee.spec;
+
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+
+import org.jboss.metadata.javaee.support.MergeableMappedMetaData;
+import org.jboss.metadata.javaee.support.NamedMetaDataWithDescriptions;
+
+/**
+ * The data-source metadata
+ * 
+ * @author Remy Maucherat
+ * @version $Revision: 81768 $
+ */
+ at XmlType(name="data-sourceType",
+      propOrder={"descriptions", "name", "className", "serverName", "portNumber", "databaseName", 
+         "url", "user", "password", "properties", "loginTimeout", "transactional", "isolationLevel",
+         "initialPoolSize", "maxPoolSize", "minPoolSize", "maxIdleTime", "maxStatements"})
+public class DataSourceMetaData extends NamedMetaDataWithDescriptions 
+   implements MergeableMappedMetaData<DataSourceMetaData>
+{
+   private static final long serialVersionUID = 1;
+
+   public static final int DEFAULT_PORT_NUMBER = -1;
+   public static final int DEFAULT_LOGIN_TIMEOUT = -1;
+   public static final boolean DEFAULT_TRANSACTIONAL = true;
+   public static final int DEFAULT_INITIAL_POOL_SIZE = -1;
+   public static final int DEFAULT_MAX_POOL_SIZE = -1;
+   public static final int DEFAULT_MIN_POOL_SIZE = -1;
+   public static final int DEFAULT_MAX_IDLE_TIME = -1;
+   public static final int DEFAULT_MAX_STATEMENTS = -1;
+
+   private String className;
+   private String serverName;
+   private int portNumber = DEFAULT_PORT_NUMBER;
+   private String databaseName;
+   private String url;
+   private String user;
+   private String password;
+   private PropertiesMetaData properties;
+   private int loginTimeout = DEFAULT_LOGIN_TIMEOUT;
+   private boolean transactional = DEFAULT_TRANSACTIONAL;
+   private IsolationLevelType isolationLevel;
+   private int initialPoolSize = DEFAULT_INITIAL_POOL_SIZE;
+   private int maxPoolSize = DEFAULT_MAX_POOL_SIZE;
+   private int minPoolSize = DEFAULT_MIN_POOL_SIZE;
+   private int maxIdleTime = DEFAULT_MAX_IDLE_TIME;
+   private int maxStatements = DEFAULT_MAX_STATEMENTS;
+
+   public String getClassName()
+   {
+      return className;
+   }
+   @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
+   public void setClassName(String className)
+   {
+      this.className = className;
+   }
+   public String getServerName()
+   {
+      return serverName;
+   }
+   public void setServerName(String serverName)
+   {
+      this.serverName = serverName;
+   }
+   public int getPortNumber()
+   {
+      return portNumber;
+   }
+   public void setPortNumber(int portNumber)
+   {
+      this.portNumber = portNumber;
+   }
+   public String getDatabaseName()
+   {
+      return databaseName;
+   }
+   public void setDatabaseName(String databaseName)
+   {
+      this.databaseName = databaseName;
+   }
+   public String getUrl()
+   {
+      return url;
+   }
+   public void setUrl(String url)
+   {
+      this.url = url;
+   }
+   public String getUser()
+   {
+      return user;
+   }
+   public void setUser(String user)
+   {
+      this.user = user;
+   }
+   public String getPassword()
+   {
+      return password;
+   }
+   public void setPassword(String password)
+   {
+      this.password = password;
+   }
+   public PropertiesMetaData getProperties()
+   {
+      return properties;
+   }
+   @XmlElement(name="property")
+   public void setProperties(PropertiesMetaData properties)
+   {
+      this.properties = properties;
+   }
+   public int getLoginTimeout()
+   {
+      return loginTimeout;
+   }
+   public void setLoginTimeout(int loginTimeout)
+   {
+      this.loginTimeout = loginTimeout;
+   }
+   public boolean isTransactional()
+   {
+      return transactional;
+   }
+   public void setTransactional(boolean transactional)
+   {
+      this.transactional = transactional;
+   }
+   public IsolationLevelType getIsolationLevel()
+   {
+      return isolationLevel;
+   }
+   public void setIsolationLevel(IsolationLevelType isolationLevel)
+   {
+      this.isolationLevel = isolationLevel;
+   }
+   public int getInitialPoolSize()
+   {
+      return initialPoolSize;
+   }
+   public void setInitialPoolSize(int initialPoolSize)
+   {
+      this.initialPoolSize = initialPoolSize;
+   }
+   public int getMaxPoolSize()
+   {
+      return maxPoolSize;
+   }
+   public void setMaxPoolSize(int maxPoolSize)
+   {
+      this.maxPoolSize = maxPoolSize;
+   }
+   public int getMinPoolSize()
+   {
+      return minPoolSize;
+   }
+   public void setMinPoolSize(int minPoolSize)
+   {
+      this.minPoolSize = minPoolSize;
+   }
+   public int getMaxIdleTime()
+   {
+      return maxIdleTime;
+   }
+   public void setMaxIdleTime(int maxIdleTime)
+   {
+      this.maxIdleTime = maxIdleTime;
+   }
+   public int getMaxStatements()
+   {
+      return maxStatements;
+   }
+   public void setMaxStatements(int maxStatements)
+   {
+      this.maxStatements = maxStatements;
+   }
+   
+   public DataSourceMetaData merge(DataSourceMetaData original)
+   {
+      DataSourceMetaData merged = new DataSourceMetaData();
+      merged.merge(this, original);
+      return merged;
+   }
+
+   /**
+    * Merge the contents of override with original into this.
+    * 
+    * @param override data which overrides original
+    * @param original the original data
+    */
+   public void merge(DataSourceMetaData override, DataSourceMetaData original)
+   {
+      super.merge(override, original);
+      if (override != null && override.getClassName() != null)
+         setClassName(override.getClassName());
+      else if (original != null && original.getClassName() != null)
+         setClassName(original.getClassName());
+      if (override != null && override.databaseName != null)
+         setDatabaseName(override.databaseName);
+      else if (original != null && original.databaseName != null)
+         setDatabaseName(original.databaseName);
+      if (override != null && override.initialPoolSize != DEFAULT_INITIAL_POOL_SIZE)
+         setInitialPoolSize(override.initialPoolSize);
+      else if (original != null && original.initialPoolSize != DEFAULT_INITIAL_POOL_SIZE)
+         setInitialPoolSize(original.initialPoolSize);
+      if (override != null && override.isolationLevel != null)
+         setIsolationLevel(override.isolationLevel);
+      else if (original != null && original.isolationLevel != null)
+         setIsolationLevel(original.isolationLevel);
+      if (override != null && override.loginTimeout != DEFAULT_LOGIN_TIMEOUT)
+         setLoginTimeout(override.loginTimeout);
+      else if (original != null && original.loginTimeout != DEFAULT_LOGIN_TIMEOUT)
+         setLoginTimeout(original.loginTimeout);
+      if (override != null && override.maxIdleTime != DEFAULT_MAX_IDLE_TIME)
+         setMaxIdleTime(override.maxIdleTime);
+      else if (original != null && original.maxIdleTime != DEFAULT_MAX_IDLE_TIME)
+         setMaxIdleTime(original.maxIdleTime);
+      if (override != null && override.maxPoolSize != DEFAULT_MAX_POOL_SIZE)
+         setMaxPoolSize(override.maxPoolSize);
+      else if (original != null && original.maxPoolSize != DEFAULT_MAX_POOL_SIZE)
+         setMaxPoolSize(original.maxPoolSize);
+      if (override != null && override.maxStatements != DEFAULT_MAX_STATEMENTS)
+         setMaxStatements(override.maxStatements);
+      else if (original != null && original.maxStatements != DEFAULT_MAX_STATEMENTS)
+         setMaxStatements(original.maxStatements);
+      if (override != null && override.minPoolSize != DEFAULT_MIN_POOL_SIZE)
+         setMinPoolSize(override.minPoolSize);
+      else if (original != null && original.minPoolSize != DEFAULT_MIN_POOL_SIZE)
+         setMinPoolSize(original.minPoolSize);
+      if (override != null && override.password != null)
+         setPassword(override.password);
+      else if (original != null && original.password != null)
+         setPassword(original.password);
+      if (override != null && override.portNumber != DEFAULT_PORT_NUMBER)
+         setPortNumber(override.portNumber);
+      else if (original != null && original.portNumber != DEFAULT_PORT_NUMBER)
+         setPortNumber(original.portNumber);
+      // TODO: do something for properties
+      if (override != null && override.serverName != null)
+         setServerName(override.serverName);
+      else if (original != null && original.serverName != null)
+         setServerName(original.serverName);
+      if (override != null && override.transactional != DEFAULT_TRANSACTIONAL)
+         setTransactional(override.transactional);
+      else if (original != null && original.transactional != DEFAULT_TRANSACTIONAL)
+         setTransactional(original.transactional);
+      if (override != null && override.url != null)
+         setUrl(override.url);
+      else if (original != null && original.url != null)
+         setUrl(original.url);
+      if (override != null && override.user != null)
+         setUser(override.user);
+      else if (original != null && original.user != null)
+         setUser(original.user);
+   }
+
+}

Added: projects/metadata/common/trunk/src/main/java/org/jboss/metadata/javaee/spec/DataSourcesMetaData.java
===================================================================
--- projects/metadata/common/trunk/src/main/java/org/jboss/metadata/javaee/spec/DataSourcesMetaData.java	                        (rev 0)
+++ projects/metadata/common/trunk/src/main/java/org/jboss/metadata/javaee/spec/DataSourcesMetaData.java	2009-10-27 18:06:19 UTC (rev 95624)
@@ -0,0 +1,69 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, 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.javaee.spec;
+
+import org.jboss.metadata.javaee.support.AbstractMappedMetaData;
+import org.jboss.metadata.javaee.support.AugmentableMetaData;
+import org.jboss.metadata.javaee.support.JavaEEMetaDataUtil;
+
+/**
+ * @author Remy Maucherat
+ * @version $Revision: 65928 $
+ */
+public class DataSourcesMetaData extends AbstractMappedMetaData<DataSourceMetaData> 
+   implements AugmentableMetaData<DataSourcesMetaData>
+{
+   private static final long serialVersionUID = 1;
+   public DataSourcesMetaData()
+   {
+      super("data sources");
+   }
+   
+   /**
+    * Merge data sources
+    * 
+    * @param override the override references
+    * @param overriden the overriden references 
+    * @param overridenFile the overriden file name
+    * @param overrideFile the override file
+    * @return the merged referencees
+    */
+   public static DataSourcesMetaData merge(DataSourcesMetaData override,
+         DataSourcesMetaData overriden,
+         String overridenFile, String overrideFile)
+   {
+      if (override == null && overriden == null)
+         return null;
+      
+      if (override == null)
+         return overriden;
+      
+      DataSourcesMetaData merged = new DataSourcesMetaData();
+      return JavaEEMetaDataUtil.merge(merged, overriden, override, "data-source", overridenFile, overrideFile, false);
+   }
+
+   public void augment(DataSourcesMetaData webFragmentMetaData, DataSourcesMetaData webMetaData)
+   {
+      // TODO
+   }
+   
+}

Modified: projects/metadata/common/trunk/src/main/java/org/jboss/metadata/javaee/spec/EJBLocalReferenceMetaData.java
===================================================================
--- projects/metadata/common/trunk/src/main/java/org/jboss/metadata/javaee/spec/EJBLocalReferenceMetaData.java	2009-10-27 17:56:25 UTC (rev 95623)
+++ projects/metadata/common/trunk/src/main/java/org/jboss/metadata/javaee/spec/EJBLocalReferenceMetaData.java	2009-10-27 18:06:19 UTC (rev 95624)
@@ -135,7 +135,7 @@
       if (override != null && override.getEjbRefName() != null)
          setEjbRefName(override.getEjbRefName());
       else if (original != null && original.getEjbRefName() != null)
-         setLocalHome(original.getEjbRefName());
+         setEjbRefName(original.getEjbRefName());
       if (override != null && override.localHome != null)
          setLocalHome(override.localHome);
       else if (original != null && original.localHome != null)

Modified: projects/metadata/common/trunk/src/main/java/org/jboss/metadata/javaee/spec/Environment.java
===================================================================
--- projects/metadata/common/trunk/src/main/java/org/jboss/metadata/javaee/spec/Environment.java	2009-10-27 17:56:25 UTC (rev 95623)
+++ projects/metadata/common/trunk/src/main/java/org/jboss/metadata/javaee/spec/Environment.java	2009-10-27 18:06:19 UTC (rev 95624)
@@ -62,4 +62,20 @@
     */
    PersistenceContextReferenceMetaData getPersistenceContextReferenceByName(String name);
 
+   /**
+    * Get the dataSources.
+    * 
+    * @return the dataSources
+    */
+   DataSourcesMetaData getDataSources();
+   
+   /**
+    * Get by name
+    * 
+    * @param name the name
+    * @return the result or null if not found
+    * @throws IllegalArgumentException for a null name
+    */
+   DataSourceMetaData getDataSourceByName(String name);
+   
 }
\ No newline at end of file

Modified: projects/metadata/common/trunk/src/main/java/org/jboss/metadata/javaee/spec/EnvironmentRefsGroupMetaData.java
===================================================================
--- projects/metadata/common/trunk/src/main/java/org/jboss/metadata/javaee/spec/EnvironmentRefsGroupMetaData.java	2009-10-27 17:56:25 UTC (rev 95623)
+++ projects/metadata/common/trunk/src/main/java/org/jboss/metadata/javaee/spec/EnvironmentRefsGroupMetaData.java	2009-10-27 18:06:19 UTC (rev 95624)
@@ -38,7 +38,7 @@
       propOrder={"environmentEntries", "ejbReferences", "ejbLocalReferences",
       "serviceReferences", "resourceReferences", "resourceEnvironmentReferences",
       "messageDestinationReferences", "persistenceContextRefs", "persistenceUnitRefs",
-      "postConstructs", "preDestroys"})
+      "postConstructs", "preDestroys", "dataSources"})
 public class EnvironmentRefsGroupMetaData extends RemoteEnvironmentRefsGroupMetaData
    implements Serializable, Environment, MutableEnvironment
 {
@@ -51,6 +51,9 @@
    /** The persistence context reference */
    private PersistenceContextReferencesMetaData persistenceContextRefs;
 
+   /** The data sources */
+   private DataSourcesMetaData dataSources;
+   
    /**
     * Create a new EnvironmentRefsGroupMetaData.
     */
@@ -124,6 +127,28 @@
       return AbstractMappedMetaData.getByName(name, persistenceContextRefs);
    }
 
+   public DataSourcesMetaData getDataSources()
+   {
+      return dataSources;
+   }
+   @XmlElement(name="data-source")
+   public void setDataSources(DataSourcesMetaData dataSources)
+   {
+      this.dataSources = dataSources;
+   }
+   
+   public DataSourceMetaData getDataSourceByName(String name)
+   {
+      return AbstractMappedMetaData.getByName(name, dataSources);
+   }
+
+   private static DataSourcesMetaData getDataSources(Environment env)
+   {
+      if(env == null)
+         return null;
+      return env.getDataSources();
+   }
+   
    public void merge(Environment jbossEnv, Environment specEnv,
          String overridenFile, String overrideFile, boolean mustOverride)
    {
@@ -154,5 +179,24 @@
      PersistenceContextReferencesMetaData persistenceContextRefs = PersistenceContextReferencesMetaData.merge(getPersistenceContextRefs(jbossEnv), getPersistenceContextRefs(specEnv), overridenFile, overrideFile);
      if(persistenceContextRefs != null)
         setPersistenceContextRefs(persistenceContextRefs);
+
+     DataSourcesMetaData dataSources = DataSourcesMetaData.merge(getDataSources(jbossEnv), getDataSources(specEnv), overridenFile, overrideFile);
+     if(dataSources != null)
+        setDataSources(dataSources);
+
    }
+
+   public void augment(RemoteEnvironmentRefsGroupMetaData augment, RemoteEnvironmentRefsGroupMetaData main)
+   {
+      super.augment(augment, main);
+      EnvironmentRefsGroupMetaData augmentE = (EnvironmentRefsGroupMetaData) augment;
+      EnvironmentRefsGroupMetaData mainE = (EnvironmentRefsGroupMetaData) main;
+      // TODO
+      // Data sources
+      
+      // EJB local references
+      
+      // Persistence context refs
+      
+   }
 }

Added: projects/metadata/common/trunk/src/main/java/org/jboss/metadata/javaee/spec/IsolationLevelType.java
===================================================================
--- projects/metadata/common/trunk/src/main/java/org/jboss/metadata/javaee/spec/IsolationLevelType.java	                        (rev 0)
+++ projects/metadata/common/trunk/src/main/java/org/jboss/metadata/javaee/spec/IsolationLevelType.java	2009-10-27 18:06:19 UTC (rev 95624)
@@ -0,0 +1,40 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, 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.javaee.spec;
+
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * IsolationLevelType.
+ * 
+ * @author Remy Maucherat
+ * @version $Revision: 1.1 $
+ */
+ at XmlType(name="isolation-levelType")
+public enum IsolationLevelType
+{
+   TRANSACTION_READ_UNCOMMITTED,
+   TRANSACTION_READ_COMMITTED,
+   TRANSACTION_REPEATABLE_READ,
+   TRANSACTION_SERIALIZABLE
+}

Modified: projects/metadata/common/trunk/src/main/java/org/jboss/metadata/javaee/spec/MessageDestinationMetaData.java
===================================================================
--- projects/metadata/common/trunk/src/main/java/org/jboss/metadata/javaee/spec/MessageDestinationMetaData.java	2009-10-27 17:56:25 UTC (rev 95623)
+++ projects/metadata/common/trunk/src/main/java/org/jboss/metadata/javaee/spec/MessageDestinationMetaData.java	2009-10-27 18:06:19 UTC (rev 95624)
@@ -33,7 +33,7 @@
  * @author <a href="adrian at jboss.com">Adrian Brock</a>
  * @version $Revision: 1.1 $
  */
- at XmlType(name="message-destinationType", propOrder={"descriptionGroup", "messageDestinationName", "jndiName", "mappedName"})
+ at XmlType(name="message-destinationType", propOrder={"descriptionGroup", "messageDestinationName", "jndiName", "mappedName", "lookupName"})
 public class MessageDestinationMetaData extends NamedMetaDataWithDescriptionGroup implements MergeableMappedMetaData<MessageDestinationMetaData>
 {
    /** The serialVersionUID */
@@ -41,6 +41,8 @@
 
    /** The mapped name */
    private String mappedName;
+   /** The lookup name */
+   private String lookupName;
 
    /**
     * Create a new MessageDestinationMetaData.
@@ -117,6 +119,26 @@
       setMappedName(jndiName);
    }
 
+   /**
+    * Get the lookupName.
+    * 
+    * @return the lookupName.
+    */
+   public String getLookupName()
+   {
+      return lookupName;
+   }
+
+   /**
+    * Set the lookupName.
+    * 
+    * @param lookupName the lookupName.
+    */
+   public void setLookupName(String lookupName)
+   {
+      this.lookupName = lookupName;
+   }
+
    public MessageDestinationMetaData merge(MessageDestinationMetaData original)
    {
       MessageDestinationMetaData merged = new MessageDestinationMetaData();
@@ -137,5 +159,9 @@
          setMappedName(override.mappedName);
       else if (original.mappedName != null)
          setMappedName(original.mappedName);
+      if (override != null && override.lookupName != null)
+         setLookupName(override.lookupName);
+      else if (original.lookupName != null)
+         setLookupName(original.lookupName);
    }
 }

Modified: projects/metadata/common/trunk/src/main/java/org/jboss/metadata/javaee/spec/MessageDestinationsMetaData.java
===================================================================
--- projects/metadata/common/trunk/src/main/java/org/jboss/metadata/javaee/spec/MessageDestinationsMetaData.java	2009-10-27 17:56:25 UTC (rev 95623)
+++ projects/metadata/common/trunk/src/main/java/org/jboss/metadata/javaee/spec/MessageDestinationsMetaData.java	2009-10-27 18:06:19 UTC (rev 95624)
@@ -22,6 +22,7 @@
 package org.jboss.metadata.javaee.spec;
 
 import org.jboss.metadata.javaee.support.AbstractMappedMetaData;
+import org.jboss.metadata.javaee.support.AugmentableMetaData;
 import org.jboss.metadata.javaee.support.JavaEEMetaDataUtil;
 import org.jboss.metadata.merge.MergeUtil;
 
@@ -32,6 +33,7 @@
  * @version $Revision: 67878 $
  */
 public class MessageDestinationsMetaData extends AbstractMappedMetaData<MessageDestinationMetaData>
+   implements AugmentableMetaData<MessageDestinationsMetaData>
 {
    /** The serialVersionUID */
    private static final long serialVersionUID = -6198704374773701253L;
@@ -71,8 +73,13 @@
 
    public void merge(MessageDestinationsMetaData override, MessageDestinationsMetaData original)
    {
-      // TODO: duplicated merge methods?
       super.merge(override, original);
       MergeUtil.merge(this, override, original);
    }
+
+   public void augment(MessageDestinationsMetaData augment,
+         MessageDestinationsMetaData main)
+   {
+      // TODO
+   }
 }

Modified: projects/metadata/common/trunk/src/main/java/org/jboss/metadata/javaee/spec/MutableEnvironment.java
===================================================================
--- projects/metadata/common/trunk/src/main/java/org/jboss/metadata/javaee/spec/MutableEnvironment.java	2009-10-27 17:56:25 UTC (rev 95623)
+++ projects/metadata/common/trunk/src/main/java/org/jboss/metadata/javaee/spec/MutableEnvironment.java	2009-10-27 18:06:19 UTC (rev 95624)
@@ -28,17 +28,18 @@
 public interface MutableEnvironment extends MutableRemoteEnvironment, Environment
 {
    /**
-    * Get the ejbLocalReferences.
-    * 
-    * @return the ejbLocalReferences.
+    * Set the ejbLocalReferences.
     */
    void setEjbLocalReferences(EJBLocalReferencesMetaData refs);
 
    /**
-    * Get the persistenceContextRefs.
-    * 
-    * @return the persistenceContextRefs.
+    * Set the persistenceContextRefs.
     */
    void setPersistenceContextRefs(PersistenceContextReferencesMetaData refs);
 
+   /**
+    * Set the dataSources.
+    */
+   void setDataSources(DataSourcesMetaData dataSources);
+   
 }

Modified: projects/metadata/common/trunk/src/main/java/org/jboss/metadata/javaee/spec/RemoteEnvironmentRefsGroupMetaData.java
===================================================================
--- projects/metadata/common/trunk/src/main/java/org/jboss/metadata/javaee/spec/RemoteEnvironmentRefsGroupMetaData.java	2009-10-27 17:56:25 UTC (rev 95623)
+++ projects/metadata/common/trunk/src/main/java/org/jboss/metadata/javaee/spec/RemoteEnvironmentRefsGroupMetaData.java	2009-10-27 18:06:19 UTC (rev 95624)
@@ -28,6 +28,7 @@
 
 import org.jboss.metadata.javaee.jboss.JBossServiceReferencesMetaData;
 import org.jboss.metadata.javaee.support.AbstractMappedMetaData;
+import org.jboss.metadata.javaee.support.AugmentableMetaData;
 import org.jboss.xb.annotations.JBossXmlCollection;
 import org.jboss.xb.annotations.JBossXmlModelGroup;
 
@@ -50,7 +51,8 @@
          "postConstructs",
          "preDestroys"})
 public class RemoteEnvironmentRefsGroupMetaData
-   implements Serializable, RemoteEnvironment, MutableRemoteEnvironment
+   implements Serializable, RemoteEnvironment, MutableRemoteEnvironment, 
+      AugmentableMetaData<RemoteEnvironmentRefsGroupMetaData>
 {
    /** The serialVersionUID */
    private static final long serialVersionUID = 2L;
@@ -498,4 +500,10 @@
       if(annotatedRefs != null)
          this.setAnnotatedEjbReferences(annotatedRefs);
    }
+   
+   public void augment(RemoteEnvironmentRefsGroupMetaData augment, RemoteEnvironmentRefsGroupMetaData main)
+   {
+      // TODO
+   }
+   
 }

Added: projects/metadata/common/trunk/src/main/java/org/jboss/metadata/javaee/support/AugmentableMetaData.java
===================================================================
--- projects/metadata/common/trunk/src/main/java/org/jboss/metadata/javaee/support/AugmentableMetaData.java	                        (rev 0)
+++ projects/metadata/common/trunk/src/main/java/org/jboss/metadata/javaee/support/AugmentableMetaData.java	2009-10-27 18:06:19 UTC (rev 95624)
@@ -0,0 +1,46 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, 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.javaee.support;
+
+/**
+ * AugmentableMetaData.
+ * This implements meta data merging according to the Servlet API 3.0
+ * definitions. 
+ * 
+ * @param <T> the augment type
+ * @author Remy Maucherat
+ * @version $Revision: 1.1 $
+ */
+public interface AugmentableMetaData<T>
+{
+   /**
+    * Augment the current meta data with the given meta data.
+    * 
+    * @param augment this meta data will augment the current one
+    * @param main this meta data will be used to resolve conflicts
+    * @throws IllegalStateException if a conflict is found between the
+    *    current meta data and the augmenting meta data, that is not
+    *    resolved according to the specific rules for the meta data
+    *    considered
+    */
+   public void augment(T augment, T main);
+}

Modified: projects/metadata/common/trunk/src/main/resources/schema/javaee_6.xsd
===================================================================
--- projects/metadata/common/trunk/src/main/resources/schema/javaee_6.xsd	2009-10-27 17:56:25 UTC (rev 95623)
+++ projects/metadata/common/trunk/src/main/resources/schema/javaee_6.xsd	2009-10-27 18:06:19 UTC (rev 95624)
@@ -2428,3 +2428,4 @@
   </xsd:complexType>
 
 </xsd:schema>
+

Added: projects/metadata/common/trunk/src/main/resources/schema/jboss-common_6_0.xsd
===================================================================
--- projects/metadata/common/trunk/src/main/resources/schema/jboss-common_6_0.xsd	                        (rev 0)
+++ projects/metadata/common/trunk/src/main/resources/schema/jboss-common_6_0.xsd	2009-10-27 18:06:19 UTC (rev 95624)
@@ -0,0 +1,571 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsd:schema xmlns="http://www.w3.org/2001/XMLSchema"
+            targetNamespace="http://www.jboss.com/xml/ns/javaee"
+            xmlns:javaee="http://java.sun.com/xml/ns/javaee"
+            xmlns:jboss="http://www.jboss.com/xml/ns/javaee"
+            xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+            elementFormDefault="qualified" 
+            attributeFormDefault="unqualified"
+            version="6.0">
+
+   <xsd:annotation>
+      <xsd:documentation> 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. </xsd:documentation>
+   </xsd:annotation>
+
+   <xsd:annotation>
+      <xsd:documentation>
+         <![CDATA[
+
+	This XML Schema defines types, elements and model groups that common to all application-specific JBoss schemas.
+        The target namespace is
+
+	http://www.jboss.com/xml/ns/javaee
+
+	]]>
+      </xsd:documentation>
+   </xsd:annotation>
+
+   <xsd:annotation>
+      <xsd:documentation> The following conventions apply to all Java EE deployment descriptor
+         elements unless indicated otherwise. - In elements that specify a pathname to a file within
+         the same JAR file, relative filenames (i.e., those not starting with "/") are considered
+         relative to the root of the JAR file's namespace. Absolute filenames (i.e., those starting
+         with "/") also specify names in the root of the JAR file's namespace. In general, relative
+         names are preferred. The exception is .war files where absolute names are preferred for
+         consistency with the Servlet API. </xsd:documentation>
+   </xsd:annotation>
+
+   <xsd:import namespace="http://java.sun.com/xml/ns/javaee" schemaLocation="http://java.sun.com/xml/ns/javaee/javaee_6.xsd"/>
+
+   <xsd:group name="descriptionGroup">
+      <xsd:sequence>
+         <xsd:element name="description" type="javaee:descriptionType" minOccurs="0" maxOccurs="unbounded" />
+         <xsd:element name="display-name" type="javaee:display-nameType" minOccurs="0" maxOccurs="unbounded" />
+         <xsd:element name="icon" type="javaee:iconType" minOccurs="0" maxOccurs="unbounded" />
+      </xsd:sequence>
+   </xsd:group>
+
+   <xsd:group name="jndiEnvironmentRefsGroup">
+      <xsd:sequence>
+         <xsd:element name="env-entry" type="jboss:env-entryType" minOccurs="0" maxOccurs="unbounded" />
+         <xsd:element name="ejb-ref" type="jboss:ejb-refType" minOccurs="0" maxOccurs="unbounded" />
+         <xsd:element name="ejb-local-ref" type="jboss:ejb-local-refType" minOccurs="0" maxOccurs="unbounded" />
+         <xsd:group ref="jboss:service-refGroup" />
+         <xsd:element name="resource-ref" type="jboss:resource-refType" minOccurs="0" maxOccurs="unbounded" />
+         <xsd:element name="resource-env-ref" type="jboss:resource-env-refType" minOccurs="0" maxOccurs="unbounded" />
+         <xsd:element name="message-destination-ref" type="jboss:message-destination-refType" minOccurs="0" maxOccurs="unbounded" />
+         <xsd:element name="persistence-context-ref" type="jboss:persistence-context-refType" minOccurs="0" maxOccurs="unbounded" />
+         <xsd:element name="persistence-unit-ref" type="jboss:persistence-unit-refType" minOccurs="0" maxOccurs="unbounded" />
+         <xsd:element name="post-construct" type="jboss:lifecycle-callbackType" minOccurs="0" maxOccurs="unbounded" />
+         <xsd:element name="pre-destroy" type="jboss:lifecycle-callbackType" minOccurs="0" maxOccurs="unbounded" />
+         <xsd:element name="data-source" type="jboss:data-sourceType" minOccurs="0" maxOccurs="unbounded" />
+      </xsd:sequence>
+   </xsd:group>
+
+   <xsd:complexType name="env-entryType">
+      <xsd:sequence>
+         <xsd:element name="description" type="javaee:descriptionType" minOccurs="0" maxOccurs="unbounded" />
+         <xsd:element name="env-entry-name" type="javaee:jndi-nameType" />
+         <xsd:element name="env-entry-type" type="javaee:env-entry-type-valuesType" minOccurs="0" />
+         <xsd:element name="env-entry-value" type="javaee:xsdStringType" minOccurs="0" />
+         <xsd:group ref="jboss:resourceGroup" />
+      </xsd:sequence>
+      <xsd:attribute name="id" type="xsd:ID" />
+   </xsd:complexType>
+
+   <xsd:complexType name="injection-targetType">
+      <xsd:sequence>
+         <xsd:element name="injection-target-class" type="javaee:fully-qualified-classType" />
+         <xsd:element name="injection-target-name" type="javaee:java-identifierType" />
+      </xsd:sequence>
+   </xsd:complexType>
+
+   <xsd:complexType name="lifecycle-callbackType">
+      <xsd:sequence>
+         <xsd:element name="lifecycle-callback-class" type="javaee:fully-qualified-classType" minOccurs="0" />
+         <xsd:element name="lifecycle-callback-method" type="javaee:java-identifierType" />
+      </xsd:sequence>
+   </xsd:complexType>
+
+   <xsd:complexType name="message-destination-refType">
+      <xsd:sequence>
+         <xsd:element name="description" type="javaee:descriptionType" minOccurs="0" maxOccurs="unbounded" />
+         <xsd:element name="message-destination-ref-name" type="javaee:jndi-nameType"/>
+         <xsd:element name="message-destination-type" type="javaee:message-destination-typeType" minOccurs="0" />
+         <xsd:element name="message-destination-usage" type="javaee:message-destination-usageType" minOccurs="0" />
+         <xsd:element name="message-destination-link" type="javaee:message-destination-linkType" minOccurs="0" />
+         <xsd:group ref="jboss:resourceGroup" />
+      </xsd:sequence>
+      <xsd:attribute name="id" type="xsd:ID" />
+   </xsd:complexType>
+
+   <!-- Bring persistence-context-refType info jboss namespace -->
+   <xsd:complexType name="persistence-context-refType">
+      <xsd:sequence>
+         <xsd:element name="description" type="javaee:descriptionType" minOccurs="0" maxOccurs="unbounded" />
+         <xsd:element name="persistence-context-ref-name" type="javaee:jndi-nameType" />
+         <xsd:element name="persistence-unit-name" type="javaee:string" minOccurs="0" />
+         <xsd:element name="persistence-context-type" type="javaee:persistence-context-typeType" minOccurs="0" />
+         <xsd:element name="persistence-property" type="javaee:propertyType" minOccurs="0" maxOccurs="unbounded" />
+         <xsd:group ref="jboss:resourceGroup" />
+      </xsd:sequence>
+      <xsd:attribute name="id" type="xsd:ID" />
+   </xsd:complexType>
+
+   <xsd:complexType name="persistence-unit-refType">
+      <xsd:sequence>
+         <xsd:element name="description" type="javaee:descriptionType" minOccurs="0" maxOccurs="unbounded" />
+         <xsd:element name="persistence-unit-ref-name" type="javaee:jndi-nameType" />
+         <xsd:element name="persistence-unit-name" type="javaee:string" minOccurs="0" />
+         <xsd:group ref="jboss:resourceGroup" />
+      </xsd:sequence>
+      <xsd:attribute name="id" type="xsd:ID" />
+   </xsd:complexType>
+
+   <xsd:complexType name="resource-env-refType">
+      <xsd:sequence>
+         <xsd:element name="description" type="javaee:descriptionType" minOccurs="0" maxOccurs="unbounded" />
+         <xsd:element name="resource-env-ref-name" type="javaee:jndi-nameType" />
+         <xsd:element name="resource-env-ref-type" type="javaee:fully-qualified-classType" minOccurs="0" />
+         <xsd:group ref="jboss:resourceGroup" />
+      </xsd:sequence>
+      <xsd:attribute name="id" type="xsd:ID" />
+   </xsd:complexType>
+
+  <xsd:complexType name="data-sourceType">
+    <xsd:sequence>
+      <xsd:element name="description" type="javaee:descriptionType" minOccurs="0" />
+      <xsd:element name="name" type="javaee:jndi-nameType" />
+      <xsd:element name="class-name" type="javaee:fully-qualified-classType" minOccurs="0" />
+      <xsd:element name="server-name" type="javaee:string" minOccurs="0" />
+      <xsd:element name="port-number" type="javaee:xsdIntegerType" minOccurs="0" />
+      <xsd:element name="database-name" type="javaee:string" minOccurs="0" />
+      <xsd:element name="url" type="javaee:jdbc-urlType" minOccurs="0" />
+      <xsd:element name="user" type="javaee:string" minOccurs="0" />
+      <xsd:element name="password" type="javaee:string" minOccurs="0" />
+      <xsd:element name="property" type="javaee:propertyType" minOccurs="0" maxOccurs="unbounded" />
+      <xsd:element name="login-timeout" type="javaee:xsdIntegerType" minOccurs="0" />
+      <xsd:element name="transactional" type="javaee:xsdBooleanType" minOccurs="0" />
+      <xsd:element name="isolation-level" type="javaee:isolation-levelType" minOccurs="0" />
+      <xsd:element name="initial-pool-size" type="javaee:xsdIntegerType" minOccurs="0" />
+      <xsd:element name="max-pool-size" type="javaee:xsdIntegerType" minOccurs="0" />
+      <xsd:element name="min-pool-size" type="javaee:xsdIntegerType" minOccurs="0" />
+      <xsd:element name="max-idle-time" type="javaee:xsdIntegerType" minOccurs="0" />
+      <xsd:element name="max-statements" type="javaee:xsdIntegerType" minOccurs="0" />
+    </xsd:sequence>
+    <xsd:attribute name="id" type="xsd:ID"/>
+   </xsd:complexType>
+
+   <xsd:group name="resourceGroup">
+      <xsd:sequence>
+         <!-- In jboss xml we allow the use of jndi-name instead of mapped-name -->
+         <xsd:choice minOccurs="0">
+            <xsd:element name="jndi-name" type="javaee:jndi-nameType"/>
+            <xsd:element name="mapped-name" type="javaee:xsdStringType"/>
+         </xsd:choice>
+         <xsd:element name="injection-target" type="jboss:injection-targetType" minOccurs="0" maxOccurs="unbounded" />
+         <xsd:element name="ignore-dependency" type="javaee:emptyType" minOccurs="0"/>
+      </xsd:sequence>
+   </xsd:group>
+
+   <xsd:group name="service-refGroup">
+      <xsd:sequence>
+         <xsd:element name="service-ref" type="jboss:service-refType" minOccurs="0" maxOccurs="unbounded">
+            <xsd:key name="service-ref_handler-name-key">
+               <xsd:selector xpath="javaee:handler" />
+               <xsd:field xpath="javaee:handler-name" />
+            </xsd:key>
+         </xsd:element>
+      </xsd:sequence>
+   </xsd:group>
+
+  <xsd:complexType name="jndi-binding-policyType">
+    <xsd:annotation>
+      <xsd:documentation>
+	<![CDATA[
+
+	  The jndiBindingPolicyType defines the fully-qualified name of
+	  a class that implements the JNDI binding policy.
+
+	  ]]>
+      </xsd:documentation>
+    </xsd:annotation>
+    <xsd:simpleContent>
+      <xsd:restriction base="javaee:fully-qualified-classType"/>
+    </xsd:simpleContent>
+  </xsd:complexType>
+
+   <xsd:complexType name="jmx-nameType">
+      <xsd:annotation>
+         <xsd:documentation> The jmx-name element allows one to specify the JMX ObjectName to use for
+            the MBean associated with the ejb-jar module. This must be a unique name and valid JMX
+            ObjectName string. </xsd:documentation>
+      </xsd:annotation>
+      <xsd:simpleContent>
+         <xsd:restriction base="javaee:string"/>
+      </xsd:simpleContent>
+   </xsd:complexType>
+
+   <xsd:complexType name="security-domainType">
+      <xsd:annotation>
+         <xsd:documentation> The security-domain element specifies the JNDI name of the security
+            manager that implements the EJBSecurityManager and RealmMapping for the domain. When
+            specified at the jboss level it specifies the security domain for all j2ee components in the
+            deployment unit. One can override the global security-domain at the container level using
+            the security-domain element at the container-configuration level. </xsd:documentation>
+      </xsd:annotation>
+      <xsd:simpleContent>
+         <xsd:restriction base="javaee:string"/>
+      </xsd:simpleContent>
+   </xsd:complexType>
+
+   <xsd:complexType name="security-roleType">
+      <xsd:annotation>
+         <xsd:documentation> The security-role element contains the definition of a security role.
+            The definition consists of an the security role name and principal name element(s). </xsd:documentation>
+      </xsd:annotation>
+      <xsd:sequence>
+         <xsd:element name="description"
+            type="javaee:descriptionType"
+            minOccurs="0"
+            maxOccurs="unbounded"/>
+         <xsd:element name="role-name"
+            type="javaee:role-nameType"/>
+         <xsd:element name="principal-name" type="jboss:principal-nameType" maxOccurs="unbounded"/>
+      </xsd:sequence>
+      <xsd:attribute name="id" type="xsd:ID"/>
+   </xsd:complexType>
+
+   <xsd:complexType name="principal-nameType">
+      <xsd:annotation>
+         <xsd:documentation> The principal-name element is the name of the principal that is mapped
+            to the assembly role-name. </xsd:documentation>
+      </xsd:annotation>
+      <xsd:simpleContent>
+         <xsd:restriction base="javaee:string"/>
+      </xsd:simpleContent>
+   </xsd:complexType>
+
+   <xsd:complexType name="dependsType">
+      <xsd:annotation>
+         <xsd:documentation> The depends element gives a JMX ObjectName of a service on which the
+            container or ejb depends. (default) </xsd:documentation>
+      </xsd:annotation>
+      <xsd:simpleContent>
+         <xsd:restriction base="javaee:string"/>
+      </xsd:simpleContent>
+   </xsd:complexType>
+
+   <xsd:complexType name="local-jndi-nameType">
+      <xsd:annotation>
+         <xsd:documentation> The JNDI name under with the local interface should be bound. If it is not
+            provided jboss will assume "jndi-name" = "beanClass/local" </xsd:documentation>
+      </xsd:annotation>
+      <xsd:simpleContent>
+         <xsd:restriction base="javaee:string"/>
+      </xsd:simpleContent>
+   </xsd:complexType>
+
+   <xsd:complexType name="ejb-refType">
+      <xsd:annotation>
+         <xsd:documentation> The ejb-ref element is used to give the jndi-name of an external ejb
+            reference. In the case of an external ejb reference, you don't provide a ejb-link element in
+            ejb-jar.xml, but you provide a jndi-name in jboss.xml Used in: entity, session,
+            message-driven, consumer, and service </xsd:documentation>
+      </xsd:annotation>
+      
+      <xsd:sequence>
+         <xsd:element name="description" type="javaee:descriptionType" minOccurs="0" maxOccurs="unbounded"/>
+         <xsd:element name="ejb-ref-name" type="javaee:ejb-ref-nameType" minOccurs="0"/>
+         <xsd:element name="ejb-ref-type" type="javaee:ejb-ref-typeType" minOccurs="0"/>
+         <xsd:element name="home" type="javaee:homeType" minOccurs="0"/>
+         <xsd:element name="remote" type="javaee:remoteType" minOccurs="0"/>
+         <xsd:element name="ejb-link" type="javaee:ejb-linkType" minOccurs="0"/>
+         <xsd:group ref="jboss:resourceGroup"/>
+      </xsd:sequence>
+      <xsd:attribute name="id" type="xsd:ID"/>
+      
+      <!-- 
+      <xsd:complexContent>
+         <xsd:extension base="javaee:ejb-refType">
+            <xsd:sequence>
+               <xsd:element name="jndi-name" type="javaee:jndi-nameType" minOccurs="0"/>
+               <xsd:element name="ignore-dependency" type="javaee:emptyType" minOccurs="0"/>
+            </xsd:sequence>
+         </xsd:extension>
+      </xsd:complexContent>
+      -->
+   </xsd:complexType>
+
+   <xsd:complexType name="ejb-local-refType">
+      <xsd:annotation>
+         <xsd:documentation> The ejb-local-ref element is used to give the jndi-name of an external ejb
+            reference. In the case of an external ejb reference, you don't provide a ejb-link element in
+            ejb-jar.xml, but you provide a jndi-name in jboss.xml </xsd:documentation>
+      </xsd:annotation>
+
+      <xsd:sequence>
+         <xsd:element name="description" type="javaee:descriptionType" minOccurs="0" maxOccurs="unbounded"/>
+         <xsd:element name="ejb-ref-name" type="javaee:ejb-ref-nameType" minOccurs="0"/>
+         <xsd:element name="ejb-ref-type" type="javaee:ejb-ref-typeType" minOccurs="0"/>
+         <xsd:element name="local-home" type="javaee:local-homeType" minOccurs="0"/>
+         <xsd:element name="local" type="javaee:localType" minOccurs="0"/>
+         <xsd:element name="ejb-link" type="javaee:ejb-linkType" minOccurs="0"/>
+         <xsd:element name="local-jndi-name" type="javaee:jndi-nameType" minOccurs="0"/>
+         <xsd:group ref="jboss:resourceGroup"/>
+      </xsd:sequence>
+      <xsd:attribute name="id" type="xsd:ID"/>
+   </xsd:complexType>
+
+   <xsd:complexType name="resource-refType">
+      <xsd:annotation>
+         <xsd:documentation> The resource-ref element gives a mapping between the "code name" of a
+            resource (res-ref-name, provided by the Bean Developer) and its "xml name" (resource-name,
+            provided by the Application Assembler). If no resource-ref is provided, jboss will assume
+            that "xml-name" = "code name" See resource-managers. </xsd:documentation>
+      </xsd:annotation>
+
+      <xsd:sequence>
+         <xsd:element name="description" type="javaee:descriptionType" minOccurs="0" maxOccurs="unbounded"/>
+         <xsd:element name="res-ref-name" type="javaee:jndi-nameType" minOccurs="0">
+            <xsd:annotation>
+               <xsd:documentation> The res-ref-name element specifies the name of a resource manager
+                  connection factory reference. The name is a JNDI name relative to the java:comp/env
+                  context. The name must be unique within a Deployment File. </xsd:documentation>
+            </xsd:annotation>
+         </xsd:element>
+
+         <xsd:element name="res-type" type="javaee:fully-qualified-classType" minOccurs="0">
+            <xsd:annotation>
+               <xsd:documentation> The res-type element specifies the type of the data source. The type
+                  is specified by the fully qualified Java language class or interface expected to be
+                  implemented by the data source. </xsd:documentation>
+            </xsd:annotation>
+         </xsd:element>
+
+         <xsd:element name="res-auth" type="javaee:res-authType" minOccurs="0"/>
+
+         <xsd:element name="res-sharing-scope" type="javaee:res-sharing-scopeType" minOccurs="0"/>
+
+         <!-- We redefine part of the resourceGroup here, so we can't ref it -->
+         <xsd:choice>
+            <xsd:element name="resource-name" type="javaee:xsdStringType"/>
+            <xsd:element name="jndi-name" type="javaee:xsdStringType"/>
+            <xsd:element name="mapped-name" type="javaee:xsdStringType"/>
+            <xsd:element name="res-url" type="javaee:xsdStringType"/>
+         </xsd:choice>
+
+         <xsd:element name="injection-target" type="jboss:injection-targetType" minOccurs="0" maxOccurs="unbounded" />
+         
+         <xsd:element name="ignore-dependency" type="javaee:emptyType" minOccurs="0"/>
+
+      </xsd:sequence>
+      <xsd:attribute name="id" type="xsd:ID"/>
+   </xsd:complexType>
+
+   <xsd:complexType name="service-ref-nameType">
+      <xsd:annotation>
+         <xsd:documentation> The service-ref-name element gives the ENC relative name used in the
+            ejb-jar.xml service-ref-name element. </xsd:documentation>
+      </xsd:annotation>
+      <xsd:simpleContent>
+         <xsd:restriction base="javaee:string"/>
+      </xsd:simpleContent>
+   </xsd:complexType>
+
+   <xsd:complexType name="loader-repositoryType" mixed="true">
+      <xsd:annotation>
+         <xsd:documentation>
+            <![CDATA[
+      The loader-repository specifies the name of the UnifiedLoaderRepository
+   MBean to use for the ear to provide ear level scoping of classes deployed
+   in the ear. It is a unique JMX ObjectName string. It may also specify
+   an arbitrary configuration by including a loader-repository-config element.
+
+Examples:
+   <loader-repository>jboss.test:loader=cts-cmp2v1-sar.ear</loader-repository>
+
+   <loader-repository loaderRepositoryClass='dot.com.LoaderRepository'>
+      dot.com:loader=unique-archive-name
+      <loader-repository-config configParserClass='dot.com.LoaderParser'>
+         java2ParentDelegaton=true
+      </loader-repository-config>
+   </loader-repository>
+        </loader-repository>
+        ]]>
+         </xsd:documentation>
+      </xsd:annotation>
+
+      <xsd:sequence>
+         <xsd:element name="loader-repository-config" type="jboss:loader-repository-configType"
+                      minOccurs="0" maxOccurs="unbounded"/>
+
+      </xsd:sequence>
+      <xsd:attribute name="id" type="xsd:ID"/>
+      <xsd:attribute name="loaderRepositoryClass" type="xsd:string"/>
+   </xsd:complexType>
+
+   <!-- **************************************************** -->
+
+   <xsd:complexType name="loader-repository-configType" mixed="true">
+      <xsd:annotation>
+         <xsd:documentation> The loader-repository-config element specifies any arbitrary configuration
+            fragment for use in configuring the loader-repository instance. The actual content of this
+            element is specific to the loaderRepositoryClass and the code parsing the element.
+         </xsd:documentation>
+      </xsd:annotation>
+
+      <xsd:attribute name="id" type="xsd:ID"/>
+      <xsd:attribute name="configParserClass" type="xsd:string"/>
+   </xsd:complexType>
+
+   <xsd:complexType name="service-refType">
+      <xsd:annotation>
+         <xsd:documentation>
+            <![CDATA[     
+  Runtime settings for a web service reference. In the simplest case,
+  there is no runtime information required for a service ref.  Runtime info
+  is only needed in the following cases :
+
+  * to define the port that should be used to resolve a container-managed port
+  * to define default Stub property settings for Stub objects
+  * to define the URL of a final WSDL document to be used
+
+  Example:
+
+  <service-ref>
+   <service-ref-name>OrganizationService</service-ref-name>
+   <wsdl-override>file:/wsdlRepository/organization-service.wsdl</wsdl-override>
+  </service-ref>
+
+  <service-ref>
+   <service-ref-name>OrganizationService</service-ref-name>
+   <config-name>Secure Client Config</config-name>
+   <config-file>META-INF/jbossws-client-config.xml</config-file>
+   <handler-chain>META-INF/jbossws-client-handlers.xml</handler-chain>
+  </service-ref>
+
+  <service-ref>
+   <service-ref-name>SecureService</service-ref-name>
+   <service-impl-class>org.jboss.tests.ws.jaxws.webserviceref.SecureEndpointService</service-impl-class>
+   <service-qname>{http://org.jboss.ws/wsref}SecureEndpointService</service-qname>
+    <port-component-ref>
+     <service-endpoint-interface>org.jboss.tests.ws.jaxws.webserviceref.SecureEndpoint</service-endpoint-interface>
+     <port-qname>{http://org.jboss.ws/wsref}SecureEndpointPort</port-qname>
+     <stub-property>
+      <name>javax.xml.ws.security.auth.username</name>
+      <value>kermit</value>
+     </stub-property>
+     <stub-property>
+      <name>javax.xml.ws.security.auth.password</name>
+      <value>thefrog</value>
+     </stub-property>
+   </port-component-ref>
+  </service-ref>
+    ]]>
+         </xsd:documentation>
+      </xsd:annotation>
+
+      <xsd:sequence>
+         <xsd:element name="service-ref-name" type="xsd:string"/>
+         <xsd:element name="service-impl-class" type="xsd:string" minOccurs="0" maxOccurs="1"/>
+         <xsd:element name="service-qname" type="xsd:string" minOccurs="0" maxOccurs="1"/>
+         <xsd:element name="config-name" type="xsd:string" minOccurs="0" maxOccurs="1"/>
+         <xsd:element name="config-file" type="xsd:string" minOccurs="0" maxOccurs="1"/>
+         <xsd:element name="handler-chain" type="xsd:string" minOccurs="0" maxOccurs="1"/>
+         <xsd:element name="port-component-ref" type="jboss:port-component-refType" minOccurs="0" maxOccurs="unbounded"/>
+         <xsd:element name="wsdl-override" type="xsd:string" minOccurs="0" maxOccurs="1"/>
+      </xsd:sequence>
+      <xsd:attribute name="id" type="xsd:ID"/>
+   </xsd:complexType>
+
+   <!--
+     Information for a port within a service-ref.
+
+     Either service-endpoint-interface or wsdl-port or both
+     (service-endpoint-interface and wsdl-port) should be specified.
+
+     If both are specified, wsdl-port represents the
+     port the container should choose for container-managed port selection.
+
+     The same wsdl-port value must not appear in
+     more than one port-component-ref entry within the same service-ref.
+
+     If a particular service-endpoint-interface is using container-managed port
+     selection, it must not appear in more than one port-component-ref entry
+     within the same service-ref.
+   -->
+   <xsd:complexType name="port-component-refType">
+      <xsd:sequence>
+         <xsd:element name="service-endpoint-interface" type="xsd:string" minOccurs="0" maxOccurs="1"/>
+         <xsd:element name="port-qname" type="xsd:string" minOccurs="0" maxOccurs="1"/>
+         <xsd:element name="config-name" type="xsd:string" minOccurs="0" maxOccurs="1"/>
+         <xsd:element name="config-file" type="xsd:string" minOccurs="0" maxOccurs="1"/>
+         <xsd:element name="stub-property" type="jboss:stub-propertyType" minOccurs="0" maxOccurs="unbounded"/>
+         <xsd:element name="call-property" type="jboss:call-propertyType" minOccurs="0" maxOccurs="unbounded"/>
+      </xsd:sequence>
+   </xsd:complexType>
+
+   <xsd:complexType name="stub-propertyType">
+      <xsd:sequence>
+         <xsd:element name="prop-name" type="xsd:string" minOccurs="0" maxOccurs="1"/>
+         <xsd:element name="prop-value" type="xsd:string" minOccurs="0" maxOccurs="1"/>
+      </xsd:sequence>
+   </xsd:complexType>
+
+   <xsd:complexType name="call-propertyType">
+      <xsd:sequence>
+         <xsd:element name="prop-name" type="xsd:string" minOccurs="0" maxOccurs="1"/>
+         <xsd:element name="prop-value" type="xsd:string" minOccurs="0" maxOccurs="1"/>
+      </xsd:sequence>
+   </xsd:complexType>
+
+   <xsd:complexType name="message-destinationType">
+      <xsd:annotation>
+         <xsd:documentation> The message-destination element is used to configure the jndi-name for a
+            message-destination in ejb-jar.xml Used in: assembly-descriptor </xsd:documentation>
+      </xsd:annotation>
+
+      <xsd:sequence>
+         <xsd:group ref="jboss:descriptionGroup"/>
+         <xsd:element name="message-destination-name" type="javaee:xsdStringType"/>
+         <xsd:choice>
+            <xsd:element name="jndi-name" type="javaee:xsdStringType"/>
+            <xsd:element name="mapped-name" type="javaee:xsdStringType"/>
+         </xsd:choice>
+         <xsd:element name="lookup-name" type="javaee:xsdStringType"/>
+      </xsd:sequence>
+      <xsd:attribute name="id" type="xsd:ID"/>
+   </xsd:complexType>
+
+   <xsd:complexType name="webservice-descriptionType">
+      <xsd:annotation>
+         <xsd:documentation>
+            <![CDATA[
+            Runtime information about a web service.
+            wsdl-publish-location is optionally used to specify
+            where the final wsdl and any dependent files should be stored.  This location
+            resides on the file system from which deployment is initiated.
+            ]]>
+         </xsd:documentation>
+      </xsd:annotation>
+      <xsd:sequence>
+         <xsd:element name="webservice-description-name" type="xsd:string"/>
+         <xsd:element name="config-name" type="xsd:string" minOccurs="0"/>
+         <xsd:element name="config-file" type="xsd:string" minOccurs="0"/>
+         <xsd:element name="wsdl-publish-location" type="xsd:string" minOccurs="0" maxOccurs="1"/>
+      </xsd:sequence>
+      <xsd:attribute name="id" type="xsd:ID" />
+   </xsd:complexType>
+
+</xsd:schema>




More information about the jboss-cvs-commits mailing list