/** * Get the PersistenceUnitDeployment from the MC controller. * * @param name the bean name * @return the PersistenceUnitDeployment */ public PersistenceUnitDeployment lookupPersistenceUnitDeployment(String name) { try { return (PersistenceUnitDeployment) lookup(name, false); } catch (NoSuchInstantiatedBeanException e) { throw new IllegalStateException("PersistenceUnitDeployment " + name + " cannot be found"); } }
private PersistenceUnitDeployment lookupPersistenceUnitDeployment(String unitName) { if (unitName == null) { throw new IllegalArgumentException("unitName is null"); } String beanName = getPersistenceUnitSupplier(topLevelDeploymentUnit, persistenceUnitDependencyResolver, unitName); if (beanName == null) { throw new IllegalStateException("No persistence unit available for " + unitName); } return jbossEjb.lookupPersistenceUnitDeployment(beanName); }
private EntityManagerFactory resolvePersistenceUnit(String unitName) { if (unitName == null) { throw new IllegalArgumentException("unitName is null"); } String beanName = getPersistenceUnitSupplier(topLevelDeploymentUnit, persistenceUnitDependencyResolver, unitName); if (beanName == null) { throw new IllegalStateException("No persistence unit available for " + unitName); } PersistenceUnitDeployment deployment = jbossEjb.lookupPersistenceUnitDeployment(beanName); ManagedEntityManagerFactory managedFactory = deployment.getManagedFactory(); return new InjectedEntityManagerFactory(managedFactory); }
/** * Get the EjbReferenceResolver from the MC controller. * * @param name the bean name * @return the EjbReferenceResolver */ public PersistenceUnitDeployment lookupPersistenceUnitDeployment(String name) { try { return (PersistenceUnitDeployment) lookup(name, false); } catch (NoSuchInstantiatedBeanException e) { throw new IllegalStateException("PersistenceUnitDeployment " + name + " cannot be found"); } }