String dependency = eic.resolvePersistenceUnitSupplier(unitName);
container.getDependencyPolicy().addDependency(dependency);
return;
}
log.warn("Container " + container + " does not implement ExtendedInjectionContainer, doing old style PersistenceUnit resolving");
PersistenceUnitDeployment deployment = null;
// look in EAR first
deployment = container.getPersistenceUnitDeployment(unitName);
if (deployment != null)
{
container.getDependencyPolicy().addDependency(deployment.getKernelName());
log.debug("***** adding PU dependency from located persistence unit: " + deployment.getKernelName());
return;
}
// probably not deployed yet.
// todo not sure if we should do this in JBoss 5
log.warn("Could not find PU dependency for " + PersistenceUnitDeployment.getDefaultKernelName(unitName) + ". Waiting for dependency to resolve");