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

Examples of org.jboss.as.server.deployment.repository.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 VirtualFile deploymentContents = deploymentUnit.getAttachment(Attachments.DEPLOYMENT_CONTENTS);

        // internal deployments do not have any contents, so there is nothing to mount
        if (deploymentContents == null)
            return;

        final VirtualFile deploymentRoot;
        final MountHandle mountHandle;
        if (deploymentContents.isDirectory()) {
            // use the contents directly
            deploymentRoot = deploymentContents;
            // nothing was mounted
            mountHandle = null;
        } else {
            // The mount point we will use for the repository file
            deploymentRoot = VFS.getChild("content/" + deploymentName);

            boolean failed = false;
            Closeable handle = null;
            try {
                final boolean mountExploded = MountExplodedMarker.isMountExploded(deploymentUnit);
                handle = serverDeploymentRepository.mountDeploymentContent(deploymentContents, 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.repository.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.