@Override public ServerStatus stopServer(String serverName, int gracefulTimeout, boolean blocking) { return serverInventory.stopServer(serverName, gracefulTimeout, blocking); }
@Override public void execute(OperationContext context, ModelNode operation) throws OperationFailedException { if (group != null) { final ModelNode model = Resource.Tools.readModel(context.readResourceFromRoot(PathAddress.EMPTY_ADDRESS, true)); for (String server : getServersForGroup(model, group)) { serverInventory.stopServer(server, TIMEOUT); } } else { serverInventory.stopServers(TIMEOUT); } context.completeStep(OperationContext.RollbackHandler.NOOP_ROLLBACK_HANDLER); } }, Stage.RUNTIME);
public ServerStatus stopServer(String serverName, int gracefulTimeout) { return serverInventory.stopServer(serverName, gracefulTimeout); }
@Override public void execute(OperationContext context, ModelNode operation) throws OperationFailedException { // Even though we don't read from the service registry, we are modifying a service context.getServiceRegistry(true); if (group != null) { final Set<String> waitForServers = new HashSet<String>(); final ModelNode model = Resource.Tools.readModel(context.readResourceFromRoot(PathAddress.EMPTY_ADDRESS, true)); for (String server : getServersForGroup(model, group)) { serverInventory.stopServer(server, timeout); waitForServers.add(server); } if (blocking) { serverInventory.awaitServersState(waitForServers, false); } } else { serverInventory.stopServers(timeout, blocking); } context.completeStep(OperationContext.RollbackHandler.NOOP_ROLLBACK_HANDLER); } }, Stage.RUNTIME);
@Override public ServerStatus stopServer(String serverName, int gracefulTimeout, boolean blocking) { return getServerInventory().stopServer(serverName, gracefulTimeout, blocking); }
@Override public void execute(OperationContext context, ModelNode operation) throws OperationFailedException { // Even though we don't read from the service registry, we are modifying a service context.getServiceRegistry(true); if (group != null) { final Set<String> waitForServers = new HashSet<String>(); final ModelNode model = Resource.Tools.readModel(context.readResourceFromRoot(PathAddress.EMPTY_ADDRESS, true)); for (String server : getServersForGroup(model, group)) { serverInventory.stopServer(server, timeout); waitForServers.add(server); } if (blocking) { serverInventory.awaitServersState(waitForServers, false); } } else { serverInventory.stopServers(timeout, blocking); } context.completeStep(OperationContext.RollbackHandler.NOOP_ROLLBACK_HANDLER); } }, Stage.RUNTIME);
@Override public ServerStatus stopServer(String serverName, int gracefulTimeout) { return getServerInventory().stopServer(serverName, gracefulTimeout); }
@Override public ServerStatus stopServer(String serverName, int gracefulTimeout, boolean blocking) { return getServerInventory().stopServer(serverName, gracefulTimeout, blocking); }
@Override public ServerStatus stopServer(String serverName, int gracefulTimeout) { return getServerInventory().stopServer(serverName, gracefulTimeout); }
@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);
@Override public void execute(OperationContext context, ModelNode operation) throws OperationFailedException { // WFLY-2741 -- DO NOT call context.getServiceRegistry(true) as that will trigger blocking for // service container stability and one use case for this op is to recover from a // messed up service container from a previous op. Instead just ask for authorization. // Note that we already have the exclusive lock, so we are just skipping waiting for stability. // If another op that is a step in a composite step with this op needs to modify the container // it will have to wait for container stability, so skipping this only matters for the case // where this step is the only runtime change. context.authorize(operation, EnumSet.of(Action.ActionEffect.WRITE_RUNTIME)); final ServerStatus status = serverInventory.stopServer(serverName, timeout, blocking); try { context.readResource(PathAddress.EMPTY_ADDRESS, false); //reading the resource to persist the autostart state. } catch (Resource.NoSuchResourceException ex) { //in case the resource no longer exists. } context.getResult().set(status.toString()); context.completeStep(OperationContext.RollbackHandler.NOOP_ROLLBACK_HANDLER); } }, OperationContext.Stage.RUNTIME);
@Override public void execute(OperationContext context, ModelNode operation) throws OperationFailedException { // WFLY-2741 -- DO NOT call context.getServiceRegistry(true) as that will trigger blocking for // service container stability and one use case for this op is to recover from a // messed up service container from a previous op. Instead just ask for authorization. // Note that we already have the exclusive lock, so we are just skipping waiting for stability. // If another op that is a step in a composite step with this op needs to modify the container // it will have to wait for container stability, so skipping this only matters for the case // where this step is the only runtime change. context.authorize(operation, EnumSet.of(Action.ActionEffect.WRITE_RUNTIME)); final ServerStatus status = serverInventory.stopServer(serverName, timeout, blocking); try { context.readResource(PathAddress.EMPTY_ADDRESS, false); //reading the resource to persist the autostart state. } catch (Resource.NoSuchResourceException ex) { //in case the resource no longer exists. } context.getResult().set(status.toString()); context.completeStep(OperationContext.RollbackHandler.NOOP_ROLLBACK_HANDLER); } }, OperationContext.Stage.RUNTIME);
@Override public void execute(OperationContext context, ModelNode operation) throws OperationFailedException { 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); } serverInventory.startServer(config.getName(), model); } } } } context.completeStep(OperationContext.RollbackHandler.NOOP_ROLLBACK_HANDLER); } }, Stage.RUNTIME);
@Override public void execute(OperationContext context, ModelNode operation) throws OperationFailedException { 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); final Set<String> waitForServers = new HashSet<String>(); if (serverConfig.isDefined()) { // Even though we don't read from the service registry, we are modifying a service context.getServiceRegistry(true); 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(), 0); } serverInventory.startServer(config.getName(), model, false, suspend); waitForServers.add(config.getName()); } } } if (blocking) { serverInventory.awaitServersState(waitForServers, true); } } context.completeStep(OperationContext.RollbackHandler.NOOP_ROLLBACK_HANDLER); } }, Stage.RUNTIME);
@Override public void execute(OperationContext context, ModelNode operation) throws OperationFailedException { 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); final Set<String> waitForServers = new HashSet<String>(); if (serverConfig.isDefined()) { // Even though we don't read from the service registry, we are modifying a service context.getServiceRegistry(true); 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(), 0); } serverInventory.startServer(config.getName(), model, false, suspend); waitForServers.add(config.getName()); } } } if (blocking) { serverInventory.awaitServersState(waitForServers, true); } } context.completeStep(OperationContext.RollbackHandler.NOOP_ROLLBACK_HANDLER); } }, Stage.RUNTIME);