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

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


            }
        }

        @Override
        public void tearDown(final ManagementClient managementClient, final String containerId) throws Exception {
            final ServerDeploymentManager manager = ServerDeploymentManager.Factory.create(managementClient.getControllerClient());
            final DeploymentPlan undeployPlan = manager.newDeploymentPlan().undeploy(TEST_JMS_XML).andRemoveUndeployed().build();
            manager.execute(undeployPlan).get();
        }
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

                final InetAddress host = hostAddress();
                getLog().info(String.format("Executing goal %s for %s on server %s (%s) port %s.", goal(), file, host.getHostName(), host.getHostAddress(), port()));
                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) {
View Full Code Here

    @Override
    public Status execute() throws MojoExecutionException, MojoFailureException {
        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

            final InetAddress host = hostAddress();
            getLog().info(String.format("Executing goal %s for %s on server %s (%s) port %s.", goal(), file, host.getHostName(), host.getHostAddress(), port()));
            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 result = manager.execute(plan).get();
                getLog().debug(String.format("Deployment Plan Id : %s", result.getDeploymentPlanId()));
            } else {
                getLog().warn(String.format("Goal %s failed on file %s. No deployment actions exist. Plan: %s", goal(), filename(), plan));
            }
        } catch (Exception e) {
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.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

            // Setup the Framework module provider
            bundleManager.addPlugin(SystemModuleProviderPlugin.class, new FrameworkModuleProvider(bundleManager));

            // Setup the {@link DeployerServicePlugin}
            ServiceContainer serviceContainer = context.getController().getServiceContainer();
            ServerDeploymentManager deploymentManager = new ModelControllerServerDeploymentManager(injectedServerController.getValue());
            DeployerServicePluginIntegration plugin = new DeployerServicePluginIntegration(bundleManager, serviceContainer, deploymentManager);
            bundleManager.addPlugin(DeployerServicePlugin.class, plugin);

            // Setup the {@link ModuleLoaderPlugin}
            ServiceModuleLoader moduleLoader = injectedServiceModuleLoader.getValue();
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.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 (offset != null) {
            port += offset;
        }
        final ModelControllerClient client = ModelControllerClient.Factory
            .create("localhost", port);
        ServerDeploymentManager deploymentManager = ServerDeploymentManager.Factory.create(client);
        InitialDeploymentPlanBuilder builder = deploymentManager.newDeploymentPlan();
        String applName = "wicket-examples1";
        URL applUrl = new URL("mvn:org.apache.wicket/wicket-examples/1.5.3/war");
        DeploymentPlan plan = builder.add(applName, applUrl).andDeploy().build();
        ServerDeploymentPlanResult result = deploymentManager.execute(plan).get();
        UUID actionId = plan.getDeploymentActions().get(0).getId();
        ServerDeploymentActionResult actionResult = result.getDeploymentActionResult(actionId);
        assertThat(actionResult.getResult(), is(Result.EXECUTED));
       
        builder = deploymentManager.newDeploymentPlan();
        plan = builder.undeploy(applName).andRemoveUndeployed().build();
        result = deploymentManager.execute(plan).get();
        actionId = plan.getDeploymentActions().get(0).getId();
        actionResult = result.getDeploymentActionResult(actionId);
        assertThat(actionResult.getResult(), is(Result.EXECUTED));
       
       
View Full Code Here

        System.setProperty("org.jboss.logging.provider", "slf4j");
        System.setProperty("jboss.server.config.dir", "target/test-classes/wildfly80-config");

        final ModelControllerClient client = ModelControllerClient.Factory
            .create("localhost", 19990);
        ServerDeploymentManager deploymentManager = ServerDeploymentManager.Factory.create(client);
        InitialDeploymentPlanBuilder builder = deploymentManager.newDeploymentPlan();
        String applName = "wicket-examples.war";
        URL applUrl = new URL("mvn:org.apache.wicket/wicket-examples/1.5.3/war");
        DeploymentPlan plan = builder.add(applName, applUrl).andDeploy().build();
        ServerDeploymentPlanResult result = deploymentManager.execute(plan).get();
        UUID actionId = plan.getDeploymentActions().get(0).getId();
        ServerDeploymentActionResult actionResult = result.getDeploymentActionResult(actionId);
        assertThat(actionResult.getResult(), is(Result.EXECUTED));

        plan = deploymentManager.newDeploymentPlan().undeploy(applName).andRemoveUndeployed()
            .build();
        deploymentManager.execute(plan).get();
        actionResult = result.getDeploymentActionResult(actionId);
        assertThat(actionResult.getResult(), is(Result.EXECUTED));

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