[jboss-svn-commits] JBL Code SVN: r21048 - labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Wed Jul 16 00:12:06 EDT 2008
Author: tcunning
Date: 2008-07-16 00:12:05 -0400 (Wed, 16 Jul 2008)
New Revision: 21048
Modified:
labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/GatewayGenerator.java
Log:
bug:JBESB-1459
Make sure that we enforce unique service names by category.
Modified: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/GatewayGenerator.java
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/GatewayGenerator.java 2008-07-16 01:42:01 UTC (rev 21047)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/GatewayGenerator.java 2008-07-16 04:12:05 UTC (rev 21048)
@@ -85,13 +85,22 @@
try {
List<Service> services = model.getServices();
- HashMap<String, String> hm = new HashMap<String, String>();
+ HashMap<String, HashMap> hm = new HashMap<String, HashMap>();
for (Service service : services) {
- if (hm.containsKey(service.getName())) {
- throw new ConfigurationException("Service names must be unique. The service name " + service.getName()
- + " is already defined within the <services> tag.");
+ if (hm.containsKey(service.getCategory())) {
+ HashMap<String, String> hc = hm.get(service.getCategory());
+
+ if (hc.containsKey(service.getName())) {
+ throw new ConfigurationException("Service names must be unique within a category. "
+ + "The service name " + service.getName()
+ + " is already defined within the " + service.getCategory() + " category.");
+ } else {
+ hc.put(service.getName(), service.getName());
+ }
} else {
- hm.put(service.getName(), service.getName());
+ HashMap <String,String> hc = new HashMap<String,String>();
+ hc.put(service.getName(), service.getName());
+ hm.put(service.getCategory(), hc);
}
}
} catch (ConfigurationException ce) {
More information about the jboss-svn-commits
mailing list