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

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


     * @param builder    the builder used to create the plan.
     * @return the deployment plan.
     * @throws IOException if the deployment plan found an error.
     */
    static DeploymentPlan redeployPlan(final AbstractDeployment deployment, final DeploymentPlanBuilder builder) throws IOException {
        DeploymentPlan plan = null;
        if (deployment.name() == null) {
            deployment.getLog().debug(deployment.nameNotDefinedMessage());
            plan = builder.replace(deployment.file()).redeploy(deployment.file().getName()).build();
        } else {
            deployment.getLog().debug(deployment.nameDefinedMessage());
View Full Code Here


     * @param builder    the builder used to create the plan.
     * @return the deployment plan.
     * @throws IOException if the deployment plan found an error.
     */
    static DeploymentPlan undeployPlan(final AbstractDeployment deployment, final DeploymentPlanBuilder builder) throws IOException {
        DeploymentPlan plan = null;
        if (deployment.name() == null) {
            deployment.getLog().debug(deployment.nameNotDefinedMessage());
            plan = builder.undeploy(deployment.file().getName()).remove(deployment.file().getName()).build();
        } else {
            deployment.getLog().debug(deployment.nameNotDefinedMessage());
View Full Code Here

            } 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.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) {
                            case FAILED:
                                throw new MojoExecutionException("Deployment failed.", actionResult.getDeploymentException());
View Full Code Here

    @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

    }

    @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

    public ContainerMethodExecutor deploy(Context context, Archive<?> archive) throws DeploymentException {
        try {
            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();
            executeDeploymentPlan(plan, deployAction,archive);

            return getContainerMethodExecutor(context);
        } catch (Exception e) {
View Full Code Here

    public void undeploy(Context context, Archive<?> archive) throws DeploymentException {
        String runtimeName = registry.remove(archive);
        if (runtimeName != null) {
            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.warning("Cannot undeploy: " + runtimeName + ":" + ex.getMessage());
            }
View Full Code Here

    public String deploy(Archive<?> archive) throws DeploymentException {
        try {
            InputStream input = archive.as(ZipExporter.class).exportAsInputStream();
            DeploymentPlanBuilder builder = deploymentManager.newDeploymentPlan();
            builder = builder.add(archive.getName(), input).andDeploy();
            DeploymentPlan plan = builder.build();
            DeploymentAction deployAction = builder.getLastAction();
            return executeDeploymentPlan(plan, deployAction);
        } catch (Exception e) {
            throw new DeploymentException("Could not deploy to container", e);
        }
View Full Code Here

    }

    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

    public void deploy(TargetModuleID targetModuleID) throws Exception {
        ROOT_LOGGER.beginDeploy(targetModuleID);
        String deploymentName = targetModuleID.getModuleID();
        DeploymentPlanBuilder builder = deploymentManager.newDeploymentPlan();
        builder = builder.add(deploymentName, new URL(deploymentName)).andDeploy();
        DeploymentPlan plan = builder.build();
        DeploymentAction deployAction = builder.getLastAction();
        executeDeploymentPlan(plan, deployAction);
        ROOT_LOGGER.endDeploy(targetModuleID);
    }
View Full Code Here

TOP

Related Classes of org.jboss.as.controller.client.helpers.standalone.DeploymentPlan

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.