Skip to content
This repository has been archived by the owner on Mar 15, 2022. It is now read-only.

Commit

Permalink
Merge pull request #274 from claudio4j/HAL-1078
Browse files Browse the repository at this point in the history
HAL-1078 - Server "Stop" action should request a suspend timeout
  • Loading branch information
hpehl committed Jul 22, 2016
2 parents 689602c + b0fd147 commit 742907b
Show file tree
Hide file tree
Showing 11 changed files with 125 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -550,6 +550,7 @@ public interface UIConstants extends Constants {
String successfullyRefreshedStatistics();
String suspend();
String suspendTimeoutDescription();
String stopTimeoutDescription();
String systemPropertiesDescription();
String transportSettings();
String unableToAddDeployment();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,7 @@ subys_web_metric_desc=Metrics for the web subsystem.
successfullyRefreshedStatistics=Successfully refreshed statistics.
suspend=Suspend
suspendTimeoutDescription=Timeout in seconds. If this is zero the operation will return immediately, -1 means that it will wait indefinitely. Note that the operation will not roll back if the timeout is exceeded, it just means that not all current requests completed in the specified timeout.
stopTimeoutDescription=Timeout in seconds. If this is set a graceful shutdown will be attempted. If this is zero (the default) then the server will shutdown immediately. A value larger than zero means the server will wait up to this many seconds for all active requests to finish. A value smaller than zero means that the server will wait indefinitely for all active requests to finish.
systemPropertiesDescription=System property values can be set in a number of places in domain.xml, host.xml and standalone.xml. The values in standalone.xml are set as part of the server boot process. Values in domain.xml and host.xml are applied to servers when they are launched.
transportSettings=Transport Settings
unableToAddDeployment=Unable to add deployment.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,7 @@ subys_web_metric_desc=Metrik f\u00FCr das Web-Untersystem.
successfullyRefreshedStatistics=Erfolgreich aktualisierte Statistiken.
suspend=Aussetzen
suspendTimeoutDescription=Timeout in Sekunden. Ist dies Null, so erfolgt eine sofortige Wiedergabe der Operation, -1 bedeutet, dass unendlich lange gewartet wird. Beachten Sie, dass die Operation nicht zur\u00FCckgesetzt wird, wenn der Timeout \u00FCberschritten wird, es bedeutet lediglich, dass nicht alle aktuellen Anfragen im festgelegten Timeout abgeschlossen wurden.
stopTimeoutDescription=Timeout in seconds. If this is set a graceful shutdown will be attempted. If this is zero (the default) then the server will shutdown immediately. A value larger than zero means the server will wait up to this many seconds for all active requests to finish. A value smaller than zero means that the server will wait indefinitely for all active requests to finish.
systemPropertiesDescription=Die Werte von Systemeigenschaften k\u00F6nnen an mehreren Orten in domain.xml, host.xml und standalone.xml eingestellt werden. Die Werte in standalone.xml werden als Teil des Server-Bootprozesses eingestellt. Werte in domain.xml und host.xml werden beim Start der Server angewendet.
transportSettings=Transporteinstellungen
unableToAddDeployment=Kann Deployment nicht hinzuf\u00FCgen.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,7 @@ subys_web_metric_desc=M\u00E9trica para el subsistema web subsystem.
successfullyRefreshedStatistics=Estad\u00EDsticas actualizadas de manera exitosa.
suspend=Suspender
suspendTimeoutDescription=Tiempo de expiraci\u00F3n en segundos. Si es cero entonces la operaci\u00F3n retornar\u00E1 inmediatamente, -1 significa que esperar\u00E1 indefinidamente. Note que la operaci\u00F3n no se deshar\u00E1 si se sobrepasa el tiempo de expiraci\u00F3n, esto solo significa que no todas las peticiones actuales se completaron en el tiempo de expiraci\u00F3n especificado.
stopTimeoutDescription=Timeout in seconds. If this is set a graceful shutdown will be attempted. If this is zero (the default) then the server will shutdown immediately. A value larger than zero means the server will wait up to this many seconds for all active requests to finish. A value smaller than zero means that the server will wait indefinitely for all active requests to finish.
systemPropertiesDescription=Los valores de las propiedades del sistema se pueden establecer en un n\u00FAmero de lugares en domain.xml, host.xml y standalone.xml. Los valores en standalone.xml se establecen como parte del proceso de arranque del servidor. Los valores en domain.xml y host.xml se se aplican a los servidores cuando se lanzan.
transportSettings=Configuraci\u00F3n del transporte
unableToAddDeployment=No se pudo agregar la implementaci\u00F3n.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,7 @@ subys_web_metric_desc=M\u00E9triques du sous-syst\u00E8me web subsystem.
successfullyRefreshedStatistics=Statistiques r\u00E9actualis\u00E9es
suspend=Interruption
suspendTimeoutDescription=Timeout en secondes. S\u0027il correspond \u00E0 z\u00E9ro, l\u0027op\u00E9ration reprend imm\u00E9diatement, -1 signifie un d\u00E9lai infini. Notez que l\u0027op\u00E9ration ne sera pas annul\u00E9e si le d\u00E9lai d\u0027expiration est d\u00E9pass\u00E9e, cela signifie simplement que toutes les demandes en cours ne seront pas achev\u00E9es dans le d\u00E9lai (timeout) sp\u00E9cifi\u00E9.
stopTimeoutDescription=Timeout in seconds. If this is set a graceful shutdown will be attempted. If this is zero (the default) then the server will shutdown immediately. A value larger than zero means the server will wait up to this many seconds for all active requests to finish. A value smaller than zero means that the server will wait indefinitely for all active requests to finish.
systemPropertiesDescription=Les valeurs de propri\u00E9t\u00E9s syst\u00E8me peuvent \u00EAtre d\u00E9finies dans un certain nombre d\u0027endroits dans domain.xml, host.xml et standalone.xml. Les valeurs de standalone.xml sont d\u00E9finies dans le cadre de la proc\u00E9dure de d\u00E9marrage du serveur. Les valeurs de domain.xml et host.xml sont appliqu\u00E9es aux serveurs quand ils sont lanc\u00E9s.
transportSettings=Configurations de transport
unableToAddDeployment=Impossible d\u0027ajouter un d\u00E9ploiement.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,7 @@ subys_web_metric_desc=Web \u30B5\u30D6\u30B7\u30B9\u30C6\u30E0\u306E\u30E1\u30C8
successfullyRefreshedStatistics=\u7D71\u8A08\u5024\u3092\u66F4\u65B0\u3057\u307E\u3057\u305F\u3002
suspend=\u4E00\u6642\u505C\u6B62
suspendTimeoutDescription=\u79D2\u5358\u4F4D\u306E\u30BF\u30A4\u30E0\u30A2\u30A6\u30C8\u3067\u3059\u3002\u30BC\u30ED\u306E\u5834\u5408\u306F\u52D5\u4F5C\u304C\u305F\u3060\u3061\u306B\u8FD4\u3055\u308C\u307E\u3059\u3002-1 \u306F\u7121\u671F\u9650\u3067\u5F85\u6A5F\u3057\u307E\u3059\u3002\u30BF\u30A4\u30E0\u30A2\u30A6\u30C8\u3092\u904E\u304E\u308B\u3068\u52D5\u4F5C\u306F\u30ED\u30FC\u30EB\u30D0\u30C3\u30AF\u3055\u308C\u307E\u305B\u3093\u3002\u3064\u307E\u308A\u3001\u73FE\u5728\u306E\u8981\u6C42\u304C\u3059\u3079\u3066\u6307\u5B9A\u3055\u308C\u305F\u30BF\u30A4\u30E0\u30A2\u30A6\u30C8\u5185\u3067\u5B8C\u4E86\u3057\u305F\u8A33\u3067\u306F\u306A\u3044\u3068\u3044\u3046\u3053\u3068\u3067\u3059\u3002
stopTimeoutDescription=Timeout in seconds. If this is set a graceful shutdown will be attempted. If this is zero (the default) then the server will shutdown immediately. A value larger than zero means the server will wait up to this many seconds for all active requests to finish. A value smaller than zero means that the server will wait indefinitely for all active requests to finish.
systemPropertiesDescription=\u30B7\u30B9\u30C6\u30E0\u30D7\u30ED\u30D1\u30C6\u30A3\u30FC\u306E\u5024\u306F domain.xml\u3001host.xml \u304A\u3088\u3073 standalone.xml \u5185\u306E\u8907\u6570\u306E\u7B87\u6240\u3067\u8A2D\u5B9A\u3059\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u3059\u3002standalone.xml \u5185\u306E\u5024\u306F\u30B5\u30FC\u30D0\u30FC\u8D77\u52D5\u30D7\u30ED\u30BB\u30B9\u306E\u4E00\u90E8\u3068\u3057\u3066\u8A2D\u5B9A\u3055\u308C\u307E\u3059\u3002domain.xml \u3068 host.xml \u5185\u306E\u5024\u306F\u30B5\u30FC\u30D0\u30FC\u304C\u8D77\u52D5\u3057\u305F\u969B\u306B\u305D\u306E\u30B5\u30FC\u30D0\u30FC\u306B\u9069\u7528\u3055\u308C\u307E\u3059\u3002
transportSettings=\u30C8\u30E9\u30F3\u30B9\u30DD\u30FC\u30C8\u306E\u8A2D\u5B9A
unableToAddDeployment=\u30C7\u30D7\u30ED\u30A4\u30E1\u30F3\u30C8\u306F\u8FFD\u52A0\u3067\u304D\u307E\u305B\u3093\u3002
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,7 @@ subys_web_metric_desc=M\u00E9tricas para o subsistema da web.
successfullyRefreshedStatistics=As estat\u00EDsticas foram atualizadas com \u00EAxito.
suspend=Suspender
suspendTimeoutDescription=Tempo limite em segundos. Se for zero, a opera\u00E7\u00E3o retornar\u00E1 imediatamente, -1 significa que aguardar\u00E1 por tempo indeterminado. Observe que, a opera\u00E7\u00E3o n\u00E3o ser\u00E1 revertida caso o tempo limite seja excedido, isto significa apenas que nem todas as solicita\u00E7\u00F5es atuais ser\u00E3o conclu\u00EDdas em um tempo limite espec\u00EDfico.
stopTimeoutDescription=Tempo limite em segundos. Se for informado um tempo, ser\u00c3\u00a1 efetuada uma parada organizada dos servi\u00c3\u00a7os. Se for um valor zero (padr\u00c3\u00a3o) ent\u00c3\u00a3o o servidor ser\u00c3\u00a1 interrompido imediatamente. Um valor maior que zero, o servidor ir\u00c3\u00a1 esperar o tempo informado at\u00c3\u00a9 que todas as requisi\u00c3\u00a7\u00c3\u00b5es em andamento sejam finalizadas. Um valor menor que zero, o servidor ir\u00c3\u00a1 esperar de maneira indefinida at\u00c3\u00a9 que todas as requisi\u00c3\u00a7\u00c3\u00b5es sejam finalizadas.
systemPropertiesDescription=Os valores das propriedades do sistema podem ser definidos em v\u00E1rios lugares\: domain.xml, host.xml e standalone.xml. Os valores em standalone.xml s\u00E3o definidos como parte do processo de inicializa\u00E7\u00E3o do servidor. Os valores em domain.xml e host.xml s\u00E3o aplicados aos servidores quando eles s\u00E3o inciados.
transportSettings=Defini\u00E7\u00F5es de Transporte
unableToAddDeployment=N\u00E3o \u00E9 poss\u00EDvel adicionar a implanta\u00E7\u00E3o.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,7 @@ subys_web_metric_desc=\u7528\u4E8E Web \u5B50\u7CFB\u7EDF\u7684\u5EA6\u91CF\u300
successfullyRefreshedStatistics=\u6210\u529F\u5730\u5237\u65B0\u4E86\u7EDF\u8BA1\u3002
suspend=\u6682\u505C
suspendTimeoutDescription=\u8D85\u65F6\u65F6\u95F4\uFF08\u79D2\uFF09\u3002\u5982\u679C\u4E3A 0\uFF0C\u64CD\u4F5C\u5C06\u7ACB\u5373\u8FD4\u56DE\uFF1B-1 \u8868\u793A\u5C06\u65E0\u9650\u671F\u7B49\u5F85\u3002\u8BF7\u6CE8\u610F\uFF0C\u5982\u679C\u8D85\u8FC7\u8D85\u65F6\u65F6\u95F4\uFF0C\u64CD\u4F5C\u5C06\u4E0D\u4F1A\u56DE\u6EDA\uFF0C\u5B83\u53EA\u8868\u793A\u5728\u6307\u5B9A\u7684\u65F6\u95F4\u5185\u6CA1\u6709\u5B8C\u6210\u6240\u6709\u7684\u8BF7\u6C42\u3002
stopTimeoutDescription=Timeout in seconds. If this is set a graceful shutdown will be attempted. If this is zero (the default) then the server will shutdown immediately. A value larger than zero means the server will wait up to this many seconds for all active requests to finish. A value smaller than zero means that the server will wait indefinitely for all active requests to finish.
systemPropertiesDescription=\u7CFB\u7EDF\u5C5E\u6027\u53EF\u4EE5\u5728 domain.xml, host.xml \u548C standalone.xml \u7684\u5F88\u591A\u5730\u65B9\u8FDB\u884C\u8BBE\u7F6E\u3002standalone.xml \u91CC\u7684\u503C\u662F\u4F5C\u4E3A\u670D\u52A1\u5668\u5F15\u5BFC\u8FC7\u7A0B\u7684\u4E00\u90E8\u5206\u6765\u8BBE\u7F6E\u7684\u3002\u800C domain.xml \u548C host.xml \u91CC\u7684\u503C\u5219\u5728\u542F\u52A8\u65F6\u5E94\u7528\u4E8E\u670D\u52A1\u5668\u3002
transportSettings=\u4F20\u8F93\u8BBE\u7F6E
unableToAddDeployment=\u65E0\u6CD5\u6DFB\u52A0\u90E8\u7F72\u3002
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
package org.jboss.as.console.client.domain;

import java.util.HashMap;
import java.util.Map;

import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.Widget;
import org.jboss.as.console.client.Console;
import org.jboss.as.console.client.domain.model.Server;
import org.jboss.as.console.client.domain.model.impl.LifecycleOperation;
import org.jboss.as.console.client.domain.runtime.DomainRuntimePresenter;
import org.jboss.as.console.client.widgets.ContentDescription;
import org.jboss.ballroom.client.widgets.forms.Form;
import org.jboss.ballroom.client.widgets.forms.FormValidation;
import org.jboss.ballroom.client.widgets.forms.NumberBoxItem;
import org.jboss.ballroom.client.widgets.window.DialogueOptions;
import org.jboss.ballroom.client.widgets.window.WindowContentBuilder;

/**
* @author Claudio Miranda
*/
public class ServerStopDialogue {

private DomainRuntimePresenter presenter;
private final Server server;

public ServerStopDialogue(final DomainRuntimePresenter presenter, final Server server) {
this.presenter = presenter;
this.server = server;
}

public Widget asWidget() {
VerticalPanel layout = new VerticalPanel();
layout.setStyleName("window-content");

NumberBoxItem timeout = new NumberBoxItem("timeout", "Timeout", true);
timeout.setValue(0);
final Form<Void> form = new Form<Void>(Void.class);
form.setFields(timeout);

DialogueOptions options = new DialogueOptions(
"Stop Server",
new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
FormValidation validation = form.validate();
if (validation.hasErrors())
return;

Map<String, Object> params = new HashMap<>();
params.put("timeout", timeout.getValue());
presenter.onServerInstanceLifecycle(server.getHostName(), server.getName(), params, LifecycleOperation.STOP);
}
},

"Cancel",
new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
presenter.closeDialoge();
}
}
);

