}
private void registerPersistenceUnit(PersistenceUnitManager pUnit)
{
try {
InjectManager beanManager = InjectManager.create(_classLoader);
BeanBuilder<EntityManagerFactory> emfFactory;
emfFactory = beanManager.createBeanFactory(EntityManagerFactory.class);
emfFactory.qualifier(CurrentLiteral.CURRENT);
emfFactory.qualifier(Names.create(pUnit.getName()));
beanManager.addBean(emfFactory.singleton(pUnit.getEntityManagerFactoryProxy()));
if (pUnit.getTransactionType() == PersistenceUnitTransactionType.JTA) {
log.finer(L.l("register persistent-unit `{0}' with transaction-type JTA", pUnit.getName()));
BeanBuilder<EntityManager> emFactory;
emFactory = beanManager.createBeanFactory(EntityManager.class);
emFactory.qualifier(CurrentLiteral.CURRENT);
emFactory.qualifier(Names.create(pUnit.getName()));
beanManager.addBean(emFactory.singleton(pUnit.getEntityManagerJtaProxy()));
} else {
log.finer(L.l("register persistent-unit `{0}' with transaction-type RESOURCE_LOCAL", pUnit.getName()));
}
/*