public static DeploymentUnitProcessor rootSafe(DeploymentUnitProcessor processor) { return new RootedDeploymentProcessor(processor); }
protected VirtualFile getMetaDataFile(final VirtualFile root, final String fileName) { return getFile( root, fileName, METADATA_LOCATIONS ); }
protected List<VirtualFile> getMetaDataFileBySuffix(final VirtualFile root, final String suffix) { return getFilesBySuffix( root, suffix, METADATA_LOCATIONS ); }
protected void addDeploymentProcessors(final DeploymentProcessorTarget processorTarget) { processorTarget.addDeploymentProcessor( HASingletonExtension.SUBSYSTEM_NAME, Phase.INSTALL, 200, rootSafe( new HASingletonInstaller() ) ); }
@Override public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { DeploymentUnit unit = phaseContext.getDeploymentUnit(); ApplicationMetaData appMetaData = unit.getAttachment( ApplicationMetaData.ATTACHMENT_KEY ); if (appMetaData == null && !ArchivedDeploymentMarker.isMarked( unit )) { return; } ResourceRoot resourceRoot = unit.getAttachment( Attachments.DEPLOYMENT_ROOT ); VirtualFile root = resourceRoot.getRoot(); try { for (String scanRoot : this.scanRoots) { for (VirtualFile child : getJarFiles( root.getChild( scanRoot ) )) { this.mountedJars.add( child ); final Closeable closable = child.isFile() ? mount( child, false ) : null; final MountHandle mountHandle = new MountHandle( closable ); final ResourceRoot childResource = new ResourceRoot( child, mountHandle ); ModuleRootMarker.mark(childResource); unit.addToAttachmentList( Attachments.RESOURCE_ROOTS, childResource ); } } } catch (IOException e) { log.error( "Error processing jars", e ); } }
@Override public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { DeploymentUnit unit = phaseContext.getDeploymentUnit(); final ModuleSpecification moduleSpecification = unit.getAttachment( Attachments.MODULE_SPECIFICATION ); final ModuleLoader moduleLoader = unit.getAttachment( Attachments.SERVICE_MODULE_LOADER ); if (unit.hasAttachment( ApplicationMetaData.ATTACHMENT_KEY )) { for (String moduleIdentifier : JAVA_SE_MODULE_IDS) { addDependency( moduleSpecification, moduleLoader, ModuleIdentifier.create( moduleIdentifier ) ); } } }
public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { DeploymentUnit unit = phaseContext.getDeploymentUnit(); ApplicationMetaData appMetaData = unit.getAttachment( ApplicationMetaData.ATTACHMENT_KEY ); if (appMetaData == null) { return; } if (appMetaData.isArchive()) { try { VirtualFile root = VFS.getChild( appMetaData.getRoot().toURI() ); mountDir( unit, root, "log", System.getProperty( "jboss.server.log.dir" ) + "/" + appMetaData.getApplicationName() ); mountDir( unit, root, "tmp", System.getProperty( "jboss.server.temp.dir" ) + "/app/" + appMetaData.getApplicationName() ); } catch (Exception e) { throw new DeploymentUnitProcessingException( e ); } } }
public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { DeploymentUnit unit = phaseContext.getDeploymentUnit(); ResourceRoot resourceRoot = unit.getAttachment( Attachments.DEPLOYMENT_ROOT ); VirtualFile root = resourceRoot.getRoot(); try { for (String path : this.paths) { VirtualFile scanRoot = root.getChild( path ); if (scanRoot == null || !scanRoot.exists()) { continue; } List<VirtualFile> children = null; if (this.filter != null) { children = scanRoot.getChildrenRecursively( this.filter ); } else { children = scanRoot.getChildrenRecursively(); } int prefixLength = scanRoot.getPathName().length(); for (VirtualFile child : children) { String relativePath = child.getPathName().substring( prefixLength ); deploy( unit, child, path, relativePath.substring( 1 ) ); } } } catch (IOException e) { throw new DeploymentUnitProcessingException( e ); } }
@Override public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { DeploymentUnit unit = phaseContext.getDeploymentUnit(); ApplicationMetaData appMetaData = unit.getAttachment( ApplicationMetaData.ATTACHMENT_KEY ); if (appMetaData == null) { return; } ResourceRoot resourceRoot = unit.getAttachment( Attachments.DEPLOYMENT_ROOT ); VirtualFile root = resourceRoot.getRoot(); try { VirtualFile explodedRoot = getExplodedApplication( root ); if (!root.equals( explodedRoot )) { appMetaData.explode( explodedRoot.getPhysicalFile() ); } } catch (IOException e) { throw new DeploymentUnitProcessingException( e ); } }
protected void addDeploymentProcessors(final DeploymentProcessorTarget processorTarget) { processorTarget.addDeploymentProcessor( Phase.DEPENDENCIES, 10, rootSafe( new CacheDependenciesProcessor() ) ); }