ApplicationClientDescriptor appClient = (ApplicationClientDescriptor) descriptor;
Result result = getInitializedResult();
addErrorDetails(result, getVerifierContext().getComponentNameConstructor());
result.setStatus(Result.PASSED); // default status is PASSED
for(PersistenceUnitsDescriptor pus : appClient.getPersistenceUnitsDescriptors()) {
for(PersistenceUnitDescriptor nextPU : pus.getPersistenceUnitDescriptors()) {
if("JTA".equals(nextPU.getTransactionType())) {
result.failed(smh.getLocalString(getClass().getName() + ".puName",
"Found a persistence unit by name [ {0} ] in persistence unit root [ {1} ] with JTA transaction type.",
new Object[]{nextPU.getName(), nextPU.getPuRoot()}));
}
}
}
for(EntityManagerFactoryReferenceDescriptor emfRef : appClient.getEntityManagerFactoryReferenceDescriptors()) {
String unitName = emfRef.getUnitName();
PersistenceUnitDescriptor nextPU = appClient.findReferencedPU(unitName);
if(nextPU == null) continue;
if("JTA".equals(nextPU.getTransactionType())) {
result.failed(smh.getLocalString(getClass().getName() + ".puRefName",
"Found a reference to a persistence unit by name [ {0} ] in persistence unit root [ {1} ] with JTA transaction type.",
new Object[]{nextPU.getName(), nextPU.getPuRoot()}));
}
}
return result;