[jboss-cvs] JBossAS SVN: r95649 - in projects/metadata/common/trunk/src/main/java/org/jboss/metadata: javaee/spec and 1 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Tue Oct 27 23:28:29 EDT 2009
Author: remy.maucherat at jboss.com
Date: 2009-10-27 23:28:27 -0400 (Tue, 27 Oct 2009)
New Revision: 95649
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/javaee/spec/DataSourcesMetaData.java
projects/metadata/common/trunk/src/main/java/org/jboss/metadata/javaee/spec/EJBLocalReferencesMetaData.java
projects/metadata/common/trunk/src/main/java/org/jboss/metadata/javaee/spec/EJBReferencesMetaData.java
projects/metadata/common/trunk/src/main/java/org/jboss/metadata/javaee/spec/EnvironmentEntriesMetaData.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/LifecycleCallbacksMetaData.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/MessageDestinationReferencesMetaData.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/PersistenceContextReferencesMetaData.java
projects/metadata/common/trunk/src/main/java/org/jboss/metadata/javaee/spec/PersistenceUnitReferencesMetaData.java
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/ResourceEnvironmentReferencesMetaData.java
projects/metadata/common/trunk/src/main/java/org/jboss/metadata/javaee/spec/ResourceInjectionMetaData.java
projects/metadata/common/trunk/src/main/java/org/jboss/metadata/javaee/spec/ResourceReferencesMetaData.java
projects/metadata/common/trunk/src/main/java/org/jboss/metadata/javaee/spec/ServiceReferencesMetaData.java
projects/metadata/common/trunk/src/main/java/org/jboss/metadata/javaee/support/AugmentableMetaData.java
Log:
- Fix the augmentable API. Although I thought I could remove the boolean, the != null check only worked
on the top level object. Dumb mistake.
- Also should fix test failure for the JBoss common schema mapping.
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-28 03:02:03 UTC (rev 95648)
+++ projects/metadata/common/trunk/src/main/java/org/jboss/metadata/ejb/jboss/JBossEnvironmentRefsGroupMetaData.java 2009-10-28 03:28:27 UTC (rev 95649)
@@ -53,7 +53,7 @@
propOrder={"environmentEntries", "ejbReferences", "ejbLocalReferences",
"serviceReferences", "resourceReferences", "resourceEnvironmentReferences",
"messageDestinationReferences", "persistenceContextRefs", "persistenceUnitRefs",
- "postConstructs", "preDestroys"})
+ "postConstructs", "preDestroys", "dataSources"})
public class JBossEnvironmentRefsGroupMetaData
extends RemoteEnvironmentRefsGroupMetaData
implements Serializable, Environment
Modified: 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 2009-10-28 03:02:03 UTC (rev 95648)
+++ projects/metadata/common/trunk/src/main/java/org/jboss/metadata/javaee/spec/DataSourcesMetaData.java 2009-10-28 03:28:27 UTC (rev 95649)
@@ -61,13 +61,13 @@
return JavaEEMetaDataUtil.merge(merged, overriden, override, "data-source", overridenFile, overrideFile, false);
}
- public void augment(DataSourcesMetaData webFragmentMetaData, DataSourcesMetaData webMetaData)
+ public void augment(DataSourcesMetaData webFragmentMetaData, DataSourcesMetaData webMetaData, boolean resolveConflicts)
{
for (DataSourceMetaData dataSourceMetaData : webFragmentMetaData)
{
if (containsKey(dataSourceMetaData.getKey()))
{
- if (webMetaData == null || !webMetaData.containsKey(dataSourceMetaData.getKey()))
+ if (!resolveConflicts && (webMetaData == null || !webMetaData.containsKey(dataSourceMetaData.getKey())))
{
throw new IllegalStateException("Unresolved conflict on data source named: "
+ dataSourceMetaData.getKey());
Modified: projects/metadata/common/trunk/src/main/java/org/jboss/metadata/javaee/spec/EJBLocalReferencesMetaData.java
===================================================================
--- projects/metadata/common/trunk/src/main/java/org/jboss/metadata/javaee/spec/EJBLocalReferencesMetaData.java 2009-10-28 03:02:03 UTC (rev 95648)
+++ projects/metadata/common/trunk/src/main/java/org/jboss/metadata/javaee/spec/EJBLocalReferencesMetaData.java 2009-10-28 03:28:27 UTC (rev 95649)
@@ -68,13 +68,13 @@
super("ejb local ref name");
}
- public void augment(EJBLocalReferencesMetaData augment, EJBLocalReferencesMetaData main)
+ public void augment(EJBLocalReferencesMetaData augment, EJBLocalReferencesMetaData main, boolean resolveConflicts)
{
for (EJBLocalReferenceMetaData ejbLocalReference : augment)
{
if (containsKey(ejbLocalReference.getKey()))
{
- if (main == null || !main.containsKey(ejbLocalReference.getKey()))
+ if (!resolveConflicts && (main == null || !main.containsKey(ejbLocalReference.getKey())))
{
throw new IllegalStateException("Unresolved conflict on ejb local reference named: "
+ ejbLocalReference.getKey());
@@ -82,7 +82,7 @@
else
{
get(ejbLocalReference.getKey()).augment(ejbLocalReference,
- (main != null) ? main.get(ejbLocalReference.getKey()) : null);
+ (main != null) ? main.get(ejbLocalReference.getKey()) : null, resolveConflicts);
}
}
else
Modified: projects/metadata/common/trunk/src/main/java/org/jboss/metadata/javaee/spec/EJBReferencesMetaData.java
===================================================================
--- projects/metadata/common/trunk/src/main/java/org/jboss/metadata/javaee/spec/EJBReferencesMetaData.java 2009-10-28 03:02:03 UTC (rev 95648)
+++ projects/metadata/common/trunk/src/main/java/org/jboss/metadata/javaee/spec/EJBReferencesMetaData.java 2009-10-28 03:28:27 UTC (rev 95649)
@@ -68,13 +68,13 @@
super("ejb ref name");
}
- public void augment(EJBReferencesMetaData augment, EJBReferencesMetaData main)
+ public void augment(EJBReferencesMetaData augment, EJBReferencesMetaData main, boolean resolveConflicts)
{
for (EJBReferenceMetaData ejbReference : augment)
{
if (containsKey(ejbReference.getKey()))
{
- if (main == null || !main.containsKey(ejbReference.getKey()))
+ if (!resolveConflicts && (main == null || !main.containsKey(ejbReference.getKey())))
{
throw new IllegalStateException("Unresolved conflict on EJB reference named: "
+ ejbReference.getKey());
@@ -82,7 +82,7 @@
else
{
get(ejbReference.getKey()).augment(ejbReference,
- (main != null) ? main.get(ejbReference.getKey()) : null);
+ (main != null) ? main.get(ejbReference.getKey()) : null, resolveConflicts);
}
}
else
Modified: projects/metadata/common/trunk/src/main/java/org/jboss/metadata/javaee/spec/EnvironmentEntriesMetaData.java
===================================================================
--- projects/metadata/common/trunk/src/main/java/org/jboss/metadata/javaee/spec/EnvironmentEntriesMetaData.java 2009-10-28 03:02:03 UTC (rev 95648)
+++ projects/metadata/common/trunk/src/main/java/org/jboss/metadata/javaee/spec/EnvironmentEntriesMetaData.java 2009-10-28 03:28:27 UTC (rev 95649)
@@ -44,13 +44,13 @@
super("env entry name");
}
- public void augment(EnvironmentEntriesMetaData augment, EnvironmentEntriesMetaData main)
+ public void augment(EnvironmentEntriesMetaData augment, EnvironmentEntriesMetaData main, boolean resolveConflicts)
{
for (EnvironmentEntryMetaData envEntry : augment)
{
if (containsKey(envEntry.getKey()))
{
- if (main == null || !main.containsKey(envEntry.getKey()))
+ if (!resolveConflicts && (main == null || !main.containsKey(envEntry.getKey())))
{
throw new IllegalStateException("Unresolved conflict on environment entry named: "
+ envEntry.getKey());
@@ -58,7 +58,7 @@
else
{
get(envEntry.getKey()).augment(envEntry,
- (main != null) ? main.get(envEntry.getKey()) : null);
+ (main != null) ? main.get(envEntry.getKey()) : null, resolveConflicts);
}
}
else
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-28 03:02:03 UTC (rev 95648)
+++ projects/metadata/common/trunk/src/main/java/org/jboss/metadata/javaee/spec/EnvironmentRefsGroupMetaData.java 2009-10-28 03:28:27 UTC (rev 95649)
@@ -186,9 +186,9 @@
}
- public void augment(RemoteEnvironmentRefsGroupMetaData augment, RemoteEnvironmentRefsGroupMetaData main)
+ public void augment(RemoteEnvironmentRefsGroupMetaData augment, RemoteEnvironmentRefsGroupMetaData main, boolean resolveConflicts)
{
- super.augment(augment, main);
+ super.augment(augment, main, resolveConflicts);
EnvironmentRefsGroupMetaData augmentE = (EnvironmentRefsGroupMetaData) augment;
EnvironmentRefsGroupMetaData mainE = (EnvironmentRefsGroupMetaData) main;
@@ -199,7 +199,8 @@
}
else if (augmentE.getDataSources() != null)
{
- getDataSources().augment(augmentE.getDataSources(), (mainE != null) ? mainE.getDataSources() : null);
+ getDataSources().augment(augmentE.getDataSources(),
+ (mainE != null) ? mainE.getDataSources() : null, resolveConflicts);
}
// EJB local references
@@ -211,7 +212,7 @@
else if (augmentE.getEjbLocalReferences() != null)
{
getEjbLocalReferences().augment(augmentE.getEjbLocalReferences(),
- (mainE != null) ? mainE.getEjbLocalReferences() : null);
+ (mainE != null) ? mainE.getEjbLocalReferences() : null, resolveConflicts);
}
// Persistence context refs
@@ -223,7 +224,7 @@
else if (augmentE.getPersistenceContextRefs() != null)
{
getPersistenceContextRefs().augment(augmentE.getPersistenceContextRefs(),
- (mainE != null) ? mainE.getPersistenceContextRefs() : null);
+ (mainE != null) ? mainE.getPersistenceContextRefs() : null, resolveConflicts);
}
}
Modified: projects/metadata/common/trunk/src/main/java/org/jboss/metadata/javaee/spec/LifecycleCallbacksMetaData.java
===================================================================
--- projects/metadata/common/trunk/src/main/java/org/jboss/metadata/javaee/spec/LifecycleCallbacksMetaData.java 2009-10-28 03:02:03 UTC (rev 95648)
+++ projects/metadata/common/trunk/src/main/java/org/jboss/metadata/javaee/spec/LifecycleCallbacksMetaData.java 2009-10-28 03:28:27 UTC (rev 95649)
@@ -124,7 +124,7 @@
}
}
- public void augment(LifecycleCallbacksMetaData augment, LifecycleCallbacksMetaData main)
+ public void augment(LifecycleCallbacksMetaData augment, LifecycleCallbacksMetaData main, boolean resolveConflicts)
{
if (main != null && main.size() > 0)
{
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-28 03:02:03 UTC (rev 95648)
+++ projects/metadata/common/trunk/src/main/java/org/jboss/metadata/javaee/spec/MessageDestinationMetaData.java 2009-10-28 03:28:27 UTC (rev 95649)
@@ -168,7 +168,7 @@
}
public void augment(MessageDestinationMetaData augment,
- MessageDestinationMetaData main)
+ MessageDestinationMetaData main, boolean resolveConflicts)
{
// Mapped name
if (getMappedName() == null)
@@ -177,8 +177,8 @@
}
else if (augment.getMappedName() != null)
{
- if (main != null && !getMappedName().equals(augment.getMappedName())
- && main.getMappedName() == null)
+ if (!resolveConflicts && !getMappedName().equals(augment.getMappedName())
+ && (main == null || main.getMappedName() == null))
{
throw new IllegalStateException("Unresolved conflict on mapped name: " + getMappedName());
}
@@ -190,8 +190,8 @@
}
else if (augment.getLookupName() != null)
{
- if (main != null && !getLookupName().equals(augment.getLookupName())
- && main.getLookupName() == null)
+ if (!resolveConflicts && !getLookupName().equals(augment.getLookupName())
+ && (main == null || main.getLookupName() == null))
{
throw new IllegalStateException("Unresolved conflict on lookup name: " + getLookupName());
}
Modified: projects/metadata/common/trunk/src/main/java/org/jboss/metadata/javaee/spec/MessageDestinationReferencesMetaData.java
===================================================================
--- projects/metadata/common/trunk/src/main/java/org/jboss/metadata/javaee/spec/MessageDestinationReferencesMetaData.java 2009-10-28 03:02:03 UTC (rev 95648)
+++ projects/metadata/common/trunk/src/main/java/org/jboss/metadata/javaee/spec/MessageDestinationReferencesMetaData.java 2009-10-28 03:28:27 UTC (rev 95649)
@@ -69,13 +69,14 @@
super("message destination ref name");
}
- public void augment(MessageDestinationReferencesMetaData augment, MessageDestinationReferencesMetaData main)
+ public void augment(MessageDestinationReferencesMetaData augment,
+ MessageDestinationReferencesMetaData main, boolean resolveConflicts)
{
for (MessageDestinationReferenceMetaData messageDestinationRef : augment)
{
if (containsKey(messageDestinationRef.getKey()))
{
- if (main == null || !main.containsKey(messageDestinationRef.getKey()))
+ if (!resolveConflicts && (main == null || !main.containsKey(messageDestinationRef.getKey())))
{
throw new IllegalStateException("Unresolved conflict on message destination reference named: "
+ messageDestinationRef.getKey());
@@ -83,7 +84,7 @@
else
{
get(messageDestinationRef.getKey()).augment(messageDestinationRef,
- (main != null) ? main.get(messageDestinationRef.getKey()) : null);
+ (main != null) ? main.get(messageDestinationRef.getKey()) : null, resolveConflicts);
}
}
else
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-28 03:02:03 UTC (rev 95648)
+++ projects/metadata/common/trunk/src/main/java/org/jboss/metadata/javaee/spec/MessageDestinationsMetaData.java 2009-10-28 03:28:27 UTC (rev 95649)
@@ -78,14 +78,14 @@
}
public void augment(MessageDestinationsMetaData augment,
- MessageDestinationsMetaData main)
+ MessageDestinationsMetaData main, boolean resolveConflicts)
{
for (MessageDestinationMetaData messageDestinationMetaData : augment)
{
if (containsKey(messageDestinationMetaData.getKey()))
{
get(messageDestinationMetaData.getKey()).augment(messageDestinationMetaData,
- (main != null) ? main.get(messageDestinationMetaData.getKey()) : null);
+ (main != null) ? main.get(messageDestinationMetaData.getKey()) : null, resolveConflicts);
}
else
{
Modified: projects/metadata/common/trunk/src/main/java/org/jboss/metadata/javaee/spec/PersistenceContextReferencesMetaData.java
===================================================================
--- projects/metadata/common/trunk/src/main/java/org/jboss/metadata/javaee/spec/PersistenceContextReferencesMetaData.java 2009-10-28 03:02:03 UTC (rev 95648)
+++ projects/metadata/common/trunk/src/main/java/org/jboss/metadata/javaee/spec/PersistenceContextReferencesMetaData.java 2009-10-28 03:28:27 UTC (rev 95649)
@@ -59,13 +59,14 @@
super("persistence-context-ref-name");
}
- public void augment(PersistenceContextReferencesMetaData augment, PersistenceContextReferencesMetaData main)
+ public void augment(PersistenceContextReferencesMetaData augment,
+ PersistenceContextReferencesMetaData main, boolean resolveConflicts)
{
for (PersistenceContextReferenceMetaData persistenceContextReference : augment)
{
if (containsKey(persistenceContextReference.getKey()))
{
- if (main == null || !main.containsKey(persistenceContextReference.getKey()))
+ if (!resolveConflicts && (main == null || !main.containsKey(persistenceContextReference.getKey())))
{
throw new IllegalStateException("Unresolved conflict on persistence context reference named: "
+ persistenceContextReference.getKey());
@@ -73,7 +74,7 @@
else
{
get(persistenceContextReference.getKey()).augment(persistenceContextReference,
- (main != null) ? main.get(persistenceContextReference.getKey()) : null);
+ (main != null) ? main.get(persistenceContextReference.getKey()) : null, resolveConflicts);
}
}
else
Modified: projects/metadata/common/trunk/src/main/java/org/jboss/metadata/javaee/spec/PersistenceUnitReferencesMetaData.java
===================================================================
--- projects/metadata/common/trunk/src/main/java/org/jboss/metadata/javaee/spec/PersistenceUnitReferencesMetaData.java 2009-10-28 03:02:03 UTC (rev 95648)
+++ projects/metadata/common/trunk/src/main/java/org/jboss/metadata/javaee/spec/PersistenceUnitReferencesMetaData.java 2009-10-28 03:28:27 UTC (rev 95649)
@@ -50,13 +50,14 @@
MergeUtil.merge(this, override, original);
}
- public void augment(PersistenceUnitReferencesMetaData augment, PersistenceUnitReferencesMetaData main)
+ public void augment(PersistenceUnitReferencesMetaData augment,
+ PersistenceUnitReferencesMetaData main, boolean resolveConflicts)
{
for (PersistenceUnitReferenceMetaData persistenceUnitRef : augment)
{
if (containsKey(persistenceUnitRef.getKey()))
{
- if (main == null || !main.containsKey(persistenceUnitRef.getKey()))
+ if (!resolveConflicts && (main == null || !main.containsKey(persistenceUnitRef.getKey())))
{
throw new IllegalStateException("Unresolved conflict on persistence unit reference named: "
+ persistenceUnitRef.getKey());
@@ -64,7 +65,7 @@
else
{
get(persistenceUnitRef.getKey()).augment(persistenceUnitRef,
- (main != null) ? main.get(persistenceUnitRef.getKey()) : null);
+ (main != null) ? main.get(persistenceUnitRef.getKey()) : null, resolveConflicts);
}
}
else
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-28 03:02:03 UTC (rev 95648)
+++ projects/metadata/common/trunk/src/main/java/org/jboss/metadata/javaee/spec/RemoteEnvironmentRefsGroupMetaData.java 2009-10-28 03:28:27 UTC (rev 95649)
@@ -501,7 +501,7 @@
this.setAnnotatedEjbReferences(annotatedRefs);
}
- public void augment(RemoteEnvironmentRefsGroupMetaData augment, RemoteEnvironmentRefsGroupMetaData main)
+ public void augment(RemoteEnvironmentRefsGroupMetaData augment, RemoteEnvironmentRefsGroupMetaData main, boolean resolveConflicts)
{
// EJB references
if (getEjbReferences() == null)
@@ -512,7 +512,7 @@
else if (augment.getEjbReferences() != null)
{
getEjbReferences().augment(augment.getEjbReferences(),
- (main != null) ? main.getEjbReferences() : null);
+ (main != null) ? main.getEjbReferences() : null, resolveConflicts);
}
// Environment entries
if (getEnvironmentEntries() == null)
@@ -523,7 +523,7 @@
else if (augment.getEnvironmentEntries() != null)
{
getEnvironmentEntries().augment(augment.getEnvironmentEntries(),
- (main != null) ? main.getEnvironmentEntries() : null);
+ (main != null) ? main.getEnvironmentEntries() : null, resolveConflicts);
}
// Message destination references
if (getMessageDestinationReferences() == null)
@@ -534,7 +534,7 @@
else if (augment.getMessageDestinationReferences() != null)
{
getMessageDestinationReferences().augment(augment.getMessageDestinationReferences(),
- (main != null) ? main.getMessageDestinationReferences() : null);
+ (main != null) ? main.getMessageDestinationReferences() : null, resolveConflicts);
}
// Persistence unit references
if (getPersistenceUnitRefs() == null)
@@ -545,7 +545,7 @@
else if (augment.getPersistenceUnitRefs() != null)
{
getPersistenceUnitRefs().augment(augment.getPersistenceUnitRefs(),
- (main != null) ? main.getPersistenceUnitRefs() : null);
+ (main != null) ? main.getPersistenceUnitRefs() : null, resolveConflicts);
}
// Post construct
if (getPostConstructs() == null)
@@ -556,7 +556,7 @@
else if (augment.getPostConstructs() != null)
{
getPostConstructs().augment(augment.getPostConstructs(),
- (main != null) ? main.getPostConstructs() : null);
+ (main != null) ? main.getPostConstructs() : null, resolveConflicts);
}
// Pre destroy
if (getPreDestroys() == null)
@@ -567,7 +567,7 @@
else if (augment.getPreDestroys() != null)
{
getPreDestroys().augment(augment.getPreDestroys(),
- (main != null) ? main.getPreDestroys() : null);
+ (main != null) ? main.getPreDestroys() : null, resolveConflicts);
}
// Resource environment references
if (getResourceEnvironmentReferences() == null)
@@ -578,7 +578,7 @@
else if (augment.getResourceEnvironmentReferences() != null)
{
getResourceEnvironmentReferences().augment(augment.getResourceEnvironmentReferences(),
- (main != null) ? main.getResourceEnvironmentReferences() : null);
+ (main != null) ? main.getResourceEnvironmentReferences() : null, resolveConflicts);
}
// Resource references
if (getResourceReferences() == null)
@@ -589,7 +589,7 @@
else if (augment.getResourceReferences() != null)
{
getResourceReferences().augment(augment.getResourceReferences(),
- (main != null) ? main.getResourceReferences() : null);
+ (main != null) ? main.getResourceReferences() : null, resolveConflicts);
}
// Service reference
if (getServiceReferences() == null)
@@ -599,7 +599,7 @@
else if (augment.getServiceReferences() != null)
{
getServiceReferences().augment(augment.getServiceReferences(),
- (main != null) ? main.getServiceReferences() : null);
+ (main != null) ? main.getServiceReferences() : null, resolveConflicts);
}
}
Modified: projects/metadata/common/trunk/src/main/java/org/jboss/metadata/javaee/spec/ResourceEnvironmentReferencesMetaData.java
===================================================================
--- projects/metadata/common/trunk/src/main/java/org/jboss/metadata/javaee/spec/ResourceEnvironmentReferencesMetaData.java 2009-10-28 03:02:03 UTC (rev 95648)
+++ projects/metadata/common/trunk/src/main/java/org/jboss/metadata/javaee/spec/ResourceEnvironmentReferencesMetaData.java 2009-10-28 03:28:27 UTC (rev 95649)
@@ -66,13 +66,14 @@
super("resource env ref name");
}
- public void augment(ResourceEnvironmentReferencesMetaData augment, ResourceEnvironmentReferencesMetaData main)
+ public void augment(ResourceEnvironmentReferencesMetaData augment,
+ ResourceEnvironmentReferencesMetaData main, boolean resolveConflicts)
{
for (ResourceEnvironmentReferenceMetaData resourceEnvRef : augment)
{
if (containsKey(resourceEnvRef.getKey()))
{
- if (main == null || !main.containsKey(resourceEnvRef.getKey()))
+ if (!resolveConflicts && (main == null || !main.containsKey(resourceEnvRef.getKey())))
{
throw new IllegalStateException("Unresolved conflict on resource environment reference named: "
+ resourceEnvRef.getKey());
@@ -80,7 +81,7 @@
else
{
get(resourceEnvRef.getKey()).augment(resourceEnvRef,
- (main != null) ? main.get(resourceEnvRef.getKey()) : null);
+ (main != null) ? main.get(resourceEnvRef.getKey()) : null, resolveConflicts);
}
}
else
Modified: projects/metadata/common/trunk/src/main/java/org/jboss/metadata/javaee/spec/ResourceInjectionMetaData.java
===================================================================
--- projects/metadata/common/trunk/src/main/java/org/jboss/metadata/javaee/spec/ResourceInjectionMetaData.java 2009-10-28 03:02:03 UTC (rev 95648)
+++ projects/metadata/common/trunk/src/main/java/org/jboss/metadata/javaee/spec/ResourceInjectionMetaData.java 2009-10-28 03:28:27 UTC (rev 95649)
@@ -213,7 +213,7 @@
setInjectionTargets(original.injectionTargets);
}
- public void augment(ResourceInjectionMetaData augment, ResourceInjectionMetaData main)
+ public void augment(ResourceInjectionMetaData augment, ResourceInjectionMetaData main, boolean resolveConflicts)
{
if (main != null && main.getInjectionTargets() != null)
{
Modified: projects/metadata/common/trunk/src/main/java/org/jboss/metadata/javaee/spec/ResourceReferencesMetaData.java
===================================================================
--- projects/metadata/common/trunk/src/main/java/org/jboss/metadata/javaee/spec/ResourceReferencesMetaData.java 2009-10-28 03:02:03 UTC (rev 95648)
+++ projects/metadata/common/trunk/src/main/java/org/jboss/metadata/javaee/spec/ResourceReferencesMetaData.java 2009-10-28 03:28:27 UTC (rev 95649)
@@ -66,13 +66,13 @@
super("resource ref name");
}
- public void augment(ResourceReferencesMetaData augment, ResourceReferencesMetaData main)
+ public void augment(ResourceReferencesMetaData augment, ResourceReferencesMetaData main, boolean resolveConflicts)
{
for (ResourceReferenceMetaData resourceRef : augment)
{
if (containsKey(resourceRef.getKey()))
{
- if (main == null || !main.containsKey(resourceRef.getKey()))
+ if (!resolveConflicts && (main == null || !main.containsKey(resourceRef.getKey())))
{
throw new IllegalStateException("Unresolved conflict on resource reference named: "
+ resourceRef.getKey());
@@ -80,7 +80,7 @@
else
{
get(resourceRef.getKey()).augment(resourceRef,
- (main != null) ? main.get(resourceRef.getKey()) : null);
+ (main != null) ? main.get(resourceRef.getKey()) : null, resolveConflicts);
}
}
else
Modified: projects/metadata/common/trunk/src/main/java/org/jboss/metadata/javaee/spec/ServiceReferencesMetaData.java
===================================================================
--- projects/metadata/common/trunk/src/main/java/org/jboss/metadata/javaee/spec/ServiceReferencesMetaData.java 2009-10-28 03:02:03 UTC (rev 95648)
+++ projects/metadata/common/trunk/src/main/java/org/jboss/metadata/javaee/spec/ServiceReferencesMetaData.java 2009-10-28 03:28:27 UTC (rev 95649)
@@ -66,13 +66,13 @@
return JavaEEMetaDataUtil.merge(merged, overriden, override, "service-ref", overridenFile, overrideFile, true);
}
- public void augment(ServiceReferencesMetaData augment, ServiceReferencesMetaData main)
+ public void augment(ServiceReferencesMetaData augment, ServiceReferencesMetaData main, boolean resolveConflicts)
{
for (ServiceReferenceMetaData serviceRef : augment)
{
if (containsKey(serviceRef.getKey()))
{
- if (main == null || !main.containsKey(serviceRef.getKey()))
+ if (!resolveConflicts && (main == null || !main.containsKey(serviceRef.getKey())))
{
throw new IllegalStateException("Unresolved conflict on service reference named: "
+ serviceRef.getKey());
@@ -80,7 +80,7 @@
else
{
get(serviceRef.getKey()).augment(serviceRef,
- (main != null) ? main.get(serviceRef.getKey()) : null);
+ (main != null) ? main.get(serviceRef.getKey()) : null, resolveConflicts);
}
}
else
Modified: 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 2009-10-28 03:02:03 UTC (rev 95648)
+++ projects/metadata/common/trunk/src/main/java/org/jboss/metadata/javaee/support/AugmentableMetaData.java 2009-10-28 03:28:27 UTC (rev 95649)
@@ -37,10 +37,12 @@
*
* @param augment this meta data will augment the current one
* @param main this meta data will be used to resolve conflicts
+ * @param resolveConflicts true if conflicts will be resolved, and
+ * false if they should cause an error
* @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);
+ public void augment(T augment, T main, boolean resolveConflicts);
}
More information about the jboss-cvs-commits
mailing list