Package org.jboss.as.controller.client.helpers.standalone

Examples of org.jboss.as.controller.client.helpers.standalone.ServerDeploymentManager$Factory


        assertNotClosed(testStream);
    }

    @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


        assertClosed(is);
    }

    @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

        assertNotClosed(is);
    }

    @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

        assertNotClosed(is);
    }

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

        assertNotClosed(is);
    }

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

        builder = sdm.newDeploymentPlan();
        builder = builder.add("test", createTempFile());
        planImpl = getDeploymentPlanImpl(builder);
        safeGetWithTimeout(sdm, planImpl);
        is = getInputStream(planImpl);
        assertClosed(is);
View Full Code Here

        assertClosed(is);
    }

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

        builder = sdm.newDeploymentPlan();
        builder = builder.add("test", createTempFile());
        planImpl = getDeploymentPlanImpl(builder);
        safeGetWithTimeout(sdm, planImpl);
        is = getInputStream(planImpl);
        assertClosed(is);
View Full Code Here

    @Override
    public Status execute() throws DeploymentExecutionException, DeploymentFailureException {
        Status resultStatus = Status.SUCCESS;
        try {
            final ServerDeploymentManager manager = ServerDeploymentManager.Factory.create(client);
            final DeploymentPlanBuilder builder = manager.newDeploymentPlan();
            final DeploymentPlan plan = createPlan(builder);
            if (plan != null) {
                if (plan.getDeploymentActions().size() > 0) {
                    final ServerDeploymentPlanResult planResult = manager.execute(plan).get();
                    // Check the results
                    for (DeploymentAction action : plan.getDeploymentActions()) {
                        final ServerDeploymentActionResult actionResult = planResult.getDeploymentActionResult(action.getId());
                        final ServerUpdateActionResult.Result result = actionResult.getResult();
                        switch (result) {
View Full Code Here

            if (checkPackaging() && IgnoredPackageTypes.isIgnored(packaging)) {
                getLog().debug(String.format("Ignoring packaging type %s.", packaging));
            } else {
                final InetAddress host = hostAddress();
                getLog().info(String.format("Executing goal %s on server %s (%s) port %s.", goal(), host.getHostName(), host.getHostAddress(), port()));
                final ServerDeploymentManager manager = ServerDeploymentManager.Factory.create(client());
                final DeploymentPlanBuilder builder = manager.newDeploymentPlan();
                final DeploymentPlan plan = createPlan(builder);
                if (plan == null) {
                    getLog().debug(String.format("Ignoring goal %s as the plan was null.", goal()));
                } else {
                    if (plan.getDeploymentActions().size() > 0) {
                        final ServerDeploymentPlanResult planResult = manager.execute(plan).get();
                        // Check the results
                        for (DeploymentAction action : plan.getDeploymentActions()) {
                            final ServerDeploymentActionResult actionResult = planResult.getDeploymentActionResult(action.getId());
                            final ServerUpdateActionResult.Result result = actionResult.getResult();
                            switch (result) {
View Full Code Here

                return;
            } else {
                archiveCounters.put(k, 1);
            }
            final ModelControllerClient client = newModelControllerClient();
            final ServerDeploymentManager deploymentManager = newDeploymentManager(client);
            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, client, deploymentManager);
            url2Id.put(archiveURL, uniqueId);
View Full Code Here

            }

            final String uniqueName = url2Id.get(archiveURL);
            if (uniqueName != null) {
                final ModelControllerClient client = newModelControllerClient();
                final ServerDeploymentManager deploymentManager = newDeploymentManager(client);
                final DeploymentPlanBuilder builder = deploymentManager.newDeploymentPlan();
                final DeploymentPlan plan = builder.undeploy(uniqueName).remove(uniqueName).build();
                final DeploymentAction deployAction = builder.getLastAction();
                try {
                    executeDeploymentPlan(plan, deployAction, client, deploymentManager);
                } finally {
View Full Code Here

TOP

Related Classes of org.jboss.as.controller.client.helpers.standalone.ServerDeploymentManager$Factory

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.