Package org.jboss.as.server.deployment.api

Examples of org.jboss.as.server.deployment.api.ServerDeploymentRepository


    public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
        final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
        if(deploymentUnit.getAttachment(Attachments.DEPLOYMENT_ROOT) != null) {
            return;
        }
        final ServerDeploymentRepository serverDeploymentRepository = deploymentUnit.getAttachment(Attachments.SERVER_DEPLOYMENT_REPOSITORY);
        if(serverDeploymentRepository == null) {
            throw new DeploymentUnitProcessingException("No deployment repository available.");
        }

        final String deploymentName = deploymentUnit.getName();
        final String deploymentRuntimeName = deploymentUnit.getAttachment(Attachments.RUNTIME_NAME);
        final byte[] deploymentHash = deploymentUnit.getAttachment(Attachments.DEPLOYMENT_HASH);

        // The mount point we will use for the repository file
        final VirtualFile deploymentRoot = VFS.getChild("content/" + deploymentRuntimeName);

        boolean failed = false;
        Closeable handle = null;
        final MountHandle mountHandle;
        try {
            final boolean mountExploded = deploymentName.endsWith("war");
            handle = serverDeploymentRepository.mountDeploymentContent(deploymentName, deploymentRuntimeName, deploymentHash, deploymentRoot, mountExploded);
            mountHandle = new MountHandle(handle);
        } catch (IOException e) {
            failed = true;
            throw new DeploymentUnitProcessingException("Failed to mount deployment content", e);
        } finally {
View Full Code Here

TOP

Related Classes of org.jboss.as.server.deployment.api.ServerDeploymentRepository

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.