Package org.jboss.as.server.mgmt

Examples of org.jboss.as.server.mgmt.ServerUpdateController


        }


        final SimpleFuture<ServerDeploymentPlanResult> resultFuture = new SimpleFuture<ServerDeploymentPlanResult>();
        final UpdateResultHandlerImpl resultHandler = new UpdateResultHandlerImpl(resultFuture, plan);
        final ServerUpdateController controller = new ServerUpdateController(getServerConfiguration(), getServiceContainer(),
                getDeploymentExecutor(), resultHandler, plan.isGlobalRollback(), !plan.isShutdown());

        DeploymentPlanImpl planImpl = (DeploymentPlanImpl) plan;

        for (DeploymentActionImpl action : planImpl.getDeploymentActionImpls()) {
            addServerGroupDeploymentUpdate(action, resultHandler, controller);
        }

        // Execute the plan asynchronously
        Runnable r = new Runnable() {
            @Override
            public void run() {
                logger.debugf("Executing deployment plan %s", plan.getId().toString());
                controller.executeUpdates();
            }
        };
        getDeploymentExecutor().execute(r);

        return resultFuture;
View Full Code Here


        @Override
        protected void sendResponse(OutputStream output) throws IOException {
            List<ResultHandler<?, Void>> results = new ArrayList<ResultHandler<?, Void>>(updates.size());

            final CountDownLatch latch = new CountDownLatch(1);
            final ServerUpdateController controller = new ServerUpdateController(serverController.getServerModel(),
                    serviceContainer, executor,
                    new ServerUpdateCommitHandler() {
                        public void handleUpdateCommit(ServerUpdateController controller, Status priorStatus) {
                            configurationPersister.configurationModified();
                            latch.countDown();
                        }
                    }, true, ! preventShutdown);

            boolean requiresRestart = false;
            for(final AbstractServerModelUpdate<?> update : updates) {
                requiresRestart |= update.requiresRestart();
                results.add(addUpdate(update, controller));
            }

            controller.executeUpdates();
            try {
                latch.await();
            } catch(Exception e) {
                throw new ManagementException("failed to execute updates", e);
            }
View Full Code Here

            return results;
        }

        final CountDownLatch latch = new CountDownLatch(1);
        ServerUpdateCommitHandlerImpl handler = new ServerUpdateCommitHandlerImpl(results, count, latch);
        final ServerUpdateController controller = new ServerUpdateController(getServerModel(),
                container, executor, handler, rollbackOnFailure, !modelOnly);

        for(int i = 0; i < count; i++) {
            controller.addServerModelUpdate(updates.get(i), handler, Integer.valueOf(i));
        }

        controller.executeUpdates();
        log.debugf("Executed %s updates", updates.size());
        try {
            latch.await();
        } catch(InterruptedException e) {
            Thread.currentThread().interrupt();
View Full Code Here

TOP

Related Classes of org.jboss.as.server.mgmt.ServerUpdateController

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.