Examples of DeploymentMountProvider


Examples of org.jboss.as.server.deployment.DeploymentMountProvider

    public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
        final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
        if(deploymentUnit.getAttachment(Attachments.DEPLOYMENT_ROOT) != null) {
            return;
        }
        final DeploymentMountProvider deploymentMountProvider = deploymentUnit.getAttachment(Attachments.SERVER_DEPLOYMENT_REPOSITORY);
        if(deploymentMountProvider == null) {
            throw ServerMessages.MESSAGES.noDeploymentRepositoryAvailable();
        }

        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);
                final MountType type;
                if(mountExploded) {
                    type = MountType.EXPANDED;
                } else if (deploymentName.endsWith(".xml")) {
                    type = MountType.REAL;
                } else {
                    type = MountType.ZIP;
                }
                handle = deploymentMountProvider.mountDeploymentContent(deploymentContents, deploymentRoot, type);
                mountHandle = new MountHandle(handle);
            } catch (IOException e) {
                failed = true;
                throw ServerMessages.MESSAGES.deploymentMountFailed(e);
            } finally {
View Full Code Here

Examples of org.jboss.as.server.deployment.DeploymentMountProvider

        ResourceRoot resourceRoot = depUnit.getAttachment(Attachments.DEPLOYMENT_ROOT);
        Closeable handle = resourceRoot.getMountHandle();
        VFSUtils.safeClose(handle);

        VirtualFile deploymentContents = depUnit.getAttachment(Attachments.DEPLOYMENT_CONTENTS);
        DeploymentMountProvider deploymentMountProvider = depUnit.getAttachment(Attachments.SERVER_DEPLOYMENT_REPOSITORY);
        VirtualFile deploymentRoot = VFS.getChild("content/" + deploymentName);

        MountHandle mountHandle;
        try {
            handle = deploymentMountProvider.mountDeploymentContent(deploymentContents, deploymentRoot, MountType.EXPANDED);
            mountHandle = new MountHandle(handle);
        } catch (IOException e) {
            VFSUtils.safeClose(handle);
            throw ServerMessages.MESSAGES.deploymentMountFailed(e);
        }
View Full Code Here

Examples of org.jboss.as.server.deployment.DeploymentMountProvider

    public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
        final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
        if(deploymentUnit.getAttachment(Attachments.DEPLOYMENT_ROOT) != null) {
            return;
        }
        final DeploymentMountProvider deploymentMountProvider = deploymentUnit.getAttachment(Attachments.SERVER_DEPLOYMENT_REPOSITORY);
        if(deploymentMountProvider == 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);
                final MountType type;
                if(mountExploded) {
                    type = MountType.EXPANDED;
                } else if (deploymentName.endsWith(".xml")) {
                    type = MountType.REAL;
                } else {
                    type = MountType.ZIP;
                }
                handle = deploymentMountProvider.mountDeploymentContent(deploymentContents, deploymentRoot, type);
                mountHandle = new MountHandle(handle);
            } catch (IOException e) {
                failed = true;
                throw new DeploymentUnitProcessingException("Failed to mount deployment content", e);
            } finally {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.