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

Examples of org.jboss.as.controller.client.helpers.domain.ServerStatus


                    if(connectionFinished) {
                        break;
                    }
                    int count = 0;
                    for(final ManagedServer server : servers.values()) {
                        final ServerStatus state = server.getState();
                        switch (state) {
                            case DISABLED:
                            case FAILED:
                            case STOPPED:
                                break;
View Full Code Here


        for (String serverGroup : serverGroups) {
            boolean notFound = true;
            // Check the servers
            for (ServerIdentity serverId : statuses.keySet()) {
                if (serverGroup.equals(serverId.getServerGroupName())) {
                    ServerStatus currentStatus = statuses.get(serverId);
                    if (currentStatus != ServerStatus.STARTED) {
                        throw new MojoFailureException(
                                String.format("Status of server group '%s' is '%s', but is required to be '%s'.",
                                        serverGroup, currentStatus, ServerStatus.STARTED));
                    }
View Full Code Here

        super.performRemove(context, operation, model);
    }

    private boolean isRunningServer(String serverName) {
        ServerStatus status = serverInventory.determineServerStatus(serverName);
        switch (status) {
            case STARTED:
            case STARTING:
            case STOPPING:
                return true;
View Full Code Here

                    final String hostName = model.get(HOST).keys().iterator().next();
                    final ModelNode serverConfig = model.get(HOST, hostName).get(SERVER_CONFIG);
                    final Set<String> serversInGroup = getServersForGroup(model, group);
                    if(serverConfig.isDefined()) {
                        for (Property config : serverConfig.asPropertyList()) {
                            final ServerStatus status = serverInventory.determineServerStatus(config.getName());
                            if (status != ServerStatus.STARTING && status != ServerStatus.STARTED) {
                                if (group == null || serversInGroup.contains(config.getName())) {
                                    if (status != ServerStatus.STOPPED) {
                                        serverInventory.stopServer(config.getName(), TIMEOUT);
                                    }
View Full Code Here

        final String serverName = element.getValue();
        final boolean blocking = operation.get("blocking").asBoolean(false);
        context.addStep(new OperationStepHandler() {
            @Override
            public void execute(OperationContext context, ModelNode operation) throws OperationFailedException {
                final ServerStatus status = serverInventory.stopServer(serverName, -1, blocking);
                context.getResult().set(status.toString());
                context.completeStep(OperationContext.RollbackHandler.NOOP_ROLLBACK_HANDLER);
            }
        }, OperationContext.Stage.RUNTIME);
        context.stepCompleted();
    }
View Full Code Here

        final ModelNode model = Resource.Tools.readModel(context.readResourceFromRoot(PathAddress.EMPTY_ADDRESS, true));
        context.addStep(new OperationStepHandler() {
            @Override
            public void execute(OperationContext context, ModelNode operation) throws OperationFailedException {
                final ServerStatus origStatus = serverInventory.determineServerStatus(serverName);
                if (origStatus != ServerStatus.STARTED && origStatus != ServerStatus.STARTING) {
                    final ServerStatus status = serverInventory.startServer(serverName, model, blocking);
                    context.getResult().set(status.toString());
                } else {
                    context.getResult().set(origStatus.toString());
                }

                context.completeStep(new OperationContext.RollbackHandler() {
View Full Code Here

        final ModelNode model = Resource.Tools.readModel(context.readResourceFromRoot(PathAddress.EMPTY_ADDRESS, true));
        context.addStep(new OperationStepHandler() {
            @Override
            public void execute(OperationContext context, ModelNode operation) throws OperationFailedException {
                final ServerStatus origStatus = serverInventory.determineServerStatus(serverName);
                if (origStatus != ServerStatus.STARTED) {
                    throw new OperationFailedException(new ModelNode(MESSAGES.cannotRestartServer(serverName, origStatus)));
                }
                final ServerStatus status = serverInventory.restartServer(serverName, -1, model, blocking);
                context.getResult().set(status.toString());
                context.completeStep(OperationContext.RollbackHandler.NOOP_ROLLBACK_HANDLER);
            }
        }, OperationContext.Stage.RUNTIME);

        context.stepCompleted();
View Full Code Here

            isStart = subModel.get(AUTO_START).asBoolean();
        } else {
            isStart = true;
        }

        ServerStatus status = serverInventory.determineServerStatus(serverName);

        if (status == ServerStatus.STOPPED) {
            status = isStart ? status : ServerStatus.DISABLED;
        }

        if(status != null) {
            context.getResult().set(status.toString());
            context.stepCompleted();
        } else {
            throw new OperationFailedException(new ModelNode(MESSAGES.failedToGetServerStatus()));
        }
    }
View Full Code Here

                    if(connectionFinished) {
                        break;
                    }
                    int count = 0;
                    for(final ManagedServer server : servers.values()) {
                        final ServerStatus state = server.getState();
                        switch (state) {
                            case DISABLED:
                            case FAILED:
                            case STOPPED:
                                break;
View Full Code Here

            processInventoryLatch.countDown();
        }
    }

    public ServerStatus determineServerStatus(final String serverName) {
        ServerStatus status;
        final String processName = ManagedServer.getServerProcessName(serverName);
        final ManagedServer client = servers.get(processName);
        if (client == null) {
            status = ServerStatus.STOPPED; // TODO move the configuration state outside
        } else {
View Full Code Here

TOP

Related Classes of org.jboss.as.controller.client.helpers.domain.ServerStatus

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.