diff --git a/mod_cluster/undertow/src/main/java/org/wildfly/mod_cluster/undertow/UndertowEventHandlerAdapterService.java b/mod_cluster/undertow/src/main/java/org/wildfly/mod_cluster/undertow/UndertowEventHandlerAdapterService.java
index d016df2d7ae1..be7061442af9 100644
--- a/mod_cluster/undertow/src/main/java/org/wildfly/mod_cluster/undertow/UndertowEventHandlerAdapterService.java
+++ b/mod_cluster/undertow/src/main/java/org/wildfly/mod_cluster/undertow/UndertowEventHandlerAdapterService.java
@@ -84,7 +84,7 @@ public void start(StartContext context) {
eventHandler.start(this.server);
for (Engine engine : this.server.getEngines()) {
for (org.jboss.modcluster.container.Host host : engine.getHosts()) {
- host.getContexts().forEach(c->contexts.add(c));
+ host.getContexts().forEach(contexts::add);
}
}
@@ -120,13 +120,15 @@ private Context createContext(String contextPath, Host host) {
private synchronized void onStart(Context context) {
ContainerEventHandler handler = this.configuration.getContainerEventHandler();
- handler.add(context);
-
State state = this.configuration.getSuspendController().getState();
- // TODO break into onDeploymentAdd once implemented in Undertow
- if(state == State.RUNNING) {
+ if (state == State.RUNNING) {
+ // Normal operation - trigger ENABLE-APP
handler.start(context);
+ } else {
+ // Suspended mode - trigger STOP-APP without request nor session draining;
+ // n.b. contexts will be started by UndertowEventHandlerAdapterService#resume()
+ handler.add(context);
}
this.contexts.add(context);
@@ -134,10 +136,13 @@ private synchronized void onStart(Context context) {
private synchronized void onStop(Context context) {
ContainerEventHandler handler = this.configuration.getContainerEventHandler();
+
+ // Trigger STOP-APP with possible session draining
handler.stop(context);
- // TODO break into onDeploymentRemove once implemented in Undertow
+ // Trigger REMOVE-APP
handler.remove(context);
+
this.contexts.remove(context);
}
diff --git a/pom.xml b/pom.xml
index 389f67bdfb67..fbf558feae62 100644
--- a/pom.xml
+++ b/pom.xml
@@ -523,7 +523,7 @@
3.0.4.Final
8.0.0.Final
16.0.0.Final
- 2.0.2.Final
+ 2.0.3.Final
7.0.0.Final
9.0.2.Final
6.2.5.Final