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

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


*/
public final class Deploy extends AbstractDeployment {

    @Override
    public DeploymentPlan createPlan(final DeploymentPlanBuilder builder) throws IOException, MojoFailureException {
        final DeploymentPlan plan;
        if (force()) {
            if (deploymentExists()) {
                getLog().debug("Deployment already exists, redeploying application.");
                plan = redeployPlan(this, builder);
            } else {
View Full Code Here


     * @return the deployment plan.
     *
     * @throws IOException if the deployment plan found an error.
     */
    protected static DeploymentPlan deployPlan(final AbstractDeployment deployment, final DeploymentPlanBuilder builder) throws IOException {
        DeploymentPlan plan = null;
        if (deployment.name() == null) {
            deployment.getLog().debug(deployment.nameNotDefinedMessage());
            plan = builder.add(deployment.file()).deploy(deployment.filename()).build();
        } else {
            deployment.getLog().debug(deployment.nameDefinedMessage());
View Full Code Here

     * @return the deployment plan.
     *
     * @throws IOException if the deployment plan found an error.
     */
    protected 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.filename()).build();
        } else {
            deployment.getLog().debug(deployment.nameDefinedMessage());
View Full Code Here

     * @return the deployment plan.
     *
     * @throws IOException if the deployment plan found an error.
     */
    protected 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.filename()).remove(deployment.filename()).build();
        } else {
            deployment.getLog().debug(deployment.nameNotDefinedMessage());
View Full Code Here

                if (force()) {
                    getLog().debug("force option is enabled");
                }
                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

    public synchronized void undeploy() throws ExecutionException, InterruptedException, TimeoutException {
        DeploymentPlanBuilder builder = manager.newDeploymentPlan();
        for (AbstractDeployment deployment : deployments) {
            builder = deployment.removeDeployment(builder);
        }
        DeploymentPlan plan = builder.build();
        if (plan.getDeploymentActions().size() > 0) {
            manager.execute(builder.build()).get(timeout, TimeUnit.MILLISECONDS);
        }
    }
View Full Code Here

            // 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;
View Full Code Here

        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

        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();
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

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.