private static void handleJarDeployment(DeploymentPhaseContext phaseContext, boolean startEarly, Platform platform) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); if (!isEarDeployment(deploymentUnit) && !isWarDeployment(deploymentUnit) && JPADeploymentMarker.isJPADeployment(deploymentUnit)) { final ResourceRoot deploymentRoot = deploymentUnit.getAttachment(Attachments.DEPLOYMENT_ROOT); PersistenceUnitMetadataHolder holder; if (deploymentRoot != null && (holder = deploymentRoot.getAttachment(PersistenceUnitMetadataHolder.PERSISTENCE_UNITS)) != null && holder.getPersistenceUnits().size() > 0) { ArrayList<PersistenceUnitMetadataHolder> puList = new ArrayList<PersistenceUnitMetadataHolder>(1); puList.add(holder); ROOT_LOGGER.tracef("install persistence unit definition for jar %s", deploymentRoot.getRootName()); // assemble and install the PU service addPuService(phaseContext, puList, startEarly, platform); } } }
private static void handleJarDeployment(DeploymentPhaseContext phaseContext, boolean startEarly, Platform platform) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); if (!isEarDeployment(deploymentUnit) && !isWarDeployment(deploymentUnit) && JPADeploymentMarker.isJPADeployment(deploymentUnit)) { final ResourceRoot deploymentRoot = deploymentUnit.getAttachment(Attachments.DEPLOYMENT_ROOT); PersistenceUnitMetadataHolder holder; if (deploymentRoot != null && (holder = deploymentRoot.getAttachment(PersistenceUnitMetadataHolder.PERSISTENCE_UNITS)) != null && holder.getPersistenceUnits().size() > 0) { ArrayList<PersistenceUnitMetadataHolder> puList = new ArrayList<PersistenceUnitMetadataHolder>(1); puList.add(holder); ROOT_LOGGER.tracef("install persistence unit definition for jar %s", deploymentRoot.getRootName()); // assemble and install the PU service addPuService(phaseContext, puList, startEarly, platform); } } }
private static void handleEarDeployment(DeploymentPhaseContext phaseContext, boolean startEarly, Platform platform) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); if (isEarDeployment(deploymentUnit) && JPADeploymentMarker.isJPADeployment(deploymentUnit)) { // handle META-INF/persistence.xml final List<ResourceRoot> deploymentRoots = DeploymentUtils.allResourceRoots(deploymentUnit); for (final ResourceRoot root : deploymentRoots) { if (!SubDeploymentMarker.isSubDeployment(root)) { PersistenceUnitMetadataHolder holder; ArrayList<PersistenceUnitMetadataHolder> puList = new ArrayList<PersistenceUnitMetadataHolder>(1); if (root != null && (holder = root.getAttachment(PersistenceUnitMetadataHolder.PERSISTENCE_UNITS)) != null && holder.getPersistenceUnits().size() > 0) { // assemble and install the PU service puList.add(holder); } ROOT_LOGGER.tracef("install persistence unit definitions for ear %s", root.getRootName()); addPuService(phaseContext, puList, startEarly, platform); } } } }
private static void handleEarDeployment(DeploymentPhaseContext phaseContext, boolean startEarly, Platform platform) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); if (isEarDeployment(deploymentUnit) && JPADeploymentMarker.isJPADeployment(deploymentUnit)) { // handle META-INF/persistence.xml final List<ResourceRoot> deploymentRoots = DeploymentUtils.allResourceRoots(deploymentUnit); for (final ResourceRoot root : deploymentRoots) { if (!SubDeploymentMarker.isSubDeployment(root)) { PersistenceUnitMetadataHolder holder; ArrayList<PersistenceUnitMetadataHolder> puList = new ArrayList<PersistenceUnitMetadataHolder>(1); if (root != null && (holder = root.getAttachment(PersistenceUnitMetadataHolder.PERSISTENCE_UNITS)) != null && holder.getPersistenceUnits().size() > 0) { // assemble and install the PU service puList.add(holder); } ROOT_LOGGER.tracef("install persistence unit definitions for ear %s", root.getRootName()); addPuService(phaseContext, puList, startEarly, platform); } } } }
addPuService(phaseContext, puList, startEarly, platform);
addPuService(phaseContext, puList, startEarly, platform);