mountHandle = new MountHandle(null); } else { final Closeable closable = child.isFile() ? mount(child, false) : null; mountHandle = new MountHandle(closable); final boolean isWarFile = child.getName().toLowerCase(Locale.ENGLISH).endsWith(WAR_EXTENSION); final boolean isRarFile = child.getName().toLowerCase(Locale.ENGLISH).endsWith(RAR_EXTENSION); this.createResourceRoot(deploymentUnit, child, isWarFile || isRarFile, isWarFile); final ResourceRoot childResource = this.createResourceRoot(deploymentUnit, moduleFile, true, webArchive); childResource.putAttachment(org.jboss.as.ee.structure.Attachments.MODULE_META_DATA, module); this.createResourceRoot(deploymentUnit, child, false, false);
/** * Creates a {@link ResourceRoot} for the passed {@link VirtualFile file} and adds it to the list of {@link ResourceRoot}s * in the {@link DeploymentUnit deploymentUnit} * * @param deploymentUnit The deployment unit * @param file The file for which the resource root will be created * @param markAsSubDeployment If this is true, then the {@link ResourceRoot} that is created will be marked as a subdeployment * through a call to {@link SubDeploymentMarker#mark(org.jboss.as.server.deployment.module.ResourceRoot)} * @param explodeDuringMount If this is true then the {@link VirtualFile file} will be exploded during mount, * while creating the {@link ResourceRoot} * @return Returns the created {@link ResourceRoot} * @throws IOException */ private ResourceRoot createResourceRoot(final DeploymentUnit deploymentUnit, final VirtualFile file, final boolean markAsSubDeployment, final boolean explodeDuringMount) throws IOException { final boolean war = file.getName().toLowerCase(Locale.ENGLISH).endsWith(WAR_EXTENSION); final Closeable closable = file.isFile() ? mount(file, explodeDuringMount) : exportExplodedWar(war, file, deploymentUnit); final MountHandle mountHandle = new MountHandle(closable); final ResourceRoot resourceRoot = new ResourceRoot(file, mountHandle); deploymentUnit.addToAttachmentList(Attachments.RESOURCE_ROOTS, resourceRoot); if (markAsSubDeployment) { SubDeploymentMarker.mark(resourceRoot); } if (war) { resourceRoot.putAttachment(Attachments.INDEX_RESOURCE_ROOT, false); SubExplodedDeploymentMarker.mark(resourceRoot); } return resourceRoot; }
private Closeable exportExplodedWar(final boolean war, final VirtualFile file, final DeploymentUnit deploymentUnit) throws IOException { if (isExplodedWarInArchiveEar(war, file, deploymentUnit)) { File warContent = file.getPhysicalFile(); VFSUtils.recursiveCopy(file, warContent.getParentFile()); return VFS.mountReal(warContent, file); } return null; }
processorTarget.addDeploymentProcessor(EeExtension.SUBSYSTEM_NAME, Phase.STRUCTURE, Phase.STRUCTURE_JBOSS_EJB_CLIENT_XML_PARSE, new EJBClientDescriptorParsingProcessor()); processorTarget.addDeploymentProcessor(EeExtension.SUBSYSTEM_NAME, Phase.STRUCTURE, Phase.STRUCTURE_EJB_EAR_APPLICATION_NAME, new EarApplicationNameProcessor()); processorTarget.addDeploymentProcessor(EeExtension.SUBSYSTEM_NAME, Phase.STRUCTURE, Phase.STRUCTURE_EAR, new EarStructureProcessor()); processorTarget.addDeploymentProcessor(EeExtension.SUBSYSTEM_NAME, Phase.STRUCTURE, Phase.STRUCTURE_EJB_JAR_IN_EAR, new EjbJarDeploymentProcessor()); processorTarget.addDeploymentProcessor(EeExtension.SUBSYSTEM_NAME, Phase.STRUCTURE, Phase.STRUCTURE_APPLICATION_CLIENT_IN_EAR, new ApplicationClientDeploymentProcessor());
/** * Creates a {@link ResourceRoot} for the passed {@link VirtualFile file} and adds it to the list of {@link ResourceRoot}s * in the {@link DeploymentUnit deploymentUnit} * * @param deploymentUnit The deployment unit * @param file The file for which the resource root will be created * @param markAsSubDeployment If this is true, then the {@link ResourceRoot} that is created will be marked as a subdeployment * through a call to {@link SubDeploymentMarker#mark(org.jboss.as.server.deployment.module.ResourceRoot)} * @param explodeDuringMount If this is true then the {@link VirtualFile file} will be exploded during mount, * while creating the {@link ResourceRoot} * @return Returns the created {@link ResourceRoot} * @throws IOException */ private ResourceRoot createResourceRoot(final DeploymentUnit deploymentUnit, final VirtualFile file, final boolean markAsSubDeployment, final boolean explodeDuringMount) throws IOException { final boolean war = file.getName().toLowerCase(Locale.ENGLISH).endsWith(WAR_EXTENSION); final Closeable closable = file.isFile() ? mount(file, explodeDuringMount) : null; final MountHandle mountHandle = new MountHandle(closable); final ResourceRoot resourceRoot = new ResourceRoot(file, mountHandle); deploymentUnit.addToAttachmentList(Attachments.RESOURCE_ROOTS, resourceRoot); if (markAsSubDeployment) { SubDeploymentMarker.mark(resourceRoot); } if (war) { resourceRoot.putAttachment(Attachments.INDEX_RESOURCE_ROOT, false); } return resourceRoot; }
processorTarget.addDeploymentProcessor(EeExtension.SUBSYSTEM_NAME, Phase.STRUCTURE, Phase.STRUCTURE_JBOSS_EJB_CLIENT_XML_PARSE, new EJBClientDescriptorParsingProcessor()); processorTarget.addDeploymentProcessor(EeExtension.SUBSYSTEM_NAME, Phase.STRUCTURE, Phase.STRUCTURE_EJB_EAR_APPLICATION_NAME, new EarApplicationNameProcessor()); processorTarget.addDeploymentProcessor(EeExtension.SUBSYSTEM_NAME, Phase.STRUCTURE, Phase.STRUCTURE_EAR, new EarStructureProcessor()); processorTarget.addDeploymentProcessor(EeExtension.SUBSYSTEM_NAME, Phase.STRUCTURE, Phase.STRUCTURE_EJB_JAR_IN_EAR, new EjbJarDeploymentProcessor()); processorTarget.addDeploymentProcessor(EeExtension.SUBSYSTEM_NAME, Phase.STRUCTURE, Phase.STRUCTURE_APPLICATION_CLIENT_IN_EAR, new ApplicationClientDeploymentProcessor());
List<VirtualFile> libArchives = libDir.getChildren(CHILD_ARCHIVE_FILTER); for (final VirtualFile child : libArchives) { final Closeable closable = child.isFile() ? mount(child, false) : null; final MountHandle mountHandle = new MountHandle(closable); final ResourceRoot childResource = new ResourceRoot(child, mountHandle); final boolean isWarFile = child.getName().toLowerCase(Locale.ENGLISH).endsWith(WAR_EXTENSION); final boolean isRarFile = child.getName().toLowerCase(Locale.ENGLISH).endsWith(RAR_EXTENSION); this.createResourceRoot(deploymentUnit, child, isWarFile || isRarFile, isWarFile); final ResourceRoot childResource = this.createResourceRoot(deploymentUnit, moduleFile, true, webArchive); childResource.putAttachment(org.jboss.as.ee.structure.Attachments.MODULE_META_DATA, module); this.createResourceRoot(deploymentUnit, child, false, false);
/** * Creates a {@link ResourceRoot} for the passed {@link VirtualFile file} and adds it to the list of {@link ResourceRoot}s * in the {@link DeploymentUnit deploymentUnit} * * @param deploymentUnit The deployment unit * @param file The file for which the resource root will be created * @param markAsSubDeployment If this is true, then the {@link ResourceRoot} that is created will be marked as a subdeployment * through a call to {@link SubDeploymentMarker#mark(org.jboss.as.server.deployment.module.ResourceRoot)} * @param explodeDuringMount If this is true then the {@link VirtualFile file} will be exploded during mount, * while creating the {@link ResourceRoot} * @return Returns the created {@link ResourceRoot} * @throws IOException */ private ResourceRoot createResourceRoot(final DeploymentUnit deploymentUnit, final VirtualFile file, final boolean markAsSubDeployment, final boolean explodeDuringMount) throws IOException { final boolean war = file.getName().toLowerCase(Locale.ENGLISH).endsWith(WAR_EXTENSION); final Closeable closable = file.isFile() ? mount(file, explodeDuringMount) : exportExplodedWar(war, file, deploymentUnit); final MountHandle mountHandle = new MountHandle(closable); final ResourceRoot resourceRoot = new ResourceRoot(file, mountHandle); deploymentUnit.addToAttachmentList(Attachments.RESOURCE_ROOTS, resourceRoot); if (markAsSubDeployment) { SubDeploymentMarker.mark(resourceRoot); } if (war) { resourceRoot.putAttachment(Attachments.INDEX_RESOURCE_ROOT, false); SubExplodedDeploymentMarker.mark(resourceRoot); } return resourceRoot; }
processorTarget.addDeploymentProcessor(EeExtension.SUBSYSTEM_NAME, Phase.STRUCTURE, Phase.STRUCTURE_JBOSS_EJB_CLIENT_XML_PARSE, new EJBClientDescriptorParsingProcessor()); processorTarget.addDeploymentProcessor(EeExtension.SUBSYSTEM_NAME, Phase.STRUCTURE, Phase.STRUCTURE_EJB_EAR_APPLICATION_NAME, new EarApplicationNameProcessor()); processorTarget.addDeploymentProcessor(EeExtension.SUBSYSTEM_NAME, Phase.STRUCTURE, Phase.STRUCTURE_EAR, new EarStructureProcessor()); processorTarget.addDeploymentProcessor(EeExtension.SUBSYSTEM_NAME, Phase.STRUCTURE, Phase.STRUCTURE_EJB_JAR_IN_EAR, new EjbJarDeploymentProcessor()); processorTarget.addDeploymentProcessor(EeExtension.SUBSYSTEM_NAME, Phase.STRUCTURE, Phase.STRUCTURE_APPLICATION_CLIENT_IN_EAR, new ApplicationClientDeploymentProcessor());
private Closeable exportExplodedWar(final boolean war, final VirtualFile file, final DeploymentUnit deploymentUnit) throws IOException { if (isExplodedWarInArchiveEar(war, file, deploymentUnit)) { File warContent = file.getPhysicalFile(); VFSUtils.recursiveCopy(file, warContent.getParentFile()); return VFS.mountReal(warContent, file); } return null; }
mountHandle = new MountHandle(null); } else { final Closeable closable = child.isFile() ? mount(child, false) : null; mountHandle = new MountHandle(closable); final boolean isWarFile = child.getName().toLowerCase(Locale.ENGLISH).endsWith(WAR_EXTENSION); final boolean isRarFile = child.getName().toLowerCase(Locale.ENGLISH).endsWith(RAR_EXTENSION); this.createResourceRoot(deploymentUnit, child, isWarFile || isRarFile, isWarFile); final ResourceRoot childResource = this.createResourceRoot(deploymentUnit, moduleFile, true, webArchive); childResource.putAttachment(org.jboss.as.ee.structure.Attachments.MODULE_META_DATA, module); this.createResourceRoot(deploymentUnit, child, false, false);
/** * Creates a {@link ResourceRoot} for the passed {@link VirtualFile file} and adds it to the list of {@link ResourceRoot}s * in the {@link DeploymentUnit deploymentUnit} * * @param deploymentUnit The deployment unit * @param file The file for which the resource root will be created * @param markAsSubDeployment If this is true, then the {@link ResourceRoot} that is created will be marked as a subdeployment * through a call to {@link SubDeploymentMarker#mark(org.jboss.as.server.deployment.module.ResourceRoot)} * @param explodeDuringMount If this is true then the {@link VirtualFile file} will be exploded during mount, * while creating the {@link ResourceRoot} * @return Returns the created {@link ResourceRoot} * @throws IOException */ private ResourceRoot createResourceRoot(final DeploymentUnit deploymentUnit, final VirtualFile file, final boolean markAsSubDeployment, final boolean explodeDuringMount) throws IOException { final boolean war = file.getName().toLowerCase(Locale.ENGLISH).endsWith(WAR_EXTENSION); final Closeable closable = file.isFile() ? mount(file, explodeDuringMount) : exportExplodedWar(war, file, deploymentUnit); final MountHandle mountHandle = new MountHandle(closable); final ResourceRoot resourceRoot = new ResourceRoot(file, mountHandle); deploymentUnit.addToAttachmentList(Attachments.RESOURCE_ROOTS, resourceRoot); if (markAsSubDeployment) { SubDeploymentMarker.mark(resourceRoot); } if (war) { resourceRoot.putAttachment(Attachments.INDEX_RESOURCE_ROOT, false); SubExplodedDeploymentMarker.mark(resourceRoot); } return resourceRoot; }
processorTarget.addDeploymentProcessor(EeExtension.SUBSYSTEM_NAME, Phase.STRUCTURE, Phase.STRUCTURE_JBOSS_EJB_CLIENT_XML_PARSE, new EJBClientDescriptorParsingProcessor()); processorTarget.addDeploymentProcessor(EeExtension.SUBSYSTEM_NAME, Phase.STRUCTURE, Phase.STRUCTURE_EJB_EAR_APPLICATION_NAME, new EarApplicationNameProcessor()); processorTarget.addDeploymentProcessor(EeExtension.SUBSYSTEM_NAME, Phase.STRUCTURE, Phase.STRUCTURE_EAR, new EarStructureProcessor()); processorTarget.addDeploymentProcessor(EeExtension.SUBSYSTEM_NAME, Phase.STRUCTURE, Phase.STRUCTURE_EJB_JAR_IN_EAR, new EjbJarDeploymentProcessor()); processorTarget.addDeploymentProcessor(EeExtension.SUBSYSTEM_NAME, Phase.STRUCTURE, Phase.STRUCTURE_APPLICATION_CLIENT_IN_EAR, new ApplicationClientDeploymentProcessor());
private Closeable exportExplodedWar(final boolean war, final VirtualFile file, final DeploymentUnit deploymentUnit) throws IOException { if (isExplodedWarInArchiveEar(war, file, deploymentUnit)) { File warContent = file.getPhysicalFile(); VFSUtils.recursiveCopy(file, warContent.getParentFile()); return VFS.mountReal(warContent, file); } return null; }
mountHandle = new MountHandle(null); } else { final Closeable closable = child.isFile() ? mount(child, false) : null; mountHandle = new MountHandle(closable); final boolean isWarFile = child.getName().toLowerCase(Locale.ENGLISH).endsWith(WAR_EXTENSION); final boolean isRarFile = child.getName().toLowerCase(Locale.ENGLISH).endsWith(RAR_EXTENSION); this.createResourceRoot(deploymentUnit, child, isWarFile || isRarFile, isWarFile); final ResourceRoot childResource = this.createResourceRoot(deploymentUnit, moduleFile, true, webArchive); childResource.putAttachment(org.jboss.as.ee.structure.Attachments.MODULE_META_DATA, module); this.createResourceRoot(deploymentUnit, child, false, false);