// ----------------------------------------

Widget formWidget = form.asWidget();

layout.add(new HTML("<h3> Stop server " + server.getName() + " ?</h3>"));
layout.add(new ContentDescription(Console.CONSTANTS.stopTimeoutDescription()));
layout.add(formWidget);
return new WindowContentBuilder(layout, options).build();
}

}
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
package org.jboss.as.console.client.domain.runtime;

import com.google.gwt.core.client.GWT;
import java.util.Collections;
import java.util.List;
import java.util.Map;

import com.google.gwt.core.client.Scheduler;
import com.google.gwt.event.shared.GwtEvent;
import com.google.gwt.safehtml.shared.SafeHtml;
Expand All @@ -19,12 +22,11 @@
import com.gwtplatform.mvp.client.proxy.RevealContentEvent;
import com.gwtplatform.mvp.client.proxy.RevealContentHandler;
import com.gwtplatform.mvp.shared.proxy.PlaceRequest;

import org.jboss.as.console.client.Console;
import org.jboss.as.console.client.core.Footer;
import org.jboss.as.console.client.core.Header;
import org.jboss.as.console.client.core.NameTokens;
import org.jboss.as.console.client.core.UIConstants;
import org.jboss.as.console.client.domain.ServerStopDialogue;
import org.jboss.as.console.client.domain.ServerSuspendDialogue;
import org.jboss.as.console.client.domain.hosts.CopyServerWizard;
import org.jboss.as.console.client.domain.hosts.HostMgmtPresenter;
Expand Down Expand Up @@ -76,10 +78,6 @@
import org.jboss.gwt.flow.client.Outcome;
import org.jboss.gwt.flow.client.PushFlowCallback;

