1);
DataSources dataSources = null;
if (dataSourceConfig != null) {
String driverName = dataSourceConfig.getDriver();
InstalledDriver installedDriver = driverRegistry.getValue().getInstalledDriver(driverName);
if (installedDriver != null) {
String moduleName = installedDriver.getModuleName() != null ? installedDriver.getModuleName().getName()
: null;
org.jboss.jca.common.api.metadata.ds.Driver driver = new DriverImpl(installedDriver.getDriverName(),
installedDriver.getMajorVersion(), installedDriver.getMinorVersion(),
moduleName, installedDriver.getDriverClassName(),
installedDriver.getDataSourceClassName(), installedDriver.getXaDataSourceClassName());
drivers.put(driverName, driver);
}
dataSources = new DatasourcesImpl(Arrays.asList(dataSourceConfig), null, drivers);
} else if (xaDataSourceConfig != null) {
String driverName = xaDataSourceConfig.getDriver();
InstalledDriver installedDriver = driverRegistry.getValue().getInstalledDriver(driverName);
if (installedDriver != null) {
String moduleName = installedDriver.getModuleName() != null ? installedDriver.getModuleName().getName()
: null;
org.jboss.jca.common.api.metadata.ds.Driver driver = new DriverImpl(installedDriver.getDriverName(),
installedDriver.getMajorVersion(), installedDriver.getMinorVersion(), moduleName,
installedDriver.getDriverClassName(),
installedDriver.getDataSourceClassName(), installedDriver.getXaDataSourceClassName());
drivers.put(driverName, driver);
}
dataSources = new DatasourcesImpl(null, Arrays.asList(xaDataSourceConfig), drivers);
}