Examples of DeploymentPlanBuilder


Examples of org.jboss.as.controller.client.helpers.standalone.DeploymentPlanBuilder

        modelControllerClient = ModelControllerClient.Factory.create(address, port, callbackHandler);
    }

    @Override
    public void deploy(final URL archiveURL) throws Exception {
        final DeploymentPlanBuilder builder = deploymentManager.newDeploymentPlan().add(archiveURL).andDeploy();
        final DeploymentPlan plan = builder.build();
        final DeploymentAction deployAction = builder.getLastAction();
        final String uniqueId = deployAction.getDeploymentUnitUniqueName();
        executeDeploymentPlan(plan, deployAction);
        url2Id.put(archiveURL, uniqueId);
    }
View Full Code Here

Examples of org.jboss.as.controller.client.helpers.standalone.DeploymentPlanBuilder

        executeDeploymentPlan(plan, deployAction);
        url2Id.put(archiveURL, uniqueId);
    }

    public void undeploy(final URL archiveURL) throws Exception {
        final DeploymentPlanBuilder builder = deploymentManager.newDeploymentPlan();
        final String uniqueName = url2Id.get(archiveURL);
        if (uniqueName != null) {
            final DeploymentPlan plan = builder.undeploy(uniqueName).remove(uniqueName).build();
            final DeploymentAction deployAction = builder.getLastAction();
            try {
                executeDeploymentPlan(plan, deployAction);
            } finally {
                url2Id.remove(archiveURL);
            }
View Full Code Here

Examples of org.jboss.as.controller.client.helpers.standalone.DeploymentPlanBuilder

    public String deploy(Archive<?> archive) throws DeploymentException {
        try {
            final InputStream input = archive.as(ZipExporter.class).exportAsInputStream();
            try {
                DeploymentPlanBuilder builder = deploymentManager.newDeploymentPlan();
                builder = builder.add(archive.getName(), input).andDeploy();
                DeploymentPlan plan = builder.build();
                DeploymentAction deployAction = builder.getLastAction();
                return executeDeploymentPlan(plan, deployAction);
            } finally {
                if(input != null) try {
                    input.close();
                } catch (IOException e) {
View Full Code Here

Examples of org.jboss.as.controller.client.helpers.standalone.DeploymentPlanBuilder

        }
    }

    public void undeploy(String runtimeName) throws DeploymentException {
        try {
            DeploymentPlanBuilder builder = deploymentManager.newDeploymentPlan();
            DeploymentPlan plan = builder.undeploy(runtimeName).remove(runtimeName).build();
            Future<ServerDeploymentPlanResult> future = deploymentManager.execute(plan);
            future.get();
        } catch (Exception ex) {
            log.warn("Cannot undeploy: " + runtimeName + ":" + ex.getMessage());
        }
View Full Code Here

Examples of org.jboss.as.controller.client.helpers.standalone.DeploymentPlanBuilder

    }

    @Test
    public void testFileSuccess() throws IOException {
        ServerDeploymentManager sdm = new MockServerDeploymentManager();
        DeploymentPlanBuilder builder = sdm.newDeploymentPlan();
        builder = builder.add("test", createTempFile());
        DeploymentPlanImpl planImpl = getDeploymentPlanImpl(builder);
        safeGet(sdm, planImpl);
        InputStream is = getInputStream(planImpl);
        assertClosed(is);
    }
View Full Code Here

Examples of org.jboss.as.controller.client.helpers.standalone.DeploymentPlanBuilder

    }

    @Test
    public void testURLSuccess() throws IOException {
        ServerDeploymentManager sdm = new MockServerDeploymentManager();
        DeploymentPlanBuilder builder = sdm.newDeploymentPlan();
        builder = builder.add("test", createTempURL());
        DeploymentPlanImpl planImpl = getDeploymentPlanImpl(builder);
        safeGet(sdm, planImpl);
        InputStream is = getInputStream(planImpl);
        assertClosed(is);
    }
View Full Code Here

Examples of org.jboss.as.controller.client.helpers.standalone.DeploymentPlanBuilder

    }

    @Test
    public void testStreamSuccess() throws IOException {
        ServerDeploymentManager sdm = new MockServerDeploymentManager();
        DeploymentPlanBuilder builder = sdm.newDeploymentPlan();
        createTempInputStream();
        builder = builder.add("test", testStream);
        DeploymentPlanImpl planImpl = getDeploymentPlanImpl(builder);
        safeGet(sdm, planImpl);
        assertNotClosed(testStream);
    }
View Full Code Here

Examples of org.jboss.as.controller.client.helpers.standalone.DeploymentPlanBuilder

    }

    @Test
    public void testSuccessfulCancel() throws IOException {
        ServerDeploymentManager sdm = new MockServerDeploymentManager(true);
        DeploymentPlanBuilder builder = sdm.newDeploymentPlan();
        builder = builder.add("test", createTempFile());
        DeploymentPlanImpl planImpl = getDeploymentPlanImpl(builder);
        safeCancel(sdm, planImpl);
        InputStream is = getInputStream(planImpl);
        assertClosed(is);
    }
View Full Code Here

Examples of org.jboss.as.controller.client.helpers.standalone.DeploymentPlanBuilder

    }

    @Test
    public void testUnsuccessfulCancel() throws IOException {
        ServerDeploymentManager sdm = new MockServerDeploymentManager(false);
        DeploymentPlanBuilder builder = sdm.newDeploymentPlan();
        builder = builder.add("test", createTempFile());
        DeploymentPlanImpl planImpl = getDeploymentPlanImpl(builder);
        safeCancel(sdm, planImpl);
        InputStream is = getInputStream(planImpl);
        assertNotClosed(is);
    }
View Full Code Here

Examples of org.jboss.as.controller.client.helpers.standalone.DeploymentPlanBuilder

    }

    @Test
    public void testInterrupted() throws IOException {
        ServerDeploymentManager sdm = new MockServerDeploymentManager(new InterruptedException());
        DeploymentPlanBuilder builder = sdm.newDeploymentPlan();
        builder = builder.add("test", createTempFile());
        DeploymentPlanImpl planImpl = getDeploymentPlanImpl(builder);
        safeGet(sdm, planImpl);
        InputStream is = getInputStream(planImpl);
        assertNotClosed(is);

        builder = sdm.newDeploymentPlan();
        builder = builder.add("test", createTempFile());
        planImpl = getDeploymentPlanImpl(builder);
        safeGetWithTimeout(sdm, planImpl);
        is = getInputStream(planImpl);
        assertNotClosed(is);
    }
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.