public static boolean isClassesRoot(ResourceRoot resourceRoot) { return "classes".equals(resourceRoot.getRootName()); }
annotationsMetaData.put(entry.getKey().getRootName(), processAnnotations(jarIndex));
webFragments.put(resourceRoot.getRootName(), webFragmentMetaData); UndertowLogger.ROOT_LOGGER.distributableDisabledInFragmentXml(deploymentUnit.getName(),resourceRoot.getRootName()); } catch (XMLStreamException e) { throw new DeploymentUnitProcessingException(UndertowLogger.ROOT_LOGGER.failToParseXMLDescriptor(webFragment.toString(), e.getLocation().getLineNumber(), e.getLocation().getColumnNumber()));
if(Web.equals(moduleMetaData.getType()) && moduleMetaData.getFileName().equals(deploymentRoot.getRootName())) { String contextRoot = WebModuleMetaData.class.cast(moduleMetaData.getValue()).getContextRoot();
for (ResourceRoot resourceRoot : structure) { if (ModuleRootMarker.isModuleRoot(resourceRoot) && !SubDeploymentMarker.isSubDeployment(resourceRoot)) { if (resourceRoot.getRootName().equals("classes")) {
for (ResourceRoot resourceRoot : resourceRoots) { if (resourceRoot.getRoot().getName().toLowerCase(Locale.ENGLISH).endsWith(".jar")) { jarsSet.add(resourceRoot.getRootName()); scis.put(resourceRoot.getRootName(), sci);
private void handlingExistingClassPathEntry(final DeploymentUnit deploymentUnit, final ArrayDeque<RootEntry> resourceRoots, final DeploymentUnit topLevelDeployment, final VirtualFile topLevelRoot, final Map<VirtualFile, ResourceRoot> subDeployments, final Map<VirtualFile, AdditionalModuleSpecification> additionalModules, final Set<VirtualFile> existingAccessibleRoots, final ResourceRoot resourceRoot, final Attachable target, final VirtualFile classPathFile) throws DeploymentUnitProcessingException { if (existingAccessibleRoots.contains(classPathFile)) { ServerLogger.DEPLOYMENT_LOGGER.debugf("Class-Path entry %s in %s ignored, as target is already accessible", classPathFile, resourceRoot.getRoot()); } else if (additionalModules.containsKey(classPathFile)) { final AdditionalModuleSpecification moduleSpecification = additionalModules.get(classPathFile); //as class path entries are exported, transitive dependencies will also be available target.addToAttachmentList(Attachments.CLASS_PATH_ENTRIES, moduleSpecification.getModuleIdentifier()); } else if (subDeployments.containsKey(classPathFile)) { //now we need to calculate the sub deployment module identifier //unfortunately the sub deployment has not been setup yet, so we cannot just //get it from the sub deployment directly final ResourceRoot otherRoot = subDeployments.get(classPathFile); target.addToAttachmentList(Attachments.CLASS_PATH_ENTRIES, ModuleIdentifierProcessor.createModuleIdentifier(otherRoot.getRootName(), otherRoot, topLevelDeployment, topLevelRoot, false)); } else { createAdditionalModule(deploymentUnit, resourceRoot, topLevelDeployment, topLevelRoot, additionalModules, classPathFile, resourceRoots); } }
private void handlingExistingClassPathEntry(final ArrayDeque<RootEntry> resourceRoots, final DeploymentUnit topLevelDeployment, final VirtualFile topLevelRoot, final Map<VirtualFile, ResourceRoot> subDeployments, final Map<VirtualFile, AdditionalModuleSpecification> additionalModules, final Set<VirtualFile> existingAccessibleRoots, final ResourceRoot resourceRoot, final Attachable target, final VirtualFile classPathFile) throws DeploymentUnitProcessingException { if (existingAccessibleRoots.contains(classPathFile)) { ServerLogger.DEPLOYMENT_LOGGER.debugf("Class-Path entry %s in %s ignored, as target is already accessible", classPathFile, resourceRoot.getRoot()); } else if (additionalModules.containsKey(classPathFile)) { final AdditionalModuleSpecification moduleSpecification = additionalModules.get(classPathFile); //as class path entries are exported, transitive dependencies will also be available target.addToAttachmentList(Attachments.CLASS_PATH_ENTRIES, moduleSpecification.getModuleIdentifier()); } else if (subDeployments.containsKey(classPathFile)) { //now we need to calculate the sub deployment module identifier //unfortunately the sub deployment has not been setup yet, so we cannot just //get it from the sub deployment directly final ResourceRoot otherRoot = subDeployments.get(classPathFile); target.addToAttachmentList(Attachments.CLASS_PATH_ENTRIES, ModuleIdentifierProcessor.createModuleIdentifier(otherRoot.getRootName(), otherRoot, topLevelDeployment, topLevelRoot, false)); } else { ModuleIdentifier identifier = createAdditionalModule(resourceRoot, topLevelDeployment, topLevelRoot, additionalModules, classPathFile, resourceRoots); target.addToAttachmentList(Attachments.CLASS_PATH_ENTRIES, identifier); } }
private void handlingExistingClassPathEntry(final ArrayDeque<RootEntry> resourceRoots, final DeploymentUnit topLevelDeployment, final VirtualFile topLevelRoot, final Map<VirtualFile, ResourceRoot> subDeployments, final Map<VirtualFile, AdditionalModuleSpecification> additionalModules, final Set<VirtualFile> existingAccessibleRoots, final ResourceRoot resourceRoot, final Attachable target, final VirtualFile classPathFile) throws DeploymentUnitProcessingException { if (existingAccessibleRoots.contains(classPathFile)) { ServerLogger.DEPLOYMENT_LOGGER.debugf("Class-Path entry %s in %s ignored, as target is already accessible", classPathFile, resourceRoot.getRoot()); } else if (additionalModules.containsKey(classPathFile)) { final AdditionalModuleSpecification moduleSpecification = additionalModules.get(classPathFile); //as class path entries are exported, transitive dependencies will also be available target.addToAttachmentList(Attachments.CLASS_PATH_ENTRIES, moduleSpecification.getModuleIdentifier()); } else if (subDeployments.containsKey(classPathFile)) { //now we need to calculate the sub deployment module identifier //unfortunately the sub deployment has not been setup yet, so we cannot just //get it from the sub deployment directly final ResourceRoot otherRoot = subDeployments.get(classPathFile); target.addToAttachmentList(Attachments.CLASS_PATH_ENTRIES, ModuleIdentifierProcessor.createModuleIdentifier(otherRoot.getRootName(), otherRoot, topLevelDeployment, topLevelRoot, false)); } else { ModuleIdentifier identifier = createAdditionalModule(resourceRoot, topLevelDeployment, topLevelRoot, additionalModules, classPathFile, resourceRoots); target.addToAttachmentList(Attachments.CLASS_PATH_ENTRIES, identifier); } }
private void handlingExistingClassPathEntry(final ArrayDeque<RootEntry> resourceRoots, final DeploymentUnit topLevelDeployment, final VirtualFile topLevelRoot, final Map<VirtualFile, ResourceRoot> subDeployments, final Map<VirtualFile, AdditionalModuleSpecification> additionalModules, final Set<VirtualFile> existingAccessibleRoots, final ResourceRoot resourceRoot, final Attachable target, final VirtualFile classPathFile) throws DeploymentUnitProcessingException { if (existingAccessibleRoots.contains(classPathFile)) { ServerLogger.DEPLOYMENT_LOGGER.debugf("Class-Path entry %s in %s ignored, as target is already accessible", classPathFile, resourceRoot.getRoot()); } else if (additionalModules.containsKey(classPathFile)) { final AdditionalModuleSpecification moduleSpecification = additionalModules.get(classPathFile); //as class path entries are exported, transitive dependencies will also be available target.addToAttachmentList(Attachments.CLASS_PATH_ENTRIES, moduleSpecification.getModuleIdentifier()); } else if (subDeployments.containsKey(classPathFile)) { //now we need to calculate the sub deployment module identifier //unfortunately the sub deployment has not been setup yet, so we cannot just //get it from the sub deployment directly final ResourceRoot otherRoot = subDeployments.get(classPathFile); target.addToAttachmentList(Attachments.CLASS_PATH_ENTRIES, ModuleIdentifierProcessor.createModuleIdentifier(otherRoot.getRootName(), otherRoot, topLevelDeployment, topLevelRoot, false)); } else { ModuleIdentifier identifier = createAdditionalModule(resourceRoot, topLevelDeployment, topLevelRoot, additionalModules, classPathFile, resourceRoots); target.addToAttachmentList(Attachments.CLASS_PATH_ENTRIES, identifier); } }
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); } } }
@Override public void undeploy(DeploymentUnit deploymentUnit) { final ServiceRegistry serviceRegistry = deploymentUnit.getServiceRegistry(); final List<ResourceRoot> childRoots = deploymentUnit.getAttachmentList(Attachments.RESOURCE_ROOTS); for (final ResourceRoot childRoot : childRoots) { if (!SubDeploymentMarker.isSubDeployment(childRoot)) { continue; } final ServiceName serviceName = Services.deploymentUnitName(deploymentUnit.getName(), childRoot.getRootName()); final ServiceController<?> serviceController = serviceRegistry.getService(serviceName); if (serviceController != null) { serviceController.setMode(ServiceController.Mode.REMOVE); } } } }
@Override public void undeploy(DeploymentUnit deploymentUnit) { final ServiceRegistry serviceRegistry = deploymentUnit.getServiceRegistry(); final List<ResourceRoot> childRoots = deploymentUnit.getAttachmentList(Attachments.RESOURCE_ROOTS); for (final ResourceRoot childRoot : childRoots) { if (!SubDeploymentMarker.isSubDeployment(childRoot)) { continue; } final ServiceName serviceName = Services.deploymentUnitName(deploymentUnit.getName(), childRoot.getRootName()); final ServiceController<?> serviceController = serviceRegistry.getService(serviceName); if (serviceController != null) { serviceController.setMode(ServiceController.Mode.REMOVE); } } } }
protected DeploymentUnit createAndInitializeDeploymentUnit(ServiceRegistry registry) { final String deploymentName = deploymentRoot.getRootName(); final DeploymentUnit deploymentUnit = new DeploymentUnitImpl(parent, deploymentName, registry); deploymentUnit.putAttachment(Attachments.DEPLOYMENT_ROOT, deploymentRoot); deploymentUnit.putAttachment(Attachments.MODULE_SPECIFICATION, new ModuleSpecification()); deploymentUnit.putAttachment(DeploymentModelUtils.REGISTRATION_ATTACHMENT, registration); deploymentUnit.putAttachment(DeploymentModelUtils.MUTABLE_REGISTRATION_ATTACHMENT, mutableRegistration); deploymentUnit.putAttachment(DeploymentModelUtils.DEPLOYMENT_RESOURCE, resource); deploymentUnit.putAttachment(Attachments.SERVICE_VERIFICATION_HANDLER, serviceVerificationHandler); deploymentUnit.putAttachment(Attachments.VAULT_READER_ATTACHMENT_KEY, vaultReader); this.resource = null; return deploymentUnit; }
@Override public void undeploy(final DeploymentUnit deploymentUnit) { final ServiceRegistry serviceRegistry = deploymentUnit.getServiceRegistry(); final List<ResourceRoot> childRoots = deploymentUnit.getAttachmentList(Attachments.RESOURCE_ROOTS); for (final ResourceRoot childRoot : childRoots) { if (!SubDeploymentMarker.isSubDeployment(childRoot)) { continue; } final ServiceName serviceName = Services.deploymentUnitName(deploymentUnit.getName(), childRoot.getRootName()); final ServiceController<?> serviceController = serviceRegistry.getService(serviceName); if (serviceController != null) { serviceController.setMode(ServiceController.Mode.REMOVE); } } deploymentUnit.removeAttachment(Attachments.SUB_DEPLOYMENTS); } }
protected DeploymentUnit createAndInitializeDeploymentUnit(ServiceRegistry registry) { final String deploymentName = deploymentRoot.getRootName(); final DeploymentUnit deploymentUnit = new DeploymentUnitImpl(parent, deploymentName, registry); deploymentUnit.putAttachment(Attachments.DEPLOYMENT_ROOT, deploymentRoot); deploymentUnit.putAttachment(Attachments.MODULE_SPECIFICATION, new ModuleSpecification()); deploymentUnit.putAttachment(DeploymentModelUtils.REGISTRATION_ATTACHMENT, registration); deploymentUnit.putAttachment(DeploymentModelUtils.MUTABLE_REGISTRATION_ATTACHMENT, mutableRegistration); deploymentUnit.putAttachment(DeploymentModelUtils.DEPLOYMENT_RESOURCE, resource); deploymentUnit.putAttachment(Attachments.SERVICE_VERIFICATION_HANDLER, serviceVerificationHandler); deploymentUnit.putAttachment(Attachments.VAULT_READER_ATTACHMENT_KEY, vaultReader); this.resource = null; return deploymentUnit; }
@Override public void undeploy(final DeploymentUnit deploymentUnit) { final ServiceRegistry serviceRegistry = deploymentUnit.getServiceRegistry(); final List<ResourceRoot> childRoots = deploymentUnit.getAttachmentList(Attachments.RESOURCE_ROOTS); for (final ResourceRoot childRoot : childRoots) { if (!SubDeploymentMarker.isSubDeployment(childRoot)) { continue; } final ServiceName serviceName = Services.deploymentUnitName(deploymentUnit.getName(), childRoot.getRootName()); final ServiceController<?> serviceController = serviceRegistry.getService(serviceName); if (serviceController != null) { serviceController.setMode(ServiceController.Mode.REMOVE); } } deploymentUnit.removeAttachment(Attachments.SUB_DEPLOYMENTS); } }
protected DeploymentUnit createAndInitializeDeploymentUnit(ServiceRegistry registry) { final String deploymentName = deploymentRoot.getRootName(); final DeploymentUnit deploymentUnit = new DeploymentUnitImpl(parent, deploymentName, registry); deploymentUnit.putAttachment(Attachments.DEPLOYMENT_ROOT, deploymentRoot); deploymentUnit.putAttachment(Attachments.MODULE_SPECIFICATION, new ModuleSpecification()); deploymentUnit.putAttachment(DeploymentResourceSupport.REGISTRATION_ATTACHMENT, registration); deploymentUnit.putAttachment(DeploymentResourceSupport.MUTABLE_REGISTRATION_ATTACHMENT, mutableRegistration); deploymentUnit.putAttachment(DeploymentResourceSupport.DEPLOYMENT_RESOURCE, resource); deploymentUnit.putAttachment(Attachments.DEPLOYMENT_RESOURCE_SUPPORT, new DeploymentResourceSupport(deploymentUnit)); deploymentUnit.putAttachment(Attachments.CAPABILITY_SERVICE_SUPPORT, capabilityServiceSupport); deploymentUnit.putAttachment(Attachments.VAULT_READER_ATTACHMENT_KEY, vaultReader); deploymentUnit.putAttachment(Attachments.DEPLOYMENT_OVERLAY_INDEX, parent.getAttachment(Attachments.DEPLOYMENT_OVERLAY_INDEX)); deploymentUnit.putAttachment(Attachments.PATH_MANAGER, pathManager); return deploymentUnit; }
protected DeploymentUnit createAndInitializeDeploymentUnit(ServiceRegistry registry) { final String deploymentName = deploymentRoot.getRootName(); final DeploymentUnit deploymentUnit = new DeploymentUnitImpl(parent, deploymentName, registry); deploymentUnit.putAttachment(Attachments.DEPLOYMENT_ROOT, deploymentRoot); deploymentUnit.putAttachment(Attachments.MODULE_SPECIFICATION, new ModuleSpecification()); deploymentUnit.putAttachment(DeploymentResourceSupport.REGISTRATION_ATTACHMENT, registration); deploymentUnit.putAttachment(DeploymentResourceSupport.MUTABLE_REGISTRATION_ATTACHMENT, mutableRegistration); deploymentUnit.putAttachment(DeploymentResourceSupport.DEPLOYMENT_RESOURCE, resource); deploymentUnit.putAttachment(Attachments.DEPLOYMENT_RESOURCE_SUPPORT, new DeploymentResourceSupport(deploymentUnit)); deploymentUnit.putAttachment(Attachments.CAPABILITY_SERVICE_SUPPORT, capabilityServiceSupport); deploymentUnit.putAttachment(Attachments.VAULT_READER_ATTACHMENT_KEY, vaultReader); deploymentUnit.putAttachment(Attachments.DEPLOYMENT_OVERLAY_INDEX, parent.getAttachment(Attachments.DEPLOYMENT_OVERLAY_INDEX)); deploymentUnit.putAttachment(Attachments.PATH_MANAGER, pathManager); return deploymentUnit; }