Examples of DeploymentPlanBuilder


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

    }

    @Override
    public String deploy(Archive<?> archive) throws Exception {
        InputStream input = archive.as(ZipExporter.class).exportZip();
        DeploymentPlanBuilder builder = deploymentManager.newDeploymentPlan();
        builder = builder.add(archive.getName(), input).andDeploy();
        DeploymentPlan plan = builder.build();
        DeploymentAction deployAction = builder.getLastAction();
        String runtimeName = executeDeploymentPlan(plan, deployAction);
        return runtimeName;
    }
View Full Code Here

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

        return runtimeName;
    }

    @Override
    public void undeploy(String runtimeName) throws Exception {
        DeploymentPlanBuilder builder = deploymentManager.newDeploymentPlan();
        DeploymentPlan plan = builder.undeploy(runtimeName).remove(runtimeName).build();
        Future<ServerDeploymentPlanResult> future = deploymentManager.execute(plan);
        future.get();
    }
View Full Code Here

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

    }

    @Override
    public void deploy(TargetModuleID targetModuleID) throws Exception {
        ROOT_LOGGER.beginDeploy(targetModuleID);
        DeploymentPlanBuilder builder = deploymentManager.newDeploymentPlan();
        TargetModuleExt targetModule = (TargetModuleExt) targetModuleID;
        URL contentURL = targetModule.getContentFile().toURI().toURL();
        builder = builder.add(targetModule.getModuleID(), contentURL).andDeploy();
        DeploymentPlan plan = builder.build();
        DeploymentAction deployAction = builder.getLastAction();
        executeDeploymentPlan(plan, deployAction);
        ROOT_LOGGER.endDeploy(targetModuleID);
    }
View Full Code Here

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

    }

    @Override
    public void undeploy(TargetModuleID targetModuleID) throws Exception {
        String deploymentName = targetModuleID.getModuleID();
        DeploymentPlanBuilder builder = deploymentManager.newDeploymentPlan();
        DeploymentPlan plan = builder.undeploy(deploymentName).remove(deploymentName).build();
        Future<ServerDeploymentPlanResult> future = deploymentManager.execute(plan);
        future.get();
    }
View Full Code Here

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

            String contextName = DeploymentHolderService.getContextName(dep);
            DeploymentHolderService.addService(serviceTarget, contextName, dep);

            // Build and execute the deployment plan
            InputStream inputStream = dep.getRoot().openStream();
            DeploymentPlanBuilder builder = deploymentManager.newDeploymentPlan();
            builder = builder.add(contextName, inputStream).andDeploy();
            DeploymentPlan plan = builder.build();
            DeploymentAction deployAction = builder.getLastAction();
            executeDeploymentPlan(plan, deployAction);

        } catch (RuntimeException rte) {
            throw rte;
        } catch (BundleException ex) {
View Full Code Here

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

        BundleManagement bundleManager = injectedBundleManager.getValue();
        bundleManager.uninstallBundle(dep);

        try {
            // Undeploy through the deployment manager
            DeploymentPlanBuilder builder = deploymentManager.newDeploymentPlan();
            String contextName = DeploymentHolderService.getContextName(dep);
            builder = builder.undeploy(contextName).remove(contextName);
            DeploymentPlan plan = builder.build();
            DeploymentAction removeAction = builder.getLastAction();
            executeDeploymentPlan(plan, removeAction);
        } catch (Exception ex) {
            log.warn("Cannot undeploy bundle: " + dep, ex);
        }
    }
View Full Code Here

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

    @Override
    public ContainerMethodExecutor deploy(Context context, Archive<?> archive) throws DeploymentException {
        try {
            InputStream input = archive.as(ZipExporter.class).exportZip();
            DeploymentPlanBuilder builder = deploymentManager.newDeploymentPlan().withRollback();
            builder = builder.add(archive.getName(), input).andDeploy();
            DeploymentPlan plan = builder.build();
            DeploymentAction deployAction = builder.getLastAction();
            executeDeploymentPlan(plan, deployAction,archive);

            return getContainerMethodExecutor(context);
        } catch (Exception e) {
            throw new DeploymentException("Could not deploy to container", e);
View Full Code Here

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

    @Override
    public void undeploy(Context context, Archive<?> archive) throws DeploymentException {
        String runtimeName = registry.remove(archive);
        if (runtimeName != null) {
            try {
                DeploymentPlanBuilder builder = deploymentManager.newDeploymentPlan().withRollback();
                DeploymentPlan plan = builder.undeploy(runtimeName).remove(runtimeName).build();
                Future<ServerDeploymentPlanResult> future = deploymentManager.execute(plan);
                future.get();
            } catch (Exception ex) {
                log.warning("Cannot undeploy: " + runtimeName + ":" + ex.getMessage());
            }
View Full Code Here

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

                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) {
View Full Code Here

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

            } 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
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.