package org.jboss.resource.adapter.jdbc.xa; public class HAXAManagedConnectionFactory extends XAManagedConnectionFactory { ... private void initSelector() throws JBossResourceException { if(urlProperty != null && urlProperty.length() > 0 && urlDelimeter != null && urlDelimeter.trim().length() > 0) { List xaDataList = new ArrayList(); //we must get information for each "url" and create a xaDataSource for each List XaProperties = new ArrayList(); String urlProperties[] = urlProperty.split(urlDelimeter); for (int cpt = 0; cpt < urlProperties.length; cpt++) { String urlValues[] = ((String) xaProps.get(urlProperties[cpt])).split(urlDelimeter); if (XaProperties == null || XaProperties.size() == 0) { //we must create properties for each value for (int valuesCpt = 0; valuesCpt < urlValues.length; valuesCpt++) { Properties xaPropsCopy = cloneProperties(xaProps); //set the specific property xaPropsCopy.setProperty(urlProperties[cpt], urlValues[valuesCpt]); XaProperties.add(xaPropsCopy); } } else { //we must modify the property with the value of the corresponding xaDataSource //verify that we have a new value for each xaDatasource if (urlValues.length != XaProperties.size()) throw new JBossResourceException("Unable to create the xa datasource, the xa properties must have the same number of values"); //put the property in the corresponding xaDataSource properties for (int valuesCpt = 0; valuesCpt < urlValues.length; valuesCpt++) { Properties xaPropsCopy = (Properties) XaProperties.get(valuesCpt); xaPropsCopy.setProperty(urlProperties[cpt], urlValues[valuesCpt]); } } } //create xaDataSource for each properties created for (int propertiesCpt = 0; propertiesCpt < XaProperties.size(); propertiesCpt++) { XADataSource xads = createXaDataSource((Properties) XaProperties.get(propertiesCpt)); xaDataList.add(new XAData(xads, "Url" + propertiesCpt)); log.debug("added XA HA connection url: " + "Url" + propertiesCpt); } xadsSelector = new XADataSelector(xaDataList); } } .... }