String tokenString = unit.getName();
String[] tokens = tokenString.split("#");
ModelNode unitValue = unit.getValue();
System.out.println(tokens[0]+">"+unitValue);
DeployedPersistenceUnit pu = deployedPersistenceUnitEntityAdapter.fromDMR(unitValue);
pu.setName(tokens[1]);
pu.setType(persistenceUnit);
pu.setSubsystem(subsystem);
// TODO: re-enable?
//pu.setAddress(addressFor(subsystem.getAddress(), "hibernate-persistence-unit", fullname));
if (unitValue.hasDefined("entity"))
{
List<ModelNode> entityNodes = unitValue.get("entity").asList();
List<String> names = new ArrayList<String>(entityNodes.size());
for (ModelNode entityNode : entityNodes)
{
String entityName = entityNode.asProperty().getName();
names.add(entityName);
}
pu.setEntities(names);
}
pus.add(pu);
}
}