if (ModelAdapter.wasSuccess(response))
{
List<ModelNode> nodes = response.get(RESULT).asList();
for (ModelNode node : nodes)
{
DeploymentSubsystem subsystem = null;
Property property = node.asProperty();
String name = property.getName();
ModelNode subsystemNode = property.getValue().asObject();
DeploymentDataType type = null;
try {
type = DeploymentDataType.valueOf(name);
} catch (IllegalArgumentException e) {
Console.warning("Unknown deployment type: "+name);
type = unknown;
}
switch (type)
{
case ejb3:
subsystem = deploymentEjbSubsystemEntityAdapter.fromDMR(subsystemNode);
break;
case jpa:
subsystem = deploymentJpaSubsystemEntityAdapter.fromDMR(subsystemNode);
break;
case undertow:
subsystem = deploymentWebSubsystemnEntityAdapter.fromDMR(subsystemNode);
break;
case webservices:
subsystem = deploymentWebserviceSubsystemEntityAdapter.fromDMR(subsystemNode);
break;
default:
break;
}
if (subsystem != null)
{
subsystem.setName(name);
subsystem.setType(type);
subsystem.setDeployment(deployment);
subsystems.add(subsystem);
subsystem.setAddress(addressFor(deployment.getAddress(), "subsystem", subsystem.getName()));
}
}
}
callback.onSuccess(subsystems);
}