subsystem.get(OP).set(ADD);
subsystem.get(OP_ADDR).set(address);
list.add(subsystem);
DataSources dataSources = null;
try {
String localName = null;
switch (Namespace.forUri(reader.getNamespaceURI())) {
case DATASOURCES_1_0: {
localName = reader.getLocalName();
Element element = Element.forName(reader.getLocalName());
log.tracef("%s -> %s", localName, element);
switch (element) {
case SUBSYSTEM: {
final DsParser parser = new DsParser();
dataSources = parser.parse(reader);
requireNoContent(reader);
break;
}
}
}
}
} catch (Exception e) {
throw new XMLStreamException(e);
}
if (dataSources != null) {
for (DataSource dataSource : dataSources.getDataSource()) {
final ModelNode dsAddress = address.clone();
dsAddress.add(DATA_SOURCE, dataSource.getJndiName());
dsAddress.protect();
final ModelNode operation = new ModelNode();
operation.get(OP_ADDR).set(dsAddress);
operation.get(OP).set(ADD);
fillFrom(operation, dataSource);
list.add(operation);
}
for (XaDataSource xaDataSource : dataSources.getXaDataSource()) {
final ModelNode dsAddress = address.clone();
dsAddress.add(XA_DATA_SOURCE, xaDataSource.getJndiName());
dsAddress.protect();
final ModelNode operation = new ModelNode();
operation.get(OP_ADDR).set(dsAddress);
operation.get(OP).set(ADD);
fillFrom(operation, xaDataSource);
list.add(operation);
}
for (Driver driver : dataSources.getDrivers()) {
final ModelNode driverAddress = address.clone();
driverAddress.add(JDBC_DRIVER, driver.getName());
driverAddress.protect();
final ModelNode op = Util.getEmptyOperation(ADD, driverAddress);