import java.util.Collections;
import java.util.List;
import java.util.Map;

import static org.jboss.dmr.client.ModelDescriptionConstants.*;

/**
Expand Down Expand Up @@ -345,6 +343,16 @@ public void onLaunchSuspendDialogue(Server server) {

}

public void onLaunchStopDialogue(Server server) {
window = new DefaultWindow("Stop Server");
window.setWidth(480);
window.setHeight(360);
window.trapWidget(new ServerStopDialogue(this, server).asWidget());
window.setGlassEnabled(true);
window.center();

}

public void onServerInstanceLifecycle(final String host, final String server, final LifecycleOperation op) {
onServerInstanceLifecycle(host, server, Collections.EMPTY_MAP, op);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
package org.jboss.as.console.client.domain.runtime;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import javax.inject.Inject;

import com.allen_sauer.gwt.log.client.Log;
import com.google.gwt.core.client.GWT;
import com.google.gwt.core.client.Scheduler;
Expand All @@ -20,6 +25,7 @@
import org.jboss.as.console.client.Console;
import org.jboss.as.console.client.core.NameTokens;
import org.jboss.as.console.client.core.SuspendableViewImpl;
import org.jboss.as.console.client.domain.model.RuntimeState;
import org.jboss.as.console.client.domain.model.Server;
import org.jboss.as.console.client.domain.model.SrvState;
import org.jboss.as.console.client.domain.model.SuspendState;
Expand All @@ -41,11 +47,6 @@
import org.jboss.ballroom.client.widgets.window.Feedback;
import org.jboss.dmr.client.dispatch.DispatchAsync;

import javax.inject.Inject;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

/**
* @author Heiko Braun
*/
Expand Down Expand Up @@ -374,19 +375,26 @@ public void executeOn(Server server) {
@Override
public void executeOn(Server server) {

LifecycleOperation op = server.isStarted() ? LifecycleOperation.STOP : LifecycleOperation.START;
Feedback.confirm(
"Server " + op.name(),
"Do you really want to " + op.name() + " server " + server.getName() + "?",
new Feedback.ConfirmationHandler() {
LifecycleOperation op = server.getRuntimeState() == RuntimeState.STOPPED ?
LifecycleOperation.START : LifecycleOperation.STOP;

@Override
public void onConfirmation(boolean isConfirmed) {
if (isConfirmed)
presenter.onServerInstanceLifecycle(server.getHostName(), server.getName(), op);
}
});
if (LifecycleOperation.START == op) {
Feedback.confirm(
"Server " + op.name(),
"Do you really want to " + op.name() + " server " + server.getName() + "?",
new Feedback.ConfirmationHandler() {

@Override
public void onConfirmation(boolean isConfirmed) {
if (isConfirmed)
presenter.onServerInstanceLifecycle(server.getHostName(), server.getName(), op);
}
});


} else {
presenter.onLaunchStopDialogue(server);
}
}

}, MenuDelegate.Role.Operation) {
Expand Down

0 comments on commit 742907b

Please sign in to comment.