if (raModel.hasDefined("connection-definitions")) {
List<Property> connections = raModel.get("connection-definitions").asPropertyList();
for (final Property con : connections) {
ModelNode connectionModel = con.getValue();
ConnectionDefinition connectionDefinition = connectionAdapter
.with(new KeyAssignment() {
@Override
public Object valueForKey(String key) {
return con.getName();
}
})
.fromDMR(connectionModel);
// config properties
List<PropertyRecord> connectionProps = parseConfigProperties(connectionModel);
connectionDefinition.setProperties(connectionProps);
// pool
PoolConfig poolConfig = poolAdapter.with(new KeyAssignment() {
@Override
public Object valueForKey(String key) {
//return connectionModel.get("");
return "";
}
}).fromDMR(connectionModel);
connectionDefinition.setPoolConfig(poolConfig);
resourceAdapter.getConnectionDefinitions().add(connectionDefinition);
}
}
// admin objects
if (raModel.hasDefined("admin-objects")) {
List<Property> admins = raModel.get("admin-objects").asPropertyList();
List<AdminObject> adminEntities = new ArrayList<AdminObject>(admins.size());
for (final Property admin : admins) {
ModelNode adminModel = admin.getValue();
AdminObject adminObject = adminAdapter
.with(new KeyAssignment() {
@Override
public Object valueForKey(String key) {
return admin.getName();
}
}).fromDMR(adminModel);