From 67bd321bfcf62a32deb658fd7619245e774606fa Mon Sep 17 00:00:00 2001
From: Joakim Erdfelt
Date: Thu, 30 Apr 2020 14:51:42 -0500
Subject: [PATCH 01/77] Issue #4830 - Enabling JMX on jetty-slf4j-impl
Signed-off-by: Joakim Erdfelt
---
.../src/main/java/module-info.java | 2 +
.../eclipse/jetty/logging/JettyLogger.java | 38 +-------
.../logging/JettyLoggerConfiguration.java | 74 +++------------
.../jetty/logging/JettyLoggerFactory.java | 77 ++++++++++++++--
.../logging/JettyLoggerFactoryMBean.java | 31 +++++++
.../jetty/logging/JettyLoggingJmx.java | 50 +++++++++++
.../logging/JettyLoggingServiceProvider.java | 2 +
.../org/eclipse/jetty/logging/LevelUtils.java | 90 +++++++++++++++++++
.../jetty/logging/JettyLoggerTest.java | 2 +-
.../eclipse/jetty/logging/JmxExperiment.java | 46 ++++++++++
10 files changed, 305 insertions(+), 107 deletions(-)
create mode 100644 jetty-slf4j-impl/src/main/java/org/eclipse/jetty/logging/JettyLoggerFactoryMBean.java
create mode 100644 jetty-slf4j-impl/src/main/java/org/eclipse/jetty/logging/JettyLoggingJmx.java
create mode 100644 jetty-slf4j-impl/src/main/java/org/eclipse/jetty/logging/LevelUtils.java
create mode 100644 jetty-slf4j-impl/src/test/java/org/eclipse/jetty/logging/JmxExperiment.java
diff --git a/jetty-slf4j-impl/src/main/java/module-info.java b/jetty-slf4j-impl/src/main/java/module-info.java
index 0bfb99cd437..3cfbbf20391 100644
--- a/jetty-slf4j-impl/src/main/java/module-info.java
+++ b/jetty-slf4j-impl/src/main/java/module-info.java
@@ -25,5 +25,7 @@ module org.eclipse.jetty.logging
requires transitive org.slf4j;
+ requires static java.management;
+
provides SLF4JServiceProvider with JettyLoggingServiceProvider;
}
diff --git a/jetty-slf4j-impl/src/main/java/org/eclipse/jetty/logging/JettyLogger.java b/jetty-slf4j-impl/src/main/java/org/eclipse/jetty/logging/JettyLogger.java
index 90e1a639b5b..54ab43069e8 100644
--- a/jetty-slf4j-impl/src/main/java/org/eclipse/jetty/logging/JettyLogger.java
+++ b/jetty-slf4j-impl/src/main/java/org/eclipse/jetty/logging/JettyLogger.java
@@ -247,7 +247,7 @@ public class JettyLogger implements LocationAwareLogger, Logger
{
long timestamp = System.currentTimeMillis();
String threadName = Thread.currentThread().getName();
- getAppender().emit(this, intToLevel(levelInt), timestamp, threadName, throwable, message, argArray);
+ getAppender().emit(this, LevelUtils.intToLevel(levelInt), timestamp, threadName, throwable, message, argArray);
}
}
@@ -636,43 +636,9 @@ public class JettyLogger implements LocationAwareLogger, Logger
getAppender().emit(this, level, timestamp, threadName, throwable, msg);
}
- public static Level intToLevel(int level)
- {
- if (level >= JettyLogger.OFF)
- return Level.ERROR;
- if (level >= Level.ERROR.toInt())
- return Level.ERROR;
- if (level >= Level.WARN.toInt())
- return Level.WARN;
- if (level >= Level.INFO.toInt())
- return Level.INFO;
- if (level >= Level.DEBUG.toInt())
- return Level.DEBUG;
- if (level >= Level.TRACE.toInt())
- return Level.TRACE;
- return Level.TRACE; // everything else
- }
-
- public static String levelToString(int level)
- {
- if (level >= JettyLogger.OFF)
- return "OFF";
- if (level >= Level.ERROR.toInt())
- return "ERROR";
- if (level >= Level.WARN.toInt())
- return "WARN";
- if (level >= Level.INFO.toInt())
- return "INFO";
- if (level >= Level.DEBUG.toInt())
- return "DEBUG";
- if (level >= Level.TRACE.toInt())
- return "TRACE";
- return "OFF"; // everything else
- }
-
@Override
public String toString()
{
- return String.format("%s:%s:LEVEL=%s", JettyLogger.class.getSimpleName(), name, levelToString(level));
+ return String.format("%s:%s:LEVEL=%s", JettyLogger.class.getSimpleName(), name, LevelUtils.levelToString(level));
}
}
diff --git a/jetty-slf4j-impl/src/main/java/org/eclipse/jetty/logging/JettyLoggerConfiguration.java b/jetty-slf4j-impl/src/main/java/org/eclipse/jetty/logging/JettyLoggerConfiguration.java
index 2864430fee2..547e54e82f3 100644
--- a/jetty-slf4j-impl/src/main/java/org/eclipse/jetty/logging/JettyLoggerConfiguration.java
+++ b/jetty-slf4j-impl/src/main/java/org/eclipse/jetty/logging/JettyLoggerConfiguration.java
@@ -26,7 +26,6 @@ import java.security.PrivilegedAction;
import java.util.Locale;
import java.util.Properties;
import java.util.TimeZone;
-import java.util.function.Function;
import org.slf4j.event.Level;
@@ -82,7 +81,7 @@ public class JettyLoggerConfiguration
startName = startName.substring(0, startName.length() - SUFFIX_STACKS.length());
}
- Boolean hideStacks = walkParentLoggerNames(startName, (key) ->
+ Boolean hideStacks = JettyLoggerFactory.walkParentLoggerNames(startName, (key) ->
{
String stacksBool = properties.getProperty(key + SUFFIX_STACKS);
if (stacksBool != null)
@@ -124,12 +123,12 @@ public class JettyLoggerConfiguration
startName = startName.substring(0, startName.length() - SUFFIX_LEVEL.length());
}
- Integer level = walkParentLoggerNames(startName, (key) ->
+ Integer level = JettyLoggerFactory.walkParentLoggerNames(startName, (key) ->
{
- String levelStr = properties.getProperty(key + SUFFIX_LEVEL);
- if (levelStr != null)
+ String levelStr1 = properties.getProperty(key + SUFFIX_LEVEL);
+ if (levelStr1 != null)
{
- return getLevelInt(key, levelStr);
+ return LevelUtils.getLevelInt(key, levelStr1);
}
return null;
});
@@ -140,7 +139,7 @@ public class JettyLoggerConfiguration
String levelStr = properties.getProperty("log" + SUFFIX_LEVEL);
if (levelStr != null)
{
- level = getLevelInt("log", levelStr);
+ level = LevelUtils.getLevelInt("log", levelStr);
}
}
@@ -193,6 +192,11 @@ public class JettyLoggerConfiguration
});
}
+ public String getString(String key, String defValue)
+ {
+ return properties.getProperty(key, defValue);
+ }
+
public boolean getBoolean(String key, boolean defValue)
{
String val = properties.getProperty(key, Boolean.toString(defValue));
@@ -216,36 +220,6 @@ public class JettyLoggerConfiguration
}
}
- private Integer getLevelInt(String levelSegment, String levelStr)
- {
- if (levelStr == null)
- {
- return null;
- }
-
- String levelName = levelStr.trim().toUpperCase(Locale.ENGLISH);
- switch (levelName)
- {
- case "ALL":
- return JettyLogger.ALL;
- case "TRACE":
- return Level.TRACE.toInt();
- case "DEBUG":
- return Level.DEBUG.toInt();
- case "INFO":
- return Level.INFO.toInt();
- case "WARN":
- return Level.WARN.toInt();
- case "ERROR":
- return Level.ERROR.toInt();
- case "OFF":
- return JettyLogger.OFF;
- default:
- System.err.println("Unknown JettyLogger/Slf4J Level [" + levelSegment + "]=[" + levelName + "], expecting only [ALL, TRACE, DEBUG, INFO, WARN, ERROR, OFF] as values.");
- return null;
- }
- }
-
private URL getResource(ClassLoader loader, String resourceName)
{
if (loader == null)
@@ -303,30 +277,4 @@ public class JettyLoggerConfiguration
}
return null;
}
-
- private T walkParentLoggerNames(String startName, Function nameFunction)
- {
- String nameSegment = startName;
-
- // Checking with FQCN first, then each package segment from longest to shortest.
- while ((nameSegment != null) && (nameSegment.length() > 0))
- {
- T ret = nameFunction.apply(nameSegment);
- if (ret != null)
- return ret;
-
- // Trim and try again.
- int idx = nameSegment.lastIndexOf('.');
- if (idx >= 0)
- {
- nameSegment = nameSegment.substring(0, idx);
- }
- else
- {
- nameSegment = null;
- }
- }
-
- return null;
- }
}
diff --git a/jetty-slf4j-impl/src/main/java/org/eclipse/jetty/logging/JettyLoggerFactory.java b/jetty-slf4j-impl/src/main/java/org/eclipse/jetty/logging/JettyLoggerFactory.java
index 83d39cf71c1..f607ada4790 100644
--- a/jetty-slf4j-impl/src/main/java/org/eclipse/jetty/logging/JettyLoggerFactory.java
+++ b/jetty-slf4j-impl/src/main/java/org/eclipse/jetty/logging/JettyLoggerFactory.java
@@ -22,16 +22,16 @@ import java.util.Objects;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import java.util.function.Consumer;
+import java.util.function.Function;
import org.slf4j.ILoggerFactory;
import org.slf4j.Logger;
-public class JettyLoggerFactory implements ILoggerFactory
+public class JettyLoggerFactory implements ILoggerFactory, JettyLoggerFactoryMBean
{
- private static final String ROOT_LOGGER_NAME = "";
private final JettyLoggerConfiguration configuration;
private final JettyLogger rootLogger;
- private ConcurrentMap loggerMap;
+ private final ConcurrentMap loggerMap;
public JettyLoggerFactory(JettyLoggerConfiguration config)
{
@@ -41,9 +41,9 @@ public class JettyLoggerFactory implements ILoggerFactory
StdErrAppender appender = new StdErrAppender(configuration);
- rootLogger = new JettyLogger(this, ROOT_LOGGER_NAME, appender);
- loggerMap.put(ROOT_LOGGER_NAME, rootLogger);
- rootLogger.setLevel(configuration.getLevel(ROOT_LOGGER_NAME));
+ rootLogger = new JettyLogger(this, Logger.ROOT_LOGGER_NAME, appender);
+ loggerMap.put(Logger.ROOT_LOGGER_NAME, rootLogger);
+ rootLogger.setLevel(configuration.getLevel(Logger.ROOT_LOGGER_NAME));
}
/**
@@ -54,7 +54,7 @@ public class JettyLoggerFactory implements ILoggerFactory
*/
public JettyLogger getJettyLogger(String name)
{
- if (name.equals(ROOT_LOGGER_NAME))
+ if (name.equals(Logger.ROOT_LOGGER_NAME))
{
return getRootLogger();
}
@@ -179,4 +179,67 @@ public class JettyLoggerFactory implements ILoggerFactory
return dense.toString();
}
+
+ public static T walkParentLoggerNames(String startName, Function nameFunction)
+ {
+ String nameSegment = startName;
+
+ // Checking with FQCN first, then each package segment from longest to shortest.
+ while ((nameSegment != null) && (nameSegment.length() > 0))
+ {
+ T ret = nameFunction.apply(nameSegment);
+ if (ret != null)
+ return ret;
+
+ // Trim and try again.
+ int idx = nameSegment.lastIndexOf('.');
+ if (idx >= 0)
+ {
+ nameSegment = nameSegment.substring(0, idx);
+ }
+ else
+ {
+ nameSegment = null;
+ }
+ }
+
+ return null;
+ }
+
+ @Override
+ public String[] getLoggerNames()
+ {
+ return loggerMap.keySet().toArray(new String[0]);
+ }
+
+ @Override
+ public int getLoggerCount()
+ {
+ return loggerMap.size();
+ }
+
+ @Override
+ public String getLoggerLevel(String loggerName)
+ {
+ return walkParentLoggerNames(loggerName, (key) ->
+ {
+ JettyLogger logger = loggerMap.get(key);
+ if (key != null)
+ {
+ return LevelUtils.levelToString(logger.getLevel());
+ }
+ return null;
+ });
+ }
+
+ @Override
+ public void setLoggerLevel(String loggerName, String levelName)
+ {
+ Integer levelInt = LevelUtils.getLevelInt(loggerName, levelName);
+ if (levelInt != null)
+ {
+ JettyLogger jettyLogger = getJettyLogger(loggerName);
+ jettyLogger.setLevel(levelInt);
+ }
+ }
}
diff --git a/jetty-slf4j-impl/src/main/java/org/eclipse/jetty/logging/JettyLoggerFactoryMBean.java b/jetty-slf4j-impl/src/main/java/org/eclipse/jetty/logging/JettyLoggerFactoryMBean.java
new file mode 100644
index 00000000000..59c2da9f0a2
--- /dev/null
+++ b/jetty-slf4j-impl/src/main/java/org/eclipse/jetty/logging/JettyLoggerFactoryMBean.java
@@ -0,0 +1,31 @@
+//
+// ========================================================================
+// Copyright (c) 1995-2020 Mort Bay Consulting Pty Ltd and others.
+//
+// This program and the accompanying materials are made available under
+// the terms of the Eclipse Public License 2.0 which is available at
+// https://www.eclipse.org/legal/epl-2.0
+//
+// This Source Code may also be made available under the following
+// Secondary Licenses when the conditions for such availability set
+// forth in the Eclipse Public License, v. 2.0 are satisfied:
+// the Apache License v2.0 which is available at
+// https://www.apache.org/licenses/LICENSE-2.0
+//
+// SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
+// ========================================================================
+//
+
+package org.eclipse.jetty.logging;
+
+@SuppressWarnings("unused")
+public interface JettyLoggerFactoryMBean
+{
+ int getLoggerCount();
+
+ String[] getLoggerNames();
+
+ void setLoggerLevel(String loggerName, String levelName);
+
+ String getLoggerLevel(String loggerName);
+}
diff --git a/jetty-slf4j-impl/src/main/java/org/eclipse/jetty/logging/JettyLoggingJmx.java b/jetty-slf4j-impl/src/main/java/org/eclipse/jetty/logging/JettyLoggingJmx.java
new file mode 100644
index 00000000000..f7aeac3a80e
--- /dev/null
+++ b/jetty-slf4j-impl/src/main/java/org/eclipse/jetty/logging/JettyLoggingJmx.java
@@ -0,0 +1,50 @@
+//
+// ========================================================================
+// Copyright (c) 1995-2020 Mort Bay Consulting Pty Ltd and others.
+//
+// This program and the accompanying materials are made available under
+// the terms of the Eclipse Public License 2.0 which is available at
+// https://www.eclipse.org/legal/epl-2.0
+//
+// This Source Code may also be made available under the following
+// Secondary Licenses when the conditions for such availability set
+// forth in the Eclipse Public License, v. 2.0 are satisfied:
+// the Apache License v2.0 which is available at
+// https://www.apache.org/licenses/LICENSE-2.0
+//
+// SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
+// ========================================================================
+//
+
+package org.eclipse.jetty.logging;
+
+import java.lang.management.ManagementFactory;
+import javax.management.MBeanServer;
+import javax.management.ObjectName;
+
+public class JettyLoggingJmx
+{
+ public static void initialize(JettyLoggerConfiguration config, JettyLoggerFactory loggerFactory)
+ {
+ if (!config.getBoolean("org.eclipse.jetty.logging.jmx", false))
+ {
+ loggerFactory.getJettyLogger(JettyLoggingJmx.class.getName()).debug("JMX not enabled");
+ return;
+ }
+
+ try
+ {
+ MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
+ String contextName = config.getString("org.eclipse.jetty.logging.jmx.contextName", "default");
+
+ ObjectName objName = new ObjectName(JettyLoggerFactory.class.getName() + ":name=" + contextName);
+ mbs.registerMBean(loggerFactory, objName);
+ }
+ catch (Throwable cause)
+ {
+ JettyLogger logger = loggerFactory.getJettyLogger(JettyLoggingJmx.class.getName());
+ logger.warn("java.management not available.");
+ logger.debug("java.management is not available", cause);
+ }
+ }
+}
diff --git a/jetty-slf4j-impl/src/main/java/org/eclipse/jetty/logging/JettyLoggingServiceProvider.java b/jetty-slf4j-impl/src/main/java/org/eclipse/jetty/logging/JettyLoggingServiceProvider.java
index 01ad473162a..61e7ec47f40 100644
--- a/jetty-slf4j-impl/src/main/java/org/eclipse/jetty/logging/JettyLoggingServiceProvider.java
+++ b/jetty-slf4j-impl/src/main/java/org/eclipse/jetty/logging/JettyLoggingServiceProvider.java
@@ -45,6 +45,8 @@ public class JettyLoggingServiceProvider implements SLF4JServiceProvider
loggerFactory = new JettyLoggerFactory(config);
markerFactory = new BasicMarkerFactory();
mdcAdapter = new NOPMDCAdapter(); // TODO: Provide Jetty Implementation?
+
+ JettyLoggingJmx.initialize(config, loggerFactory);
}
public JettyLoggerFactory getJettyLoggerFactory()
diff --git a/jetty-slf4j-impl/src/main/java/org/eclipse/jetty/logging/LevelUtils.java b/jetty-slf4j-impl/src/main/java/org/eclipse/jetty/logging/LevelUtils.java
new file mode 100644
index 00000000000..e78abf4817b
--- /dev/null
+++ b/jetty-slf4j-impl/src/main/java/org/eclipse/jetty/logging/LevelUtils.java
@@ -0,0 +1,90 @@
+//
+// ========================================================================
+// Copyright (c) 1995-2020 Mort Bay Consulting Pty Ltd and others.
+//
+// This program and the accompanying materials are made available under
+// the terms of the Eclipse Public License 2.0 which is available at
+// https://www.eclipse.org/legal/epl-2.0
+//
+// This Source Code may also be made available under the following
+// Secondary Licenses when the conditions for such availability set
+// forth in the Eclipse Public License, v. 2.0 are satisfied:
+// the Apache License v2.0 which is available at
+// https://www.apache.org/licenses/LICENSE-2.0
+//
+// SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
+// ========================================================================
+//
+
+package org.eclipse.jetty.logging;
+
+import java.util.Locale;
+
+import org.slf4j.event.Level;
+
+public class LevelUtils
+{
+ public static Integer getLevelInt(String loggerName, String levelStr)
+ {
+ if (levelStr == null)
+ {
+ return null;
+ }
+
+ String levelName = levelStr.trim().toUpperCase(Locale.ENGLISH);
+ switch (levelName)
+ {
+ case "ALL":
+ return JettyLogger.ALL;
+ case "TRACE":
+ return Level.TRACE.toInt();
+ case "DEBUG":
+ return Level.DEBUG.toInt();
+ case "INFO":
+ return Level.INFO.toInt();
+ case "WARN":
+ return Level.WARN.toInt();
+ case "ERROR":
+ return Level.ERROR.toInt();
+ case "OFF":
+ return JettyLogger.OFF;
+ default:
+ System.err.println("Unknown JettyLogger/Slf4J Level [" + loggerName + "]=[" + levelName + "], expecting only [ALL, TRACE, DEBUG, INFO, WARN, ERROR, OFF] as values.");
+ return null;
+ }
+ }
+
+ public static Level intToLevel(int level)
+ {
+ if (level >= JettyLogger.OFF)
+ return Level.ERROR;
+ if (level >= Level.ERROR.toInt())
+ return Level.ERROR;
+ if (level >= Level.WARN.toInt())
+ return Level.WARN;
+ if (level >= Level.INFO.toInt())
+ return Level.INFO;
+ if (level >= Level.DEBUG.toInt())
+ return Level.DEBUG;
+ if (level >= Level.TRACE.toInt())
+ return Level.TRACE;
+ return Level.TRACE; // everything else
+ }
+
+ public static String levelToString(int level)
+ {
+ if (level >= JettyLogger.OFF)
+ return "OFF";
+ if (level >= Level.ERROR.toInt())
+ return "ERROR";
+ if (level >= Level.WARN.toInt())
+ return "WARN";
+ if (level >= Level.INFO.toInt())
+ return "INFO";
+ if (level >= Level.DEBUG.toInt())
+ return "DEBUG";
+ if (level >= Level.TRACE.toInt())
+ return "TRACE";
+ return "OFF"; // everything else
+ }
+}
diff --git a/jetty-slf4j-impl/src/test/java/org/eclipse/jetty/logging/JettyLoggerTest.java b/jetty-slf4j-impl/src/test/java/org/eclipse/jetty/logging/JettyLoggerTest.java
index 86b6fd6db8d..58b0c660573 100644
--- a/jetty-slf4j-impl/src/test/java/org/eclipse/jetty/logging/JettyLoggerTest.java
+++ b/jetty-slf4j-impl/src/test/java/org/eclipse/jetty/logging/JettyLoggerTest.java
@@ -609,6 +609,6 @@ public class JettyLoggerTest
private void assertLevel(JettyLogger log, Level expectedLevel)
{
assertThat("Log[" + log.getName() + "].level",
- JettyLogger.levelToString(log.getLevel()), is(expectedLevel.toString()));
+ LevelUtils.levelToString(log.getLevel()), is(expectedLevel.toString()));
}
}
diff --git a/jetty-slf4j-impl/src/test/java/org/eclipse/jetty/logging/JmxExperiment.java b/jetty-slf4j-impl/src/test/java/org/eclipse/jetty/logging/JmxExperiment.java
new file mode 100644
index 00000000000..26e12297d23
--- /dev/null
+++ b/jetty-slf4j-impl/src/test/java/org/eclipse/jetty/logging/JmxExperiment.java
@@ -0,0 +1,46 @@
+//
+// ========================================================================
+// Copyright (c) 1995-2020 Mort Bay Consulting Pty Ltd and others.
+//
+// This program and the accompanying materials are made available under
+// the terms of the Eclipse Public License 2.0 which is available at
+// https://www.eclipse.org/legal/epl-2.0
+//
+// This Source Code may also be made available under the following
+// Secondary Licenses when the conditions for such availability set
+// forth in the Eclipse Public License, v. 2.0 are satisfied:
+// the Apache License v2.0 which is available at
+// https://www.apache.org/licenses/LICENSE-2.0
+//
+// SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
+// ========================================================================
+//
+
+package org.eclipse.jetty.logging;
+
+import java.util.Properties;
+
+public class JmxExperiment
+{
+ public static void main(String[] args)
+ {
+ try
+ {
+ Properties props = new Properties();
+ props.setProperty("org.eclipse.jetty.logging.jmx", "true");
+ props.setProperty("org.eclipse.jetty.logging.jmx.contextName", "Main");
+ props.setProperty("org.eclipse.jetty.logging.LEVEL", "DEBUG");
+ JettyLoggerConfiguration config = new JettyLoggerConfiguration(props);
+ JettyLoggerFactory loggerFactory = new JettyLoggerFactory(config);
+
+ JettyLoggingJmx.initialize(config, loggerFactory);
+
+ loggerFactory.getJettyLogger(JmxExperiment.class.getName()).info("Waiting for key-press");
+ System.in.read();
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ }
+}
From c144358f421a774ab1f34fbae1a173ea453baa60 Mon Sep 17 00:00:00 2001
From: Joakim Erdfelt
Date: Fri, 1 May 2020 08:34:13 -0500
Subject: [PATCH 02/77] Issue #4830 - Adding jmx entries for logging-jetty
module
Signed-off-by: Joakim Erdfelt
---
.../modules/logging/jetty/resources/jetty-logging.properties | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/jetty-home/src/main/resources/modules/logging/jetty/resources/jetty-logging.properties b/jetty-home/src/main/resources/modules/logging/jetty/resources/jetty-logging.properties
index d0fdf6c5bd5..a9c6aeb60ab 100644
--- a/jetty-home/src/main/resources/modules/logging/jetty/resources/jetty-logging.properties
+++ b/jetty-home/src/main/resources/modules/logging/jetty/resources/jetty-logging.properties
@@ -4,5 +4,9 @@ org.eclipse.jetty.LEVEL=INFO
#com.example.LEVEL=INFO
## Configure a level for specific logger
#com.example.MyComponent.LEVEL=INFO
+## Enable JMX management of Jetty Logging
+# org.eclipse.jetty.logging.jmx=true
+## Configure JMX Context Name
+# org.eclipse.jetty.logging.jmx.contextName=JettyServer
## Hide stacks traces in an arbitrary logger tree
#com.example.STACKS=false
From d2399205ff7d7820c6757d0f9f4acec9bea79412 Mon Sep 17 00:00:00 2001
From: Simone Bordet
Date: Sun, 3 May 2020 10:06:41 +0200
Subject: [PATCH 03/77] Issue #4830 - Add JMX to new Jetty 10 jetty-slf4j-impl.
Alternative implementation that adds JMX support for jetty-slf4j-impl.
This version modifies MBeanContainer to be aware of @MXBean annotations and *MBean and *MXBean interfaces, so it does not require a dependency on jetty-jmx nor on java.management.
Signed-off-by: Simone Bordet
---
examples/embedded/pom.xml | 2 +-
.../eclipse/jetty/embedded/Http2Server.java | 3 +
.../jetty/resources/jetty-logging.properties | 4 +-
.../org/eclipse/jetty/jmx/MBeanContainer.java | 55 ++++++-
jetty-slf4j-impl/pom.xml | 31 +++-
.../src/main/java/module-info.java | 2 -
.../eclipse/jetty/logging/JettyLogger.java | 74 +++++++++-
.../logging/JettyLoggerConfiguration.java | 52 ++-----
.../jetty/logging/JettyLoggerFactory.java | 134 ++++--------------
.../logging/JettyLoggerFactoryMBean.java | 3 +-
.../jetty/logging/JettyLoggingJmx.java | 50 -------
.../logging/JettyLoggingServiceProvider.java | 2 -
.../org/eclipse/jetty/logging/LevelUtils.java | 73 +++-------
.../org/eclipse/jetty/logging/JMXTest.java | 74 ++++++++++
.../jetty/logging/JettyLoggerTest.java | 6 +-
.../eclipse/jetty/logging/JmxExperiment.java | 46 ------
16 files changed, 289 insertions(+), 322 deletions(-)
delete mode 100644 jetty-slf4j-impl/src/main/java/org/eclipse/jetty/logging/JettyLoggingJmx.java
create mode 100644 jetty-slf4j-impl/src/test/java/org/eclipse/jetty/logging/JMXTest.java
delete mode 100644 jetty-slf4j-impl/src/test/java/org/eclipse/jetty/logging/JmxExperiment.java
diff --git a/examples/embedded/pom.xml b/examples/embedded/pom.xml
index 22bc490c200..558be37b6e6 100644
--- a/examples/embedded/pom.xml
+++ b/examples/embedded/pom.xml
@@ -22,7 +22,7 @@
org.eclipse.jettyjetty-slf4j-impl
- test
+ runtimeorg.eclipse.jetty
diff --git a/examples/embedded/src/main/java/org/eclipse/jetty/embedded/Http2Server.java b/examples/embedded/src/main/java/org/eclipse/jetty/embedded/Http2Server.java
index 22dfd38702a..c18551268d1 100644
--- a/examples/embedded/src/main/java/org/eclipse/jetty/embedded/Http2Server.java
+++ b/examples/embedded/src/main/java/org/eclipse/jetty/embedded/Http2Server.java
@@ -61,6 +61,7 @@ import org.eclipse.jetty.servlet.ServletHolder;
import org.eclipse.jetty.servlets.PushCacheFilter;
import org.eclipse.jetty.util.resource.PathResource;
import org.eclipse.jetty.util.ssl.SslContextFactory;
+import org.slf4j.LoggerFactory;
public class Http2Server
{
@@ -74,6 +75,8 @@ public class Http2Server
ManagementFactory.getPlatformMBeanServer());
server.addBean(mbContainer);
+ server.addBean(LoggerFactory.getILoggerFactory());
+
ServletContextHandler context = new ServletContextHandler(server, "/", ServletContextHandler.SESSIONS);
Path docroot = Paths.get("src/main/resources/docroot");
if (!Files.exists(docroot))
diff --git a/jetty-home/src/main/resources/modules/logging/jetty/resources/jetty-logging.properties b/jetty-home/src/main/resources/modules/logging/jetty/resources/jetty-logging.properties
index a9c6aeb60ab..fba91898dc4 100644
--- a/jetty-home/src/main/resources/modules/logging/jetty/resources/jetty-logging.properties
+++ b/jetty-home/src/main/resources/modules/logging/jetty/resources/jetty-logging.properties
@@ -4,9 +4,7 @@ org.eclipse.jetty.LEVEL=INFO
#com.example.LEVEL=INFO
## Configure a level for specific logger
#com.example.MyComponent.LEVEL=INFO
-## Enable JMX management of Jetty Logging
-# org.eclipse.jetty.logging.jmx=true
## Configure JMX Context Name
-# org.eclipse.jetty.logging.jmx.contextName=JettyServer
+# org.eclipse.jetty.logging.jmx.context=JettyServer
## Hide stacks traces in an arbitrary logger tree
#com.example.STACKS=false
diff --git a/jetty-jmx/src/main/java/org/eclipse/jetty/jmx/MBeanContainer.java b/jetty-jmx/src/main/java/org/eclipse/jetty/jmx/MBeanContainer.java
index f8db4c44bd2..b6ed4b2a90c 100644
--- a/jetty-jmx/src/main/java/org/eclipse/jetty/jmx/MBeanContainer.java
+++ b/jetty-jmx/src/main/java/org/eclipse/jetty/jmx/MBeanContainer.java
@@ -30,10 +30,12 @@ import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Collectors;
+import javax.management.DynamicMBean;
import javax.management.InstanceNotFoundException;
import javax.management.MBeanInfo;
import javax.management.MBeanRegistrationException;
import javax.management.MBeanServer;
+import javax.management.MXBean;
import javax.management.ObjectName;
import javax.management.modelmbean.ModelMBean;
@@ -60,7 +62,7 @@ public class MBeanContainer implements Container.InheritedListener, Dumpable, De
private final MBeanServer _mbeanServer;
private final boolean _useCacheForOtherClassLoaders;
- private final ConcurrentMap _metaData = new ConcurrentHashMap<>();
+ private final ConcurrentMap, MetaData> _metaData = new ConcurrentHashMap<>();
private final ConcurrentMaporg.eclipse.jetty.websocket
- websocket-core
+ websocket-core-common
+ 10.0.0-SNAPSHOT
+
+
+ org.eclipse.jetty.websocket
+ websocket-core-client
+ 10.0.0-SNAPSHOT
+
+
+ org.eclipse.jetty.websocket
+ websocket-core-server10.0.0-SNAPSHOT
diff --git a/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestOSGiUtil.java b/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestOSGiUtil.java
index 15aaaa512e5..961ff63ec53 100644
--- a/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestOSGiUtil.java
+++ b/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestOSGiUtil.java
@@ -19,21 +19,11 @@
package org.eclipse.jetty.osgi.test;
import java.io.File;
-import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import org.eclipse.jetty.client.HttpClient;
-import org.eclipse.jetty.client.api.ContentResponse;
-import org.eclipse.jetty.client.http.HttpClientTransportOverHTTP;
-import org.eclipse.jetty.http.HttpStatus;
-import org.eclipse.jetty.io.ClientConnector;
import org.eclipse.jetty.osgi.boot.OSGiServerConstants;
import org.eclipse.jetty.toolchain.test.FS;
import org.eclipse.jetty.util.StringUtil;
@@ -43,16 +33,12 @@ import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.options.WrappedUrlProvisionOption.OverwriteMode;
import org.ops4j.pax.tinybundles.core.TinyBundle;
import org.ops4j.pax.tinybundles.core.TinyBundles;
-import org.ops4j.pax.url.mvn.internal.AetherBasedResolver;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
import org.osgi.framework.Constants;
import org.osgi.framework.ServiceReference;
-import org.osgi.service.http.HttpService;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
@@ -195,7 +181,9 @@ public class TestOSGiUtil
res.add(mavenBundle().groupId("org.eclipse.jetty").artifactId("jetty-jndi").versionAsInProject().start());
res.add(mavenBundle().groupId("org.eclipse.jetty").artifactId("jetty-plus").versionAsInProject().start());
res.add(mavenBundle().groupId("org.eclipse.jetty").artifactId("jetty-annotations").versionAsInProject().start());
- res.add(mavenBundle().groupId("org.eclipse.jetty.websocket").artifactId("websocket-core").versionAsInProject().start());
+ res.add(mavenBundle().groupId("org.eclipse.jetty.websocket").artifactId("websocket-core-server").versionAsInProject().start());
+ res.add(mavenBundle().groupId("org.eclipse.jetty.websocket").artifactId("websocket-core-client").versionAsInProject().start());
+ res.add(mavenBundle().groupId("org.eclipse.jetty.websocket").artifactId("websocket-core-common").versionAsInProject().start());
res.add(mavenBundle().groupId("org.eclipse.jetty.websocket").artifactId("websocket-util").versionAsInProject().start());
res.add(mavenBundle().groupId("org.eclipse.jetty.websocket").artifactId("websocket-util-server").versionAsInProject().start());
res.add(mavenBundle().groupId("org.eclipse.jetty.websocket").artifactId("websocket-jetty-api").versionAsInProject().start());
diff --git a/jetty-websocket/pom.xml b/jetty-websocket/pom.xml
index 3d74b9c9e91..b30945be593 100644
--- a/jetty-websocket/pom.xml
+++ b/jetty-websocket/pom.xml
@@ -14,9 +14,11 @@
http://www.eclipse.org/jetty
- websocket-core
- websocket-util
- websocket-util-server
+
+ websocket-core-common
+ websocket-core-client
+ websocket-core-server
+ websocket-core-testswebsocket-jetty-apiwebsocket-jetty-common
@@ -28,6 +30,9 @@
websocket-javax-clientwebsocket-javax-serverwebsocket-javax-tests
+
+ websocket-util
+ websocket-util-server
diff --git a/jetty-websocket/websocket-core-client/pom.xml b/jetty-websocket/websocket-core-client/pom.xml
new file mode 100644
index 00000000000..5924b661527
--- /dev/null
+++ b/jetty-websocket/websocket-core-client/pom.xml
@@ -0,0 +1,82 @@
+
+
+
+ org.eclipse.jetty.websocket
+ websocket-parent
+ 10.0.0-SNAPSHOT
+
+
+ 4.0.0
+ websocket-core-client
+ Jetty :: Websocket :: Core :: Client
+
+
+ ${project.groupId}.core.client
+
+
+
+
+ org.eclipse.jetty.websocket
+ websocket-core-common
+ ${project.version}
+
+
+ org.eclipse.jetty
+ jetty-client
+ ${project.version}
+
+
+ org.eclipse.jetty
+ jetty-xml
+ ${project.version}
+ true
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-enforcer-plugin
+
+
+ ban-ws-apis
+
+ enforce
+
+
+
+
+
+ org.eclipse.jetty.websocket:websocket-jetty-api
+ javax.websocket
+
+
+
+
+
+
+ ban-java-servlet-api
+
+ enforce
+
+
+
+
+
+ javax.servlet
+ servletapi
+ org.eclipse.jetty.orbit:javax.servlet
+ org.mortbay.jetty:servlet-api
+ jetty:servlet-api
+ jetty-servlet-api
+
+
+
+
+
+
+
+
+
+
diff --git a/jetty-websocket/websocket-core/src/main/config/modules/websocket.mod b/jetty-websocket/websocket-core-client/src/main/config/modules/websocket.mod
similarity index 100%
rename from jetty-websocket/websocket-core/src/main/config/modules/websocket.mod
rename to jetty-websocket/websocket-core-client/src/main/config/modules/websocket.mod
diff --git a/jetty-websocket/websocket-core-client/src/main/java/module-info.java b/jetty-websocket/websocket-core-client/src/main/java/module-info.java
new file mode 100644
index 00000000000..0e8dbf89111
--- /dev/null
+++ b/jetty-websocket/websocket-core-client/src/main/java/module-info.java
@@ -0,0 +1,29 @@
+//
+// ========================================================================
+// Copyright (c) 1995-2020 Mort Bay Consulting Pty Ltd and others.
+//
+// This program and the accompanying materials are made available under
+// the terms of the Eclipse Public License 2.0 which is available at
+// https://www.eclipse.org/legal/epl-2.0
+//
+// This Source Code may also be made available under the following
+// Secondary Licenses when the conditions for such availability set
+// forth in the Eclipse Public License, v. 2.0 are satisfied:
+// the Apache License v2.0 which is available at
+// https://www.apache.org/licenses/LICENSE-2.0
+//
+// SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
+// ========================================================================
+//
+
+module org.eclipse.jetty.websocket.core.client
+{
+ exports org.eclipse.jetty.websocket.core.client;
+
+ requires org.slf4j;
+ requires transitive org.eclipse.jetty.client;
+ requires transitive org.eclipse.jetty.websocket.core.common;
+
+ // Only required if using XmlHttpClientProvider.
+ requires static org.eclipse.jetty.xml;
+}
diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/client/ClientUpgradeRequest.java b/jetty-websocket/websocket-core-client/src/main/java/org/eclipse/jetty/websocket/core/client/ClientUpgradeRequest.java
similarity index 98%
rename from jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/client/ClientUpgradeRequest.java
rename to jetty-websocket/websocket-core-client/src/main/java/org/eclipse/jetty/websocket/core/client/ClientUpgradeRequest.java
index fec8515b2f7..ab74b874ec1 100644
--- a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/client/ClientUpgradeRequest.java
+++ b/jetty-websocket/websocket-core-client/src/main/java/org/eclipse/jetty/websocket/core/client/ClientUpgradeRequest.java
@@ -80,8 +80,8 @@ public abstract class ClientUpgradeRequest extends HttpRequest implements Respon
protected final CompletableFuture futureCoreSession;
private final WebSocketCoreClient wsClient;
private FrameHandler frameHandler;
- private Configuration.ConfigurationCustomizer customizer = new Configuration.ConfigurationCustomizer();
- private List upgradeListeners = new ArrayList<>();
+ private final Configuration.ConfigurationCustomizer customizer = new Configuration.ConfigurationCustomizer();
+ private final List upgradeListeners = new ArrayList<>();
private List requestedExtensions = new ArrayList<>();
public ClientUpgradeRequest(WebSocketCoreClient webSocketClient, URI requestURI)
diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/client/HttpClientProvider.java b/jetty-websocket/websocket-core-client/src/main/java/org/eclipse/jetty/websocket/core/client/HttpClientProvider.java
similarity index 100%
rename from jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/client/HttpClientProvider.java
rename to jetty-websocket/websocket-core-client/src/main/java/org/eclipse/jetty/websocket/core/client/HttpClientProvider.java
diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/client/HttpUpgraderOverHTTP.java b/jetty-websocket/websocket-core-client/src/main/java/org/eclipse/jetty/websocket/core/client/HttpUpgraderOverHTTP.java
similarity index 100%
rename from jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/client/HttpUpgraderOverHTTP.java
rename to jetty-websocket/websocket-core-client/src/main/java/org/eclipse/jetty/websocket/core/client/HttpUpgraderOverHTTP.java
diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/client/HttpUpgraderOverHTTP2.java b/jetty-websocket/websocket-core-client/src/main/java/org/eclipse/jetty/websocket/core/client/HttpUpgraderOverHTTP2.java
similarity index 100%
rename from jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/client/HttpUpgraderOverHTTP2.java
rename to jetty-websocket/websocket-core-client/src/main/java/org/eclipse/jetty/websocket/core/client/HttpUpgraderOverHTTP2.java
diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/client/UpgradeListener.java b/jetty-websocket/websocket-core-client/src/main/java/org/eclipse/jetty/websocket/core/client/UpgradeListener.java
similarity index 100%
rename from jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/client/UpgradeListener.java
rename to jetty-websocket/websocket-core-client/src/main/java/org/eclipse/jetty/websocket/core/client/UpgradeListener.java
diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/client/WebSocketCoreClient.java b/jetty-websocket/websocket-core-client/src/main/java/org/eclipse/jetty/websocket/core/client/WebSocketCoreClient.java
similarity index 98%
rename from jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/client/WebSocketCoreClient.java
rename to jetty-websocket/websocket-core-client/src/main/java/org/eclipse/jetty/websocket/core/client/WebSocketCoreClient.java
index e4aa450d181..7795e5460c2 100644
--- a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/client/WebSocketCoreClient.java
+++ b/jetty-websocket/websocket-core-client/src/main/java/org/eclipse/jetty/websocket/core/client/WebSocketCoreClient.java
@@ -40,7 +40,7 @@ public class WebSocketCoreClient extends ContainerLifeCycle
private static final Logger LOG = LoggerFactory.getLogger(WebSocketCoreClient.class);
private final HttpClient httpClient;
- private WebSocketComponents components;
+ private final WebSocketComponents components;
// TODO: Things to consider for inclusion in this class (or removal if they can be set elsewhere, like HttpClient)
// - AsyncWrite Idle Timeout
diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/client/XmlHttpClientProvider.java b/jetty-websocket/websocket-core-client/src/main/java/org/eclipse/jetty/websocket/core/client/XmlHttpClientProvider.java
similarity index 100%
rename from jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/client/XmlHttpClientProvider.java
rename to jetty-websocket/websocket-core-client/src/main/java/org/eclipse/jetty/websocket/core/client/XmlHttpClientProvider.java
diff --git a/jetty-websocket/websocket-core-common/pom.xml b/jetty-websocket/websocket-core-common/pom.xml
new file mode 100644
index 00000000000..4290b2ffb5d
--- /dev/null
+++ b/jetty-websocket/websocket-core-common/pom.xml
@@ -0,0 +1,80 @@
+
+
+
+ org.eclipse.jetty.websocket
+ websocket-parent
+ 10.0.0-SNAPSHOT
+
+
+ 4.0.0
+ websocket-core-common
+ Jetty :: Websocket :: Core :: Common
+
+
+ ${project.groupId}.core.common
+
+
+
+
+ org.eclipse.jetty
+ jetty-io
+ ${project.version}
+
+
+ org.eclipse.jetty
+ jetty-http
+ ${project.version}
+
+
+ org.slf4j
+ slf4j-api
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-enforcer-plugin
+
+
+ ban-ws-apis
+
+ enforce
+
+
+
+
+
+ org.eclipse.jetty.websocket:websocket-jetty-api
+ javax.websocket
+
+
+
+
+
+
+ ban-java-servlet-api
+
+ enforce
+
+
+
+
+
+ javax.servlet
+ servletapi
+ org.eclipse.jetty.orbit:javax.servlet
+ org.mortbay.jetty:servlet-api
+ jetty:servlet-api
+ jetty-servlet-api
+
+
+
+
+
+
+
+
+
+
diff --git a/jetty-websocket/websocket-core-common/src/main/config/modules/websocket.mod b/jetty-websocket/websocket-core-common/src/main/config/modules/websocket.mod
new file mode 100644
index 00000000000..da53af6d2e2
--- /dev/null
+++ b/jetty-websocket/websocket-core-common/src/main/config/modules/websocket.mod
@@ -0,0 +1,11 @@
+DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html
+
+[description]
+Enable both jetty and javax websocket modules for deployed web applications.
+
+[tags]
+websocket
+
+[depend]
+websocket-jetty
+websocket-javax
diff --git a/jetty-websocket/websocket-core/src/main/java/module-info.java b/jetty-websocket/websocket-core-common/src/main/java/module-info.java
similarity index 78%
rename from jetty-websocket/websocket-core/src/main/java/module-info.java
rename to jetty-websocket/websocket-core-common/src/main/java/module-info.java
index c2fa64dda77..c2fb2c5276c 100644
--- a/jetty-websocket/websocket-core/src/main/java/module-info.java
+++ b/jetty-websocket/websocket-core-common/src/main/java/module-info.java
@@ -22,22 +22,16 @@ import org.eclipse.jetty.websocket.core.internal.IdentityExtension;
import org.eclipse.jetty.websocket.core.internal.PerMessageDeflateExtension;
import org.eclipse.jetty.websocket.core.internal.ValidationExtension;
-module org.eclipse.jetty.websocket.core
+module org.eclipse.jetty.websocket.core.common
{
exports org.eclipse.jetty.websocket.core;
- exports org.eclipse.jetty.websocket.core.client;
- exports org.eclipse.jetty.websocket.core.server;
exports org.eclipse.jetty.websocket.core.exception;
- exports org.eclipse.jetty.websocket.core.internal to org.eclipse.jetty.util;
+ exports org.eclipse.jetty.websocket.core.internal to org.eclipse.jetty.websocket.core.client, org.eclipse.jetty.websocket.core.server, org.eclipse.jetty.util;
- requires jetty.servlet.api;
- requires transitive org.eclipse.jetty.client;
- requires transitive org.eclipse.jetty.server;
+ requires org.eclipse.jetty.http;
+ requires org.eclipse.jetty.io;
requires org.slf4j;
- // Only required if using XmlHttpClientProvider.
- requires static org.eclipse.jetty.xml;
-
uses Extension;
provides Extension with
diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/AbstractExtension.java b/jetty-websocket/websocket-core-common/src/main/java/org/eclipse/jetty/websocket/core/AbstractExtension.java
similarity index 100%
rename from jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/AbstractExtension.java
rename to jetty-websocket/websocket-core-common/src/main/java/org/eclipse/jetty/websocket/core/AbstractExtension.java
diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/Behavior.java b/jetty-websocket/websocket-core-common/src/main/java/org/eclipse/jetty/websocket/core/Behavior.java
similarity index 100%
rename from jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/Behavior.java
rename to jetty-websocket/websocket-core-common/src/main/java/org/eclipse/jetty/websocket/core/Behavior.java
diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/CloseStatus.java b/jetty-websocket/websocket-core-common/src/main/java/org/eclipse/jetty/websocket/core/CloseStatus.java
similarity index 96%
rename from jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/CloseStatus.java
rename to jetty-websocket/websocket-core-common/src/main/java/org/eclipse/jetty/websocket/core/CloseStatus.java
index cdbed64f7a6..e324d2c866e 100644
--- a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/CloseStatus.java
+++ b/jetty-websocket/websocket-core-common/src/main/java/org/eclipse/jetty/websocket/core/CloseStatus.java
@@ -306,15 +306,12 @@ public class CloseStatus
}
// Reserved / not yet allocated
- if ((statusCode == 1004) || // Reserved in RFC6455 (might be defined in the future)
- ((statusCode >= 1016) && (statusCode <= 2999)) || // Reserved in RFC6455 (for future revisions, and extensions)
- (statusCode >= 5000)) // RFC6455 Not allowed to be used for any purpose
- {
- return false;
- }
+ // RFC6455 Not allowed to be used for any purpose
+ return (statusCode != 1004) && // Reserved in RFC6455 (might be defined in the future)
+ ((statusCode < 1016) || (statusCode > 2999)) && // Reserved in RFC6455 (for future revisions, and extensions)
+ (statusCode < 5000);
// All others are allowed
- return true;
}
public Frame toFrame()
diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/Configuration.java b/jetty-websocket/websocket-core-common/src/main/java/org/eclipse/jetty/websocket/core/Configuration.java
similarity index 100%
rename from jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/Configuration.java
rename to jetty-websocket/websocket-core-common/src/main/java/org/eclipse/jetty/websocket/core/Configuration.java
diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/CoreSession.java b/jetty-websocket/websocket-core-common/src/main/java/org/eclipse/jetty/websocket/core/CoreSession.java
similarity index 100%
rename from jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/CoreSession.java
rename to jetty-websocket/websocket-core-common/src/main/java/org/eclipse/jetty/websocket/core/CoreSession.java
diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/Extension.java b/jetty-websocket/websocket-core-common/src/main/java/org/eclipse/jetty/websocket/core/Extension.java
similarity index 100%
rename from jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/Extension.java
rename to jetty-websocket/websocket-core-common/src/main/java/org/eclipse/jetty/websocket/core/Extension.java
diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/ExtensionConfig.java b/jetty-websocket/websocket-core-common/src/main/java/org/eclipse/jetty/websocket/core/ExtensionConfig.java
similarity index 98%
rename from jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/ExtensionConfig.java
rename to jetty-websocket/websocket-core-common/src/main/java/org/eclipse/jetty/websocket/core/ExtensionConfig.java
index 28be0a3e4f6..10a6fbb0eb6 100644
--- a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/ExtensionConfig.java
+++ b/jetty-websocket/websocket-core-common/src/main/java/org/eclipse/jetty/websocket/core/ExtensionConfig.java
@@ -38,7 +38,7 @@ import org.eclipse.jetty.util.Trie;
*/
public class ExtensionConfig
{
- private static Trie CACHE = new ArrayTrie<>(512);
+ private static final Trie CACHE = new ArrayTrie<>(512);
static
{
@@ -315,7 +315,7 @@ public class ExtensionConfig
{
private final String parameterizedName;
private String name;
- private Map params = new HashMap<>();
+ private final Map params = new HashMap<>();
public ParamParser(String parameterizedName)
{
diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/Frame.java b/jetty-websocket/websocket-core-common/src/main/java/org/eclipse/jetty/websocket/core/Frame.java
similarity index 99%
rename from jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/Frame.java
rename to jetty-websocket/websocket-core-common/src/main/java/org/eclipse/jetty/websocket/core/Frame.java
index 5c44d9c4e77..9f7c1a74435 100644
--- a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/Frame.java
+++ b/jetty-websocket/websocket-core-common/src/main/java/org/eclipse/jetty/websocket/core/Frame.java
@@ -193,11 +193,7 @@ public class Frame
{
return false;
}
- if (!Arrays.equals(mask, other.mask))
- {
- return false;
- }
- return true;
+ return Arrays.equals(mask, other.mask);
}
public byte[] getMask()
diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/FrameHandler.java b/jetty-websocket/websocket-core-common/src/main/java/org/eclipse/jetty/websocket/core/FrameHandler.java
similarity index 93%
rename from jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/FrameHandler.java
rename to jetty-websocket/websocket-core-common/src/main/java/org/eclipse/jetty/websocket/core/FrameHandler.java
index 2e16bee68a2..265103b1324 100644
--- a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/FrameHandler.java
+++ b/jetty-websocket/websocket-core-common/src/main/java/org/eclipse/jetty/websocket/core/FrameHandler.java
@@ -19,8 +19,6 @@
package org.eclipse.jetty.websocket.core;
import org.eclipse.jetty.util.Callback;
-import org.eclipse.jetty.websocket.core.client.ClientUpgradeRequest;
-import org.eclipse.jetty.websocket.core.server.Negotiation;
/**
* Interface for local WebSocket Endpoint Frame handling.
@@ -31,11 +29,11 @@ import org.eclipse.jetty.websocket.core.server.Negotiation;
* is instantiated by the application, either:
*
*
- *
On the server, the application layer must provide a {@link org.eclipse.jetty.websocket.core.server.WebSocketNegotiator} instance
+ *
On the server, the application layer must provide a {@code org.eclipse.jetty.websocket.core.server.WebSocketNegotiator} instance
* to negotiate and accept websocket connections, which will return the FrameHandler instance to use from
- * {@link org.eclipse.jetty.websocket.core.server.WebSocketNegotiator#negotiate(Negotiation)}.
- *
On the client, the application returns the FrameHandler instance to user from the {@link ClientUpgradeRequest}
- * instance that it passes to the {@link org.eclipse.jetty.websocket.core.client.WebSocketCoreClient#connect(ClientUpgradeRequest)} method/
On the client, the application returns the FrameHandler instance to user from the {@code ClientUpgradeRequest}
+ * instance that it passes to the {@code org.eclipse.jetty.websocket.core.client.WebSocketCoreClient#connect(ClientUpgradeRequest)} method/
*
*
* Once instantiated the FrameHandler follows is used as follows:
diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/IncomingFrames.java b/jetty-websocket/websocket-core-common/src/main/java/org/eclipse/jetty/websocket/core/IncomingFrames.java
similarity index 100%
rename from jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/IncomingFrames.java
rename to jetty-websocket/websocket-core-common/src/main/java/org/eclipse/jetty/websocket/core/IncomingFrames.java
diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/MessageHandler.java b/jetty-websocket/websocket-core-common/src/main/java/org/eclipse/jetty/websocket/core/MessageHandler.java
similarity index 100%
rename from jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/MessageHandler.java
rename to jetty-websocket/websocket-core-common/src/main/java/org/eclipse/jetty/websocket/core/MessageHandler.java
diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/OpCode.java b/jetty-websocket/websocket-core-common/src/main/java/org/eclipse/jetty/websocket/core/OpCode.java
similarity index 100%
rename from jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/OpCode.java
rename to jetty-websocket/websocket-core-common/src/main/java/org/eclipse/jetty/websocket/core/OpCode.java
diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/OutgoingFrames.java b/jetty-websocket/websocket-core-common/src/main/java/org/eclipse/jetty/websocket/core/OutgoingFrames.java
similarity index 100%
rename from jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/OutgoingFrames.java
rename to jetty-websocket/websocket-core-common/src/main/java/org/eclipse/jetty/websocket/core/OutgoingFrames.java
diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/WebSocketComponents.java b/jetty-websocket/websocket-core-common/src/main/java/org/eclipse/jetty/websocket/core/WebSocketComponents.java
similarity index 71%
rename from jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/WebSocketComponents.java
rename to jetty-websocket/websocket-core-common/src/main/java/org/eclipse/jetty/websocket/core/WebSocketComponents.java
index 1f5d593f7fd..325132b097b 100644
--- a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/WebSocketComponents.java
+++ b/jetty-websocket/websocket-core-common/src/main/java/org/eclipse/jetty/websocket/core/WebSocketComponents.java
@@ -19,7 +19,6 @@
package org.eclipse.jetty.websocket.core;
import java.util.zip.Deflater;
-import javax.servlet.ServletContext;
import org.eclipse.jetty.io.ByteBufferPool;
import org.eclipse.jetty.io.MappedByteBufferPool;
@@ -31,26 +30,14 @@ import org.eclipse.jetty.util.compression.InflaterPool;
/**
* A collection of components which are the resources needed for websockets such as
* {@link ByteBufferPool}, {@link WebSocketExtensionRegistry}, and {@link DecoratedObjectFactory}.
- *
- * These components should be accessed through {@link WebSocketComponents#ensureWebSocketComponents} so that
- * the instance can be shared by being stored as a bean on the ContextHandler.
*/
public class WebSocketComponents
{
- public static final String WEBSOCKET_COMPONENTS_ATTRIBUTE = WebSocketComponents.class.getName();
-
- public static WebSocketComponents ensureWebSocketComponents(ServletContext servletContext)
- {
- // Ensure a mapping exists
- WebSocketComponents components = (WebSocketComponents)servletContext.getAttribute(WEBSOCKET_COMPONENTS_ATTRIBUTE);
- if (components == null)
- {
- components = new WebSocketComponents();
- servletContext.setAttribute(WEBSOCKET_COMPONENTS_ATTRIBUTE, components);
- }
-
- return components;
- }
+ private final DecoratedObjectFactory objectFactory;
+ private final WebSocketExtensionRegistry extensionRegistry;
+ private final ByteBufferPool bufferPool;
+ private final InflaterPool inflaterPool;
+ private final DeflaterPool deflaterPool;
public WebSocketComponents()
{
@@ -69,12 +56,6 @@ public class WebSocketComponents
this.inflaterPool = inflaterPool;
}
- private DecoratedObjectFactory objectFactory;
- private WebSocketExtensionRegistry extensionRegistry;
- private ByteBufferPool bufferPool;
- private InflaterPool inflaterPool;
- private DeflaterPool deflaterPool;
-
public ByteBufferPool getBufferPool()
{
return bufferPool;
diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/WebSocketConstants.java b/jetty-websocket/websocket-core-common/src/main/java/org/eclipse/jetty/websocket/core/WebSocketConstants.java
similarity index 100%
rename from jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/WebSocketConstants.java
rename to jetty-websocket/websocket-core-common/src/main/java/org/eclipse/jetty/websocket/core/WebSocketConstants.java
diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/WebSocketExtensionRegistry.java b/jetty-websocket/websocket-core-common/src/main/java/org/eclipse/jetty/websocket/core/WebSocketExtensionRegistry.java
similarity index 96%
rename from jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/WebSocketExtensionRegistry.java
rename to jetty-websocket/websocket-core-common/src/main/java/org/eclipse/jetty/websocket/core/WebSocketExtensionRegistry.java
index a6b55884f68..09b6d51754a 100644
--- a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/WebSocketExtensionRegistry.java
+++ b/jetty-websocket/websocket-core-common/src/main/java/org/eclipse/jetty/websocket/core/WebSocketExtensionRegistry.java
@@ -30,7 +30,7 @@ import org.eclipse.jetty.util.TypeUtil;
public class WebSocketExtensionRegistry implements Iterable>
{
- private Map> availableExtensions = new HashMap<>();
+ private final Map> availableExtensions = new HashMap<>();
public WebSocketExtensionRegistry()
{
diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/exception/BadPayloadException.java b/jetty-websocket/websocket-core-common/src/main/java/org/eclipse/jetty/websocket/core/exception/BadPayloadException.java
similarity index 100%
rename from jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/exception/BadPayloadException.java
rename to jetty-websocket/websocket-core-common/src/main/java/org/eclipse/jetty/websocket/core/exception/BadPayloadException.java
diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/exception/CloseException.java b/jetty-websocket/websocket-core-common/src/main/java/org/eclipse/jetty/websocket/core/exception/CloseException.java
similarity index 97%
rename from jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/exception/CloseException.java
rename to jetty-websocket/websocket-core-common/src/main/java/org/eclipse/jetty/websocket/core/exception/CloseException.java
index 6243d216de8..150700ec616 100644
--- a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/exception/CloseException.java
+++ b/jetty-websocket/websocket-core-common/src/main/java/org/eclipse/jetty/websocket/core/exception/CloseException.java
@@ -21,7 +21,7 @@ package org.eclipse.jetty.websocket.core.exception;
@SuppressWarnings("serial")
public class CloseException extends WebSocketException
{
- private int statusCode;
+ private final int statusCode;
public CloseException(int closeCode, String message)
{
diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/exception/MessageTooLargeException.java b/jetty-websocket/websocket-core-common/src/main/java/org/eclipse/jetty/websocket/core/exception/MessageTooLargeException.java
similarity index 100%
rename from jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/exception/MessageTooLargeException.java
rename to jetty-websocket/websocket-core-common/src/main/java/org/eclipse/jetty/websocket/core/exception/MessageTooLargeException.java
diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/exception/ProtocolException.java b/jetty-websocket/websocket-core-common/src/main/java/org/eclipse/jetty/websocket/core/exception/ProtocolException.java
similarity index 100%
rename from jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/exception/ProtocolException.java
rename to jetty-websocket/websocket-core-common/src/main/java/org/eclipse/jetty/websocket/core/exception/ProtocolException.java
diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/exception/UpgradeException.java b/jetty-websocket/websocket-core-common/src/main/java/org/eclipse/jetty/websocket/core/exception/UpgradeException.java
similarity index 100%
rename from jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/exception/UpgradeException.java
rename to jetty-websocket/websocket-core-common/src/main/java/org/eclipse/jetty/websocket/core/exception/UpgradeException.java
diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/exception/WebSocketException.java b/jetty-websocket/websocket-core-common/src/main/java/org/eclipse/jetty/websocket/core/exception/WebSocketException.java
similarity index 100%
rename from jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/exception/WebSocketException.java
rename to jetty-websocket/websocket-core-common/src/main/java/org/eclipse/jetty/websocket/core/exception/WebSocketException.java
diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/exception/WebSocketTimeoutException.java b/jetty-websocket/websocket-core-common/src/main/java/org/eclipse/jetty/websocket/core/exception/WebSocketTimeoutException.java
similarity index 100%
rename from jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/exception/WebSocketTimeoutException.java
rename to jetty-websocket/websocket-core-common/src/main/java/org/eclipse/jetty/websocket/core/exception/WebSocketTimeoutException.java
diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/exception/WebSocketWriteTimeoutException.java b/jetty-websocket/websocket-core-common/src/main/java/org/eclipse/jetty/websocket/core/exception/WebSocketWriteTimeoutException.java
similarity index 100%
rename from jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/exception/WebSocketWriteTimeoutException.java
rename to jetty-websocket/websocket-core-common/src/main/java/org/eclipse/jetty/websocket/core/exception/WebSocketWriteTimeoutException.java
diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/internal/ExtensionStack.java b/jetty-websocket/websocket-core-common/src/main/java/org/eclipse/jetty/websocket/core/internal/ExtensionStack.java
similarity index 99%
rename from jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/internal/ExtensionStack.java
rename to jetty-websocket/websocket-core-common/src/main/java/org/eclipse/jetty/websocket/core/internal/ExtensionStack.java
index 28f3232c816..ccde09f3361 100644
--- a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/internal/ExtensionStack.java
+++ b/jetty-websocket/websocket-core-common/src/main/java/org/eclipse/jetty/websocket/core/internal/ExtensionStack.java
@@ -54,7 +54,7 @@ public class ExtensionStack implements IncomingFrames, OutgoingFrames, Dumpable
private List extensions;
private IncomingFrames incoming;
private OutgoingFrames outgoing;
- private Extension[] rsvClaims = new Extension[3];
+ private final Extension[] rsvClaims = new Extension[3];
public ExtensionStack(WebSocketComponents components, Behavior behavior)
{
diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/internal/FragmentExtension.java b/jetty-websocket/websocket-core-common/src/main/java/org/eclipse/jetty/websocket/core/internal/FragmentExtension.java
similarity index 100%
rename from jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/internal/FragmentExtension.java
rename to jetty-websocket/websocket-core-common/src/main/java/org/eclipse/jetty/websocket/core/internal/FragmentExtension.java
diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/internal/FragmentingFlusher.java b/jetty-websocket/websocket-core-common/src/main/java/org/eclipse/jetty/websocket/core/internal/FragmentingFlusher.java
similarity index 100%
rename from jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/internal/FragmentingFlusher.java
rename to jetty-websocket/websocket-core-common/src/main/java/org/eclipse/jetty/websocket/core/internal/FragmentingFlusher.java
diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/internal/FrameCaptureExtension.java b/jetty-websocket/websocket-core-common/src/main/java/org/eclipse/jetty/websocket/core/internal/FrameCaptureExtension.java
similarity index 97%
rename from jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/internal/FrameCaptureExtension.java
rename to jetty-websocket/websocket-core-common/src/main/java/org/eclipse/jetty/websocket/core/internal/FrameCaptureExtension.java
index a4b7ccb73f4..9612f744651 100644
--- a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/internal/FrameCaptureExtension.java
+++ b/jetty-websocket/websocket-core-common/src/main/java/org/eclipse/jetty/websocket/core/internal/FrameCaptureExtension.java
@@ -51,8 +51,8 @@ public class FrameCaptureExtension extends AbstractExtension
private Path incomingFramesPath;
private Path outgoingFramesPath;
- private AtomicInteger incomingCount = new AtomicInteger(0);
- private AtomicInteger outgoingCount = new AtomicInteger(0);
+ private final AtomicInteger incomingCount = new AtomicInteger(0);
+ private final AtomicInteger outgoingCount = new AtomicInteger(0);
private SeekableByteChannel incomingChannel;
private SeekableByteChannel outgoingChannel;
diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/internal/FrameEntry.java b/jetty-websocket/websocket-core-common/src/main/java/org/eclipse/jetty/websocket/core/internal/FrameEntry.java
similarity index 100%
rename from jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/internal/FrameEntry.java
rename to jetty-websocket/websocket-core-common/src/main/java/org/eclipse/jetty/websocket/core/internal/FrameEntry.java
diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/internal/FrameFlusher.java b/jetty-websocket/websocket-core-common/src/main/java/org/eclipse/jetty/websocket/core/internal/FrameFlusher.java
similarity index 99%
rename from jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/internal/FrameFlusher.java
rename to jetty-websocket/websocket-core-common/src/main/java/org/eclipse/jetty/websocket/core/internal/FrameFlusher.java
index c7633d291e5..e4483f6e719 100644
--- a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/internal/FrameFlusher.java
+++ b/jetty-websocket/websocket-core-common/src/main/java/org/eclipse/jetty/websocket/core/internal/FrameFlusher.java
@@ -511,7 +511,7 @@ public class FrameFlusher extends IteratingCallback
private class Entry extends FrameEntry
{
private ByteBuffer headerBuffer;
- private long timeOfCreation = System.currentTimeMillis();
+ private final long timeOfCreation = System.currentTimeMillis();
private Entry(Frame frame, Callback callback, boolean batch)
{
diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/internal/FrameSequence.java b/jetty-websocket/websocket-core-common/src/main/java/org/eclipse/jetty/websocket/core/internal/FrameSequence.java
similarity index 100%
rename from jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/internal/FrameSequence.java
rename to jetty-websocket/websocket-core-common/src/main/java/org/eclipse/jetty/websocket/core/internal/FrameSequence.java
diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/internal/Generator.java b/jetty-websocket/websocket-core-common/src/main/java/org/eclipse/jetty/websocket/core/internal/Generator.java
similarity index 100%
rename from jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/internal/Generator.java
rename to jetty-websocket/websocket-core-common/src/main/java/org/eclipse/jetty/websocket/core/internal/Generator.java
diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/internal/IdentityExtension.java b/jetty-websocket/websocket-core-common/src/main/java/org/eclipse/jetty/websocket/core/internal/IdentityExtension.java
similarity index 100%
rename from jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/internal/IdentityExtension.java
rename to jetty-websocket/websocket-core-common/src/main/java/org/eclipse/jetty/websocket/core/internal/IdentityExtension.java
diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/internal/Negotiated.java b/jetty-websocket/websocket-core-common/src/main/java/org/eclipse/jetty/websocket/core/internal/Negotiated.java
similarity index 100%
rename from jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/internal/Negotiated.java
rename to jetty-websocket/websocket-core-common/src/main/java/org/eclipse/jetty/websocket/core/internal/Negotiated.java
diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/internal/NullAppendable.java b/jetty-websocket/websocket-core-common/src/main/java/org/eclipse/jetty/websocket/core/internal/NullAppendable.java
similarity index 100%
rename from jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/internal/NullAppendable.java
rename to jetty-websocket/websocket-core-common/src/main/java/org/eclipse/jetty/websocket/core/internal/NullAppendable.java
diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/internal/Parser.java b/jetty-websocket/websocket-core-common/src/main/java/org/eclipse/jetty/websocket/core/internal/Parser.java
similarity index 100%
rename from jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/internal/Parser.java
rename to jetty-websocket/websocket-core-common/src/main/java/org/eclipse/jetty/websocket/core/internal/Parser.java
diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/internal/PerMessageDeflateExtension.java b/jetty-websocket/websocket-core-common/src/main/java/org/eclipse/jetty/websocket/core/internal/PerMessageDeflateExtension.java
similarity index 100%
rename from jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/internal/PerMessageDeflateExtension.java
rename to jetty-websocket/websocket-core-common/src/main/java/org/eclipse/jetty/websocket/core/internal/PerMessageDeflateExtension.java
diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/internal/TransformingFlusher.java b/jetty-websocket/websocket-core-common/src/main/java/org/eclipse/jetty/websocket/core/internal/TransformingFlusher.java
similarity index 100%
rename from jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/internal/TransformingFlusher.java
rename to jetty-websocket/websocket-core-common/src/main/java/org/eclipse/jetty/websocket/core/internal/TransformingFlusher.java
diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/internal/ValidationExtension.java b/jetty-websocket/websocket-core-common/src/main/java/org/eclipse/jetty/websocket/core/internal/ValidationExtension.java
similarity index 100%
rename from jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/internal/ValidationExtension.java
rename to jetty-websocket/websocket-core-common/src/main/java/org/eclipse/jetty/websocket/core/internal/ValidationExtension.java
diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/internal/WebSocketConnection.java b/jetty-websocket/websocket-core-common/src/main/java/org/eclipse/jetty/websocket/core/internal/WebSocketConnection.java
similarity index 99%
rename from jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/internal/WebSocketConnection.java
rename to jetty-websocket/websocket-core-common/src/main/java/org/eclipse/jetty/websocket/core/internal/WebSocketConnection.java
index e83759e7285..0d61d603659 100644
--- a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/internal/WebSocketConnection.java
+++ b/jetty-websocket/websocket-core-common/src/main/java/org/eclipse/jetty/websocket/core/internal/WebSocketConnection.java
@@ -63,8 +63,8 @@ public class WebSocketConnection extends AbstractConnection implements Connectio
private long demand;
private boolean fillingAndParsing;
- private LongAdder messagesIn = new LongAdder();
- private LongAdder bytesIn = new LongAdder();
+ private final LongAdder messagesIn = new LongAdder();
+ private final LongAdder bytesIn = new LongAdder();
// Read / Parse variables
private RetainableByteBuffer networkBuffer;
diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/internal/WebSocketCore.java b/jetty-websocket/websocket-core-common/src/main/java/org/eclipse/jetty/websocket/core/internal/WebSocketCore.java
similarity index 100%
rename from jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/internal/WebSocketCore.java
rename to jetty-websocket/websocket-core-common/src/main/java/org/eclipse/jetty/websocket/core/internal/WebSocketCore.java
diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/internal/WebSocketCoreSession.java b/jetty-websocket/websocket-core-common/src/main/java/org/eclipse/jetty/websocket/core/internal/WebSocketCoreSession.java
similarity index 97%
rename from jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/internal/WebSocketCoreSession.java
rename to jetty-websocket/websocket-core-common/src/main/java/org/eclipse/jetty/websocket/core/internal/WebSocketCoreSession.java
index 53de09e2191..148d2fcf0ed 100644
--- a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/internal/WebSocketCoreSession.java
+++ b/jetty-websocket/websocket-core-common/src/main/java/org/eclipse/jetty/websocket/core/internal/WebSocketCoreSession.java
@@ -29,7 +29,6 @@ import java.util.concurrent.Executor;
import java.util.concurrent.TimeoutException;
import org.eclipse.jetty.io.ByteBufferPool;
-import org.eclipse.jetty.server.handler.ContextHandler;
import org.eclipse.jetty.util.Callback;
import org.eclipse.jetty.util.Utf8Appendable;
import org.eclipse.jetty.util.component.Dumpable;
@@ -81,7 +80,6 @@ public class WebSocketCoreSession implements IncomingFrames, CoreSession, Dumpab
private long maxTextMessageSize = WebSocketConstants.DEFAULT_MAX_TEXT_MESSAGE_SIZE;
private Duration idleTimeout = WebSocketConstants.DEFAULT_IDLE_TIMEOUT;
private Duration writeTimeout = WebSocketConstants.DEFAULT_WRITE_TIMEOUT;
- private final ContextHandler contextHandler;
public WebSocketCoreSession(FrameHandler handler, Behavior behavior, Negotiated negotiated, WebSocketComponents components)
{
@@ -90,26 +88,16 @@ public class WebSocketCoreSession implements IncomingFrames, CoreSession, Dumpab
this.behavior = behavior;
this.negotiated = negotiated;
this.demanding = handler.isDemanding();
-
- if (behavior == Behavior.SERVER)
- {
- ContextHandler.Context context = ContextHandler.getCurrentContext();
- this.contextHandler = (context != null) ? context.getContextHandler() : null;
- }
- else
- {
- this.contextHandler = null;
- }
-
negotiated.getExtensions().initialize(new IncomingAdaptor(), new OutgoingAdaptor(), this);
}
- private void handle(Runnable runnable)
+ /**
+ * Can be overridden to scope into the correct classloader before calling application code.
+ * @param runnable the runnable to execute.
+ */
+ protected void handle(Runnable runnable)
{
- if (contextHandler != null)
- contextHandler.handle(runnable);
- else
- runnable.run();
+ runnable.run();
}
/**
diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/internal/WebSocketSessionState.java b/jetty-websocket/websocket-core-common/src/main/java/org/eclipse/jetty/websocket/core/internal/WebSocketSessionState.java
similarity index 100%
rename from jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/internal/WebSocketSessionState.java
rename to jetty-websocket/websocket-core-common/src/main/java/org/eclipse/jetty/websocket/core/internal/WebSocketSessionState.java
diff --git a/jetty-websocket/websocket-core/src/main/resources/META-INF/services/org.eclipse.jetty.websocket.core.Extension b/jetty-websocket/websocket-core-common/src/main/resources/META-INF/services/org.eclipse.jetty.websocket.core.Extension
similarity index 100%
rename from jetty-websocket/websocket-core/src/main/resources/META-INF/services/org.eclipse.jetty.websocket.core.Extension
rename to jetty-websocket/websocket-core-common/src/main/resources/META-INF/services/org.eclipse.jetty.websocket.core.Extension
diff --git a/jetty-websocket/websocket-core-server/pom.xml b/jetty-websocket/websocket-core-server/pom.xml
new file mode 100644
index 00000000000..ab55a54ecb0
--- /dev/null
+++ b/jetty-websocket/websocket-core-server/pom.xml
@@ -0,0 +1,76 @@
+
+
+
+ org.eclipse.jetty.websocket
+ websocket-parent
+ 10.0.0-SNAPSHOT
+
+
+ 4.0.0
+ websocket-core-server
+ Jetty :: Websocket :: Core :: Server
+
+
+ ${project.groupId}.core.server
+
+
+
+
+ org.eclipse.jetty.websocket
+ websocket-core-common
+ ${project.version}
+
+
+ org.eclipse.jetty
+ jetty-server
+ ${project.version}
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-enforcer-plugin
+
+
+ ban-ws-apis
+
+ enforce
+
+
+
+
+
+ org.eclipse.jetty.websocket:websocket-jetty-api
+ javax.websocket
+
+
+
+
+
+
+ ban-java-servlet-api
+
+ enforce
+
+
+
+
+
+ javax.servlet
+ servletapi
+ org.eclipse.jetty.orbit:javax.servlet
+ org.mortbay.jetty:servlet-api
+ jetty:servlet-api
+ jetty-servlet-api
+
+
+
+
+
+
+
+
+
+
diff --git a/jetty-websocket/websocket-core-server/src/main/config/modules/websocket.mod b/jetty-websocket/websocket-core-server/src/main/config/modules/websocket.mod
new file mode 100644
index 00000000000..da53af6d2e2
--- /dev/null
+++ b/jetty-websocket/websocket-core-server/src/main/config/modules/websocket.mod
@@ -0,0 +1,11 @@
+DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html
+
+[description]
+Enable both jetty and javax websocket modules for deployed web applications.
+
+[tags]
+websocket
+
+[depend]
+websocket-jetty
+websocket-javax
diff --git a/jetty-websocket/websocket-core-server/src/main/java/module-info.java b/jetty-websocket/websocket-core-server/src/main/java/module-info.java
new file mode 100644
index 00000000000..fa7c47d2610
--- /dev/null
+++ b/jetty-websocket/websocket-core-server/src/main/java/module-info.java
@@ -0,0 +1,26 @@
+//
+// ========================================================================
+// Copyright (c) 1995-2020 Mort Bay Consulting Pty Ltd and others.
+//
+// This program and the accompanying materials are made available under
+// the terms of the Eclipse Public License 2.0 which is available at
+// https://www.eclipse.org/legal/epl-2.0
+//
+// This Source Code may also be made available under the following
+// Secondary Licenses when the conditions for such availability set
+// forth in the Eclipse Public License, v. 2.0 are satisfied:
+// the Apache License v2.0 which is available at
+// https://www.apache.org/licenses/LICENSE-2.0
+//
+// SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
+// ========================================================================
+//
+
+module org.eclipse.jetty.websocket.core.server
+{
+ exports org.eclipse.jetty.websocket.core.server;
+
+ requires org.slf4j;
+ requires transitive org.eclipse.jetty.server;
+ requires transitive org.eclipse.jetty.websocket.core.common;
+}
diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/server/Handshaker.java b/jetty-websocket/websocket-core-server/src/main/java/org/eclipse/jetty/websocket/core/server/Handshaker.java
similarity index 100%
rename from jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/server/Handshaker.java
rename to jetty-websocket/websocket-core-server/src/main/java/org/eclipse/jetty/websocket/core/server/Handshaker.java
diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/server/Negotiation.java b/jetty-websocket/websocket-core-server/src/main/java/org/eclipse/jetty/websocket/core/server/Negotiation.java
similarity index 100%
rename from jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/server/Negotiation.java
rename to jetty-websocket/websocket-core-server/src/main/java/org/eclipse/jetty/websocket/core/server/Negotiation.java
diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/server/WebSocketNegotiator.java b/jetty-websocket/websocket-core-server/src/main/java/org/eclipse/jetty/websocket/core/server/WebSocketNegotiator.java
similarity index 100%
rename from jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/server/WebSocketNegotiator.java
rename to jetty-websocket/websocket-core-server/src/main/java/org/eclipse/jetty/websocket/core/server/WebSocketNegotiator.java
diff --git a/jetty-websocket/websocket-core-server/src/main/java/org/eclipse/jetty/websocket/core/server/WebSocketServerComponents.java b/jetty-websocket/websocket-core-server/src/main/java/org/eclipse/jetty/websocket/core/server/WebSocketServerComponents.java
new file mode 100644
index 00000000000..2fefc439d09
--- /dev/null
+++ b/jetty-websocket/websocket-core-server/src/main/java/org/eclipse/jetty/websocket/core/server/WebSocketServerComponents.java
@@ -0,0 +1,51 @@
+//
+// ========================================================================
+// Copyright (c) 1995-2020 Mort Bay Consulting Pty Ltd and others.
+//
+// This program and the accompanying materials are made available under
+// the terms of the Eclipse Public License 2.0 which is available at
+// https://www.eclipse.org/legal/epl-2.0
+//
+// This Source Code may also be made available under the following
+// Secondary Licenses when the conditions for such availability set
+// forth in the Eclipse Public License, v. 2.0 are satisfied:
+// the Apache License v2.0 which is available at
+// https://www.apache.org/licenses/LICENSE-2.0
+//
+// SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
+// ========================================================================
+//
+
+package org.eclipse.jetty.websocket.core.server;
+
+import javax.servlet.ServletContext;
+
+import org.eclipse.jetty.io.ByteBufferPool;
+import org.eclipse.jetty.util.DecoratedObjectFactory;
+import org.eclipse.jetty.websocket.core.WebSocketComponents;
+import org.eclipse.jetty.websocket.core.WebSocketExtensionRegistry;
+
+/**
+ * A collection of components which are the resources needed for websockets such as
+ * {@link ByteBufferPool}, {@link WebSocketExtensionRegistry}, and {@link DecoratedObjectFactory}.
+ *
+ * These components should be accessed through {@link WebSocketServerComponents#ensureWebSocketComponents} so that
+ * the instance can be shared by being stored as a bean on the ContextHandler.
+ */
+public class WebSocketServerComponents extends WebSocketComponents
+{
+ public static final String WEBSOCKET_COMPONENTS_ATTRIBUTE = WebSocketComponents.class.getName();
+
+ public static WebSocketComponents ensureWebSocketComponents(ServletContext servletContext)
+ {
+ // Ensure a mapping exists
+ WebSocketComponents components = (WebSocketComponents)servletContext.getAttribute(WEBSOCKET_COMPONENTS_ATTRIBUTE);
+ if (components == null)
+ {
+ components = new WebSocketServerComponents();
+ servletContext.setAttribute(WEBSOCKET_COMPONENTS_ATTRIBUTE, components);
+ }
+
+ return components;
+ }
+}
diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/server/WebSocketUpgradeHandler.java b/jetty-websocket/websocket-core-server/src/main/java/org/eclipse/jetty/websocket/core/server/WebSocketUpgradeHandler.java
similarity index 100%
rename from jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/server/WebSocketUpgradeHandler.java
rename to jetty-websocket/websocket-core-server/src/main/java/org/eclipse/jetty/websocket/core/server/WebSocketUpgradeHandler.java
diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/server/internal/AbstractHandshaker.java b/jetty-websocket/websocket-core-server/src/main/java/org/eclipse/jetty/websocket/core/server/internal/AbstractHandshaker.java
similarity index 93%
rename from jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/server/internal/AbstractHandshaker.java
rename to jetty-websocket/websocket-core-server/src/main/java/org/eclipse/jetty/websocket/core/server/internal/AbstractHandshaker.java
index 1a0d84c1c5b..77259143103 100644
--- a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/server/internal/AbstractHandshaker.java
+++ b/jetty-websocket/websocket-core-server/src/main/java/org/eclipse/jetty/websocket/core/server/internal/AbstractHandshaker.java
@@ -34,6 +34,7 @@ import org.eclipse.jetty.server.HttpConfiguration;
import org.eclipse.jetty.server.HttpTransport;
import org.eclipse.jetty.server.Request;
import org.eclipse.jetty.server.Response;
+import org.eclipse.jetty.server.handler.ContextHandler;
import org.eclipse.jetty.util.thread.Scheduler;
import org.eclipse.jetty.websocket.core.Behavior;
import org.eclipse.jetty.websocket.core.Configuration;
@@ -132,7 +133,7 @@ public abstract class AbstractHandshaker implements Handshaker
Negotiated negotiated = new Negotiated(baseRequest.getHttpURI().toURI(), protocol, baseRequest.isSecure(), extensionStack, WebSocketConstants.SPEC_VERSION_STRING);
// Create the Session
- WebSocketCoreSession coreSession = newWebSocketCoreSession(handler, negotiated, components);
+ WebSocketCoreSession coreSession = newWebSocketCoreSession(request, handler, negotiated, components);
if (defaultCustomizer != null)
defaultCustomizer.customize(coreSession);
negotiator.customize(coreSession);
@@ -195,9 +196,20 @@ public abstract class AbstractHandshaker implements Handshaker
return true;
}
- protected WebSocketCoreSession newWebSocketCoreSession(FrameHandler handler, Negotiated negotiated, WebSocketComponents components)
+ protected WebSocketCoreSession newWebSocketCoreSession(HttpServletRequest request, FrameHandler handler, Negotiated negotiated, WebSocketComponents components)
{
- return new WebSocketCoreSession(handler, Behavior.SERVER, negotiated, components);
+ final ContextHandler contextHandler = ContextHandler.getContextHandler(request.getServletContext());
+ return new WebSocketCoreSession(handler, Behavior.SERVER, negotiated, components)
+ {
+ @Override
+ protected void handle(Runnable runnable)
+ {
+ if (contextHandler != null)
+ contextHandler.handle(runnable);
+ else
+ runnable.run();
+ }
+ };
}
protected abstract WebSocketConnection createWebSocketConnection(Request baseRequest, WebSocketCoreSession coreSession);
diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/server/internal/HandshakerSelector.java b/jetty-websocket/websocket-core-server/src/main/java/org/eclipse/jetty/websocket/core/server/internal/HandshakerSelector.java
similarity index 100%
rename from jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/server/internal/HandshakerSelector.java
rename to jetty-websocket/websocket-core-server/src/main/java/org/eclipse/jetty/websocket/core/server/internal/HandshakerSelector.java
diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/server/internal/RFC6455Handshaker.java b/jetty-websocket/websocket-core-server/src/main/java/org/eclipse/jetty/websocket/core/server/internal/RFC6455Handshaker.java
similarity index 100%
rename from jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/server/internal/RFC6455Handshaker.java
rename to jetty-websocket/websocket-core-server/src/main/java/org/eclipse/jetty/websocket/core/server/internal/RFC6455Handshaker.java
diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/server/internal/RFC6455Negotiation.java b/jetty-websocket/websocket-core-server/src/main/java/org/eclipse/jetty/websocket/core/server/internal/RFC6455Negotiation.java
similarity index 100%
rename from jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/server/internal/RFC6455Negotiation.java
rename to jetty-websocket/websocket-core-server/src/main/java/org/eclipse/jetty/websocket/core/server/internal/RFC6455Negotiation.java
diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/server/internal/RFC8441Handshaker.java b/jetty-websocket/websocket-core-server/src/main/java/org/eclipse/jetty/websocket/core/server/internal/RFC8441Handshaker.java
similarity index 100%
rename from jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/server/internal/RFC8441Handshaker.java
rename to jetty-websocket/websocket-core-server/src/main/java/org/eclipse/jetty/websocket/core/server/internal/RFC8441Handshaker.java
diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/server/internal/RFC8441Negotiation.java b/jetty-websocket/websocket-core-server/src/main/java/org/eclipse/jetty/websocket/core/server/internal/RFC8441Negotiation.java
similarity index 100%
rename from jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/core/server/internal/RFC8441Negotiation.java
rename to jetty-websocket/websocket-core-server/src/main/java/org/eclipse/jetty/websocket/core/server/internal/RFC8441Negotiation.java
diff --git a/jetty-websocket/websocket-core/fuzzingclient.json b/jetty-websocket/websocket-core-tests/fuzzingclient.json
similarity index 100%
rename from jetty-websocket/websocket-core/fuzzingclient.json
rename to jetty-websocket/websocket-core-tests/fuzzingclient.json
diff --git a/jetty-websocket/websocket-core/fuzzingserver.json b/jetty-websocket/websocket-core-tests/fuzzingserver.json
similarity index 100%
rename from jetty-websocket/websocket-core/fuzzingserver.json
rename to jetty-websocket/websocket-core-tests/fuzzingserver.json
diff --git a/jetty-websocket/websocket-core/pom.xml b/jetty-websocket/websocket-core-tests/pom.xml
similarity index 77%
rename from jetty-websocket/websocket-core/pom.xml
rename to jetty-websocket/websocket-core-tests/pom.xml
index 2e976948002..bc20aa11c92 100644
--- a/jetty-websocket/websocket-core/pom.xml
+++ b/jetty-websocket/websocket-core-tests/pom.xml
@@ -7,60 +7,34 @@
4.0.0
- websocket-core
- Jetty :: Websocket :: Core
+ websocket-core-tests
+ Jetty :: Websocket :: Core :: Tests
- ${project.groupId}.core
+ ${project.groupId}.core.tests
- org.eclipse.jetty
- jetty-util
+ org.eclipse.jetty.websocket
+ websocket-core-client${project.version}
- org.eclipse.jetty
- jetty-io
+ org.eclipse.jetty.websocket
+ websocket-core-server${project.version}
- org.eclipse.jetty
- jetty-http
+ org.eclipse.jetty.websocket
+ websocket-core-common${project.version}
-
- org.slf4j
- slf4j-api
-
-
- org.eclipse.jetty
- jetty-xml
- ${project.version}
- true
-
-
- org.eclipse.jetty
- jetty-client
- ${project.version}
-
-
- org.eclipse.jetty
- jetty-server
- ${project.version}
-
-
org.eclipse.jettyjetty-slf4j-impltest
-
- org.eclipse.jetty.toolchain
- jetty-test-helper
- test
-
diff --git a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/AcceptHashTest.java b/jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/AcceptHashTest.java
similarity index 100%
rename from jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/AcceptHashTest.java
rename to jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/AcceptHashTest.java
diff --git a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/AutoFragmentTest.java b/jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/AutoFragmentTest.java
similarity index 100%
rename from jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/AutoFragmentTest.java
rename to jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/AutoFragmentTest.java
diff --git a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/CapturedHexPayloads.java b/jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/CapturedHexPayloads.java
similarity index 95%
rename from jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/CapturedHexPayloads.java
rename to jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/CapturedHexPayloads.java
index 14a641f1cd7..da005f5ad69 100644
--- a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/CapturedHexPayloads.java
+++ b/jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/CapturedHexPayloads.java
@@ -26,7 +26,7 @@ import org.eclipse.jetty.util.Callback;
public class CapturedHexPayloads implements OutgoingFrames
{
- private List captured = new ArrayList<>();
+ private final List captured = new ArrayList<>();
@Override
public void sendFrame(Frame frame, Callback callback, boolean batch)
diff --git a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/CloseStatusTest.java b/jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/CloseStatusTest.java
similarity index 100%
rename from jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/CloseStatusTest.java
rename to jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/CloseStatusTest.java
diff --git a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/EchoFrameHandler.java b/jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/EchoFrameHandler.java
similarity index 100%
rename from jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/EchoFrameHandler.java
rename to jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/EchoFrameHandler.java
diff --git a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/FlushTest.java b/jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/FlushTest.java
similarity index 97%
rename from jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/FlushTest.java
rename to jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/FlushTest.java
index f787ae8fd89..e17524caaf9 100644
--- a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/FlushTest.java
+++ b/jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/FlushTest.java
@@ -41,9 +41,9 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
public class FlushTest
{
private WebSocketServer server;
- private TestFrameHandler serverHandler = new TestFrameHandler();
+ private final TestFrameHandler serverHandler = new TestFrameHandler();
private WebSocketCoreClient client;
- private WebSocketComponents components = new WebSocketComponents();
+ private final WebSocketComponents components = new WebSocketComponents();
@BeforeEach
public void startup() throws Exception
diff --git a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/FrameBufferTest.java b/jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/FrameBufferTest.java
similarity index 96%
rename from jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/FrameBufferTest.java
rename to jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/FrameBufferTest.java
index a891d6d932f..9acce6884bd 100644
--- a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/FrameBufferTest.java
+++ b/jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/FrameBufferTest.java
@@ -40,9 +40,9 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
public class FrameBufferTest extends WebSocketTester
{
private WebSocketServer server;
- private TestFrameHandler serverHandler = new TestFrameHandler();
+ private final TestFrameHandler serverHandler = new TestFrameHandler();
private WebSocketCoreClient client;
- private WebSocketComponents components = new WebSocketComponents();
+ private final WebSocketComponents components = new WebSocketComponents();
@BeforeEach
public void startup() throws Exception
diff --git a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/GeneratorFrameFlagsTest.java b/jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/GeneratorFrameFlagsTest.java
similarity index 97%
rename from jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/GeneratorFrameFlagsTest.java
rename to jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/GeneratorFrameFlagsTest.java
index af413ce7ea7..5d18c8027c9 100644
--- a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/GeneratorFrameFlagsTest.java
+++ b/jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/GeneratorFrameFlagsTest.java
@@ -39,7 +39,7 @@ import static org.junit.jupiter.api.Assertions.assertThrows;
*/
public class GeneratorFrameFlagsTest
{
- private static WebSocketComponents components = new WebSocketComponents();
+ private static final WebSocketComponents components = new WebSocketComponents();
private WebSocketCoreSession coreSession;
public static Stream data()
diff --git a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/GeneratorParserRoundTripTest.java b/jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/GeneratorParserRoundTripTest.java
similarity index 97%
rename from jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/GeneratorParserRoundTripTest.java
rename to jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/GeneratorParserRoundTripTest.java
index 449afdd7fd6..3e8b523c881 100644
--- a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/GeneratorParserRoundTripTest.java
+++ b/jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/GeneratorParserRoundTripTest.java
@@ -33,7 +33,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
public class GeneratorParserRoundTripTest
{
- private ByteBufferPool bufferPool = new MappedByteBufferPool();
+ private final ByteBufferPool bufferPool = new MappedByteBufferPool();
@Test
public void testParserAndGenerator() throws Exception
diff --git a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/GeneratorTest.java b/jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/GeneratorTest.java
similarity index 99%
rename from jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/GeneratorTest.java
rename to jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/GeneratorTest.java
index 5456640b22e..d03da52f3e4 100644
--- a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/GeneratorTest.java
+++ b/jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/GeneratorTest.java
@@ -47,9 +47,9 @@ public class GeneratorTest
{
private static final Logger LOG = LoggerFactory.getLogger(Helper.class);
- private static Generator generator = new Generator();
- private static WebSocketCoreSession coreSession = newWebSocketCoreSession(Behavior.SERVER);
- private static WebSocketComponents components = new WebSocketComponents();
+ private static final Generator generator = new Generator();
+ private static final WebSocketCoreSession coreSession = newWebSocketCoreSession(Behavior.SERVER);
+ private static final WebSocketComponents components = new WebSocketComponents();
private static WebSocketCoreSession newWebSocketCoreSession(Behavior behavior)
{
diff --git a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/IncomingFramesCapture.java b/jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/IncomingFramesCapture.java
similarity index 100%
rename from jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/IncomingFramesCapture.java
rename to jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/IncomingFramesCapture.java
diff --git a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/MessageHandlerTest.java b/jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/MessageHandlerTest.java
similarity index 99%
rename from jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/MessageHandlerTest.java
rename to jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/MessageHandlerTest.java
index e48d38d58a7..fc14e360b83 100644
--- a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/MessageHandlerTest.java
+++ b/jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/MessageHandlerTest.java
@@ -65,7 +65,7 @@ public class MessageHandlerTest
coreSession = new CoreSession.Empty()
{
- private ByteBufferPool byteBufferPool = new MappedByteBufferPool();
+ private final ByteBufferPool byteBufferPool = new MappedByteBufferPool();
@Override
public void sendFrame(Frame frame, Callback callback, boolean batch)
diff --git a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/OpCodeTest.java b/jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/OpCodeTest.java
similarity index 100%
rename from jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/OpCodeTest.java
rename to jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/OpCodeTest.java
diff --git a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/OutgoingFramesCapture.java b/jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/OutgoingFramesCapture.java
similarity index 100%
rename from jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/OutgoingFramesCapture.java
rename to jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/OutgoingFramesCapture.java
diff --git a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/OutgoingNetworkBytesCapture.java b/jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/OutgoingNetworkBytesCapture.java
similarity index 98%
rename from jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/OutgoingNetworkBytesCapture.java
rename to jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/OutgoingNetworkBytesCapture.java
index 1c067d2a157..33561dda1f1 100644
--- a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/OutgoingNetworkBytesCapture.java
+++ b/jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/OutgoingNetworkBytesCapture.java
@@ -38,7 +38,7 @@ import static org.hamcrest.Matchers.lessThan;
public class OutgoingNetworkBytesCapture implements OutgoingFrames
{
private final Generator generator;
- private List captured;
+ private final List captured;
public OutgoingNetworkBytesCapture(Generator generator)
{
diff --git a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/ParsePayloadLengthTest.java b/jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/ParsePayloadLengthTest.java
similarity index 100%
rename from jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/ParsePayloadLengthTest.java
rename to jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/ParsePayloadLengthTest.java
diff --git a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/ParserBadCloseStatusCodesTest.java b/jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/ParserBadCloseStatusCodesTest.java
similarity index 98%
rename from jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/ParserBadCloseStatusCodesTest.java
rename to jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/ParserBadCloseStatusCodesTest.java
index 6fe3e60b6c5..4dfc798e772 100644
--- a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/ParserBadCloseStatusCodesTest.java
+++ b/jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/ParserBadCloseStatusCodesTest.java
@@ -65,7 +65,7 @@ public class ParserBadCloseStatusCodesTest
);
}
- private ByteBufferPool bufferPool = new MappedByteBufferPool();
+ private final ByteBufferPool bufferPool = new MappedByteBufferPool();
@ParameterizedTest(name = "closeCode={0} {1}")
@MethodSource("data")
diff --git a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/ParserBadOpCodesTest.java b/jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/ParserBadOpCodesTest.java
similarity index 98%
rename from jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/ParserBadOpCodesTest.java
rename to jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/ParserBadOpCodesTest.java
index a0dfcd2167a..f06c8960e24 100644
--- a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/ParserBadOpCodesTest.java
+++ b/jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/ParserBadOpCodesTest.java
@@ -57,7 +57,7 @@ public class ParserBadOpCodesTest
);
}
- private ByteBufferPool bufferPool = new MappedByteBufferPool();
+ private final ByteBufferPool bufferPool = new MappedByteBufferPool();
@ParameterizedTest(name = "opcode={0} {1}")
@MethodSource("data")
diff --git a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/ParserCapture.java b/jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/ParserCapture.java
similarity index 100%
rename from jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/ParserCapture.java
rename to jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/ParserCapture.java
diff --git a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/ParserGoodCloseStatusCodesTest.java b/jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/ParserGoodCloseStatusCodesTest.java
similarity index 100%
rename from jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/ParserGoodCloseStatusCodesTest.java
rename to jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/ParserGoodCloseStatusCodesTest.java
diff --git a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/ParserReservedBitTest.java b/jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/ParserReservedBitTest.java
similarity index 100%
rename from jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/ParserReservedBitTest.java
rename to jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/ParserReservedBitTest.java
diff --git a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/ParserTest.java b/jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/ParserTest.java
similarity index 100%
rename from jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/ParserTest.java
rename to jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/ParserTest.java
diff --git a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/RawFrameBuilder.java b/jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/RawFrameBuilder.java
similarity index 100%
rename from jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/RawFrameBuilder.java
rename to jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/RawFrameBuilder.java
diff --git a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/SynchronousFrameHandler.java b/jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/SynchronousFrameHandler.java
similarity index 100%
rename from jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/SynchronousFrameHandler.java
rename to jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/SynchronousFrameHandler.java
diff --git a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/TestAsyncFrameHandler.java b/jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/TestAsyncFrameHandler.java
similarity index 100%
rename from jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/TestAsyncFrameHandler.java
rename to jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/TestAsyncFrameHandler.java
diff --git a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/TestFrameHandler.java b/jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/TestFrameHandler.java
similarity index 100%
rename from jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/TestFrameHandler.java
rename to jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/TestFrameHandler.java
diff --git a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/TestMessageHandler.java b/jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/TestMessageHandler.java
similarity index 100%
rename from jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/TestMessageHandler.java
rename to jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/TestMessageHandler.java
diff --git a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/TestUpgradeHandler.java b/jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/TestUpgradeHandler.java
similarity index 100%
rename from jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/TestUpgradeHandler.java
rename to jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/TestUpgradeHandler.java
diff --git a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/TestWebSocketNegotiator.java b/jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/TestWebSocketNegotiator.java
similarity index 100%
rename from jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/TestWebSocketNegotiator.java
rename to jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/TestWebSocketNegotiator.java
diff --git a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/TestWebSocketUpgradeHandler.java b/jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/TestWebSocketUpgradeHandler.java
similarity index 100%
rename from jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/TestWebSocketUpgradeHandler.java
rename to jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/TestWebSocketUpgradeHandler.java
diff --git a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/Timeouts.java b/jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/Timeouts.java
similarity index 100%
rename from jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/Timeouts.java
rename to jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/Timeouts.java
diff --git a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/WebSocketCloseTest.java b/jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/WebSocketCloseTest.java
similarity index 99%
rename from jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/WebSocketCloseTest.java
rename to jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/WebSocketCloseTest.java
index bac1e2451d6..eeef7f56d4f 100644
--- a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/WebSocketCloseTest.java
+++ b/jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/WebSocketCloseTest.java
@@ -58,7 +58,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
*/
public class WebSocketCloseTest extends WebSocketTester
{
- private static Logger LOG = LoggerFactory.getLogger(WebSocketCloseTest.class);
+ private static final Logger LOG = LoggerFactory.getLogger(WebSocketCloseTest.class);
private static final String WS_SCHEME = "ws";
private static final String WSS_SCHEME = "wss";
diff --git a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/WebSocketFrameTest.java b/jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/WebSocketFrameTest.java
similarity index 98%
rename from jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/WebSocketFrameTest.java
rename to jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/WebSocketFrameTest.java
index 3ef42883dce..6c75606b6ad 100644
--- a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/WebSocketFrameTest.java
+++ b/jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/WebSocketFrameTest.java
@@ -32,7 +32,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
public class WebSocketFrameTest
{
- private Generator generator = new Generator();
+ private final Generator generator = new Generator();
private ByteBuffer generateWholeFrame(Generator generator, Frame frame)
{
diff --git a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/WebSocketNegotiationTest.java b/jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/WebSocketNegotiationTest.java
similarity index 99%
rename from jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/WebSocketNegotiationTest.java
rename to jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/WebSocketNegotiationTest.java
index 4cee6345c71..5fc140cb0b6 100644
--- a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/WebSocketNegotiationTest.java
+++ b/jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/WebSocketNegotiationTest.java
@@ -76,7 +76,7 @@ public class WebSocketNegotiationTest extends WebSocketTester
private WebSocketServer server;
private WebSocketCoreClient client;
- private WebSocketComponents components = new WebSocketComponents();
+ private final WebSocketComponents components = new WebSocketComponents();
@BeforeEach
public void startup() throws Exception
diff --git a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/WebSocketOpenTest.java b/jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/WebSocketOpenTest.java
similarity index 98%
rename from jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/WebSocketOpenTest.java
rename to jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/WebSocketOpenTest.java
index a96241d613d..1b564a76448 100644
--- a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/WebSocketOpenTest.java
+++ b/jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/WebSocketOpenTest.java
@@ -46,7 +46,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
*/
public class WebSocketOpenTest extends WebSocketTester
{
- private static Logger LOG = LoggerFactory.getLogger(WebSocketOpenTest.class);
+ private static final Logger LOG = LoggerFactory.getLogger(WebSocketOpenTest.class);
private WebSocketServer server;
private DemandingAsyncFrameHandler serverHandler;
@@ -190,7 +190,7 @@ public class WebSocketOpenTest extends WebSocketTester
static class DemandingAsyncFrameHandler extends TestAsyncFrameHandler
{
- private BiFunction onOpen;
+ private final BiFunction onOpen;
DemandingAsyncFrameHandler(BiFunction onOpen)
{
diff --git a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/WebSocketServer.java b/jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/WebSocketServer.java
similarity index 100%
rename from jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/WebSocketServer.java
rename to jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/WebSocketServer.java
diff --git a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/WebSocketTester.java b/jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/WebSocketTester.java
similarity index 98%
rename from jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/WebSocketTester.java
rename to jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/WebSocketTester.java
index 8ea7da37f89..4eb84f8cc0a 100644
--- a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/WebSocketTester.java
+++ b/jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/WebSocketTester.java
@@ -44,7 +44,7 @@ import static org.hamcrest.Matchers.startsWith;
public class WebSocketTester
{
- private static String NON_RANDOM_KEY = Base64.getEncoder().encodeToString("0123456701234567".getBytes());
+ private static final String NON_RANDOM_KEY = Base64.getEncoder().encodeToString("0123456701234567".getBytes());
private static SslContextFactory.Client sslContextFactory;
protected ByteBufferPool bufferPool;
protected ByteBuffer buffer;
diff --git a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/autobahn/AutobahnFrameHandler.java b/jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/autobahn/AutobahnFrameHandler.java
similarity index 100%
rename from jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/autobahn/AutobahnFrameHandler.java
rename to jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/autobahn/AutobahnFrameHandler.java
diff --git a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/autobahn/CoreAutobahnClient.java b/jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/autobahn/CoreAutobahnClient.java
similarity index 98%
rename from jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/autobahn/CoreAutobahnClient.java
rename to jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/autobahn/CoreAutobahnClient.java
index 79252a0c1a3..3e297e52127 100644
--- a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/autobahn/CoreAutobahnClient.java
+++ b/jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/autobahn/CoreAutobahnClient.java
@@ -138,9 +138,9 @@ public class CoreAutobahnClient
}
private static final Logger LOG = LoggerFactory.getLogger(CoreAutobahnClient.class);
- private URI baseWebsocketUri;
- private WebSocketCoreClient client;
- private String userAgent;
+ private final URI baseWebsocketUri;
+ private final WebSocketCoreClient client;
+ private final String userAgent;
public CoreAutobahnClient(String hostname, int port, String userAgent) throws Exception
{
diff --git a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/autobahn/CoreAutobahnServer.java b/jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/autobahn/CoreAutobahnServer.java
similarity index 100%
rename from jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/autobahn/CoreAutobahnServer.java
rename to jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/autobahn/CoreAutobahnServer.java
diff --git a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/chat/ChatWebSocketClient.java b/jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/chat/ChatWebSocketClient.java
similarity index 95%
rename from jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/chat/ChatWebSocketClient.java
rename to jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/chat/ChatWebSocketClient.java
index e5192c37dc3..3734c499324 100644
--- a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/chat/ChatWebSocketClient.java
+++ b/jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/chat/ChatWebSocketClient.java
@@ -36,11 +36,11 @@ import org.slf4j.LoggerFactory;
public class ChatWebSocketClient
{
- private static Logger LOG = LoggerFactory.getLogger(ChatWebSocketClient.class);
+ private static final Logger LOG = LoggerFactory.getLogger(ChatWebSocketClient.class);
- private URI baseWebsocketUri;
- private WebSocketCoreClient client;
- private MessageHandler handler;
+ private final URI baseWebsocketUri;
+ private final WebSocketCoreClient client;
+ private final MessageHandler handler;
private String name = String.format("unknown@%x", ThreadLocalRandom.current().nextInt());
public ChatWebSocketClient(String hostname, int port) throws Exception
diff --git a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/chat/ChatWebSocketServer.java b/jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/chat/ChatWebSocketServer.java
similarity index 98%
rename from jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/chat/ChatWebSocketServer.java
rename to jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/chat/ChatWebSocketServer.java
index 493946f2183..fee18160955 100644
--- a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/chat/ChatWebSocketServer.java
+++ b/jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/chat/ChatWebSocketServer.java
@@ -45,7 +45,7 @@ import static org.eclipse.jetty.util.Callback.NOOP;
public class ChatWebSocketServer
{
- private Set members = new HashSet<>();
+ private final Set members = new HashSet<>();
private FrameHandler negotiate(Negotiation negotiation)
{
diff --git a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/client/WebSocketClientServerTest.java b/jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/client/WebSocketClientServerTest.java
similarity index 98%
rename from jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/client/WebSocketClientServerTest.java
rename to jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/client/WebSocketClientServerTest.java
index 8a4260cad67..3a4dc6741a4 100644
--- a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/client/WebSocketClientServerTest.java
+++ b/jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/client/WebSocketClientServerTest.java
@@ -45,7 +45,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
*/
public class WebSocketClientServerTest
{
- private static Logger LOG = LoggerFactory.getLogger(WebSocketClientServerTest.class);
+ private static final Logger LOG = LoggerFactory.getLogger(WebSocketClientServerTest.class);
private WebSocketServer server;
private TestFrameHandler serverHandler;
diff --git a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/extensions/AbstractExtensionTest.java b/jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/extensions/AbstractExtensionTest.java
similarity index 100%
rename from jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/extensions/AbstractExtensionTest.java
rename to jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/extensions/AbstractExtensionTest.java
diff --git a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/extensions/ExtensionConfigTest.java b/jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/extensions/ExtensionConfigTest.java
similarity index 100%
rename from jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/extensions/ExtensionConfigTest.java
rename to jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/extensions/ExtensionConfigTest.java
diff --git a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/extensions/ExtensionStackTest.java b/jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/extensions/ExtensionStackTest.java
similarity index 100%
rename from jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/extensions/ExtensionStackTest.java
rename to jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/extensions/ExtensionStackTest.java
diff --git a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/extensions/ExtensionTool.java b/jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/extensions/ExtensionTool.java
similarity index 97%
rename from jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/extensions/ExtensionTool.java
rename to jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/extensions/ExtensionTool.java
index c8d080b0a13..1f5d2826da4 100644
--- a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/extensions/ExtensionTool.java
+++ b/jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/extensions/ExtensionTool.java
@@ -51,11 +51,11 @@ public class ExtensionTool
{
public class Tester
{
- private String requestedExtParams;
- private ExtensionConfig extConfig;
+ private final String requestedExtParams;
+ private final ExtensionConfig extConfig;
private Extension ext;
- private Parser parser;
- private IncomingFramesCapture capture;
+ private final Parser parser;
+ private final IncomingFramesCapture capture;
private Tester(String parameterizedExtension)
{
diff --git a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/extensions/FragmentExtensionTest.java b/jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/extensions/FragmentExtensionTest.java
similarity index 100%
rename from jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/extensions/FragmentExtensionTest.java
rename to jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/extensions/FragmentExtensionTest.java
diff --git a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/extensions/IdentityExtensionTest.java b/jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/extensions/IdentityExtensionTest.java
similarity index 100%
rename from jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/extensions/IdentityExtensionTest.java
rename to jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/extensions/IdentityExtensionTest.java
diff --git a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/extensions/PerMessageDeflateExtensionTest.java b/jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/extensions/PerMessageDeflateExtensionTest.java
similarity index 100%
rename from jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/extensions/PerMessageDeflateExtensionTest.java
rename to jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/extensions/PerMessageDeflateExtensionTest.java
diff --git a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/extensions/PerMessageDeflaterBufferSizeTest.java b/jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/extensions/PerMessageDeflaterBufferSizeTest.java
similarity index 98%
rename from jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/extensions/PerMessageDeflaterBufferSizeTest.java
rename to jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/extensions/PerMessageDeflaterBufferSizeTest.java
index 8d3a40bae68..5f28a82b544 100644
--- a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/extensions/PerMessageDeflaterBufferSizeTest.java
+++ b/jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/extensions/PerMessageDeflaterBufferSizeTest.java
@@ -53,8 +53,8 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
public class PerMessageDeflaterBufferSizeTest
{
private WebSocketServer server;
- private TestFrameHandler serverHandler = new TestFrameHandler();
- private TestNegotiator testNegotiator = new TestNegotiator();
+ private final TestFrameHandler serverHandler = new TestFrameHandler();
+ private final TestNegotiator testNegotiator = new TestNegotiator();
private URI serverUri;
private WebSocketCoreClient client;
diff --git a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/extensions/ValidationExtensionTest.java b/jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/extensions/ValidationExtensionTest.java
similarity index 100%
rename from jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/extensions/ValidationExtensionTest.java
rename to jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/extensions/ValidationExtensionTest.java
diff --git a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/internal/FrameFlusherTest.java b/jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/internal/FrameFlusherTest.java
similarity index 99%
rename from jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/internal/FrameFlusherTest.java
rename to jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/internal/FrameFlusherTest.java
index 2e376571e18..35f034d244c 100644
--- a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/internal/FrameFlusherTest.java
+++ b/jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/internal/FrameFlusherTest.java
@@ -57,7 +57,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
public class FrameFlusherTest
{
- private ByteBufferPool bufferPool = new MappedByteBufferPool();
+ private final ByteBufferPool bufferPool = new MappedByteBufferPool();
private Scheduler scheduler;
@BeforeEach
diff --git a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/internal/MockEndpoint.java b/jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/internal/MockEndpoint.java
similarity index 100%
rename from jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/internal/MockEndpoint.java
rename to jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/internal/MockEndpoint.java
diff --git a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/proxy/WebSocketProxy.java b/jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/proxy/WebSocketProxy.java
similarity index 99%
rename from jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/proxy/WebSocketProxy.java
rename to jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/proxy/WebSocketProxy.java
index 5d6944e0bdc..6af276077e1 100644
--- a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/proxy/WebSocketProxy.java
+++ b/jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/proxy/WebSocketProxy.java
@@ -51,8 +51,8 @@ class WebSocketProxy
}
private final Object lock = new Object();
- private WebSocketCoreClient client;
- private URI serverUri;
+ private final WebSocketCoreClient client;
+ private final URI serverUri;
public Client2Proxy client2Proxy = new Client2Proxy();
public Server2Proxy server2Proxy = new Server2Proxy();
diff --git a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/proxy/WebSocketProxyTest.java b/jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/proxy/WebSocketProxyTest.java
similarity index 100%
rename from jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/proxy/WebSocketProxyTest.java
rename to jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/proxy/WebSocketProxyTest.java
diff --git a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/server/WebSocketServerTest.java b/jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/server/WebSocketServerTest.java
similarity index 99%
rename from jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/server/WebSocketServerTest.java
rename to jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/server/WebSocketServerTest.java
index 66f235de234..d46db6e37f0 100644
--- a/jetty-websocket/websocket-core/src/test/java/org/eclipse/jetty/websocket/core/server/WebSocketServerTest.java
+++ b/jetty-websocket/websocket-core-tests/src/test/java/org/eclipse/jetty/websocket/core/server/WebSocketServerTest.java
@@ -53,7 +53,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
*/
public class WebSocketServerTest extends WebSocketTester
{
- private static Logger LOG = LoggerFactory.getLogger(WebSocketServerTest.class);
+ private static final Logger LOG = LoggerFactory.getLogger(WebSocketServerTest.class);
private WebSocketServer server;
diff --git a/jetty-websocket/websocket-core/src/test/resources/jetty-logging.properties b/jetty-websocket/websocket-core-tests/src/test/resources/jetty-logging.properties
similarity index 100%
rename from jetty-websocket/websocket-core/src/test/resources/jetty-logging.properties
rename to jetty-websocket/websocket-core-tests/src/test/resources/jetty-logging.properties
diff --git a/jetty-websocket/websocket-core/src/test/resources/keystore.p12 b/jetty-websocket/websocket-core-tests/src/test/resources/keystore.p12
similarity index 100%
rename from jetty-websocket/websocket-core/src/test/resources/keystore.p12
rename to jetty-websocket/websocket-core-tests/src/test/resources/keystore.p12
diff --git a/jetty-websocket/websocket-javax-client/pom.xml b/jetty-websocket/websocket-javax-client/pom.xml
index b2fa1cd48aa..3d3f594e723 100644
--- a/jetty-websocket/websocket-javax-client/pom.xml
+++ b/jetty-websocket/websocket-javax-client/pom.xml
@@ -15,6 +15,15 @@
+
+ org.eclipse.jetty.toolchain
+ jetty-javax-websocket-api
+
+
+ org.eclipse.jetty.websocket
+ websocket-javax-common
+ ${project.version}
+ org.eclipse.jetty.websocketwebsocket-util
@@ -22,7 +31,7 @@
org.eclipse.jetty.websocket
- websocket-javax-common
+ websocket-core-client${project.version}
@@ -30,21 +39,12 @@
jetty-client${project.version}
-
- org.eclipse.jetty.toolchain
- jetty-javax-websocket-api
- org.eclipse.jettyjetty-xml${project.version}test
-
- org.eclipse.jetty.toolchain
- jetty-test-helper
- test
-
diff --git a/jetty-websocket/websocket-javax-client/src/main/java/module-info.java b/jetty-websocket/websocket-javax-client/src/main/java/module-info.java
index eb58cdef38e..362a4a64ac5 100644
--- a/jetty-websocket/websocket-javax-client/src/main/java/module-info.java
+++ b/jetty-websocket/websocket-javax-client/src/main/java/module-info.java
@@ -25,9 +25,10 @@ module org.eclipse.jetty.websocket.javax.client
exports org.eclipse.jetty.websocket.javax.client;
exports org.eclipse.jetty.websocket.javax.client.internal to org.eclipse.jetty.websocket.javax.server;
- requires transitive jetty.websocket.api;
- requires transitive org.eclipse.jetty.client;
+ requires org.eclipse.jetty.client;
+ requires org.eclipse.jetty.websocket.core.client;
requires org.eclipse.jetty.websocket.javax.common;
+ requires transitive jetty.websocket.api;
provides ContainerProvider with JavaxWebSocketClientContainerProvider;
}
diff --git a/jetty-websocket/websocket-javax-common/pom.xml b/jetty-websocket/websocket-javax-common/pom.xml
index d606965d46c..5788cfeb68a 100644
--- a/jetty-websocket/websocket-javax-common/pom.xml
+++ b/jetty-websocket/websocket-javax-common/pom.xml
@@ -67,9 +67,8 @@
- org.eclipse.jetty.websocket
- websocket-core
- ${project.version}
+ org.eclipse.jetty.toolchain
+ jetty-javax-websocket-apiorg.eclipse.jetty.websocket
@@ -77,8 +76,9 @@
${project.version}
- org.eclipse.jetty.toolchain
- jetty-javax-websocket-api
+ org.eclipse.jetty.websocket
+ websocket-core-client
+ ${project.version}org.slf4j
@@ -89,10 +89,5 @@
jetty-slf4j-impltest
-
- org.eclipse.jetty.toolchain
- jetty-test-helper
- test
-
diff --git a/jetty-websocket/websocket-javax-common/src/main/java/module-info.java b/jetty-websocket/websocket-javax-common/src/main/java/module-info.java
index 08b85dda862..97397c3d70e 100644
--- a/jetty-websocket/websocket-javax-common/src/main/java/module-info.java
+++ b/jetty-websocket/websocket-javax-common/src/main/java/module-info.java
@@ -23,10 +23,8 @@ module org.eclipse.jetty.websocket.javax.common
exports org.eclipse.jetty.websocket.javax.common.encoders;
exports org.eclipse.jetty.websocket.javax.common.messages;
- requires transitive jetty.websocket.api;
- requires transitive org.eclipse.jetty.http;
- requires transitive org.eclipse.jetty.io;
- requires transitive org.eclipse.jetty.websocket.core;
- requires transitive org.eclipse.jetty.websocket.util;
requires org.slf4j;
+ requires transitive jetty.websocket.api;
+ requires transitive org.eclipse.jetty.websocket.core.client;
+ requires transitive org.eclipse.jetty.websocket.util;
}
diff --git a/jetty-websocket/websocket-javax-server/pom.xml b/jetty-websocket/websocket-javax-server/pom.xml
index d629de14878..e543c2dc12c 100644
--- a/jetty-websocket/websocket-javax-server/pom.xml
+++ b/jetty-websocket/websocket-javax-server/pom.xml
@@ -43,11 +43,6 @@
jetty-slf4j-impltest
-
- org.eclipse.jetty.toolchain
- jetty-test-helper
- test
-
diff --git a/jetty-websocket/websocket-javax-server/src/main/config/modules/websocket-javax.mod b/jetty-websocket/websocket-javax-server/src/main/config/modules/websocket-javax.mod
index d46554bdfaf..bb9bd0b26c5 100644
--- a/jetty-websocket/websocket-javax-server/src/main/config/modules/websocket-javax.mod
+++ b/jetty-websocket/websocket-javax-server/src/main/config/modules/websocket-javax.mod
@@ -11,7 +11,9 @@ client
annotations
[lib]
-lib/websocket/websocket-core-${jetty.version}.jar
+lib/websocket/websocket-core-common-${jetty.version}.jar
+lib/websocket/websocket-core-client-${jetty.version}.jar
+lib/websocket/websocket-core-server-${jetty.version}.jar
lib/websocket/websocket-util-${jetty.version}.jar
lib/websocket/websocket-util-server-${jetty.version}.jar
lib/websocket/jetty-javax-websocket-api-1.1.2.jar
diff --git a/jetty-websocket/websocket-javax-server/src/main/java/module-info.java b/jetty-websocket/websocket-javax-server/src/main/java/module-info.java
index af5c88bbdd4..c4ad6598d80 100644
--- a/jetty-websocket/websocket-javax-server/src/main/java/module-info.java
+++ b/jetty-websocket/websocket-javax-server/src/main/java/module-info.java
@@ -28,11 +28,11 @@ module org.eclipse.jetty.websocket.javax.server
{
exports org.eclipse.jetty.websocket.javax.server.config;
- requires transitive org.eclipse.jetty.webapp;
- requires transitive org.eclipse.jetty.websocket.javax.client;
requires org.eclipse.jetty.websocket.javax.common;
requires org.eclipse.jetty.websocket.util.server;
requires org.slf4j;
+ requires transitive org.eclipse.jetty.webapp;
+ requires transitive org.eclipse.jetty.websocket.javax.client;
provides ServletContainerInitializer with JavaxWebSocketServletContainerInitializer;
provides ServerEndpointConfig.Configurator with ContainerDefaultConfigurator;
diff --git a/jetty-websocket/websocket-javax-server/src/main/java/org/eclipse/jetty/websocket/javax/server/config/JavaxWebSocketServletContainerInitializer.java b/jetty-websocket/websocket-javax-server/src/main/java/org/eclipse/jetty/websocket/javax/server/config/JavaxWebSocketServletContainerInitializer.java
index 87739c6a434..af4cca34fe3 100644
--- a/jetty-websocket/websocket-javax-server/src/main/java/org/eclipse/jetty/websocket/javax/server/config/JavaxWebSocketServletContainerInitializer.java
+++ b/jetty-websocket/websocket-javax-server/src/main/java/org/eclipse/jetty/websocket/javax/server/config/JavaxWebSocketServletContainerInitializer.java
@@ -37,6 +37,7 @@ import org.eclipse.jetty.servlet.listener.ContainerInitializer;
import org.eclipse.jetty.util.TypeUtil;
import org.eclipse.jetty.util.thread.ThreadClassLoaderScope;
import org.eclipse.jetty.websocket.core.WebSocketComponents;
+import org.eclipse.jetty.websocket.core.server.WebSocketServerComponents;
import org.eclipse.jetty.websocket.javax.server.internal.JavaxWebSocketServerContainer;
import org.eclipse.jetty.websocket.util.server.WebSocketUpgradeFilter;
import org.eclipse.jetty.websocket.util.server.internal.WebSocketMapping;
@@ -70,20 +71,14 @@ public class JavaxWebSocketServletContainerInitializer implements ServletContain
String cp = context.getInitParameter(keyName);
if (cp != null)
{
- if (TypeUtil.isTrue(cp))
- return true;
- else
- return false;
+ return TypeUtil.isTrue(cp);
}
// Next, try attribute on context
Object enable = context.getAttribute(keyName);
if (enable != null)
{
- if (TypeUtil.isTrue(enable))
- return true;
- else
- return false;
+ return TypeUtil.isTrue(enable);
}
return null;
@@ -153,7 +148,7 @@ public class JavaxWebSocketServletContainerInitializer implements ServletContain
JavaxWebSocketServerContainer serverContainer = JavaxWebSocketServerContainer.getContainer(context.getServletContext());
if (serverContainer == null)
{
- WebSocketComponents components = WebSocketComponents.ensureWebSocketComponents(context.getServletContext());
+ WebSocketComponents components = WebSocketServerComponents.ensureWebSocketComponents(context.getServletContext());
FilterHolder filterHolder = WebSocketUpgradeFilter.ensureFilter(context.getServletContext());
WebSocketMapping mapping = WebSocketMapping.ensureMapping(context.getServletContext(), WebSocketMapping.DEFAULT_KEY);
serverContainer = JavaxWebSocketServerContainer.ensureContainer(context.getServletContext());
diff --git a/jetty-websocket/websocket-javax-server/src/main/java/org/eclipse/jetty/websocket/javax/server/internal/JavaxWebSocketServerContainer.java b/jetty-websocket/websocket-javax-server/src/main/java/org/eclipse/jetty/websocket/javax/server/internal/JavaxWebSocketServerContainer.java
index 35a5ba4a86c..59f211b5f2e 100644
--- a/jetty-websocket/websocket-javax-server/src/main/java/org/eclipse/jetty/websocket/javax/server/internal/JavaxWebSocketServerContainer.java
+++ b/jetty-websocket/websocket-javax-server/src/main/java/org/eclipse/jetty/websocket/javax/server/internal/JavaxWebSocketServerContainer.java
@@ -37,6 +37,7 @@ import org.eclipse.jetty.util.component.LifeCycle;
import org.eclipse.jetty.websocket.core.WebSocketComponents;
import org.eclipse.jetty.websocket.core.client.WebSocketCoreClient;
import org.eclipse.jetty.websocket.core.exception.WebSocketException;
+import org.eclipse.jetty.websocket.core.server.WebSocketServerComponents;
import org.eclipse.jetty.websocket.javax.client.internal.JavaxWebSocketClientContainer;
import org.eclipse.jetty.websocket.javax.server.config.JavaxWebSocketServletContainerInitializer;
import org.eclipse.jetty.websocket.util.server.internal.WebSocketMapping;
@@ -95,7 +96,7 @@ public class JavaxWebSocketServerContainer extends JavaxWebSocketClientContainer
// Create the Jetty ServerContainer implementation
container = new JavaxWebSocketServerContainer(
WebSocketMapping.ensureMapping(servletContext, WebSocketMapping.DEFAULT_KEY),
- WebSocketComponents.ensureWebSocketComponents(servletContext),
+ WebSocketServerComponents.ensureWebSocketComponents(servletContext),
coreClientSupplier);
contextHandler.addManaged(container);
contextHandler.addEventListener(container);
diff --git a/jetty-websocket/websocket-jetty-api/pom.xml b/jetty-websocket/websocket-jetty-api/pom.xml
index 5f7a34e1f77..15edf958083 100644
--- a/jetty-websocket/websocket-jetty-api/pom.xml
+++ b/jetty-websocket/websocket-jetty-api/pom.xml
@@ -14,14 +14,6 @@
${project.groupId}.api
-
-
- org.eclipse.jetty.toolchain
- jetty-test-helper
- test
-
-
-
diff --git a/jetty-websocket/websocket-jetty-client/pom.xml b/jetty-websocket/websocket-jetty-client/pom.xml
index ad9d334d39f..cc3c39db832 100644
--- a/jetty-websocket/websocket-jetty-client/pom.xml
+++ b/jetty-websocket/websocket-jetty-client/pom.xml
@@ -25,6 +25,11 @@
websocket-jetty-common${project.version}
+
+ org.eclipse.jetty.websocket
+ websocket-core-client
+ ${project.version}
+ org.eclipse.jettyjetty-client
@@ -39,11 +44,6 @@
jetty-slf4j-impltest
-
- org.eclipse.jetty.toolchain
- jetty-test-helper
- test
-
diff --git a/jetty-websocket/websocket-jetty-client/src/main/java/module-info.java b/jetty-websocket/websocket-jetty-client/src/main/java/module-info.java
index aa113d80a62..27c6f8600c3 100644
--- a/jetty-websocket/websocket-jetty-client/src/main/java/module-info.java
+++ b/jetty-websocket/websocket-jetty-client/src/main/java/module-info.java
@@ -20,9 +20,9 @@ module org.eclipse.jetty.websocket.jetty.client
{
exports org.eclipse.jetty.websocket.client;
- requires transitive org.eclipse.jetty.client;
- requires transitive org.eclipse.jetty.websocket.jetty.api;
- requires org.eclipse.jetty.websocket.core;
+ requires org.eclipse.jetty.websocket.core.client;
requires org.eclipse.jetty.websocket.jetty.common;
requires org.slf4j;
+ requires transitive org.eclipse.jetty.client;
+ requires transitive org.eclipse.jetty.websocket.jetty.api;
}
diff --git a/jetty-websocket/websocket-jetty-common/pom.xml b/jetty-websocket/websocket-jetty-common/pom.xml
index 83c726eb91d..b3809d06724 100644
--- a/jetty-websocket/websocket-jetty-common/pom.xml
+++ b/jetty-websocket/websocket-jetty-common/pom.xml
@@ -51,39 +51,10 @@
websocket-jetty-api${project.version}
-
- org.eclipse.jetty.websocket
- websocket-core
- ${project.version}
- org.eclipse.jetty.websocketwebsocket-util${project.version}
-
- org.eclipse.jetty
- jetty-util
- ${project.version}
-
-
- org.eclipse.jetty
- jetty-io
- ${project.version}
-
-
- org.slf4j
- slf4j-api
-
-
- org.eclipse.jetty
- jetty-slf4j-impl
- test
-
-
- org.eclipse.jetty.toolchain
- jetty-test-helper
- test
-
diff --git a/jetty-websocket/websocket-jetty-common/src/main/java/module-info.java b/jetty-websocket/websocket-jetty-common/src/main/java/module-info.java
index 3b652531aab..4bac66d7684 100644
--- a/jetty-websocket/websocket-jetty-common/src/main/java/module-info.java
+++ b/jetty-websocket/websocket-jetty-common/src/main/java/module-info.java
@@ -23,10 +23,11 @@ module org.eclipse.jetty.websocket.jetty.common
{
exports org.eclipse.jetty.websocket.common;
- requires transitive org.eclipse.jetty.websocket.core;
+ requires org.eclipse.jetty.util;
+ requires org.slf4j;
+ requires transitive org.eclipse.jetty.websocket.core.common;
requires transitive org.eclipse.jetty.websocket.jetty.api;
requires transitive org.eclipse.jetty.websocket.util;
- requires org.slf4j;
provides ExtensionConfig.Parser with ExtensionConfigParser;
}
diff --git a/jetty-websocket/websocket-jetty-server/pom.xml b/jetty-websocket/websocket-jetty-server/pom.xml
index ade9576c6e7..0387a72b773 100644
--- a/jetty-websocket/websocket-jetty-server/pom.xml
+++ b/jetty-websocket/websocket-jetty-server/pom.xml
@@ -15,27 +15,6 @@
-
- org.eclipse.jetty
- jetty-servlet
- ${project.version}
-
-
- org.eclipse.jetty
- jetty-annotations
- ${project.version}
-
-
- org.eclipse.jetty
- jetty-server
- ${project.version}
-
-
- org.eclipse.jetty
- jetty-jmx
- ${project.version}
- true
- org.eclipse.jetty.websocketwebsocket-jetty-api
@@ -55,6 +34,22 @@
org.eclipse.jetty.toolchainjetty-servlet-api
+
+ org.eclipse.jetty
+ jetty-servlet
+ ${project.version}
+
+
+ org.eclipse.jetty
+ jetty-annotations
+ ${project.version}
+
+
+ org.eclipse.jetty
+ jetty-jmx
+ ${project.version}
+ true
+ org.slf4jslf4j-api
@@ -64,11 +59,6 @@
jetty-slf4j-impltest
-
- org.eclipse.jetty.toolchain
- jetty-test-helper
- test
-
diff --git a/jetty-websocket/websocket-jetty-server/src/main/config/modules/websocket-jetty.mod b/jetty-websocket/websocket-jetty-server/src/main/config/modules/websocket-jetty.mod
index 9a93574f2bf..0dae0b934d1 100644
--- a/jetty-websocket/websocket-jetty-server/src/main/config/modules/websocket-jetty.mod
+++ b/jetty-websocket/websocket-jetty-server/src/main/config/modules/websocket-jetty.mod
@@ -11,7 +11,9 @@ client
annotations
[lib]
-lib/websocket/websocket-core-${jetty.version}.jar
+lib/websocket/websocket-core-common-${jetty.version}.jar
+lib/websocket/websocket-core-client-${jetty.version}.jar
+lib/websocket/websocket-core-server-${jetty.version}.jar
lib/websocket/websocket-util-${jetty.version}.jar
lib/websocket/websocket-util-server-${jetty.version}.jar
lib/websocket/websocket-jetty-api-${jetty.version}.jar
diff --git a/jetty-websocket/websocket-jetty-server/src/main/java/org/eclipse/jetty/websocket/server/JettyWebSocketServerContainer.java b/jetty-websocket/websocket-jetty-server/src/main/java/org/eclipse/jetty/websocket/server/JettyWebSocketServerContainer.java
index 06a614efec2..bc6c85030e8 100644
--- a/jetty-websocket/websocket-jetty-server/src/main/java/org/eclipse/jetty/websocket/server/JettyWebSocketServerContainer.java
+++ b/jetty-websocket/websocket-jetty-server/src/main/java/org/eclipse/jetty/websocket/server/JettyWebSocketServerContainer.java
@@ -39,6 +39,7 @@ import org.eclipse.jetty.websocket.common.SessionTracker;
import org.eclipse.jetty.websocket.core.Configuration;
import org.eclipse.jetty.websocket.core.WebSocketComponents;
import org.eclipse.jetty.websocket.core.exception.WebSocketException;
+import org.eclipse.jetty.websocket.core.server.WebSocketServerComponents;
import org.eclipse.jetty.websocket.server.config.JettyWebSocketServletContainerInitializer;
import org.eclipse.jetty.websocket.server.internal.JettyServerFrameHandlerFactory;
import org.eclipse.jetty.websocket.util.server.internal.FrameHandlerFactory;
@@ -73,7 +74,7 @@ public class JettyWebSocketServerContainer extends ContainerLifeCycle implements
container = new JettyWebSocketServerContainer(
contextHandler,
WebSocketMapping.ensureMapping(servletContext, WebSocketMapping.DEFAULT_KEY),
- WebSocketComponents.ensureWebSocketComponents(servletContext), executor);
+ WebSocketServerComponents.ensureWebSocketComponents(servletContext), executor);
servletContext.setAttribute(JETTY_WEBSOCKET_CONTAINER_ATTRIBUTE, container);
contextHandler.addManaged(container);
contextHandler.addEventListener(container);
diff --git a/jetty-websocket/websocket-jetty-server/src/main/java/org/eclipse/jetty/websocket/server/JettyWebSocketServlet.java b/jetty-websocket/websocket-jetty-server/src/main/java/org/eclipse/jetty/websocket/server/JettyWebSocketServlet.java
index 448694577c5..be184470323 100644
--- a/jetty-websocket/websocket-jetty-server/src/main/java/org/eclipse/jetty/websocket/server/JettyWebSocketServlet.java
+++ b/jetty-websocket/websocket-jetty-server/src/main/java/org/eclipse/jetty/websocket/server/JettyWebSocketServlet.java
@@ -31,6 +31,7 @@ import javax.servlet.http.HttpServletResponse;
import org.eclipse.jetty.server.handler.ContextHandler;
import org.eclipse.jetty.websocket.core.Configuration;
import org.eclipse.jetty.websocket.core.WebSocketComponents;
+import org.eclipse.jetty.websocket.core.server.WebSocketServerComponents;
import org.eclipse.jetty.websocket.server.internal.JettyServerFrameHandlerFactory;
import org.eclipse.jetty.websocket.util.server.WebSocketUpgradeFilter;
import org.eclipse.jetty.websocket.util.server.internal.FrameHandlerFactory;
@@ -129,7 +130,7 @@ public abstract class JettyWebSocketServlet extends HttpServlet
{
ServletContext servletContext = getServletContext();
- components = WebSocketComponents.ensureWebSocketComponents(servletContext);
+ components = WebSocketServerComponents.ensureWebSocketComponents(servletContext);
mapping = new WebSocketMapping(components);
String max = getInitParameter("idleTimeout");
@@ -262,7 +263,7 @@ public abstract class JettyWebSocketServlet extends HttpServlet
private static class WrappedJettyCreator implements WebSocketCreator
{
- private JettyWebSocketCreator creator;
+ private final JettyWebSocketCreator creator;
private WrappedJettyCreator(JettyWebSocketCreator creator)
{
diff --git a/jetty-websocket/websocket-jetty-server/src/main/java/org/eclipse/jetty/websocket/server/config/JettyWebSocketServletContainerInitializer.java b/jetty-websocket/websocket-jetty-server/src/main/java/org/eclipse/jetty/websocket/server/config/JettyWebSocketServletContainerInitializer.java
index 43b65eafd16..3b164c017f8 100644
--- a/jetty-websocket/websocket-jetty-server/src/main/java/org/eclipse/jetty/websocket/server/config/JettyWebSocketServletContainerInitializer.java
+++ b/jetty-websocket/websocket-jetty-server/src/main/java/org/eclipse/jetty/websocket/server/config/JettyWebSocketServletContainerInitializer.java
@@ -26,6 +26,7 @@ import org.eclipse.jetty.servlet.FilterHolder;
import org.eclipse.jetty.servlet.ServletContextHandler;
import org.eclipse.jetty.servlet.listener.ContainerInitializer;
import org.eclipse.jetty.websocket.core.WebSocketComponents;
+import org.eclipse.jetty.websocket.core.server.WebSocketServerComponents;
import org.eclipse.jetty.websocket.server.JettyWebSocketServerContainer;
import org.eclipse.jetty.websocket.util.server.WebSocketUpgradeFilter;
import org.eclipse.jetty.websocket.util.server.internal.WebSocketMapping;
@@ -89,7 +90,7 @@ public class JettyWebSocketServletContainerInitializer implements ServletContain
*/
private static JettyWebSocketServerContainer initialize(ServletContextHandler context)
{
- WebSocketComponents components = WebSocketComponents.ensureWebSocketComponents(context.getServletContext());
+ WebSocketComponents components = WebSocketServerComponents.ensureWebSocketComponents(context.getServletContext());
FilterHolder filterHolder = WebSocketUpgradeFilter.ensureFilter(context.getServletContext());
WebSocketMapping mapping = WebSocketMapping.ensureMapping(context.getServletContext(), WebSocketMapping.DEFAULT_KEY);
JettyWebSocketServerContainer container = JettyWebSocketServerContainer.ensureContainer(context.getServletContext());
diff --git a/jetty-websocket/websocket-util-server/pom.xml b/jetty-websocket/websocket-util-server/pom.xml
index c8b50273799..3fd5fc74a48 100644
--- a/jetty-websocket/websocket-util-server/pom.xml
+++ b/jetty-websocket/websocket-util-server/pom.xml
@@ -66,7 +66,7 @@
org.eclipse.jetty.websocket
- websocket-core
+ websocket-core-server${project.version}
diff --git a/jetty-websocket/websocket-util-server/src/main/java/module-info.java b/jetty-websocket/websocket-util-server/src/main/java/module-info.java
index ae57cc58894..c067bea8bf3 100644
--- a/jetty-websocket/websocket-util-server/src/main/java/module-info.java
+++ b/jetty-websocket/websocket-util-server/src/main/java/module-info.java
@@ -23,5 +23,5 @@ module org.eclipse.jetty.websocket.util.server
requires org.slf4j;
requires transitive org.eclipse.jetty.servlet;
- requires transitive org.eclipse.jetty.websocket.core;
+ requires transitive org.eclipse.jetty.websocket.core.server;
}
diff --git a/jetty-websocket/websocket-util-server/src/main/java/org/eclipse/jetty/websocket/util/server/WebSocketUpgradeFilter.java b/jetty-websocket/websocket-util-server/src/main/java/org/eclipse/jetty/websocket/util/server/WebSocketUpgradeFilter.java
index b0a9c030e90..5a64fc85ef0 100644
--- a/jetty-websocket/websocket-util-server/src/main/java/org/eclipse/jetty/websocket/util/server/WebSocketUpgradeFilter.java
+++ b/jetty-websocket/websocket-util-server/src/main/java/org/eclipse/jetty/websocket/util/server/WebSocketUpgradeFilter.java
@@ -38,7 +38,7 @@ import org.eclipse.jetty.servlet.ServletHandler;
import org.eclipse.jetty.util.annotation.ManagedObject;
import org.eclipse.jetty.util.component.Dumpable;
import org.eclipse.jetty.websocket.core.Configuration;
-import org.eclipse.jetty.websocket.core.WebSocketComponents;
+import org.eclipse.jetty.websocket.core.server.WebSocketServerComponents;
import org.eclipse.jetty.websocket.util.server.internal.WebSocketMapping;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -168,7 +168,7 @@ public class WebSocketUpgradeFilter implements Filter, Dumpable
if (mappingKey != null)
mapping = WebSocketMapping.ensureMapping(context, mappingKey);
else
- mapping = new WebSocketMapping(WebSocketComponents.ensureWebSocketComponents(context));
+ mapping = new WebSocketMapping(WebSocketServerComponents.ensureWebSocketComponents(context));
String max = config.getInitParameter("idleTimeout");
if (max == null)
diff --git a/jetty-websocket/websocket-util-server/src/main/java/org/eclipse/jetty/websocket/util/server/internal/WebSocketMapping.java b/jetty-websocket/websocket-util-server/src/main/java/org/eclipse/jetty/websocket/util/server/internal/WebSocketMapping.java
index a96a55d315c..d76cbd53e9f 100644
--- a/jetty-websocket/websocket-util-server/src/main/java/org/eclipse/jetty/websocket/util/server/internal/WebSocketMapping.java
+++ b/jetty-websocket/websocket-util-server/src/main/java/org/eclipse/jetty/websocket/util/server/internal/WebSocketMapping.java
@@ -42,6 +42,7 @@ import org.eclipse.jetty.websocket.core.exception.WebSocketException;
import org.eclipse.jetty.websocket.core.server.Handshaker;
import org.eclipse.jetty.websocket.core.server.Negotiation;
import org.eclipse.jetty.websocket.core.server.WebSocketNegotiator;
+import org.eclipse.jetty.websocket.core.server.WebSocketServerComponents;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -65,7 +66,7 @@ public class WebSocketMapping implements Dumpable, LifeCycle.Listener
if (mappingObject != null)
{
- if (WebSocketMapping.class.isInstance(mappingObject))
+ if (mappingObject instanceof WebSocketMapping)
return (WebSocketMapping)mappingObject;
else
throw new IllegalStateException(
@@ -88,7 +89,7 @@ public class WebSocketMapping implements Dumpable, LifeCycle.Listener
if (mapping == null)
{
- mapping = new WebSocketMapping(WebSocketComponents.ensureWebSocketComponents(servletContext));
+ mapping = new WebSocketMapping(WebSocketServerComponents.ensureWebSocketComponents(servletContext));
servletContext.setAttribute(mappingKey, mapping);
}
diff --git a/jetty-websocket/websocket-util/pom.xml b/jetty-websocket/websocket-util/pom.xml
index 9412101ce9f..cafdccef949 100644
--- a/jetty-websocket/websocket-util/pom.xml
+++ b/jetty-websocket/websocket-util/pom.xml
@@ -48,7 +48,7 @@
org.eclipse.jetty.websocket
- websocket-core
+ websocket-core-common${project.version}
@@ -60,10 +60,5 @@
jetty-slf4j-impltest
-
- org.eclipse.jetty.toolchain
- jetty-test-helper
- test
-
diff --git a/jetty-websocket/websocket-util/src/main/java/module-info.java b/jetty-websocket/websocket-util/src/main/java/module-info.java
index 183e1fd2715..22dafa0caea 100644
--- a/jetty-websocket/websocket-util/src/main/java/module-info.java
+++ b/jetty-websocket/websocket-util/src/main/java/module-info.java
@@ -21,6 +21,8 @@ module org.eclipse.jetty.websocket.util
exports org.eclipse.jetty.websocket.util;
exports org.eclipse.jetty.websocket.util.messages;
+ requires org.eclipse.jetty.util;
requires org.slf4j;
- requires transitive org.eclipse.jetty.websocket.core;
+ requires org.eclipse.jetty.io;
+ requires transitive org.eclipse.jetty.websocket.core.common;
}
From 8b489806b66197481b5747c73bf01ff0787cb529 Mon Sep 17 00:00:00 2001
From: Lachlan Roberts
Date: Tue, 12 May 2020 17:00:30 +1000
Subject: [PATCH 22/77] Fix osgi issues in websocket-core-common
Signed-off-by: Lachlan Roberts
---
jetty-websocket/websocket-core-common/pom.xml | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/jetty-websocket/websocket-core-common/pom.xml b/jetty-websocket/websocket-core-common/pom.xml
index 4290b2ffb5d..91cfb795f07 100644
--- a/jetty-websocket/websocket-core-common/pom.xml
+++ b/jetty-websocket/websocket-core-common/pom.xml
@@ -75,6 +75,24 @@
+
+ org.apache.felix
+ maven-bundle-plugin
+ true
+
+
+ generate-manifest
+
+ manifest
+
+
+
+ *,org.eclipse.jetty.websocket.core.common.internal.*
+
+
+
+
+
From 9f39fd1dd1b12415b636f0421c8f1715a8283a9b Mon Sep 17 00:00:00 2001
From: Lachlan Roberts
Date: Tue, 12 May 2020 11:54:28 +1000
Subject: [PATCH 23/77] Issue #4861 - reduce garbage created by the async
request attributes
Signed-off-by: Lachlan Roberts
---
.../eclipse/jetty/server/AsyncAttributes.java | 130 ++++++++++++++++++
.../org/eclipse/jetty/server/Dispatcher.java | 22 +--
.../org/eclipse/jetty/server/Request.java | 29 ++--
.../jetty/server/ServletAttributes.java | 64 +++++++++
.../org/eclipse/jetty/util/AttributesMap.java | 3 +-
5 files changed, 217 insertions(+), 31 deletions(-)
create mode 100644 jetty-server/src/main/java/org/eclipse/jetty/server/AsyncAttributes.java
create mode 100644 jetty-server/src/main/java/org/eclipse/jetty/server/ServletAttributes.java
diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/AsyncAttributes.java b/jetty-server/src/main/java/org/eclipse/jetty/server/AsyncAttributes.java
new file mode 100644
index 00000000000..90f0b452896
--- /dev/null
+++ b/jetty-server/src/main/java/org/eclipse/jetty/server/AsyncAttributes.java
@@ -0,0 +1,130 @@
+//
+// ========================================================================
+// Copyright (c) 1995-2020 Mort Bay Consulting Pty Ltd and others.
+// ------------------------------------------------------------------------
+// All rights reserved. This program and the accompanying materials
+// are made available under the terms of the Eclipse Public License v1.0
+// and Apache License v2.0 which accompanies this distribution.
+//
+// The Eclipse Public License is available at
+// http://www.eclipse.org/legal/epl-v10.html
+//
+// The Apache License v2.0 is available at
+// http://www.opensource.org/licenses/apache2.0.php
+//
+// You may elect to redistribute this code under either of these licenses.
+// ========================================================================
+//
+
+package org.eclipse.jetty.server;
+
+import java.util.HashSet;
+import java.util.Set;
+import javax.servlet.AsyncContext;
+
+import org.eclipse.jetty.util.Attributes;
+
+class AsyncAttributes extends Attributes.Wrapper
+{
+ /**
+ * Async dispatch attribute name prefix.
+ */
+ public static final String __ASYNC_PREFIX = "javax.servlet.async.";
+
+ private String _requestURI;
+ private String _contextPath;
+ private String _servletPath;
+ private String _pathInfo;
+ private String _query;
+
+ AsyncAttributes(Attributes attributes)
+ {
+ super(attributes);
+ }
+
+ @Override
+ public Object getAttribute(String key)
+ {
+ if (!key.startsWith(__ASYNC_PREFIX))
+ return super.getAttribute(key);
+
+ switch (key)
+ {
+ case AsyncContext.ASYNC_REQUEST_URI:
+ return _requestURI;
+ case AsyncContext.ASYNC_CONTEXT_PATH:
+ return _contextPath;
+ case AsyncContext.ASYNC_SERVLET_PATH:
+ return _servletPath;
+ case AsyncContext.ASYNC_PATH_INFO:
+ return _pathInfo;
+ case AsyncContext.ASYNC_QUERY_STRING:
+ return _query;
+ default:
+ return super.getAttribute(key);
+ }
+ }
+
+ @Override
+ public Set getAttributeNameSet()
+ {
+ HashSet set = new HashSet<>();
+ for (String name : _attributes.getAttributeNameSet())
+ {
+ if (!name.startsWith(__ASYNC_PREFIX))
+ set.add(name);
+ }
+
+ if (_requestURI != null)
+ set.add(AsyncContext.ASYNC_REQUEST_URI);
+ if (_contextPath != null)
+ set.add(AsyncContext.ASYNC_CONTEXT_PATH);
+ if (_servletPath != null)
+ set.add(AsyncContext.ASYNC_SERVLET_PATH);
+ if (_pathInfo != null)
+ set.add(AsyncContext.ASYNC_PATH_INFO);
+ if (_query != null)
+ set.add(AsyncContext.ASYNC_QUERY_STRING);
+
+ return set;
+ }
+
+ @Override
+ public void setAttribute(String key, Object value)
+ {
+ if (!key.startsWith(__ASYNC_PREFIX))
+ super.setAttribute(key, value);
+
+ switch (key)
+ {
+ case AsyncContext.ASYNC_REQUEST_URI:
+ _requestURI = (String)value;
+ break;
+ case AsyncContext.ASYNC_CONTEXT_PATH:
+ _contextPath = (String)value;
+ break;
+ case AsyncContext.ASYNC_SERVLET_PATH:
+ _servletPath = (String)value;
+ break;
+ case AsyncContext.ASYNC_PATH_INFO:
+ _pathInfo = (String)value;
+ break;
+ case AsyncContext.ASYNC_QUERY_STRING:
+ _query = (String)value;
+ break;
+ default:
+ super.setAttribute(key, value);
+ }
+ }
+
+ @Override
+ public void clearAttributes()
+ {
+ _requestURI = null;
+ _contextPath = null;
+ _servletPath = null;
+ _pathInfo = null;
+ _query = null;
+ super.clearAttributes();
+ }
+}
diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/Dispatcher.java b/jetty-server/src/main/java/org/eclipse/jetty/server/Dispatcher.java
index 1f3aa6150c5..649e30388c2 100644
--- a/jetty-server/src/main/java/org/eclipse/jetty/server/Dispatcher.java
+++ b/jetty-server/src/main/java/org/eclipse/jetty/server/Dispatcher.java
@@ -330,24 +330,25 @@ public class Dispatcher implements RequestDispatcher
{
case FORWARD_PATH_INFO:
_pathInfo = (String)value;
- return;
+ break;
case FORWARD_REQUEST_URI:
_requestURI = (String)value;
- return;
+ break;
case FORWARD_SERVLET_PATH:
_servletPath = (String)value;
- return;
+ break;
case FORWARD_CONTEXT_PATH:
_contextPath = (String)value;
- return;
+ break;
case FORWARD_QUERY_STRING:
_query = (String)value;
- return;
+ break;
default:
if (value == null)
_attributes.removeAttribute(key);
else
_attributes.setAttribute(key, value);
+ break;
}
}
else if (value == null)
@@ -452,24 +453,25 @@ public class Dispatcher implements RequestDispatcher
{
case INCLUDE_PATH_INFO:
_pathInfo = (String)value;
- return;
+ break;
case INCLUDE_REQUEST_URI:
_requestURI = (String)value;
- return;
+ break;
case INCLUDE_SERVLET_PATH:
_servletPath = (String)value;
- return;
+ break;
case INCLUDE_CONTEXT_PATH:
_contextPath = (String)value;
- return;
+ break;
case INCLUDE_QUERY_STRING:
_query = (String)value;
- return;
+ break;
default:
if (value == null)
_attributes.removeAttribute(key);
else
_attributes.setAttribute(key, value);
+ break;
}
}
else if (value == null)
diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/Request.java b/jetty-server/src/main/java/org/eclipse/jetty/server/Request.java
index 8b0bf63e974..07495e906a3 100644
--- a/jetty-server/src/main/java/org/eclipse/jetty/server/Request.java
+++ b/jetty-server/src/main/java/org/eclipse/jetty/server/Request.java
@@ -39,6 +39,7 @@ import java.util.EventListener;
import java.util.List;
import java.util.Locale;
import java.util.Map;
+import java.util.Objects;
import java.util.function.Supplier;
import java.util.stream.Collectors;
import javax.servlet.AsyncContext;
@@ -199,7 +200,7 @@ public class Request implements HttpServletRequest
private boolean _handled = false;
private boolean _contentParamsExtracted;
private boolean _requestedSessionIdFromCookie = false;
- private Attributes _attributes;
+ private Attributes _attributes = new ServletAttributes();
private Authentication _authentication;
private String _contentType;
private String _characterEncoding;
@@ -626,7 +627,7 @@ public class Request implements HttpServletRequest
_channel.getHttpTransport() instanceof HttpConnection)
return _channel.getHttpTransport();
}
- return (_attributes == null) ? null : _attributes.getAttribute(name);
+ return _attributes.getAttribute(name);
}
/*
@@ -635,16 +636,11 @@ public class Request implements HttpServletRequest
@Override
public Enumeration getAttributeNames()
{
- if (_attributes == null)
- return Collections.enumeration(Collections.emptyList());
-
return AttributesMap.getAttributeNamesCopy(_attributes);
}
public Attributes getAttributes()
{
- if (_attributes == null)
- _attributes = new AttributesMap();
return _attributes;
}
@@ -1868,13 +1864,10 @@ public class Request implements HttpServletRequest
_asyncNotSupportedSource = null;
_handled = false;
_attributes = Attributes.unwrap(_attributes);
- if (_attributes != null)
- {
- if (AttributesMap.class.equals(_attributes.getClass()))
- _attributes.clearAttributes();
- else
- _attributes = null;
- }
+ if (ServletAttributes.class.equals(_attributes.getClass()))
+ _attributes.clearAttributes();
+ else
+ _attributes = new ServletAttributes();
_contentType = null;
_characterEncoding = null;
_contextPath = null;
@@ -1911,7 +1904,7 @@ public class Request implements HttpServletRequest
@Override
public void removeAttribute(String name)
{
- Object oldValue = _attributes == null ? null : _attributes.getAttribute(name);
+ Object oldValue = _attributes.getAttribute(name);
if (_attributes != null)
_attributes.removeAttribute(name);
@@ -1945,15 +1938,13 @@ public class Request implements HttpServletRequest
@Override
public void setAttribute(String name, Object value)
{
- Object oldValue = _attributes == null ? null : _attributes.getAttribute(name);
+ Object oldValue = _attributes.getAttribute(name);
if ("org.eclipse.jetty.server.Request.queryEncoding".equals(name))
setQueryEncoding(value == null ? null : value.toString());
else if ("org.eclipse.jetty.server.sendContent".equals(name))
LOG.warn("Deprecated: org.eclipse.jetty.server.sendContent");
- if (_attributes == null)
- _attributes = new AttributesMap();
_attributes.setAttribute(name, value);
if (!_requestAttributeListeners.isEmpty())
@@ -1973,7 +1964,7 @@ public class Request implements HttpServletRequest
public void setAttributes(Attributes attributes)
{
- _attributes = attributes;
+ _attributes = Objects.requireNonNull(attributes);
}
/**
diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/ServletAttributes.java b/jetty-server/src/main/java/org/eclipse/jetty/server/ServletAttributes.java
new file mode 100644
index 00000000000..08df2f498de
--- /dev/null
+++ b/jetty-server/src/main/java/org/eclipse/jetty/server/ServletAttributes.java
@@ -0,0 +1,64 @@
+//
+// ========================================================================
+// Copyright (c) 1995-2020 Mort Bay Consulting Pty Ltd and others.
+// ------------------------------------------------------------------------
+// All rights reserved. This program and the accompanying materials
+// are made available under the terms of the Eclipse Public License v1.0
+// and Apache License v2.0 which accompanies this distribution.
+//
+// The Eclipse Public License is available at
+// http://www.eclipse.org/legal/epl-v10.html
+//
+// The Apache License v2.0 is available at
+// http://www.opensource.org/licenses/apache2.0.php
+//
+// You may elect to redistribute this code under either of these licenses.
+// ========================================================================
+//
+
+package org.eclipse.jetty.server;
+
+import java.util.Set;
+
+import org.eclipse.jetty.util.Attributes;
+import org.eclipse.jetty.util.AttributesMap;
+
+public class ServletAttributes implements Attributes
+{
+ private final Attributes _attributes;
+
+ public ServletAttributes()
+ {
+ _attributes = new AsyncAttributes(new AttributesMap());
+ }
+
+ @Override
+ public void removeAttribute(String name)
+ {
+ _attributes.removeAttribute(name);
+ }
+
+ @Override
+ public void setAttribute(String name, Object attribute)
+ {
+ _attributes.setAttribute(name, attribute);
+ }
+
+ @Override
+ public Object getAttribute(String name)
+ {
+ return _attributes.getAttribute(name);
+ }
+
+ @Override
+ public Set getAttributeNameSet()
+ {
+ return _attributes.getAttributeNameSet();
+ }
+
+ @Override
+ public void clearAttributes()
+ {
+ _attributes.clearAttributes();
+ }
+}
diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/AttributesMap.java b/jetty-util/src/main/java/org/eclipse/jetty/util/AttributesMap.java
index 8c41e073ce1..27bfefdc2bb 100644
--- a/jetty-util/src/main/java/org/eclipse/jetty/util/AttributesMap.java
+++ b/jetty-util/src/main/java/org/eclipse/jetty/util/AttributesMap.java
@@ -111,8 +111,7 @@ public class AttributesMap implements Attributes, Dumpable
if (attrs instanceof AttributesMap)
return Collections.enumeration(((AttributesMap)attrs).keySet());
- List names = new ArrayList<>();
- names.addAll(Collections.list(attrs.getAttributeNames()));
+ List names = new ArrayList<>(Collections.list(attrs.getAttributeNames()));
return Collections.enumeration(names);
}
From f039becb978ee8f515820d77f92ad545ce9b3243 Mon Sep 17 00:00:00 2001
From: Ludovic Orban
Date: Wed, 13 May 2020 09:14:59 +0200
Subject: [PATCH 24/77] Replace HashSet with ArrayList as that has two
benefits: (#4871)
- ArrayList contains() + add() is faster than HashSet add() for small collections
- A heap allocation of the iterator is required when iterating HashSet while iterating ArrayList can do with a stack allocation
Signed-off-by: Ludovic Orban
---
.../main/java/org/eclipse/jetty/http2/HTTP2Flusher.java | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/HTTP2Flusher.java b/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/HTTP2Flusher.java
index 3b3dd9903f7..aafbeb635e6 100644
--- a/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/HTTP2Flusher.java
+++ b/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/HTTP2Flusher.java
@@ -21,6 +21,8 @@ package org.eclipse.jetty.http2;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.util.ArrayDeque;
+import java.util.ArrayList;
+import java.util.Collection;
import java.util.Deque;
import java.util.HashSet;
import java.util.Iterator;
@@ -47,7 +49,7 @@ public class HTTP2Flusher extends IteratingCallback implements Dumpable
private final Queue windows = new ArrayDeque<>();
private final Deque entries = new ArrayDeque<>();
private final Queue pendingEntries = new ArrayDeque<>();
- private final Set processedEntries = new HashSet<>();
+ private final Collection processedEntries = new ArrayList<>();
private final HTTP2Session session;
private final ByteBufferPool.Lease lease;
private Throwable terminated;
@@ -192,7 +194,10 @@ public class HTTP2Flusher extends IteratingCallback implements Dumpable
progress = true;
- processedEntries.add(entry);
+ // We use ArrayList contains() + add() instead of HashSet add()
+ // because that is faster for collections of size up to 250 entries.
+ if (!processedEntries.contains(entry))
+ processedEntries.add(entry);
if (entry.getDataBytesRemaining() == 0)
pending.remove();
From 629e106045a7ea357c229d83ba18ff196dc434b1 Mon Sep 17 00:00:00 2001
From: Lachlan Roberts
Date: Wed, 13 May 2020 19:10:11 +1000
Subject: [PATCH 25/77] Issue #4861 - increase efficiency of ServletAttributes
when going async
Signed-off-by: Lachlan Roberts
---
.../eclipse/jetty/server/AsyncAttributes.java | 54 +++++++++--------
.../jetty/server/AsyncContextEvent.java | 31 ++--------
.../org/eclipse/jetty/server/Request.java | 58 +++++++++++++++++--
.../jetty/server/ServletAttributes.java | 35 ++++++++---
4 files changed, 112 insertions(+), 66 deletions(-)
diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/AsyncAttributes.java b/jetty-server/src/main/java/org/eclipse/jetty/server/AsyncAttributes.java
index 90f0b452896..9d040cb9a06 100644
--- a/jetty-server/src/main/java/org/eclipse/jetty/server/AsyncAttributes.java
+++ b/jetty-server/src/main/java/org/eclipse/jetty/server/AsyncAttributes.java
@@ -26,28 +26,27 @@ import org.eclipse.jetty.util.Attributes;
class AsyncAttributes extends Attributes.Wrapper
{
- /**
- * Async dispatch attribute name prefix.
- */
- public static final String __ASYNC_PREFIX = "javax.servlet.async.";
-
private String _requestURI;
private String _contextPath;
private String _servletPath;
private String _pathInfo;
- private String _query;
+ private String _queryString;
- AsyncAttributes(Attributes attributes)
+ public AsyncAttributes(Attributes attributes, String requestUri, String contextPath, String servletPath, String pathInfo, String queryString)
{
super(attributes);
+
+ // TODO: make fields final in jetty-10 and NOOP when one of these attributes is set.
+ _requestURI = requestUri;
+ _contextPath = contextPath;
+ _servletPath = servletPath;
+ _pathInfo = pathInfo;
+ _queryString = queryString;
}
@Override
public Object getAttribute(String key)
{
- if (!key.startsWith(__ASYNC_PREFIX))
- return super.getAttribute(key);
-
switch (key)
{
case AsyncContext.ASYNC_REQUEST_URI:
@@ -59,7 +58,7 @@ class AsyncAttributes extends Attributes.Wrapper
case AsyncContext.ASYNC_PATH_INFO:
return _pathInfo;
case AsyncContext.ASYNC_QUERY_STRING:
- return _query;
+ return _queryString;
default:
return super.getAttribute(key);
}
@@ -68,13 +67,7 @@ class AsyncAttributes extends Attributes.Wrapper
@Override
public Set getAttributeNameSet()
{
- HashSet set = new HashSet<>();
- for (String name : _attributes.getAttributeNameSet())
- {
- if (!name.startsWith(__ASYNC_PREFIX))
- set.add(name);
- }
-
+ Set set = new HashSet<>(super.getAttributeNameSet());
if (_requestURI != null)
set.add(AsyncContext.ASYNC_REQUEST_URI);
if (_contextPath != null)
@@ -83,18 +76,14 @@ class AsyncAttributes extends Attributes.Wrapper
set.add(AsyncContext.ASYNC_SERVLET_PATH);
if (_pathInfo != null)
set.add(AsyncContext.ASYNC_PATH_INFO);
- if (_query != null)
+ if (_queryString != null)
set.add(AsyncContext.ASYNC_QUERY_STRING);
-
return set;
}
@Override
public void setAttribute(String key, Object value)
{
- if (!key.startsWith(__ASYNC_PREFIX))
- super.setAttribute(key, value);
-
switch (key)
{
case AsyncContext.ASYNC_REQUEST_URI:
@@ -110,10 +99,11 @@ class AsyncAttributes extends Attributes.Wrapper
_pathInfo = (String)value;
break;
case AsyncContext.ASYNC_QUERY_STRING:
- _query = (String)value;
+ _queryString = (String)value;
break;
default:
super.setAttribute(key, value);
+ break;
}
}
@@ -124,7 +114,21 @@ class AsyncAttributes extends Attributes.Wrapper
_contextPath = null;
_servletPath = null;
_pathInfo = null;
- _query = null;
+ _queryString = null;
super.clearAttributes();
}
+
+ public void applyToAttributes(Attributes attributes)
+ {
+ if (_requestURI != null)
+ attributes.setAttribute(AsyncContext.ASYNC_REQUEST_URI, _requestURI);
+ if (_contextPath != null)
+ attributes.setAttribute(AsyncContext.ASYNC_CONTEXT_PATH, _contextPath);
+ if (_servletPath != null)
+ attributes.setAttribute(AsyncContext.ASYNC_SERVLET_PATH, _servletPath);
+ if (_pathInfo != null)
+ attributes.setAttribute(AsyncContext.ASYNC_PATH_INFO, _pathInfo);
+ if (_queryString != null)
+ attributes.setAttribute(AsyncContext.ASYNC_QUERY_STRING, _queryString);
+ }
}
diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/AsyncContextEvent.java b/jetty-server/src/main/java/org/eclipse/jetty/server/AsyncContextEvent.java
index 9be11f7f39e..cc413f9ec8f 100644
--- a/jetty-server/src/main/java/org/eclipse/jetty/server/AsyncContextEvent.java
+++ b/jetty-server/src/main/java/org/eclipse/jetty/server/AsyncContextEvent.java
@@ -20,7 +20,6 @@ package org.eclipse.jetty.server;
import javax.servlet.AsyncContext;
import javax.servlet.AsyncEvent;
-import javax.servlet.RequestDispatcher;
import javax.servlet.ServletContext;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
@@ -32,7 +31,7 @@ public class AsyncContextEvent extends AsyncEvent implements Runnable
{
private final Context _context;
private final AsyncContextState _asyncContext;
- private volatile HttpChannelState _state;
+ private final HttpChannelState _state;
private ServletContext _dispatchContext;
private String _dispatchPath;
private volatile Scheduler.Task _timeoutTask;
@@ -45,31 +44,9 @@ public class AsyncContextEvent extends AsyncEvent implements Runnable
_asyncContext = asyncContext;
_state = state;
- // If we haven't been async dispatched before
- if (baseRequest.getAttribute(AsyncContext.ASYNC_REQUEST_URI) == null)
- {
- // We are setting these attributes during startAsync, when the spec implies that
- // they are only available after a call to AsyncContext.dispatch(...);
-
- // have we been forwarded before?
- String uri = (String)baseRequest.getAttribute(RequestDispatcher.FORWARD_REQUEST_URI);
- if (uri != null)
- {
- baseRequest.setAttribute(AsyncContext.ASYNC_REQUEST_URI, uri);
- baseRequest.setAttribute(AsyncContext.ASYNC_CONTEXT_PATH, baseRequest.getAttribute(RequestDispatcher.FORWARD_CONTEXT_PATH));
- baseRequest.setAttribute(AsyncContext.ASYNC_SERVLET_PATH, baseRequest.getAttribute(RequestDispatcher.FORWARD_SERVLET_PATH));
- baseRequest.setAttribute(AsyncContext.ASYNC_PATH_INFO, baseRequest.getAttribute(RequestDispatcher.FORWARD_PATH_INFO));
- baseRequest.setAttribute(AsyncContext.ASYNC_QUERY_STRING, baseRequest.getAttribute(RequestDispatcher.FORWARD_QUERY_STRING));
- }
- else
- {
- baseRequest.setAttribute(AsyncContext.ASYNC_REQUEST_URI, baseRequest.getRequestURI());
- baseRequest.setAttribute(AsyncContext.ASYNC_CONTEXT_PATH, baseRequest.getContextPath());
- baseRequest.setAttribute(AsyncContext.ASYNC_SERVLET_PATH, baseRequest.getServletPath());
- baseRequest.setAttribute(AsyncContext.ASYNC_PATH_INFO, baseRequest.getPathInfo());
- baseRequest.setAttribute(AsyncContext.ASYNC_QUERY_STRING, baseRequest.getQueryString());
- }
- }
+ // We are setting these attributes during startAsync, when the spec implies that
+ // they are only available after a call to AsyncContext.dispatch(...);
+ baseRequest.setAsyncAttributes();
}
public ServletContext getSuspendedContext()
diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/Request.java b/jetty-server/src/main/java/org/eclipse/jetty/server/Request.java
index 07495e906a3..0b8939f6dcb 100644
--- a/jetty-server/src/main/java/org/eclipse/jetty/server/Request.java
+++ b/jetty-server/src/main/java/org/eclipse/jetty/server/Request.java
@@ -39,7 +39,6 @@ import java.util.EventListener;
import java.util.List;
import java.util.Locale;
import java.util.Map;
-import java.util.Objects;
import java.util.function.Supplier;
import java.util.stream.Collectors;
import javax.servlet.AsyncContext;
@@ -200,7 +199,7 @@ public class Request implements HttpServletRequest
private boolean _handled = false;
private boolean _contentParamsExtracted;
private boolean _requestedSessionIdFromCookie = false;
- private Attributes _attributes = new ServletAttributes();
+ private Attributes _attributes;
private Authentication _authentication;
private String _contentType;
private String _characterEncoding;
@@ -627,7 +626,7 @@ public class Request implements HttpServletRequest
_channel.getHttpTransport() instanceof HttpConnection)
return _channel.getHttpTransport();
}
- return _attributes.getAttribute(name);
+ return (_attributes == null) ? null : _attributes.getAttribute(name);
}
/*
@@ -636,11 +635,16 @@ public class Request implements HttpServletRequest
@Override
public Enumeration getAttributeNames()
{
+ if (_attributes == null)
+ return Collections.enumeration(Collections.emptyList());
+
return AttributesMap.getAttributeNamesCopy(_attributes);
}
public Attributes getAttributes()
{
+ if (_attributes == null)
+ _attributes = new ServletAttributes();
return _attributes;
}
@@ -1904,7 +1908,7 @@ public class Request implements HttpServletRequest
@Override
public void removeAttribute(String name)
{
- Object oldValue = _attributes.getAttribute(name);
+ Object oldValue = _attributes == null ? null : _attributes.getAttribute(name);
if (_attributes != null)
_attributes.removeAttribute(name);
@@ -1938,13 +1942,15 @@ public class Request implements HttpServletRequest
@Override
public void setAttribute(String name, Object value)
{
- Object oldValue = _attributes.getAttribute(name);
+ Object oldValue = _attributes == null ? null : _attributes.getAttribute(name);
if ("org.eclipse.jetty.server.Request.queryEncoding".equals(name))
setQueryEncoding(value == null ? null : value.toString());
else if ("org.eclipse.jetty.server.sendContent".equals(name))
LOG.warn("Deprecated: org.eclipse.jetty.server.sendContent");
+ if (_attributes == null)
+ _attributes = new ServletAttributes();
_attributes.setAttribute(name, value);
if (!_requestAttributeListeners.isEmpty())
@@ -1964,7 +1970,47 @@ public class Request implements HttpServletRequest
public void setAttributes(Attributes attributes)
{
- _attributes = Objects.requireNonNull(attributes);
+ _attributes = attributes;
+ }
+
+ public void setAsyncAttributes()
+ {
+ // Return if we have been async dispatched before.
+ if (getAttribute(AsyncContext.ASYNC_REQUEST_URI) != null)
+ return;
+
+ // Unwrap the _attributes to get the base attributes instance.
+ Attributes baseAttributes;
+ if (_attributes == null)
+ _attributes = baseAttributes = new ServletAttributes();
+ else
+ baseAttributes = Attributes.unwrap(_attributes);
+
+ AsyncAttributes asyncAttributes;
+ // Have we been forwarded before?
+ String uri = (String)getAttribute(RequestDispatcher.FORWARD_REQUEST_URI);
+ if (uri != null)
+ {
+ String contextPath = (String)getAttribute(RequestDispatcher.FORWARD_CONTEXT_PATH);
+ String servletPath = (String)getAttribute(RequestDispatcher.FORWARD_SERVLET_PATH);
+ String pathInfo = (String)getAttribute(RequestDispatcher.FORWARD_PATH_INFO);
+ String queryString = (String)getAttribute(RequestDispatcher.FORWARD_QUERY_STRING);
+ asyncAttributes = new AsyncAttributes(baseAttributes, uri, contextPath, servletPath, pathInfo, queryString);
+ }
+ else
+ {
+ String requestURI = getRequestURI();
+ String contextPath = getContextPath();
+ String servletPath = getServletPath();
+ String pathInfo = getPathInfo();
+ String queryString = getQueryString();
+ asyncAttributes = new AsyncAttributes(baseAttributes, requestURI, contextPath, servletPath, pathInfo, queryString);
+ }
+
+ if (baseAttributes instanceof ServletAttributes)
+ ((ServletAttributes)_attributes).setAsyncAttributes(asyncAttributes);
+ else
+ asyncAttributes.applyToAttributes(_attributes);
}
/**
diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/ServletAttributes.java b/jetty-server/src/main/java/org/eclipse/jetty/server/ServletAttributes.java
index 08df2f498de..18c1dd8e305 100644
--- a/jetty-server/src/main/java/org/eclipse/jetty/server/ServletAttributes.java
+++ b/jetty-server/src/main/java/org/eclipse/jetty/server/ServletAttributes.java
@@ -25,40 +25,59 @@ import org.eclipse.jetty.util.AttributesMap;
public class ServletAttributes implements Attributes
{
- private final Attributes _attributes;
+ private final Attributes _attributes = new AttributesMap();
+ private AsyncAttributes _asyncAttributes;
- public ServletAttributes()
+ public void setAsyncAttributes(AsyncAttributes attributes)
{
- _attributes = new AsyncAttributes(new AttributesMap());
+ _asyncAttributes = attributes;
}
@Override
public void removeAttribute(String name)
{
- _attributes.removeAttribute(name);
+ if (_asyncAttributes == null)
+ _attributes.removeAttribute(name);
+ else
+ _asyncAttributes.removeAttribute(name);
}
@Override
public void setAttribute(String name, Object attribute)
{
- _attributes.setAttribute(name, attribute);
+ if (_asyncAttributes == null)
+ _attributes.setAttribute(name, attribute);
+ else
+ _asyncAttributes.setAttribute(name, attribute);
}
@Override
public Object getAttribute(String name)
{
- return _attributes.getAttribute(name);
+ if (_asyncAttributes == null)
+ return _attributes.getAttribute(name);
+ else
+ return _asyncAttributes.getAttribute(name);
}
@Override
public Set getAttributeNameSet()
{
- return _attributes.getAttributeNameSet();
+ if (_asyncAttributes == null)
+ return _attributes.getAttributeNameSet();
+ else
+ return _asyncAttributes.getAttributeNameSet();
}
@Override
public void clearAttributes()
{
- _attributes.clearAttributes();
+ if (_asyncAttributes == null)
+ _attributes.clearAttributes();
+ else
+ {
+ _asyncAttributes.clearAttributes();
+ _asyncAttributes = null;
+ }
}
}
From 475c2c2f1e065c71ee220491c853f95c7a60bfcf Mon Sep 17 00:00:00 2001
From: Simone Bordet
Date: Wed, 13 May 2020 11:48:30 +0200
Subject: [PATCH 26/77] Issue #4836 - Too Many Files Error with AWS ALB.
Added test to replicate the traffic seen in the issue.
The test shows that we do close the server EndPoint.
Signed-off-by: Simone Bordet
---
.../jetty/client/ssl/SslBytesServerTest.java | 75 +++++++++++++++++--
.../jetty/client/ssl/SslBytesTest.java | 2 +
2 files changed, 72 insertions(+), 5 deletions(-)
diff --git a/jetty-client/src/test/java/org/eclipse/jetty/client/ssl/SslBytesServerTest.java b/jetty-client/src/test/java/org/eclipse/jetty/client/ssl/SslBytesServerTest.java
index 16162f34aae..40332f31b01 100644
--- a/jetty-client/src/test/java/org/eclipse/jetty/client/ssl/SslBytesServerTest.java
+++ b/jetty-client/src/test/java/org/eclipse/jetty/client/ssl/SslBytesServerTest.java
@@ -67,6 +67,7 @@ import org.eclipse.jetty.server.handler.AbstractHandler;
import org.eclipse.jetty.toolchain.test.MavenTestingUtils;
import org.eclipse.jetty.util.component.Dumpable;
import org.eclipse.jetty.util.ssl.SslContextFactory;
+import org.eclipse.jetty.util.thread.QueuedThreadPool;
import org.hamcrest.Matchers;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Assumptions;
@@ -88,8 +89,9 @@ import static org.junit.jupiter.api.Assertions.fail;
import static org.junit.jupiter.api.condition.OS.LINUX;
import static org.junit.jupiter.api.condition.OS.WINDOWS;
-// This whole test is very specific to how TLS < 1.3 works.
-@EnabledOnJre({JRE.JAVA_8, JRE.JAVA_9, JRE.JAVA_10})
+// Other JREs have slight differences in how TLS work
+// and this test expects a very specific TLS behavior.
+@EnabledOnJre({JRE.JAVA_8, JRE.JAVA_11})
public class SslBytesServerTest extends SslBytesTest
{
private final AtomicInteger sslFills = new AtomicInteger();
@@ -108,9 +110,9 @@ public class SslBytesServerTest extends SslBytesTest
@BeforeEach
public void init() throws Exception
{
-
- threadPool = Executors.newCachedThreadPool();
- server = new Server();
+ QueuedThreadPool serverThreads = new QueuedThreadPool();
+ serverThreads.setName("server");
+ server = new Server(serverThreads);
sslFills.set(0);
sslFlushes.set(0);
@@ -119,6 +121,8 @@ public class SslBytesServerTest extends SslBytesTest
File keyStore = MavenTestingUtils.getTestResourceFile("keystore.p12");
sslContextFactory = new SslContextFactory.Server();
+ // This whole test is very specific to how TLS < 1.3 works.
+ sslContextFactory.setIncludeProtocols("TLSv1.2");
sslContextFactory.setKeyStorePath(keyStore.getAbsolutePath());
sslContextFactory.setKeyStorePassword("storepwd");
@@ -238,6 +242,7 @@ public class SslBytesServerTest extends SslBytesTest
sslContext = sslContextFactory.getSslContext();
+ threadPool = Executors.newCachedThreadPool();
proxy = new SimpleProxy(threadPool, "localhost", serverPort);
proxy.start();
logger.info("proxy:{} <==> server:{}", proxy.getPort(), serverPort);
@@ -1128,6 +1133,66 @@ public class SslBytesServerTest extends SslBytesTest
client.close();
}
+ @Test
+ public void testRequestResponseServerIdleTimeoutClientResets() throws Exception
+ {
+ SSLSocket client = newClient();
+
+ SimpleProxy.AutomaticFlow automaticProxyFlow = proxy.startAutomaticFlow();
+ client.startHandshake();
+ assertTrue(automaticProxyFlow.stop(5, TimeUnit.SECONDS));
+
+ Future request = threadPool.submit(() ->
+ {
+ OutputStream clientOutput = client.getOutputStream();
+ clientOutput.write((
+ "GET / HTTP/1.1\r\n" +
+ "Host: localhost\r\n" +
+ "\r\n").getBytes(StandardCharsets.UTF_8));
+ clientOutput.flush();
+ return null;
+ });
+
+ // Application data
+ TLSRecord record = proxy.readFromClient();
+ proxy.flushToServer(record);
+ assertNull(request.get(5, TimeUnit.SECONDS));
+
+ // Application data
+ record = proxy.readFromServer();
+ assertEquals(TLSRecord.Type.APPLICATION, record.getType());
+ proxy.flushToClient(record);
+
+ BufferedReader reader = new BufferedReader(new InputStreamReader(client.getInputStream(), StandardCharsets.UTF_8));
+ String line = reader.readLine();
+ assertNotNull(line);
+ assertTrue(line.startsWith("HTTP/1.1 200 "));
+ while ((line = reader.readLine()) != null)
+ {
+ if (line.trim().length() == 0)
+ break;
+ }
+
+ // Wait for the server idle timeout.
+ Thread.sleep(idleTimeout);
+
+ // We expect that the server sends the TLS Alert.
+ record = proxy.readFromServer();
+ assertNotNull(record);
+ assertEquals(TLSRecord.Type.ALERT, record.getType());
+
+ // Send a RST to the server.
+ proxy.sendRSTToServer();
+
+ // Wait for the RST to be processed by the server.
+ Thread.sleep(1000);
+
+ // The server EndPoint must be closed.
+ assertFalse(serverEndPoint.get().isOpen());
+
+ client.close();
+ }
+
@Test
@EnabledOnOs(LINUX) // see message below
public void testRequestWithCloseAlertWithSplitBoundary() throws Exception
diff --git a/jetty-client/src/test/java/org/eclipse/jetty/client/ssl/SslBytesTest.java b/jetty-client/src/test/java/org/eclipse/jetty/client/ssl/SslBytesTest.java
index 06827ecc9e3..b5b287391e4 100644
--- a/jetty-client/src/test/java/org/eclipse/jetty/client/ssl/SslBytesTest.java
+++ b/jetty-client/src/test/java/org/eclipse/jetty/client/ssl/SslBytesTest.java
@@ -237,6 +237,7 @@ public abstract class SslBytesTest
public void flushToServer(TLSRecord record, long sleep) throws Exception
{
+ logger.debug("P --> S {}", record);
if (record == null)
{
server.shutdownOutput();
@@ -275,6 +276,7 @@ public abstract class SslBytesTest
public void flushToClient(TLSRecord record) throws Exception
{
+ logger.debug("C <-- P {}", record);
if (record == null)
{
client.shutdownOutput();
From 6527b3b083b068e4a0fe583d0edd0c18a8bacb4d Mon Sep 17 00:00:00 2001
From: Jan Bartel
Date: Wed, 13 May 2020 12:12:14 +0200
Subject: [PATCH 27/77] Issue #4868 update asm 7.3.1 (#4869)
Signed-off-by: Jan Bartel
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index ada9444a5af..b8986db6a86 100644
--- a/pom.xml
+++ b/pom.xml
@@ -28,7 +28,7 @@
9.4.8.Final2.0.102.4.0
- 7.2
+ 7.3.11.21benchmarks1.4.0
From 4aece5e9cfd8b461d0e13ea243cadc63947e35e7 Mon Sep 17 00:00:00 2001
From: Lachlan Roberts
Date: Wed, 13 May 2020 23:05:54 +1000
Subject: [PATCH 28/77] Issue #4861 - changes from review
Signed-off-by: Lachlan Roberts
---
.../org/eclipse/jetty/server/Request.java | 11 +++---
.../jetty/server/ServletAttributes.java | 34 ++++++-------------
2 files changed, 18 insertions(+), 27 deletions(-)
diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/Request.java b/jetty-server/src/main/java/org/eclipse/jetty/server/Request.java
index 0b8939f6dcb..34f9e57bbb8 100644
--- a/jetty-server/src/main/java/org/eclipse/jetty/server/Request.java
+++ b/jetty-server/src/main/java/org/eclipse/jetty/server/Request.java
@@ -1868,10 +1868,13 @@ public class Request implements HttpServletRequest
_asyncNotSupportedSource = null;
_handled = false;
_attributes = Attributes.unwrap(_attributes);
- if (ServletAttributes.class.equals(_attributes.getClass()))
- _attributes.clearAttributes();
- else
- _attributes = new ServletAttributes();
+ if (_attributes != null)
+ {
+ if (ServletAttributes.class.equals(_attributes.getClass()))
+ _attributes.clearAttributes();
+ else
+ _attributes = null;
+ }
_contentType = null;
_characterEncoding = null;
_contextPath = null;
diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/ServletAttributes.java b/jetty-server/src/main/java/org/eclipse/jetty/server/ServletAttributes.java
index 18c1dd8e305..ec24e37216c 100644
--- a/jetty-server/src/main/java/org/eclipse/jetty/server/ServletAttributes.java
+++ b/jetty-server/src/main/java/org/eclipse/jetty/server/ServletAttributes.java
@@ -33,51 +33,39 @@ public class ServletAttributes implements Attributes
_asyncAttributes = attributes;
}
+ private Attributes getAttributes()
+ {
+ return (_asyncAttributes == null) ? _attributes : _asyncAttributes;
+ }
+
@Override
public void removeAttribute(String name)
{
- if (_asyncAttributes == null)
- _attributes.removeAttribute(name);
- else
- _asyncAttributes.removeAttribute(name);
+ getAttributes().removeAttribute(name);
}
@Override
public void setAttribute(String name, Object attribute)
{
- if (_asyncAttributes == null)
- _attributes.setAttribute(name, attribute);
- else
- _asyncAttributes.setAttribute(name, attribute);
+ getAttributes().setAttribute(name, attribute);
}
@Override
public Object getAttribute(String name)
{
- if (_asyncAttributes == null)
- return _attributes.getAttribute(name);
- else
- return _asyncAttributes.getAttribute(name);
+ return getAttributes().getAttribute(name);
}
@Override
public Set getAttributeNameSet()
{
- if (_asyncAttributes == null)
- return _attributes.getAttributeNameSet();
- else
- return _asyncAttributes.getAttributeNameSet();
+ return getAttributes().getAttributeNameSet();
}
@Override
public void clearAttributes()
{
- if (_asyncAttributes == null)
- _attributes.clearAttributes();
- else
- {
- _asyncAttributes.clearAttributes();
- _asyncAttributes = null;
- }
+ getAttributes().clearAttributes();
+ _asyncAttributes = null;
}
}
From 87be7b15eb5c11326ee67b446b4a671a606dbfa9 Mon Sep 17 00:00:00 2001
From: Ludovic Orban
Date: Wed, 13 May 2020 14:10:52 +0200
Subject: [PATCH 29/77] replace regex match with simple string comparisons
Signed-off-by: Ludovic Orban
---
.../src/main/java/org/eclipse/jetty/client/HttpClient.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/jetty-client/src/main/java/org/eclipse/jetty/client/HttpClient.java b/jetty-client/src/main/java/org/eclipse/jetty/client/HttpClient.java
index 54aa8edab8c..b181a46a915 100644
--- a/jetty-client/src/main/java/org/eclipse/jetty/client/HttpClient.java
+++ b/jetty-client/src/main/java/org/eclipse/jetty/client/HttpClient.java
@@ -1145,7 +1145,7 @@ public class HttpClient extends ContainerLifeCycle
protected String normalizeHost(String host)
{
- if (host != null && host.matches("\\[.*\\]"))
+ if (host != null && host.startsWith("[") && host.endsWith("]"))
return host.substring(1, host.length() - 1);
return host;
}
From e7aa3c2e2302978df82eba1bee4724cef7a43d8b Mon Sep 17 00:00:00 2001
From: Ludovic Orban
Date: Wed, 13 May 2020 14:23:02 +0200
Subject: [PATCH 30/77] explicitly size the listeners array lists
Signed-off-by: Ludovic Orban
---
.../java/org/eclipse/jetty/client/HttpConversation.java | 2 +-
.../main/java/org/eclipse/jetty/client/HttpReceiver.java | 7 ++++---
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/jetty-client/src/main/java/org/eclipse/jetty/client/HttpConversation.java b/jetty-client/src/main/java/org/eclipse/jetty/client/HttpConversation.java
index 713b142d2f8..3e39039e944 100644
--- a/jetty-client/src/main/java/org/eclipse/jetty/client/HttpConversation.java
+++ b/jetty-client/src/main/java/org/eclipse/jetty/client/HttpConversation.java
@@ -117,9 +117,9 @@ public class HttpConversation extends AttributesMap
// will notify a listener that may send a new request and trigger
// another call to this method which will build different listeners
// which may be iterated over when the iteration continues.
- List listeners = new ArrayList<>();
HttpExchange firstExchange = exchanges.peekFirst();
HttpExchange lastExchange = exchanges.peekLast();
+ List listeners = new ArrayList<>(firstExchange.getResponseListeners().size() + lastExchange.getResponseListeners().size());
if (firstExchange == lastExchange)
{
// We don't have a conversation, just a single request.
diff --git a/jetty-client/src/main/java/org/eclipse/jetty/client/HttpReceiver.java b/jetty-client/src/main/java/org/eclipse/jetty/client/HttpReceiver.java
index d8961dc8f62..f14eda67106 100644
--- a/jetty-client/src/main/java/org/eclipse/jetty/client/HttpReceiver.java
+++ b/jetty-client/src/main/java/org/eclipse/jetty/client/HttpReceiver.java
@@ -21,6 +21,7 @@ package org.eclipse.jetty.client;
import java.io.IOException;
import java.net.URI;
import java.nio.ByteBuffer;
+import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
@@ -31,7 +32,6 @@ import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.atomic.AtomicReference;
import java.util.function.LongConsumer;
import java.util.function.LongUnaryOperator;
-import java.util.stream.Collectors;
import org.eclipse.jetty.client.api.Response;
import org.eclipse.jetty.client.api.Result;
@@ -693,10 +693,11 @@ public abstract class HttpReceiver
private ContentListeners(List responseListeners)
{
- listeners = responseListeners.stream()
+ listeners = new ArrayList<>(responseListeners.size());
+ responseListeners.stream()
.filter(Response.DemandedContentListener.class::isInstance)
.map(Response.DemandedContentListener.class::cast)
- .collect(Collectors.toList());
+ .forEach(listeners::add);
}
private boolean isEmpty()
From 7d80c8fc3909b341bae48234df81224a28f28611 Mon Sep 17 00:00:00 2001
From: Ludovic Orban
Date: Wed, 13 May 2020 14:10:10 +0200
Subject: [PATCH 31/77] Add constructor to better align with 10.0.x
Signed-off-by: Ludovic Orban
---
.../java/org/eclipse/jetty/client/HttpClient.java | 14 +++++++++++++-
.../websocket/common/test/BlockheadClient.java | 1 -
2 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/jetty-client/src/main/java/org/eclipse/jetty/client/HttpClient.java b/jetty-client/src/main/java/org/eclipse/jetty/client/HttpClient.java
index b181a46a915..545b13cf4b5 100644
--- a/jetty-client/src/main/java/org/eclipse/jetty/client/HttpClient.java
+++ b/jetty-client/src/main/java/org/eclipse/jetty/client/HttpClient.java
@@ -163,7 +163,7 @@ public class HttpClient extends ContainerLifeCycle
*/
public HttpClient()
{
- this(null);
+ this(new HttpClientTransportOverHTTP(), null);
}
/**
@@ -178,6 +178,18 @@ public class HttpClient extends ContainerLifeCycle
this(new HttpClientTransportOverHTTP(), sslContextFactory);
}
+ /**
+ * Creates a {@link HttpClient} instance that can perform requests to non-TLS destinations only
+ * (that is, requests with the "http" scheme only, and not "https").
+ *
+ * @param transport the {@link HttpClientTransport}
+ * @see #HttpClient(HttpClientTransport, SslContextFactory) to perform requests to TLS destinations.
+ */
+ public HttpClient(HttpClientTransport transport)
+ {
+ this(transport, null);
+ }
+
public HttpClient(HttpClientTransport transport, SslContextFactory sslContextFactory)
{
this.transport = transport;
diff --git a/jetty-websocket/websocket-common/src/test/java/org/eclipse/jetty/websocket/common/test/BlockheadClient.java b/jetty-websocket/websocket-common/src/test/java/org/eclipse/jetty/websocket/common/test/BlockheadClient.java
index 22e1a963ab8..d5fc0af0112 100644
--- a/jetty-websocket/websocket-common/src/test/java/org/eclipse/jetty/websocket/common/test/BlockheadClient.java
+++ b/jetty-websocket/websocket-common/src/test/java/org/eclipse/jetty/websocket/common/test/BlockheadClient.java
@@ -44,7 +44,6 @@ public class BlockheadClient extends HttpClient implements WebSocketContainerSco
public BlockheadClient()
{
- super(null);
setName("Blockhead-CLIENT");
this.extensionFactory = new WebSocketExtensionFactory(this);
}
From 1974b1b407c1d20496f4548457326511f30cd757 Mon Sep 17 00:00:00 2001
From: Ludovic Orban
Date: Wed, 13 May 2020 17:35:10 +0200
Subject: [PATCH 32/77] avoid creating URI instances when possible
Signed-off-by: Ludovic Orban
---
.../jetty/client/HttpAuthenticationStore.java | 6 +++
.../eclipse/jetty/client/HttpConnection.java | 41 ++++++++++++++-----
.../jetty/client/api/AuthenticationStore.java | 8 ++++
3 files changed, 44 insertions(+), 11 deletions(-)
diff --git a/jetty-client/src/main/java/org/eclipse/jetty/client/HttpAuthenticationStore.java b/jetty-client/src/main/java/org/eclipse/jetty/client/HttpAuthenticationStore.java
index 937bcac6b70..eadce9cee0f 100644
--- a/jetty-client/src/main/java/org/eclipse/jetty/client/HttpAuthenticationStore.java
+++ b/jetty-client/src/main/java/org/eclipse/jetty/client/HttpAuthenticationStore.java
@@ -93,4 +93,10 @@ public class HttpAuthenticationStore implements AuthenticationStore
}
return null;
}
+
+ @Override
+ public boolean hasAuthenticationResults()
+ {
+ return !results.isEmpty();
+ }
}
diff --git a/jetty-client/src/main/java/org/eclipse/jetty/client/HttpConnection.java b/jetty-client/src/main/java/org/eclipse/jetty/client/HttpConnection.java
index de07bd97afc..39b29e3ad56 100644
--- a/jetty-client/src/main/java/org/eclipse/jetty/client/HttpConnection.java
+++ b/jetty-client/src/main/java/org/eclipse/jetty/client/HttpConnection.java
@@ -27,6 +27,7 @@ import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import org.eclipse.jetty.client.api.Authentication;
+import org.eclipse.jetty.client.api.AuthenticationStore;
import org.eclipse.jetty.client.api.Connection;
import org.eclipse.jetty.client.api.ContentProvider;
import org.eclipse.jetty.client.api.Request;
@@ -103,12 +104,14 @@ public abstract class HttpConnection implements Connection
request.path(path);
}
- URI uri = request.getURI();
-
- if (proxy instanceof HttpProxy && !HttpClient.isSchemeSecure(request.getScheme()) && uri != null)
+ if (proxy instanceof HttpProxy && !HttpClient.isSchemeSecure(request.getScheme()))
{
- path = uri.toString();
- request.path(path);
+ URI uri = request.getURI();
+ if (uri != null)
+ {
+ path = uri.toString();
+ request.path(path);
+ }
}
// If we are HTTP 1.1, add the Host header
@@ -147,9 +150,10 @@ public abstract class HttpConnection implements Connection
// Cookies
CookieStore cookieStore = getHttpClient().getCookieStore();
- if (cookieStore != null)
+ if (cookieStore != null && cookieStore.getClass() != HttpCookieStore.Empty.class)
{
StringBuilder cookies = null;
+ URI uri = request.getURI();
if (uri != null)
cookies = convertCookies(HttpCookieStore.matchPath(uri, cookieStore.get(uri)), null);
cookies = convertCookies(request.getCookies(), cookies);
@@ -158,8 +162,8 @@ public abstract class HttpConnection implements Connection
}
// Authentication
- applyAuthentication(request, proxy != null ? proxy.getURI() : null);
- applyAuthentication(request, uri);
+ applyProxyAuthentication(request, proxy);
+ applyRequestAuthentication(request);
}
private StringBuilder convertCookies(List cookies, StringBuilder builder)
@@ -175,11 +179,26 @@ public abstract class HttpConnection implements Connection
return builder;
}
- private void applyAuthentication(Request request, URI uri)
+ private void applyRequestAuthentication(Request request)
{
- if (uri != null)
+ AuthenticationStore authenticationStore = getHttpClient().getAuthenticationStore();
+ if (authenticationStore.hasAuthenticationResults())
{
- Authentication.Result result = getHttpClient().getAuthenticationStore().findAuthenticationResult(uri);
+ URI uri = request.getURI();
+ if (uri != null)
+ {
+ Authentication.Result result = authenticationStore.findAuthenticationResult(uri);
+ if (result != null)
+ result.apply(request);
+ }
+ }
+ }
+
+ private void applyProxyAuthentication(Request request, ProxyConfiguration.Proxy proxy)
+ {
+ if (proxy != null)
+ {
+ Authentication.Result result = getHttpClient().getAuthenticationStore().findAuthenticationResult(proxy.getURI());
if (result != null)
result.apply(request);
}
diff --git a/jetty-client/src/main/java/org/eclipse/jetty/client/api/AuthenticationStore.java b/jetty-client/src/main/java/org/eclipse/jetty/client/api/AuthenticationStore.java
index 7c8429288dc..f0884f5bcc1 100644
--- a/jetty-client/src/main/java/org/eclipse/jetty/client/api/AuthenticationStore.java
+++ b/jetty-client/src/main/java/org/eclipse/jetty/client/api/AuthenticationStore.java
@@ -75,4 +75,12 @@ public interface AuthenticationStore
* @return the {@link Authentication.Result} that matches the given URI, or null
*/
Authentication.Result findAuthenticationResult(URI uri);
+
+ /**
+ * @return false if there are no stored authentication results, true if there may be some.
+ */
+ default boolean hasAuthenticationResults()
+ {
+ return true;
+ }
}
From 7111f5f1617bbdb1f4f0a25aad016873108cfa06 Mon Sep 17 00:00:00 2001
From: Lachlan Roberts
Date: Thu, 14 May 2020 08:26:44 +1000
Subject: [PATCH 33/77] Issue #4861 - AsyncAttributes should wrap
ServletAttributes inner AttributesMap
Signed-off-by: Lachlan Roberts
---
.../eclipse/jetty/server/AsyncAttributes.java | 22 ++++----
.../org/eclipse/jetty/server/Request.java | 56 +++++++++++--------
.../jetty/server/ServletAttributes.java | 4 +-
3 files changed, 46 insertions(+), 36 deletions(-)
diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/AsyncAttributes.java b/jetty-server/src/main/java/org/eclipse/jetty/server/AsyncAttributes.java
index 9d040cb9a06..8121d61cb5f 100644
--- a/jetty-server/src/main/java/org/eclipse/jetty/server/AsyncAttributes.java
+++ b/jetty-server/src/main/java/org/eclipse/jetty/server/AsyncAttributes.java
@@ -118,17 +118,17 @@ class AsyncAttributes extends Attributes.Wrapper
super.clearAttributes();
}
- public void applyToAttributes(Attributes attributes)
+ public static void applyAsyncAttributes(Attributes attributes, String requestURI, String contextPath, String servletPath, String pathInfo, String queryString)
{
- if (_requestURI != null)
- attributes.setAttribute(AsyncContext.ASYNC_REQUEST_URI, _requestURI);
- if (_contextPath != null)
- attributes.setAttribute(AsyncContext.ASYNC_CONTEXT_PATH, _contextPath);
- if (_servletPath != null)
- attributes.setAttribute(AsyncContext.ASYNC_SERVLET_PATH, _servletPath);
- if (_pathInfo != null)
- attributes.setAttribute(AsyncContext.ASYNC_PATH_INFO, _pathInfo);
- if (_queryString != null)
- attributes.setAttribute(AsyncContext.ASYNC_QUERY_STRING, _queryString);
+ if (requestURI != null)
+ attributes.setAttribute(AsyncContext.ASYNC_REQUEST_URI, requestURI);
+ if (contextPath != null)
+ attributes.setAttribute(AsyncContext.ASYNC_CONTEXT_PATH, contextPath);
+ if (servletPath != null)
+ attributes.setAttribute(AsyncContext.ASYNC_SERVLET_PATH, servletPath);
+ if (pathInfo != null)
+ attributes.setAttribute(AsyncContext.ASYNC_PATH_INFO, pathInfo);
+ if (queryString != null)
+ attributes.setAttribute(AsyncContext.ASYNC_QUERY_STRING, queryString);
}
}
diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/Request.java b/jetty-server/src/main/java/org/eclipse/jetty/server/Request.java
index 34f9e57bbb8..6565a6e7a7b 100644
--- a/jetty-server/src/main/java/org/eclipse/jetty/server/Request.java
+++ b/jetty-server/src/main/java/org/eclipse/jetty/server/Request.java
@@ -1982,6 +1982,30 @@ public class Request implements HttpServletRequest
if (getAttribute(AsyncContext.ASYNC_REQUEST_URI) != null)
return;
+ String requestURI;
+ String contextPath;
+ String servletPath;
+ String pathInfo;
+ String queryString;
+
+ // Have we been forwarded before?
+ requestURI = (String)getAttribute(RequestDispatcher.FORWARD_REQUEST_URI);
+ if (requestURI != null)
+ {
+ contextPath = (String)getAttribute(RequestDispatcher.FORWARD_CONTEXT_PATH);
+ servletPath = (String)getAttribute(RequestDispatcher.FORWARD_SERVLET_PATH);
+ pathInfo = (String)getAttribute(RequestDispatcher.FORWARD_PATH_INFO);
+ queryString = (String)getAttribute(RequestDispatcher.FORWARD_QUERY_STRING);
+ }
+ else
+ {
+ requestURI = getRequestURI();
+ contextPath = getContextPath();
+ servletPath = getServletPath();
+ pathInfo = getPathInfo();
+ queryString = getQueryString();
+ }
+
// Unwrap the _attributes to get the base attributes instance.
Attributes baseAttributes;
if (_attributes == null)
@@ -1989,31 +2013,17 @@ public class Request implements HttpServletRequest
else
baseAttributes = Attributes.unwrap(_attributes);
- AsyncAttributes asyncAttributes;
- // Have we been forwarded before?
- String uri = (String)getAttribute(RequestDispatcher.FORWARD_REQUEST_URI);
- if (uri != null)
- {
- String contextPath = (String)getAttribute(RequestDispatcher.FORWARD_CONTEXT_PATH);
- String servletPath = (String)getAttribute(RequestDispatcher.FORWARD_SERVLET_PATH);
- String pathInfo = (String)getAttribute(RequestDispatcher.FORWARD_PATH_INFO);
- String queryString = (String)getAttribute(RequestDispatcher.FORWARD_QUERY_STRING);
- asyncAttributes = new AsyncAttributes(baseAttributes, uri, contextPath, servletPath, pathInfo, queryString);
- }
- else
- {
- String requestURI = getRequestURI();
- String contextPath = getContextPath();
- String servletPath = getServletPath();
- String pathInfo = getPathInfo();
- String queryString = getQueryString();
- asyncAttributes = new AsyncAttributes(baseAttributes, requestURI, contextPath, servletPath, pathInfo, queryString);
- }
-
if (baseAttributes instanceof ServletAttributes)
- ((ServletAttributes)_attributes).setAsyncAttributes(asyncAttributes);
+ {
+ // Set the AsyncAttributes on the ServletAttributes.
+ ServletAttributes servletAttributes = (ServletAttributes)baseAttributes;
+ servletAttributes.setAsyncAttributes(requestURI, contextPath, servletPath, pathInfo, queryString);
+ }
else
- asyncAttributes.applyToAttributes(_attributes);
+ {
+ // If ServletAttributes has been replaced just set them on the top level Attributes.
+ AsyncAttributes.applyAsyncAttributes(_attributes, requestURI, contextPath, servletPath, pathInfo, queryString);
+ }
}
/**
diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/ServletAttributes.java b/jetty-server/src/main/java/org/eclipse/jetty/server/ServletAttributes.java
index ec24e37216c..b98a3a04e9c 100644
--- a/jetty-server/src/main/java/org/eclipse/jetty/server/ServletAttributes.java
+++ b/jetty-server/src/main/java/org/eclipse/jetty/server/ServletAttributes.java
@@ -28,9 +28,9 @@ public class ServletAttributes implements Attributes
private final Attributes _attributes = new AttributesMap();
private AsyncAttributes _asyncAttributes;
- public void setAsyncAttributes(AsyncAttributes attributes)
+ public void setAsyncAttributes(String requestURI, String contextPath, String servletPath, String pathInfo, String queryString)
{
- _asyncAttributes = attributes;
+ _asyncAttributes = new AsyncAttributes(_attributes, requestURI, contextPath, servletPath, pathInfo, queryString);
}
private Attributes getAttributes()
From dacd5e7e368fa7e74135afbbdebe99258b3b88b6 Mon Sep 17 00:00:00 2001
From: Lachlan Roberts
Date: Thu, 14 May 2020 16:02:21 +1000
Subject: [PATCH 34/77] fix websocket-core-test pom.xml file
Signed-off-by: Lachlan Roberts
---
jetty-websocket/websocket-core-tests/pom.xml | 52 +++++---------------
1 file changed, 13 insertions(+), 39 deletions(-)
diff --git a/jetty-websocket/websocket-core-tests/pom.xml b/jetty-websocket/websocket-core-tests/pom.xml
index bc20aa11c92..f24b3607818 100644
--- a/jetty-websocket/websocket-core-tests/pom.xml
+++ b/jetty-websocket/websocket-core-tests/pom.xml
@@ -41,45 +41,19 @@
org.apache.maven.plugins
- maven-enforcer-plugin
-
-
- ban-ws-apis
-
- enforce
-
-
-
-
-
- org.eclipse.jetty.websocket:websocket-jetty-api
- javax.websocket
-
-
-
-
-
-
- ban-java-servlet-api
-
- enforce
-
-
-
-
-
- javax.servlet
- servletapi
- org.eclipse.jetty.orbit:javax.servlet
- org.mortbay.jetty:servlet-api
- jetty:servlet-api
- jetty-servlet-api
-
-
-
-
-
-
+ maven-deploy-plugin
+
+
+ true
+
+
+
+ org.apache.maven.plugins
+ maven-javadoc-plugin
+
+
+ true
+
From 5cff403a698410803ab23c4d58afd74d30ed3f0d Mon Sep 17 00:00:00 2001
From: Simone Bordet
Date: Thu, 14 May 2020 14:57:49 +0200
Subject: [PATCH 35/77] Issue #4787 - Make
org.eclipse.jetty.client.HttpRequest's host name writable.
Made the methods in the interface default so that potential implementers do not break.
Signed-off-by: Simone Bordet
---
.../java/org/eclipse/jetty/client/api/Request.java | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/jetty-client/src/main/java/org/eclipse/jetty/client/api/Request.java b/jetty-client/src/main/java/org/eclipse/jetty/client/api/Request.java
index a7c9217b44a..1a1ce529cf6 100644
--- a/jetty-client/src/main/java/org/eclipse/jetty/client/api/Request.java
+++ b/jetty-client/src/main/java/org/eclipse/jetty/client/api/Request.java
@@ -70,7 +70,10 @@ public interface Request
* @param host the URI host of this request, such as "127.0.0.1" or "google.com"
* @return this request object
*/
- Request host(String host);
+ default Request host(String host)
+ {
+ return this;
+ }
/**
* @return the URI port of this request such as 80 or 443
@@ -78,11 +81,13 @@ public interface Request
int getPort();
/**
- *
* @param port the URI port of this request such as 80 or 443
* @return this request object
*/
- Request port(int port);
+ default Request port(int port)
+ {
+ return this;
+ }
/**
* @return the method of this request, such as GET or POST, as a String
From a0b9cb3fa4e15405ad0ae9916e1a772fd6fccaba Mon Sep 17 00:00:00 2001
From: olivier lamy
Date: Fri, 8 May 2020 14:14:22 +1000
Subject: [PATCH 36/77] use docker image to test infinispan remote access
Signed-off-by: olivier lamy
---
.../test-infinispan-sessions/pom.xml | 16 +++++++---
.../remote/RemoteInfinispanTestSupport.java | 32 +++++++++++++++++--
.../test/resources/simplelogger.properties | 3 ++
3 files changed, 43 insertions(+), 8 deletions(-)
create mode 100644 tests/test-sessions/test-infinispan-sessions/src/test/resources/simplelogger.properties
diff --git a/tests/test-sessions/test-infinispan-sessions/pom.xml b/tests/test-sessions/test-infinispan-sessions/pom.xml
index 4a96db6f65e..fe7096d5d69 100644
--- a/tests/test-sessions/test-infinispan-sessions/pom.xml
+++ b/tests/test-sessions/test-infinispan-sessions/pom.xml
@@ -11,7 +11,9 @@
http://www.eclipse.org/jetty${project.groupId}.sessions.infinispan
- 127.0.0.1
+
+
+ 9.4.11.Final
@@ -129,15 +131,19 @@
org.slf4j
- slf4j-jdk14
- 1.7.25
+ slf4j-simple
+ test
+
+
+ org.testcontainers
+ testcontainerstest
- remote
+ remote-session-testshotrod.enabled
@@ -154,7 +160,7 @@
**/*.java
- ${hotrod.host}
+ ${infinispan.docker.version}
diff --git a/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/remote/RemoteInfinispanTestSupport.java b/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/remote/RemoteInfinispanTestSupport.java
index 07db3147f19..a275f5c88fc 100644
--- a/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/remote/RemoteInfinispanTestSupport.java
+++ b/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/remote/RemoteInfinispanTestSupport.java
@@ -35,6 +35,10 @@ import org.infinispan.client.hotrod.configuration.ConfigurationBuilder;
import org.infinispan.client.hotrod.marshall.ProtoStreamMarshaller;
import org.infinispan.protostream.FileDescriptorSource;
import org.infinispan.protostream.SerializationContext;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.testcontainers.containers.GenericContainer;
+import org.testcontainers.containers.output.Slf4jLogConsumer;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
@@ -45,17 +49,33 @@ import static org.junit.jupiter.api.Assertions.fail;
*/
public class RemoteInfinispanTestSupport
{
+ private static final Logger LOG = LoggerFactory.getLogger(RemoteInfinispanTestSupport.class);
public static final String DEFAULT_CACHE_NAME = "session_test_cache";
public RemoteCache _cache;
private String _name;
public static RemoteCacheManager _manager;
+ private static final Logger INFINISPAN_LOG =
+ LoggerFactory.getLogger("org.eclipse.jetty.server.session.remote.infinispanLogs");
+
+ static GenericContainer infinispan =
+ new GenericContainer("jboss/infinispan-server:" +
+ System.getProperty("infinispan.docker.version", "9.4.11.Final"))
+ .withEnv("APP_USER","theuser")
+ .withEnv("APP_PASS","foobar")
+ .withLogConsumer(new Slf4jLogConsumer(INFINISPAN_LOG));
static
{
try
{
- String host = System.getProperty("hotrod.host", "127.0.0.1");
+ long start = System.currentTimeMillis();
+ infinispan.start();
+ String host = infinispan.getContainerIpAddress();
+ System.setProperty("hotrod.host", host);
+ int port = infinispan.getMappedPort(11222);
+ LOG.info("Infinispan container started for {}:{} - {}ms", host, port,
+ System.currentTimeMillis() - start);
SearchMapping mapping = new SearchMapping();
mapping.entity(SessionData.class).indexed().providedId()
.property("expiry", ElementType.METHOD).field();
@@ -64,7 +84,12 @@ public class RemoteInfinispanTestSupport
properties.put(Environment.MODEL_MAPPING, mapping);
ConfigurationBuilder clientBuilder = new ConfigurationBuilder();
- clientBuilder.withProperties(properties).addServer().host(host).marshaller(new ProtoStreamMarshaller());
+ clientBuilder.withProperties(properties).addServer().host(host).port(port)
+ .security().authentication().enable().realm("default")
+ .serverName("infinispan")
+ .saslMechanism("DIGEST-MD5")
+ .username("theuser").password("foobar")
+ .marshaller(new ProtoStreamMarshaller());
_manager = new RemoteCacheManager(clientBuilder.build());
@@ -90,7 +115,8 @@ public class RemoteInfinispanTestSupport
}
catch (Exception e)
{
- fail(e);
+ LOG.error(e.getMessage(), e);
+ throw new RuntimeException(e);
}
}
diff --git a/tests/test-sessions/test-infinispan-sessions/src/test/resources/simplelogger.properties b/tests/test-sessions/test-infinispan-sessions/src/test/resources/simplelogger.properties
new file mode 100644
index 00000000000..cc6528beeee
--- /dev/null
+++ b/tests/test-sessions/test-infinispan-sessions/src/test/resources/simplelogger.properties
@@ -0,0 +1,3 @@
+org.slf4j.simpleLogger.defaultLogLevel=info
+org.slf4j.simpleLogger.log.org.eclipse.jetty.server.session.remote.infinispanLogs=info
+org.slf4j.simpleLogger.log.org.eclipse.jetty.server.session.remote.RemoteInfinispanTestSupport=info
From abec84596f21ed19b4c37d58e8e14f83fe807ee9 Mon Sep 17 00:00:00 2001
From: olivier lamy
Date: Mon, 11 May 2020 11:41:42 +1000
Subject: [PATCH 37/77] Activate infinispan remote testing using docker image
Signed-off-by: olivier lamy
---
.../test-infinispan-sessions/pom.xml | 8 ++-
.../remote/RemoteInfinispanTestSupport.java | 50 +++++++++++++------
2 files changed, 40 insertions(+), 18 deletions(-)
diff --git a/tests/test-sessions/test-infinispan-sessions/pom.xml b/tests/test-sessions/test-infinispan-sessions/pom.xml
index fe7096d5d69..9529f0e2b32 100644
--- a/tests/test-sessions/test-infinispan-sessions/pom.xml
+++ b/tests/test-sessions/test-infinispan-sessions/pom.xml
@@ -13,7 +13,10 @@
${project.groupId}.sessions.infinispan
- 9.4.11.Final
+
+ 9.4.8.Final
+
+ jboss/infinispan-server
@@ -160,7 +163,8 @@
**/*.java
- ${infinispan.docker.version}
+ ${infinispan.docker.image.version}
+ ${infinispan.docker.image.name}
diff --git a/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/remote/RemoteInfinispanTestSupport.java b/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/remote/RemoteInfinispanTestSupport.java
index a275f5c88fc..438ae6e619d 100644
--- a/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/remote/RemoteInfinispanTestSupport.java
+++ b/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/remote/RemoteInfinispanTestSupport.java
@@ -31,18 +31,19 @@ import org.hibernate.search.cfg.Environment;
import org.hibernate.search.cfg.SearchMapping;
import org.infinispan.client.hotrod.RemoteCache;
import org.infinispan.client.hotrod.RemoteCacheManager;
+import org.infinispan.client.hotrod.configuration.Configuration;
import org.infinispan.client.hotrod.configuration.ConfigurationBuilder;
import org.infinispan.client.hotrod.marshall.ProtoStreamMarshaller;
import org.infinispan.protostream.FileDescriptorSource;
import org.infinispan.protostream.SerializationContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import org.testcontainers.Testcontainers;
import org.testcontainers.containers.GenericContainer;
import org.testcontainers.containers.output.Slf4jLogConsumer;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
-import static org.junit.jupiter.api.Assertions.fail;
/**
* RemoteInfinispanTestSupport
@@ -57,18 +58,28 @@ public class RemoteInfinispanTestSupport
private static final Logger INFINISPAN_LOG =
LoggerFactory.getLogger("org.eclipse.jetty.server.session.remote.infinispanLogs");
- static GenericContainer infinispan =
- new GenericContainer("jboss/infinispan-server:" +
- System.getProperty("infinispan.docker.version", "9.4.11.Final"))
- .withEnv("APP_USER","theuser")
- .withEnv("APP_PASS","foobar")
- .withLogConsumer(new Slf4jLogConsumer(INFINISPAN_LOG));
+ static GenericContainer infinispan;
static
{
try
{
+ Testcontainers.exposeHostPorts(11222);
long start = System.currentTimeMillis();
+ String infinispanVersion = System.getProperty("infinispan.docker.image.version", "9.4.8.Final");
+ infinispan =
+ new GenericContainer(System.getProperty("infinispan.docker.image.name", "jboss/infinispan-server") +
+ ":" + infinispanVersion)
+ .withEnv("APP_USER","theuser")
+ .withEnv("APP_PASS","foobar")
+ .withEnv("MGMT_USER", "admin")
+ .withEnv("MGMT_PASS", "admin")
+ .withExposedPorts(11222)
+ .withLogConsumer(new Slf4jLogConsumer(INFINISPAN_LOG));
+ if (infinispanVersion.startsWith("9.4"))
+ {
+ infinispan = infinispan.withCommand("standalone");
+ }
infinispan.start();
String host = infinispan.getContainerIpAddress();
System.setProperty("hotrod.host", host);
@@ -83,15 +94,22 @@ public class RemoteInfinispanTestSupport
Properties properties = new Properties();
properties.put(Environment.MODEL_MAPPING, mapping);
- ConfigurationBuilder clientBuilder = new ConfigurationBuilder();
- clientBuilder.withProperties(properties).addServer().host(host).port(port)
- .security().authentication().enable().realm("default")
- .serverName("infinispan")
- .saslMechanism("DIGEST-MD5")
- .username("theuser").password("foobar")
+ ConfigurationBuilder configurationBuilder = new ConfigurationBuilder().withProperties(properties)
+ .addServer().host(host).port(port)
.marshaller(new ProtoStreamMarshaller());
- _manager = new RemoteCacheManager(clientBuilder.build());
+ if (infinispanVersion.startsWith("1"))
+ {
+ configurationBuilder.security().authentication()
+ .realm("default")
+ .serverName("infinispan")
+ .saslMechanism("DIGEST-MD5")
+ .username("theuser").password("foobar");
+ }
+
+ Configuration configuration = configurationBuilder.build();
+
+ _manager = new RemoteCacheManager(configuration);
FileDescriptorSource fds = new FileDescriptorSource();
fds.addProtoFiles("/session.proto");
@@ -111,7 +129,7 @@ public class RemoteInfinispanTestSupport
}
String content = baos.toString("UTF-8");
- _manager.getCache("___protobuf_metadata").put("session.proto", content);
+ _manager.administration().getOrCreateCache("___protobuf_metadata", (String)null).put("session.proto", content);
}
catch (Exception e)
{
@@ -140,7 +158,7 @@ public class RemoteInfinispanTestSupport
public void setup() throws Exception
{
- _cache = _manager.getCache(_name);
+ _cache = _manager.administration().getOrCreateCache(_name,(String)null);
}
public void teardown() throws Exception
From e2edd6f38fe5944547c91c543de2fba065699a57 Mon Sep 17 00:00:00 2001
From: olivier lamy
Date: Wed, 13 May 2020 07:50:02 +1000
Subject: [PATCH 38/77] more testing with Jan configuration file
Signed-off-by: olivier lamy
---
.../remote/RemoteInfinispanTestSupport.java | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/remote/RemoteInfinispanTestSupport.java b/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/remote/RemoteInfinispanTestSupport.java
index 438ae6e619d..a23697b1afd 100644
--- a/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/remote/RemoteInfinispanTestSupport.java
+++ b/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/remote/RemoteInfinispanTestSupport.java
@@ -41,6 +41,7 @@ import org.slf4j.LoggerFactory;
import org.testcontainers.Testcontainers;
import org.testcontainers.containers.GenericContainer;
import org.testcontainers.containers.output.Slf4jLogConsumer;
+import org.testcontainers.utility.MountableFile;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
@@ -74,12 +75,15 @@ public class RemoteInfinispanTestSupport
.withEnv("APP_PASS","foobar")
.withEnv("MGMT_USER", "admin")
.withEnv("MGMT_PASS", "admin")
- .withExposedPorts(11222)
+ .withExposedPorts(4712,4713,7600,8080,8088,8089,8443,8181,8888,9990,9993,11211,11222,11223,11224,57600)
+ // /opt/jboss/infinispan-server/standalone/configuration/
+ .withCopyFileToContainer(MountableFile.forClasspathResource("remote-session-test.xml"),
+ "/opt/jboss/infinispan-server/standalone/configuration/remote-session-test.xml")
.withLogConsumer(new Slf4jLogConsumer(INFINISPAN_LOG));
- if (infinispanVersion.startsWith("9.4"))
- {
- infinispan = infinispan.withCommand("standalone");
- }
+// if (infinispanVersion.startsWith("9.4"))
+// {
+ infinispan = infinispan.withCommand("-c remote-session-test.xml"); // standalone
+// }
infinispan.start();
String host = infinispan.getContainerIpAddress();
System.setProperty("hotrod.host", host);
From 6b0b5c13e502f5eb879be795d5c0800bd20a387d Mon Sep 17 00:00:00 2001
From: olivier lamy
Date: Wed, 13 May 2020 14:34:59 +1000
Subject: [PATCH 39/77] finally use the file from Jan :)
Signed-off-by: olivier lamy
---
.../remote/RemoteInfinispanTestSupport.java | 17 +-
.../test/resources/remote-session-test.xml | 392 ++++++++++++++++++
2 files changed, 403 insertions(+), 6 deletions(-)
create mode 100644 tests/test-sessions/test-infinispan-sessions/src/test/resources/remote-session-test.xml
diff --git a/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/remote/RemoteInfinispanTestSupport.java b/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/remote/RemoteInfinispanTestSupport.java
index a23697b1afd..05849c0831f 100644
--- a/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/remote/RemoteInfinispanTestSupport.java
+++ b/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/remote/RemoteInfinispanTestSupport.java
@@ -31,6 +31,7 @@ import org.hibernate.search.cfg.Environment;
import org.hibernate.search.cfg.SearchMapping;
import org.infinispan.client.hotrod.RemoteCache;
import org.infinispan.client.hotrod.RemoteCacheManager;
+import org.infinispan.client.hotrod.configuration.ClientIntelligence;
import org.infinispan.client.hotrod.configuration.Configuration;
import org.infinispan.client.hotrod.configuration.ConfigurationBuilder;
import org.infinispan.client.hotrod.marshall.ProtoStreamMarshaller;
@@ -41,6 +42,7 @@ import org.slf4j.LoggerFactory;
import org.testcontainers.Testcontainers;
import org.testcontainers.containers.GenericContainer;
import org.testcontainers.containers.output.Slf4jLogConsumer;
+import org.testcontainers.containers.wait.strategy.LogMessageWaitStrategy;
import org.testcontainers.utility.MountableFile;
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -75,15 +77,14 @@ public class RemoteInfinispanTestSupport
.withEnv("APP_PASS","foobar")
.withEnv("MGMT_USER", "admin")
.withEnv("MGMT_PASS", "admin")
- .withExposedPorts(4712,4713,7600,8080,8088,8089,8443,8181,8888,9990,9993,11211,11222,11223,11224,57600)
- // /opt/jboss/infinispan-server/standalone/configuration/
+ .waitingFor(new LogMessageWaitStrategy()
+ .withRegEx(".*Infinispan Server.*started in.*\\s"))
+ .withExposedPorts(4712,4713,8088,8089,8443,9990,9993,11211,11222,11223,11224)
.withCopyFileToContainer(MountableFile.forClasspathResource("remote-session-test.xml"),
"/opt/jboss/infinispan-server/standalone/configuration/remote-session-test.xml")
.withLogConsumer(new Slf4jLogConsumer(INFINISPAN_LOG));
-// if (infinispanVersion.startsWith("9.4"))
-// {
- infinispan = infinispan.withCommand("-c remote-session-test.xml"); // standalone
-// }
+ // we could simply use `standalone` as well but... :)
+ infinispan = infinispan.withCommand("-c remote-session-test.xml");
infinispan.start();
String host = infinispan.getContainerIpAddress();
System.setProperty("hotrod.host", host);
@@ -100,6 +101,9 @@ public class RemoteInfinispanTestSupport
ConfigurationBuilder configurationBuilder = new ConfigurationBuilder().withProperties(properties)
.addServer().host(host).port(port)
+ // we just want to limit connectivity to list of host:port we knows at start
+ // as infinispan create new host:port dynamically but due to how docker expose host/port we cannot do that
+ .clientIntelligence(ClientIntelligence.BASIC)
.marshaller(new ProtoStreamMarshaller());
if (infinispanVersion.startsWith("1"))
@@ -134,6 +138,7 @@ public class RemoteInfinispanTestSupport
String content = baos.toString("UTF-8");
_manager.administration().getOrCreateCache("___protobuf_metadata", (String)null).put("session.proto", content);
+ _manager.administration().getOrCreateCache("remote-session-test", (String)null);
}
catch (Exception e)
{
diff --git a/tests/test-sessions/test-infinispan-sessions/src/test/resources/remote-session-test.xml b/tests/test-sessions/test-infinispan-sessions/src/test/resources/remote-session-test.xml
new file mode 100644
index 00000000000..eebc11417e3
--- /dev/null
+++ b/tests/test-sessions/test-infinispan-sessions/src/test/resources/remote-session-test.xml
@@ -0,0 +1,392 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE
+ h2
+
+ sa
+ sa
+
+
+
+
+ org.h2.jdbcx.JdbcDataSource
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
From 90527065c09eba77b53cc065df8b474c7f50db53 Mon Sep 17 00:00:00 2001
From: olivier lamy
Date: Wed, 13 May 2020 20:00:44 +1000
Subject: [PATCH 40/77] no need to ignore those tests
Signed-off-by: olivier lamy
---
.../test-infinispan-sessions/pom.xml | 61 -------------------
1 file changed, 61 deletions(-)
diff --git a/tests/test-sessions/test-infinispan-sessions/pom.xml b/tests/test-sessions/test-infinispan-sessions/pom.xml
index 9529f0e2b32..bd2ee0d6e6a 100644
--- a/tests/test-sessions/test-infinispan-sessions/pom.xml
+++ b/tests/test-sessions/test-infinispan-sessions/pom.xml
@@ -171,66 +171,5 @@
-
- jdk10
-
- 10
-
-
-
-
- org.apache.maven.plugins
- maven-surefire-plugin
-
-
- **/ClusteredSessionScavengingTest
-
-
-
-
-
-
-
- jdk11
-
- 11
-
-
-
-
- org.apache.maven.plugins
- maven-surefire-plugin
-
-
- **/ClusteredSessionScavengingTest
-
-
-
-
-
-
-
-
- alltests
-
-
- alltests
- true
-
-
-
-
-
- org.apache.maven.plugins
- maven-surefire-plugin
-
-
- FOOBAR
-
-
-
-
-
-
From ebbe2c5843e5abd534a1b44ac8cd47d2643a61ba Mon Sep 17 00:00:00 2001
From: olivier lamy
Date: Wed, 13 May 2020 20:15:17 +1000
Subject: [PATCH 41/77] use new junit api to test exception
Signed-off-by: olivier lamy
---
.../session/InfinispanSessionDataStoreTest.java | 12 ++----------
.../SerializedInfinispanSessionDataStoreTest.java | 12 ++----------
.../remote/RemoteInfinispanSessionDataStoreTest.java | 12 ++----------
3 files changed, 6 insertions(+), 30 deletions(-)
diff --git a/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/InfinispanSessionDataStoreTest.java b/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/InfinispanSessionDataStoreTest.java
index 62c4446c871..1465b334eda 100644
--- a/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/InfinispanSessionDataStoreTest.java
+++ b/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/InfinispanSessionDataStoreTest.java
@@ -30,7 +30,7 @@ import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
-import static org.junit.jupiter.api.Assertions.fail;
+import static org.junit.jupiter.api.Assertions.assertThrows;
/**
* InfinispanSessionDataStoreTest
@@ -106,15 +106,7 @@ public class InfinispanSessionDataStoreTest extends AbstractSessionDataStoreTest
((InfinispanSessionDataStore)store).setCache(null);
//test that loading it fails
- try
- {
- store.load("222");
- fail("Session should be unreadable");
- }
- catch (UnreadableSessionDataException e)
- {
- //expected exception
- }
+ assertThrows(UnreadableSessionDataException.class, () -> store.load("222"));
}
/**
diff --git a/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/SerializedInfinispanSessionDataStoreTest.java b/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/SerializedInfinispanSessionDataStoreTest.java
index 5f45903196b..37f92e3b447 100644
--- a/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/SerializedInfinispanSessionDataStoreTest.java
+++ b/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/SerializedInfinispanSessionDataStoreTest.java
@@ -30,7 +30,7 @@ import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
-import static org.junit.jupiter.api.Assertions.fail;
+import static org.junit.jupiter.api.Assertions.assertThrows;
/**
* SerializedInfinispanSessionDataStoreTest
@@ -107,15 +107,7 @@ public class SerializedInfinispanSessionDataStoreTest extends AbstractSessionDat
((InfinispanSessionDataStore)store).setCache(null);
//test that loading it fails
- try
- {
- store.load("222");
- fail("Session should be unreadable");
- }
- catch (UnreadableSessionDataException e)
- {
- //expected exception
- }
+ assertThrows(UnreadableSessionDataException.class,() -> store.load("222"));
}
/**
diff --git a/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/remote/RemoteInfinispanSessionDataStoreTest.java b/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/remote/RemoteInfinispanSessionDataStoreTest.java
index 510ffdd6a0c..718a38e06e3 100644
--- a/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/remote/RemoteInfinispanSessionDataStoreTest.java
+++ b/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/remote/RemoteInfinispanSessionDataStoreTest.java
@@ -38,7 +38,7 @@ import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
-import static org.junit.jupiter.api.Assertions.fail;
+import static org.junit.jupiter.api.Assertions.assertThrows;
/**
* RemoteInfinispanSessionDataStoreTest
@@ -130,15 +130,7 @@ public class RemoteInfinispanSessionDataStoreTest extends AbstractSessionDataSto
((InfinispanSessionDataStore)store).setCache(null);
//test that loading it fails
- try
- {
- store.load("222");
- fail("Session should be unreadable");
- }
- catch (UnreadableSessionDataException e)
- {
- //expected exception
- }
+ assertThrows(UnreadableSessionDataException.class, () -> store.load("222"));
}
@Test
From bb26241a37736e4526e4c34e3e8563ba9dad9f51 Mon Sep 17 00:00:00 2001
From: olivier lamy
Date: Thu, 14 May 2020 14:54:23 +1000
Subject: [PATCH 42/77] add RemoteQueryManagerTest to use infinispan via
testcontainer, simplify how we start infinispan
Signed-off-by: olivier lamy
---
.../infinispan-remote-query/pom.xml | 18 +-
.../infinispan/RemoteQueryManagerTest.java | 73 +++-
.../test/resources/simplelogger.properties | 3 +
.../test-infinispan-sessions/pom.xml | 4 +-
.../remote/RemoteInfinispanTestSupport.java | 7 +-
.../test/resources/remote-session-test.xml | 392 ------------------
6 files changed, 82 insertions(+), 415 deletions(-)
create mode 100644 jetty-infinispan/infinispan-remote-query/src/test/resources/simplelogger.properties
delete mode 100644 tests/test-sessions/test-infinispan-sessions/src/test/resources/remote-session-test.xml
diff --git a/jetty-infinispan/infinispan-remote-query/pom.xml b/jetty-infinispan/infinispan-remote-query/pom.xml
index a9ec47afbaa..4cb8d9bbb6a 100644
--- a/jetty-infinispan/infinispan-remote-query/pom.xml
+++ b/jetty-infinispan/infinispan-remote-query/pom.xml
@@ -7,12 +7,11 @@
4.0.0infinispan-remote-queryJetty :: Infinispan Session Manager Remote
- http://www.eclipse.org/jetty${project.groupId}.infinispan.remote.query
+ 9.4.8.Final
- installorg.apache.maven.plugins
@@ -127,10 +126,20 @@
infinispan-remote-query-client${infinispan.version}
+
+ org.slf4j
+ slf4j-simple
+ test
+
+
+ org.testcontainers
+ testcontainers
+ test
+
- remote
+ remote-session-testshotrod.enabled
@@ -144,6 +153,9 @@
maven-surefire-pluginfalse
+
+ ${infinispan.docker.image.version}
+
diff --git a/jetty-infinispan/infinispan-remote-query/src/test/java/org/eclipse/jetty/server/session/infinispan/RemoteQueryManagerTest.java b/jetty-infinispan/infinispan-remote-query/src/test/java/org/eclipse/jetty/server/session/infinispan/RemoteQueryManagerTest.java
index 6fd5521e9f0..53b04adeb25 100644
--- a/jetty-infinispan/infinispan-remote-query/src/test/java/org/eclipse/jetty/server/session/infinispan/RemoteQueryManagerTest.java
+++ b/jetty-infinispan/infinispan-remote-query/src/test/java/org/eclipse/jetty/server/session/infinispan/RemoteQueryManagerTest.java
@@ -27,6 +27,7 @@ import java.util.Random;
import java.util.Set;
import org.eclipse.jetty.server.session.SessionData;
+import org.eclipse.jetty.session.infinispan.InfinispanSessionData;
import org.eclipse.jetty.session.infinispan.QueryManager;
import org.eclipse.jetty.session.infinispan.RemoteQueryManager;
import org.eclipse.jetty.session.infinispan.SessionDataMarshaller;
@@ -35,11 +36,23 @@ import org.hibernate.search.cfg.Environment;
import org.hibernate.search.cfg.SearchMapping;
import org.infinispan.client.hotrod.RemoteCache;
import org.infinispan.client.hotrod.RemoteCacheManager;
+import org.infinispan.client.hotrod.configuration.ClientIntelligence;
import org.infinispan.client.hotrod.configuration.ConfigurationBuilder;
import org.infinispan.client.hotrod.marshall.ProtoStreamMarshaller;
import org.infinispan.protostream.FileDescriptorSource;
import org.infinispan.protostream.SerializationContext;
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
+import org.junit.runner.RunWith;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.testcontainers.containers.GenericContainer;
+import org.testcontainers.containers.output.Slf4jLogConsumer;
+import org.testcontainers.containers.wait.strategy.LogMessageWaitStrategy;
+import org.testcontainers.utility.MountableFile;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
@@ -49,8 +62,45 @@ public class RemoteQueryManagerTest
{
public static final String DEFAULT_CACHE_NAME = "remote-session-test";
+ private static final Logger LOG = LoggerFactory.getLogger(RemoteQueryManagerTest.class);
+
+ private static final Logger INFINISPAN_LOG =
+ LoggerFactory.getLogger("org.eclipse.jetty.server.session.infinispan.infinispanLogs");
+
+ private String host;
+ private int port;
+
+ GenericContainer infinispan =
+ new GenericContainer(System.getProperty("infinispan.docker.image.name", "jboss/infinispan-server") +
+ ":" + System.getProperty("infinispan.docker.image.version", "9.4.8.Final"))
+ .withEnv("APP_USER","theuser")
+ .withEnv("APP_PASS","foobar")
+ .withEnv("MGMT_USER", "admin")
+ .withEnv("MGMT_PASS", "admin")
+ .waitingFor(new LogMessageWaitStrategy()
+ .withRegEx(".*Infinispan Server.*started in.*\\s"))
+ .withExposedPorts(4712,4713,8088,8089,8443,9990,9993,11211,11222,11223,11224)
+ .withLogConsumer(new Slf4jLogConsumer(INFINISPAN_LOG));
+
+ @BeforeEach
+ public void setup() throws Exception
+ {
+ long start = System.currentTimeMillis();
+ infinispan.start();
+ host = infinispan.getContainerIpAddress();
+ port = infinispan.getMappedPort(11222);
+ LOG.info("Infinispan container started for {}:{} - {}ms", host, port,
+ System.currentTimeMillis() - start);
+ }
+
+ @AfterEach
+ public void stop() throws Exception
+ {
+ infinispan.stop();
+ }
+
@Test
- public void test() throws Exception
+ public void testQuery() throws Exception
{
SearchMapping mapping = new SearchMapping();
mapping.entity(SessionData.class).indexed().providedId().property("expiry", ElementType.FIELD).field();
@@ -59,9 +109,13 @@ public class RemoteQueryManagerTest
properties.put(Environment.MODEL_MAPPING, mapping);
ConfigurationBuilder clientBuilder = new ConfigurationBuilder();
- clientBuilder.withProperties(properties).addServer().host("127.0.0.1").marshaller(new ProtoStreamMarshaller());
+ clientBuilder.withProperties(properties).addServer()
+ .host(this.host).port(this.port)
+ .clientIntelligence(ClientIntelligence.BASIC)
+ .marshaller(new ProtoStreamMarshaller());
RemoteCacheManager remoteCacheManager = new RemoteCacheManager(clientBuilder.build());
+ remoteCacheManager.administration().getOrCreateCache("remote-session-test", (String)null);
FileDescriptorSource fds = new FileDescriptorSource();
fds.addProtoFiles("/session.proto");
@@ -70,20 +124,17 @@ public class RemoteQueryManagerTest
serCtx.registerProtoFiles(fds);
serCtx.registerMarshaller(new SessionDataMarshaller());
- RemoteCache cache = remoteCacheManager.getCache(DEFAULT_CACHE_NAME);
-
- ByteArrayOutputStream baos;
- try (InputStream is = RemoteQueryManagerTest.class.getClassLoader().getResourceAsStream("session.proto"))
+ try (InputStream is = RemoteQueryManagerTest.class.getClassLoader().getResourceAsStream("session.proto");
+ ByteArrayOutputStream baos = new ByteArrayOutputStream())
{
if (is == null)
throw new IllegalStateException("inputstream is null");
-
- baos = new ByteArrayOutputStream();
IO.copy(is, baos);
+ String content = baos.toString("UTF-8");
+ remoteCacheManager.getCache("___protobuf_metadata").put("session.proto", content);
}
- String content = baos.toString("UTF-8");
- remoteCacheManager.getCache("___protobuf_metadata").put("session.proto", content);
+ RemoteCache cache = remoteCacheManager.getCache(DEFAULT_CACHE_NAME);
//put some sessions into the remote cache
int numSessions = 10;
@@ -97,7 +148,7 @@ public class RemoteQueryManagerTest
String id = "sd" + i;
//create new sessiondata with random expiry time
long expiryTime = r.nextInt(maxExpiryTime);
- SessionData sd = new SessionData(id, "", "", 0, 0, 0, 0);
+ InfinispanSessionData sd = new InfinispanSessionData(id, "", "", 0, 0, 0, 0);
sd.setLastNode("lastNode");
sd.setExpiry(expiryTime);
diff --git a/jetty-infinispan/infinispan-remote-query/src/test/resources/simplelogger.properties b/jetty-infinispan/infinispan-remote-query/src/test/resources/simplelogger.properties
new file mode 100644
index 00000000000..0bd8aee936e
--- /dev/null
+++ b/jetty-infinispan/infinispan-remote-query/src/test/resources/simplelogger.properties
@@ -0,0 +1,3 @@
+org.slf4j.simpleLogger.defaultLogLevel=info
+org.slf4j.simpleLogger.log.org.eclipse.jetty.server.session.infinispan.infinispanLogs=debug
+org.slf4j.simpleLogger.log.org.eclipse.jetty.server.session.infinispan.RemoteQueryManagerTest=debug
diff --git a/tests/test-sessions/test-infinispan-sessions/pom.xml b/tests/test-sessions/test-infinispan-sessions/pom.xml
index bd2ee0d6e6a..ba31c16285f 100644
--- a/tests/test-sessions/test-infinispan-sessions/pom.xml
+++ b/tests/test-sessions/test-infinispan-sessions/pom.xml
@@ -12,9 +12,7 @@
${project.groupId}.sessions.infinispan
-
-
- 9.4.8.Final
+ ${infinispan.version}jboss/infinispan-server
diff --git a/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/remote/RemoteInfinispanTestSupport.java b/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/remote/RemoteInfinispanTestSupport.java
index 05849c0831f..c94cb71ca73 100644
--- a/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/remote/RemoteInfinispanTestSupport.java
+++ b/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/remote/RemoteInfinispanTestSupport.java
@@ -39,7 +39,6 @@ import org.infinispan.protostream.FileDescriptorSource;
import org.infinispan.protostream.SerializationContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import org.testcontainers.Testcontainers;
import org.testcontainers.containers.GenericContainer;
import org.testcontainers.containers.output.Slf4jLogConsumer;
import org.testcontainers.containers.wait.strategy.LogMessageWaitStrategy;
@@ -67,7 +66,7 @@ public class RemoteInfinispanTestSupport
{
try
{
- Testcontainers.exposeHostPorts(11222);
+ //Testcontainers.exposeHostPorts(11222);
long start = System.currentTimeMillis();
String infinispanVersion = System.getProperty("infinispan.docker.image.version", "9.4.8.Final");
infinispan =
@@ -80,11 +79,7 @@ public class RemoteInfinispanTestSupport
.waitingFor(new LogMessageWaitStrategy()
.withRegEx(".*Infinispan Server.*started in.*\\s"))
.withExposedPorts(4712,4713,8088,8089,8443,9990,9993,11211,11222,11223,11224)
- .withCopyFileToContainer(MountableFile.forClasspathResource("remote-session-test.xml"),
- "/opt/jboss/infinispan-server/standalone/configuration/remote-session-test.xml")
.withLogConsumer(new Slf4jLogConsumer(INFINISPAN_LOG));
- // we could simply use `standalone` as well but... :)
- infinispan = infinispan.withCommand("-c remote-session-test.xml");
infinispan.start();
String host = infinispan.getContainerIpAddress();
System.setProperty("hotrod.host", host);
diff --git a/tests/test-sessions/test-infinispan-sessions/src/test/resources/remote-session-test.xml b/tests/test-sessions/test-infinispan-sessions/src/test/resources/remote-session-test.xml
deleted file mode 100644
index eebc11417e3..00000000000
--- a/tests/test-sessions/test-infinispan-sessions/src/test/resources/remote-session-test.xml
+++ /dev/null
@@ -1,392 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE
- h2
-
- sa
- sa
-
-
-
-
- org.h2.jdbcx.JdbcDataSource
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
From 9b16f2deee34cdd4ed573231107a1cce070563a0 Mon Sep 17 00:00:00 2001
From: olivier lamy
Date: Thu, 14 May 2020 15:00:30 +1000
Subject: [PATCH 43/77] do not create on start
Signed-off-by: olivier lamy
---
.../jetty/server/session/remote/RemoteInfinispanTestSupport.java | 1 -
1 file changed, 1 deletion(-)
diff --git a/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/remote/RemoteInfinispanTestSupport.java b/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/remote/RemoteInfinispanTestSupport.java
index c94cb71ca73..3955fe518fe 100644
--- a/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/remote/RemoteInfinispanTestSupport.java
+++ b/tests/test-sessions/test-infinispan-sessions/src/test/java/org/eclipse/jetty/server/session/remote/RemoteInfinispanTestSupport.java
@@ -133,7 +133,6 @@ public class RemoteInfinispanTestSupport
String content = baos.toString("UTF-8");
_manager.administration().getOrCreateCache("___protobuf_metadata", (String)null).put("session.proto", content);
- _manager.administration().getOrCreateCache("remote-session-test", (String)null);
}
catch (Exception e)
{
From 590b1a6ab17680b2793e4a1181e6226929cf732a Mon Sep 17 00:00:00 2001
From: Lachlan Roberts
Date: Mon, 18 May 2020 11:49:12 +1000
Subject: [PATCH 44/77] Issue #4873 - fix timeout on ExecutorThreadPool.join()
Signed-off-by: Lachlan Roberts
---
.../java/org/eclipse/jetty/util/thread/ExecutorThreadPool.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/thread/ExecutorThreadPool.java b/jetty-util/src/main/java/org/eclipse/jetty/util/thread/ExecutorThreadPool.java
index db558cb8b89..9d1e2f0ea97 100644
--- a/jetty-util/src/main/java/org/eclipse/jetty/util/thread/ExecutorThreadPool.java
+++ b/jetty-util/src/main/java/org/eclipse/jetty/util/thread/ExecutorThreadPool.java
@@ -302,7 +302,7 @@ public class ExecutorThreadPool extends ContainerLifeCycle implements ThreadPool
@Override
public void join() throws InterruptedException
{
- _executor.awaitTermination(getStopTimeout(), TimeUnit.MILLISECONDS);
+ _executor.awaitTermination(Long.MAX_VALUE, TimeUnit.MILLISECONDS);
}
@Override
From 3215e11b3fe118652f181f6e4df2fb2c43aba7de Mon Sep 17 00:00:00 2001
From: Olivier Lamy
Date: Tue, 19 May 2020 16:28:53 +1000
Subject: [PATCH 45/77] Issue #4887 update documentation
org.apache.aries.spifly.dynamic.bundle version 1.2.4
---
.../src/main/asciidoc/development/frameworks/osgi.adoc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/jetty-documentation/src/main/asciidoc/development/frameworks/osgi.adoc b/jetty-documentation/src/main/asciidoc/development/frameworks/osgi.adoc
index 9f72bf7398c..e7059fdef4e 100644
--- a/jetty-documentation/src/main/asciidoc/development/frameworks/osgi.adoc
+++ b/jetty-documentation/src/main/asciidoc/development/frameworks/osgi.adoc
@@ -55,7 +55,7 @@ You *must also install the Apache Aries SPI Fly bundles* as many parts of Jetty
[cols=",,",options="header",]
|=======================================================================
|Jar |Bundle Symbolic Name |Location
-|org.apache.aries.spifly:org.apache.aries.spifly.dynamic.bundle-1.2.jar |org.apache.aries.spifly.dynamic.bundle
+|org.apache.aries.spifly:org.apache.aries.spifly.dynamic.bundle-1.2.4.jar |org.apache.aries.spifly.dynamic.bundle
|https://repo1.maven.org/maven2/org/apache/aries/spifly/org.apache.aries.spifly.dynamic.bundle/[Maven central]
|=======================================================================
From ae0b70fbfcca858eb554e3660896ed325c5b7b2a Mon Sep 17 00:00:00 2001
From: Lachlan Roberts
Date: Wed, 20 May 2020 00:45:05 +1000
Subject: [PATCH 46/77] Issue #4873 - add test to reproduce the
ExecutorThreadPool.join() issue
Signed-off-by: Lachlan Roberts
---
.../util/thread/ExecutorThreadPoolTest.java | 24 +++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/jetty-util/src/test/java/org/eclipse/jetty/util/thread/ExecutorThreadPoolTest.java b/jetty-util/src/test/java/org/eclipse/jetty/util/thread/ExecutorThreadPoolTest.java
index 95ab6a22aab..a495d719bb0 100644
--- a/jetty-util/src/test/java/org/eclipse/jetty/util/thread/ExecutorThreadPoolTest.java
+++ b/jetty-util/src/test/java/org/eclipse/jetty/util/thread/ExecutorThreadPoolTest.java
@@ -18,7 +18,13 @@
package org.eclipse.jetty.util.thread;
+import java.time.Duration;
+
import org.eclipse.jetty.util.thread.ThreadPool.SizedThreadPool;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertThrows;
+import static org.junit.jupiter.api.Assertions.assertTimeoutPreemptively;
public class ExecutorThreadPoolTest extends AbstractThreadPoolTest
{
@@ -27,4 +33,22 @@ public class ExecutorThreadPoolTest extends AbstractThreadPoolTest
{
return new ExecutorThreadPool(max);
}
+
+ @Test
+ public void testJoin() throws Exception
+ {
+ final long stopTimeout = 100;
+ ExecutorThreadPool executorThreadPool = new ExecutorThreadPool(10);
+ executorThreadPool.setStopTimeout(stopTimeout);
+ executorThreadPool.start();
+
+ // Verify that join does not timeout after waiting twice the stopTimeout.
+ assertThrows(Throwable.class, () ->
+ assertTimeoutPreemptively(Duration.ofMillis(stopTimeout * 2), executorThreadPool::join)
+ );
+
+ // After stopping the ThreadPool join should unblock.
+ executorThreadPool.stop();
+ assertTimeoutPreemptively(Duration.ofMillis(stopTimeout), executorThreadPool::join);
+ }
}
From 3845790c5d24ea69b1724acd45fdf27a76321c0c Mon Sep 17 00:00:00 2001
From: Greg Wilkins
Date: Wed, 20 May 2020 10:47:23 +0200
Subject: [PATCH 47/77] Hpack optimizations
If the dynamic table size is already 0, do not evictAll.
Signed-off-by: Greg Wilkins
---
.../eclipse/jetty/http2/hpack/HpackContext.java | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/jetty-http2/http2-hpack/src/main/java/org/eclipse/jetty/http2/hpack/HpackContext.java b/jetty-http2/http2-hpack/src/main/java/org/eclipse/jetty/http2/hpack/HpackContext.java
index ab587240876..5625b2c0cb9 100644
--- a/jetty-http2/http2-hpack/src/main/java/org/eclipse/jetty/http2/hpack/HpackContext.java
+++ b/jetty-http2/http2-hpack/src/main/java/org/eclipse/jetty/http2/hpack/HpackContext.java
@@ -395,12 +395,15 @@ public class HpackContext
{
if (LOG.isDebugEnabled())
LOG.debug(String.format("HdrTbl[%x] evictAll", HpackContext.this.hashCode()));
- _fieldMap.clear();
- _nameMap.clear();
- _offset = 0;
- _size = 0;
- _dynamicTableSizeInBytes = 0;
- Arrays.fill(_entries, null);
+ if (size() > 0)
+ {
+ _fieldMap.clear();
+ _nameMap.clear();
+ _offset = 0;
+ _size = 0;
+ _dynamicTableSizeInBytes = 0;
+ Arrays.fill(_entries, null);
+ }
}
}
From 3ead429476cc82567631e40aa62376de7e178439 Mon Sep 17 00:00:00 2001
From: Simone Bordet
Date: Wed, 20 May 2020 12:35:16 +0200
Subject: [PATCH 48/77] Fixes #4892 - Non-blocking JSON parser.
Implemented non-blocking JSON parser.
Signed-off-by: Simone Bordet
---
.../eclipse/jetty/util/ajax/AsyncJSON.java | 1205 +++++++++++++++++
.../jetty/util/ajax/AsyncJSONTest.java | 503 +++++++
2 files changed, 1708 insertions(+)
create mode 100644 jetty-util-ajax/src/main/java/org/eclipse/jetty/util/ajax/AsyncJSON.java
create mode 100644 jetty-util-ajax/src/test/java/org/eclipse/jetty/util/ajax/AsyncJSONTest.java
diff --git a/jetty-util-ajax/src/main/java/org/eclipse/jetty/util/ajax/AsyncJSON.java b/jetty-util-ajax/src/main/java/org/eclipse/jetty/util/ajax/AsyncJSON.java
new file mode 100644
index 00000000000..8dba7382402
--- /dev/null
+++ b/jetty-util-ajax/src/main/java/org/eclipse/jetty/util/ajax/AsyncJSON.java
@@ -0,0 +1,1205 @@
+//
+// ========================================================================
+// Copyright (c) 1995-2020 Mort Bay Consulting Pty Ltd and others.
+// ------------------------------------------------------------------------
+// All rights reserved. This program and the accompanying materials
+// are made available under the terms of the Eclipse Public License v1.0
+// and Apache License v2.0 which accompanies this distribution.
+//
+// The Eclipse Public License is available at
+// http://www.eclipse.org/legal/epl-v10.html
+//
+// The Apache License v2.0 is available at
+// http://www.opensource.org/licenses/apache2.0.php
+//
+// You may elect to redistribute this code under either of these licenses.
+// ========================================================================
+//
+
+package org.eclipse.jetty.util.ajax;
+
+import java.nio.ByteBuffer;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
+import org.eclipse.jetty.util.ArrayTernaryTrie;
+import org.eclipse.jetty.util.BufferUtil;
+import org.eclipse.jetty.util.Loader;
+import org.eclipse.jetty.util.Trie;
+import org.eclipse.jetty.util.TypeUtil;
+import org.eclipse.jetty.util.Utf8StringBuilder;
+
+public class AsyncJSON
+{
+ public static class Factory
+ {
+ private Trie cache;
+ private Map convertors;
+ private boolean detailedParseException;
+
+ public boolean isDetailedParseException()
+ {
+ return detailedParseException;
+ }
+
+ public void setDetailedParseException(boolean detailedParseException)
+ {
+ this.detailedParseException = detailedParseException;
+ }
+
+ public void cache(String value)
+ {
+ if (cache == null)
+ cache = new ArrayTernaryTrie.Growing<>(false, 64, 64);
+ cache.put("\"" + value + "\"", value);
+ }
+
+ public String cached(ByteBuffer buffer)
+ {
+ if (cache != null)
+ {
+ String result = cache.getBest(buffer, 0, buffer.remaining());
+ if (result != null)
+ {
+ buffer.position(buffer.position() + result.length() + 2);
+ return result;
+ }
+ }
+ return null;
+ }
+
+ public AsyncJSON newAsyncJSON()
+ {
+ return new AsyncJSON(this);
+ }
+
+ public void putConvertor(String className, JSON.Convertor convertor)
+ {
+ if (convertors == null)
+ convertors = new ConcurrentHashMap<>();
+ convertors.put(className, convertor);
+ }
+
+ public JSON.Convertor removeConvertor(String className)
+ {
+ if (convertors != null)
+ return convertors.remove(className);
+ return null;
+ }
+ }
+
+ private static final Object UNSET = new Object();
+
+ private final Factory factory;
+ private final FrameStack stack = new FrameStack();
+ private final Utf8StringBuilder stringBuilder;
+ private final NumberBuilder numberBuilder;
+ private List chunks;
+
+ public AsyncJSON(Factory factory)
+ {
+ this.factory = factory;
+ this.stringBuilder = new Utf8StringBuilder(32);
+ this.numberBuilder = new NumberBuilder();
+ }
+
+ // Used by tests only.
+ boolean isEmpty()
+ {
+ return stack.isEmpty();
+ }
+
+ public boolean parse(byte[] bytes)
+ {
+ return parse(ByteBuffer.wrap(bytes));
+ }
+
+ public boolean parse(ByteBuffer buffer)
+ {
+ try
+ {
+ if (factory.isDetailedParseException())
+ {
+ if (chunks == null)
+ chunks = new ArrayList<>();
+ ByteBuffer copy = buffer.isDirect()
+ ? ByteBuffer.allocateDirect(buffer.remaining())
+ : ByteBuffer.allocate(buffer.remaining());
+ copy.put(buffer).flip();
+ chunks.add(copy);
+ buffer.flip();
+ }
+
+ if (stack.isEmpty())
+ stack.push(State.COMPLETE, UNSET);
+
+ while (true)
+ {
+ Frame frame = stack.peek();
+ State state = frame.state;
+ switch (state)
+ {
+ case COMPLETE:
+ {
+ if (frame.value == UNSET)
+ {
+ if (parseAny(buffer))
+ break;
+ return false;
+ }
+ else
+ {
+ while (buffer.hasRemaining())
+ {
+ int position = buffer.position();
+ byte peek = buffer.get(position);
+ if (Character.isWhitespace((char)peek))
+ buffer.position(position + 1);
+ else
+ throw newInvalidJSON(buffer, "invalid character after JSON data");
+ }
+ return true;
+ }
+ }
+ case NULL:
+ {
+ if (parseNull(buffer))
+ break;
+ return false;
+ }
+ case TRUE:
+ {
+ if (parseTrue(buffer))
+ break;
+ return false;
+ }
+ case FALSE:
+ {
+ if (parseFalse(buffer))
+ break;
+ return false;
+ }
+ case NUMBER:
+ {
+ if (parseNumber(buffer))
+ break;
+ return false;
+ }
+ case STRING:
+ {
+ if (parseString(buffer))
+ break;
+ return false;
+ }
+ case ESCAPE:
+ {
+ if (parseEscape(buffer))
+ break;
+ return false;
+ }
+ case UNICODE:
+ {
+ if (parseUnicode(buffer))
+ break;
+ return false;
+ }
+ case ARRAY:
+ {
+ if (parseArray(buffer))
+ break;
+ return false;
+ }
+ case OBJECT:
+ {
+ if (parseObject(buffer))
+ break;
+ return false;
+ }
+ case OBJECT_FIELD:
+ {
+ if (parseObjectField(buffer))
+ break;
+ return false;
+ }
+ case OBJECT_FIELD_NAME:
+ {
+ if (parseObjectFieldName(buffer))
+ break;
+ return false;
+ }
+ case OBJECT_FIELD_VALUE:
+ {
+ if (parseObjectFieldValue(buffer))
+ break;
+ return false;
+ }
+ default:
+ {
+ throw new IllegalStateException("invalid state " + state);
+ }
+ }
+ }
+ }
+ catch (Throwable x)
+ {
+ reset();
+ throw x;
+ }
+ }
+
+ public R eof()
+ {
+ try
+ {
+ if (stack.isEmpty())
+ throw new IllegalStateException("no JSON parsed");
+
+ while (true)
+ {
+ State state = stack.peek().state;
+ switch (state)
+ {
+ case NUMBER:
+ {
+ Number value = numberBuilder.value();
+ stack.pop();
+ stack.peek().value(value);
+ break;
+ }
+ case COMPLETE:
+ {
+ if (stack.peek().value == UNSET)
+ throw new IllegalStateException("invalid state " + state);
+ return (R)complete();
+ }
+ default:
+ {
+ throw newInvalidJSON(BufferUtil.EMPTY_BUFFER, "incomplete JSON");
+ }
+ }
+ }
+ }
+ catch (Throwable x)
+ {
+ reset();
+ throw x;
+ }
+ }
+
+ protected Map newObject(Context context)
+ {
+ return new HashMap<>();
+ }
+
+ protected List newArray(Context context)
+ {
+ return new ArrayList<>();
+ }
+
+ private Object complete()
+ {
+ Object result = stack.peek().value;
+ reset();
+ return result;
+ }
+
+ private void reset()
+ {
+ stack.clear();
+ chunks = null;
+ }
+
+ private boolean parseAny(ByteBuffer buffer)
+ {
+ while (buffer.hasRemaining())
+ {
+ byte peek = buffer.get(buffer.position());
+ switch (peek)
+ {
+ case '[':
+ if (parseArray(buffer))
+ return true;
+ break;
+ case '{':
+ if (parseObject(buffer))
+ return true;
+ break;
+ case '-':
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ if (parseNumber(buffer))
+ return true;
+ break;
+ case '"':
+ if (parseString(buffer))
+ return true;
+ break;
+ case 'f':
+ if (parseFalse(buffer))
+ return true;
+ break;
+ case 'n':
+ if (parseNull(buffer))
+ return true;
+ break;
+ case 't':
+ if (parseTrue(buffer))
+ return true;
+ break;
+ default:
+ if (Character.isWhitespace(peek))
+ {
+ buffer.get();
+ break;
+ }
+ throw newInvalidJSON(buffer, "unrecognized JSON value");
+ }
+ }
+ return false;
+ }
+
+ private boolean parseNull(ByteBuffer buffer)
+ {
+ while (buffer.hasRemaining())
+ {
+ byte currentByte = buffer.get();
+ switch (currentByte)
+ {
+ case 'n':
+ if (stack.peek().state != State.NULL)
+ {
+ stack.push(State.NULL, 0);
+ parseNullCharacter(buffer, 0);
+ break;
+ }
+ throw newInvalidJSON(buffer, "invalid 'null' literal");
+ case 'u':
+ parseNullCharacter(buffer, 1);
+ break;
+ case 'l':
+ int index = (Integer)stack.peek().value;
+ if (index == 2 || index == 3)
+ parseNullCharacter(buffer, index);
+ else
+ throw newInvalidJSON(buffer, "invalid 'null' literal");
+ if (index == 3)
+ {
+ stack.pop();
+ stack.peek().value(null);
+ return true;
+ }
+ break;
+ default:
+ throw newInvalidJSON(buffer, "invalid 'null' literal");
+ }
+ }
+ return false;
+ }
+
+ private void parseNullCharacter(ByteBuffer buffer, int index)
+ {
+ Frame frame = stack.peek();
+ int value = (Integer)frame.value;
+ if (value == index)
+ frame.value = ++value;
+ else
+ throw newInvalidJSON(buffer, "invalid 'null' literal");
+ }
+
+ private boolean parseTrue(ByteBuffer buffer)
+ {
+ while (buffer.hasRemaining())
+ {
+ byte currentByte = buffer.get();
+ switch (currentByte)
+ {
+ case 't':
+ if (stack.peek().state != State.TRUE)
+ {
+ stack.push(State.TRUE, 0);
+ parseTrueCharacter(buffer, 0);
+ break;
+ }
+ throw newInvalidJSON(buffer, "invalid 'true' literal");
+ case 'r':
+ parseTrueCharacter(buffer, 1);
+ break;
+ case 'u':
+ parseTrueCharacter(buffer, 2);
+ break;
+ case 'e':
+ parseTrueCharacter(buffer, 3);
+ stack.pop();
+ stack.peek().value(Boolean.TRUE);
+ return true;
+ default:
+ throw newInvalidJSON(buffer, "invalid 'true' literal");
+ }
+ }
+ return false;
+ }
+
+ private void parseTrueCharacter(ByteBuffer buffer, int index)
+ {
+ Frame frame = stack.peek();
+ int value = (Integer)frame.value;
+ if (value == index)
+ frame.value = ++value;
+ else
+ throw newInvalidJSON(buffer, "invalid 'true' literal");
+ }
+
+ private boolean parseFalse(ByteBuffer buffer)
+ {
+ while (buffer.hasRemaining())
+ {
+ byte currentByte = buffer.get();
+ switch (currentByte)
+ {
+ case 'f':
+ if (stack.peek().state != State.FALSE)
+ {
+ stack.push(State.FALSE, 0);
+ parseFalseCharacter(buffer, 0);
+ break;
+ }
+ throw newInvalidJSON(buffer, "invalid 'false' literal");
+ case 'a':
+ parseFalseCharacter(buffer, 1);
+ break;
+ case 'l':
+ parseFalseCharacter(buffer, 2);
+ break;
+ case 's':
+ parseFalseCharacter(buffer, 3);
+ break;
+ case 'e':
+ parseFalseCharacter(buffer, 4);
+ stack.pop();
+ stack.peek().value(Boolean.FALSE);
+ return true;
+ default:
+ throw newInvalidJSON(buffer, "invalid 'false' literal");
+ }
+ }
+ return false;
+ }
+
+ private void parseFalseCharacter(ByteBuffer buffer, int index)
+ {
+ Frame frame = stack.peek();
+ int value = (Integer)frame.value;
+ if (value == index)
+ frame.value = ++value;
+ else
+ throw newInvalidJSON(buffer, "invalid 'false' literal");
+ }
+
+ private boolean parseNumber(ByteBuffer buffer)
+ {
+ if (stack.peek().state != State.NUMBER)
+ stack.push(State.NUMBER, numberBuilder);
+
+ while (buffer.hasRemaining())
+ {
+ byte currentByte = buffer.get();
+ switch (currentByte)
+ {
+ case '+':
+ case '-':
+ if (numberBuilder.appendSign(currentByte))
+ break;
+ throw newInvalidJSON(buffer, "invalid number");
+ case '.':
+ case 'E':
+ case 'e':
+ if (numberBuilder.appendAlpha(currentByte))
+ break;
+ throw newInvalidJSON(buffer, "invalid number");
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ numberBuilder.appendDigit(currentByte);
+ break;
+ default:
+ buffer.position(buffer.position() - 1);
+ Number value = numberBuilder.value();
+ stack.pop();
+ stack.peek().value(value);
+ return true;
+ }
+ }
+ return false;
+ }
+
+ private boolean parseString(ByteBuffer buffer)
+ {
+ Frame frame = stack.peek();
+ if (buffer.hasRemaining() && frame.state != State.STRING)
+ {
+ String result = factory.cached(buffer);
+ if (result != null)
+ {
+ frame.value(result);
+ return true;
+ }
+ }
+
+ while (buffer.hasRemaining())
+ {
+ byte currentByte = buffer.get();
+ switch (currentByte)
+ {
+ // Explicit delimiter, handle push and pop in this method.
+ case '"':
+ {
+ if (stack.peek().state != State.STRING)
+ {
+ stack.push(State.STRING, stringBuilder);
+ break;
+ }
+ else
+ {
+ String string = stringBuilder.toString();
+ stringBuilder.reset();
+ stack.pop();
+ stack.peek().value(string);
+ return true;
+ }
+ }
+ case '\\':
+ {
+ buffer.position(buffer.position() - 1);
+ if (parseEscape(buffer))
+ break;
+ return false;
+ }
+ default:
+ {
+ stringBuilder.append(currentByte);
+ break;
+ }
+ }
+ }
+ return false;
+ }
+
+ private boolean parseEscape(ByteBuffer buffer)
+ {
+ while (buffer.hasRemaining())
+ {
+ byte currentByte = buffer.get();
+ switch (currentByte)
+ {
+ case '\\':
+ if (stack.peek().state != State.ESCAPE)
+ {
+ stack.push(State.ESCAPE, stringBuilder);
+ break;
+ }
+ else
+ {
+ return parseEscapeCharacter((char)currentByte);
+ }
+ case '"':
+ case '/':
+ return parseEscapeCharacter((char)currentByte);
+ case 'b':
+ return parseEscapeCharacter('\b');
+ case 'f':
+ return parseEscapeCharacter('\f');
+ case 'n':
+ return parseEscapeCharacter('\n');
+ case 'r':
+ return parseEscapeCharacter('\r');
+ case 't':
+ return parseEscapeCharacter('\t');
+ case 'u':
+ stack.push(State.UNICODE, ByteBuffer.allocate(4));
+ return parseUnicode(buffer);
+ default:
+ throw newInvalidJSON(buffer, "invalid escape sequence");
+ }
+ }
+ return false;
+ }
+
+ private boolean parseEscapeCharacter(char escape)
+ {
+ stack.pop();
+ stringBuilder.append(escape);
+ return true;
+ }
+
+ private boolean parseUnicode(ByteBuffer buffer)
+ {
+ // Expect 4 hex digits.
+ while (buffer.hasRemaining())
+ {
+ byte currentByte = buffer.get();
+ ByteBuffer hex = (ByteBuffer)stack.peek().value;
+ hex.put(hexToByte(buffer, currentByte));
+ if (!hex.hasRemaining())
+ {
+ int result = (hex.get(0) << 12) +
+ (hex.get(1) << 8) +
+ (hex.get(2) << 4) +
+ (hex.get(3));
+ stack.pop();
+ // Also done with escape parsing.
+ stack.pop();
+ stringBuilder.append((char)result);
+ return true;
+ }
+ }
+ return false;
+ }
+
+ private byte hexToByte(ByteBuffer buffer, byte currentByte)
+ {
+ try
+ {
+ return TypeUtil.convertHexDigit(currentByte);
+ }
+ catch (Throwable x)
+ {
+ throw newInvalidJSON(buffer, "invalid hex digit");
+ }
+ }
+
+ private boolean parseArray(ByteBuffer buffer)
+ {
+ while (buffer.hasRemaining())
+ {
+ byte peek = buffer.get(buffer.position());
+ switch (peek)
+ {
+ // Explicit delimiters, handle push and pop in this method.
+ case '[':
+ {
+ buffer.get();
+ stack.push(State.ARRAY, newArray(stack));
+ break;
+ }
+ case ']':
+ {
+ buffer.get();
+ Object array = stack.peek().value;
+ stack.pop();
+ stack.peek().value(array);
+ return true;
+ }
+ case ',':
+ {
+ buffer.get();
+ break;
+ }
+ default:
+ {
+ if (Character.isWhitespace(peek))
+ {
+ buffer.get();
+ break;
+ }
+ else
+ {
+ if (parseAny(buffer))
+ {
+ break;
+ }
+ return false;
+ }
+ }
+ }
+ }
+ return false;
+ }
+
+ private boolean parseObject(ByteBuffer buffer)
+ {
+ while (buffer.hasRemaining())
+ {
+ byte currentByte = buffer.get();
+ switch (currentByte)
+ {
+ // Explicit delimiters, handle push and pop in this method.
+ case '{':
+ {
+ if (stack.peek().state != State.OBJECT)
+ {
+ stack.push(State.OBJECT, newObject(stack));
+ break;
+ }
+ throw newInvalidJSON(buffer, "invalid object");
+ }
+ case '}':
+ {
+ @SuppressWarnings("unchecked")
+ Map object = (Map)stack.peek().value;
+ stack.pop();
+ stack.peek().value(convertObject(object));
+ return true;
+ }
+ case ',':
+ {
+ break;
+ }
+ default:
+ {
+ if (Character.isWhitespace(currentByte))
+ {
+ break;
+ }
+ else
+ {
+ buffer.position(buffer.position() - 1);
+ if (parseObjectField(buffer))
+ break;
+ return false;
+ }
+ }
+ }
+ }
+ return false;
+ }
+
+ private boolean parseObjectField(ByteBuffer buffer)
+ {
+ while (buffer.hasRemaining())
+ {
+ byte peek = buffer.get(buffer.position());
+ switch (peek)
+ {
+ case '"':
+ {
+ if (stack.peek().state == State.OBJECT)
+ {
+ stack.push(State.OBJECT_FIELD, UNSET);
+ if (parseObjectFieldName(buffer))
+ {
+ // We are not done yet, parse the value.
+ break;
+ }
+ return false;
+ }
+ else
+ {
+ return parseObjectFieldValue(buffer);
+ }
+ }
+ default:
+ {
+ if (Character.isWhitespace(peek))
+ {
+ buffer.get();
+ break;
+ }
+ else if (stack.peek().state == State.OBJECT_FIELD_VALUE)
+ {
+ return parseObjectFieldValue(buffer);
+ }
+ else
+ {
+ throw newInvalidJSON(buffer, "invalid object field");
+ }
+ }
+ }
+ }
+ return false;
+ }
+
+ private boolean parseObjectFieldName(ByteBuffer buffer)
+ {
+ while (buffer.hasRemaining())
+ {
+ byte peek = buffer.get(buffer.position());
+ switch (peek)
+ {
+ case '"':
+ {
+ if (stack.peek().state == State.OBJECT_FIELD)
+ {
+ stack.push(State.OBJECT_FIELD_NAME, UNSET);
+ if (parseString(buffer))
+ {
+ // We are not done yet, parse until the ':'.
+ break;
+ }
+ return false;
+ }
+ else
+ {
+ throw newInvalidJSON(buffer, "invalid object field");
+ }
+ }
+ case ':':
+ {
+ buffer.get();
+ // We are done with the field name.
+ String fieldName = (String)stack.peek().value;
+ stack.pop();
+ // Change state to parse the field value.
+ stack.push(fieldName, State.OBJECT_FIELD_VALUE, UNSET);
+ return true;
+ }
+ default:
+ {
+ if (Character.isWhitespace(peek))
+ {
+ buffer.get();
+ break;
+ }
+ else
+ {
+ throw newInvalidJSON(buffer, "invalid object field");
+ }
+ }
+ }
+ }
+ return false;
+ }
+
+ private boolean parseObjectFieldValue(ByteBuffer buffer)
+ {
+ if (stack.peek().value == UNSET)
+ {
+ if (!parseAny(buffer))
+ return false;
+ }
+
+ // We are done with the field value.
+ Frame frame = stack.peek();
+ Object value = frame.value;
+ String name = frame.name;
+ stack.pop();
+ // We are done with the field.
+ stack.pop();
+ @SuppressWarnings("unchecked")
+ Map map = (Map)stack.peek().value;
+ map.put(name, value);
+
+ return true;
+ }
+
+ private Object convertObject(Map object)
+ {
+ Object result = convertObject("x-class", object);
+ if (result == null)
+ {
+ result = convertObject("class", object);
+ if (result == null)
+ return object;
+ }
+ return result;
+ }
+
+ private Object convertObject(String fieldName, Map object)
+ {
+ String className = (String)object.get(fieldName);
+ if (className == null)
+ return null;
+
+ JSON.Convertible convertible = toConvertible(className);
+ if (convertible != null)
+ {
+ convertible.fromJSON(object);
+ return convertible;
+ }
+
+ JSON.Convertor convertor = factory.convertors.get(className);
+ if (convertor != null)
+ return convertor.fromJSON(object);
+
+ return null;
+ }
+
+ private JSON.Convertible toConvertible(String className)
+ {
+ try
+ {
+ Class> klass = Loader.loadClass(className);
+ if (JSON.Convertible.class.isAssignableFrom(klass))
+ return (JSON.Convertible)klass.getConstructor().newInstance();
+ return null;
+ }
+ catch (Throwable x)
+ {
+ throw new IllegalArgumentException(x);
+ }
+ }
+
+ protected RuntimeException newInvalidJSON(ByteBuffer buffer, String message)
+ {
+ Utf8StringBuilder builder = new Utf8StringBuilder();
+ builder.append(System.lineSeparator());
+ int position = buffer.position();
+ if (factory.isDetailedParseException())
+ {
+ chunks.forEach(chunk -> builder.append(buffer));
+ }
+ else
+ {
+ buffer.position(0);
+ builder.append(buffer);
+ buffer.position(position);
+ }
+ builder.append(System.lineSeparator());
+ String indent = "";
+ if (position > 1)
+ {
+ char[] chars = new char[position - 1];
+ Arrays.fill(chars, ' ');
+ indent = new String(chars);
+ }
+ builder.append(indent);
+ builder.append("^ ");
+ builder.append(message);
+ return new IllegalArgumentException(builder.toString());
+ }
+
+ public interface Context
+ {
+ public int depth();
+ }
+
+ private enum State
+ {
+ COMPLETE, NULL, TRUE, FALSE, NUMBER, STRING, ESCAPE, UNICODE, ARRAY, OBJECT, OBJECT_FIELD, OBJECT_FIELD_NAME, OBJECT_FIELD_VALUE
+ }
+
+ private static class Frame
+ {
+ private String name;
+ private State state;
+ private Object value;
+
+ private Frame(State state, Object value)
+ {
+ this.state = state;
+ this.value = value;
+ }
+
+ private void value(Object value)
+ {
+ switch (state)
+ {
+ case COMPLETE:
+ case STRING:
+ case OBJECT_FIELD_NAME:
+ case OBJECT_FIELD_VALUE:
+ {
+ this.value = value;
+ break;
+ }
+ case ARRAY:
+ {
+ @SuppressWarnings("unchecked")
+ List array = (List)this.value;
+ array.add(value);
+ break;
+ }
+ default:
+ {
+ throw new IllegalStateException("invalid state " + state);
+ }
+ }
+ }
+ }
+
+ private static class NumberBuilder
+ {
+ // 1 => positive integer
+ // 0 => non-integer
+ // -1 => negative integer
+ private int integer = 1;
+ private long value;
+ private StringBuilder builder;
+
+ private boolean appendSign(byte b)
+ {
+ if (integer == 0)
+ {
+ if (builder.length() == 0)
+ {
+ builder.append((char)b);
+ return true;
+ }
+ else
+ {
+ char c = builder.charAt(builder.length() - 1);
+ if (c == 'E' || c == 'e')
+ {
+ builder.append((char)b);
+ return true;
+ }
+ }
+ return false;
+ }
+ else
+ {
+ if (value == 0)
+ {
+ if (b == '-')
+ {
+ if (integer == 1)
+ {
+ integer = -1;
+ return true;
+ }
+ }
+ else
+ {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ private void appendDigit(byte b)
+ {
+ if (integer == 0)
+ builder.append((char)b);
+ else
+ value = value * 10 + (b - '0');
+ }
+
+ private boolean appendAlpha(byte b)
+ {
+ if (integer == 0)
+ {
+ char c = builder.charAt(builder.length() - 1);
+ if ('0' <= c && c <= '9' && builder.indexOf("" + (char)b) < 0)
+ {
+ builder.append((char)b);
+ return true;
+ }
+ }
+ else
+ {
+ if (builder == null)
+ builder = new StringBuilder(16);
+ if (integer == -1)
+ builder.append('-');
+ integer = 0;
+ builder.append(value);
+ builder.append((char)b);
+ return true;
+ }
+ return false;
+ }
+
+ private Number value()
+ {
+ try
+ {
+ if (integer == 0)
+ return Double.parseDouble(builder.toString());
+ return integer * value;
+ }
+ finally
+ {
+ reset();
+ }
+ }
+
+ private void reset()
+ {
+ integer = 1;
+ value = 0;
+ if (builder != null)
+ builder.setLength(0);
+ }
+ }
+
+ private static class FrameStack implements AsyncJSON.Context
+ {
+ private final List stack = new ArrayList<>();
+ private int cursor;
+
+ private FrameStack()
+ {
+ grow(6);
+ }
+
+ private void grow(int grow)
+ {
+ for (int i = 0; i < grow; i++)
+ {
+ stack.add(new Frame(null, null));
+ }
+ }
+
+ private void clear()
+ {
+ while (!isEmpty())
+ {
+ pop();
+ }
+ }
+
+ private boolean isEmpty()
+ {
+ return cursor == 0;
+ }
+
+ @Override
+ public int depth()
+ {
+ return cursor - 1;
+ }
+
+ private Frame peek()
+ {
+ if (isEmpty())
+ throw new IllegalStateException("empty stack");
+ return stack.get(depth());
+ }
+
+ private void push(AsyncJSON.State state, Object value)
+ {
+ push(null, state, value);
+ }
+
+ private void push(String name, AsyncJSON.State state, Object value)
+ {
+ if (cursor == stack.size())
+ grow(2);
+ ++cursor;
+ Frame frame = stack.get(depth());
+ frame.name = name;
+ frame.state = state;
+ frame.value = value;
+ }
+
+ private void pop()
+ {
+ if (isEmpty())
+ throw new IllegalStateException("empty stack");
+ Frame frame = stack.get(depth());
+ --cursor;
+ frame.name = null;
+ frame.value = null;
+ frame.state = null;
+ }
+ }
+}
diff --git a/jetty-util-ajax/src/test/java/org/eclipse/jetty/util/ajax/AsyncJSONTest.java b/jetty-util-ajax/src/test/java/org/eclipse/jetty/util/ajax/AsyncJSONTest.java
new file mode 100644
index 00000000000..07b2ccadce8
--- /dev/null
+++ b/jetty-util-ajax/src/test/java/org/eclipse/jetty/util/ajax/AsyncJSONTest.java
@@ -0,0 +1,503 @@
+/*
+ * Copyright (c) 2008-2020 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.eclipse.jetty.util.ajax;
+
+import java.nio.ByteBuffer;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.MethodSource;
+import org.junit.jupiter.params.provider.ValueSource;
+
+import static java.nio.charset.StandardCharsets.UTF_8;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertSame;
+import static org.junit.jupiter.api.Assertions.assertThrows;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+public class AsyncJSONTest
+{
+ private static AsyncJSON newAsyncJSON()
+ {
+ AsyncJSON.Factory factory = new AsyncJSON.Factory();
+ factory.setDetailedParseException(true);
+ return factory.newAsyncJSON();
+ }
+
+ @ParameterizedTest
+ @ValueSource(strings = {"|", "}", "]", "{]", "[}", "+", ".", "{} []"})
+ public void testParseInvalidJSON(String json)
+ {
+ byte[] bytes = json.getBytes(UTF_8);
+ AsyncJSON parser = newAsyncJSON();
+
+ // Parse the whole input.
+ assertThrows(IllegalArgumentException.class, () -> parser.parse(bytes));
+ assertTrue(parser.isEmpty());
+
+ // Parse byte by byte.
+ assertThrows(IllegalArgumentException.class, () ->
+ {
+ for (byte b : bytes)
+ {
+ parser.parse(new byte[]{b});
+ }
+ });
+ assertTrue(parser.isEmpty());
+ }
+
+
+ @ParameterizedTest(name = "[{index}] ''{0}'' -> ''{1}''")
+ @MethodSource("validStrings")
+ public void testParseString(String string, String expected)
+ {
+ String json = "\"${value}\"".replace("${value}", string);
+ byte[] bytes = json.getBytes(UTF_8);
+ AsyncJSON parser = newAsyncJSON();
+
+ // Parse the whole input.
+ assertTrue(parser.parse(bytes));
+ assertEquals(expected, parser.eof());
+ assertTrue(parser.isEmpty());
+
+ // Parse byte by byte.
+ for (int i = 0; i < bytes.length; ++i)
+ {
+ byte b = bytes[i];
+ if (i == bytes.length - 1)
+ assertTrue(parser.parse(new byte[]{b}));
+ else
+ assertFalse(parser.parse(new byte[]{b}));
+ }
+ assertEquals(expected, parser.eof());
+ assertTrue(parser.isEmpty());
+ }
+
+ public static List validStrings()
+ {
+ List result = new ArrayList<>();
+ result.add(new Object[]{"", ""});
+ result.add(new Object[]{" \t\r\n", " \t\r\n"});
+ result.add(new Object[]{"\u20AC", "\u20AC"});
+ result.add(new Object[]{"\\u20AC", "\u20AC"});
+ result.add(new Object[]{"/foo", "/foo"});
+ result.add(new Object[]{"123E+01", "123E+01"});
+ result.add(new Object[]{"A\\u20AC/foo\\t\\n", "A\u20AC/foo\t\n"});
+ result.add(new Object[]{" ABC ", " ABC "});
+ return result;
+ }
+
+ @ParameterizedTest
+ @ValueSource(strings = {"\\u", "\\u0", "\\x"})
+ public void testParseInvalidString(String value)
+ {
+ String json = "\"${value}\"".replace("${value}", value);
+ byte[] bytes = json.getBytes(UTF_8);
+ AsyncJSON parser = newAsyncJSON();
+
+ // Parse the whole input.
+ assertThrows(IllegalArgumentException.class, () -> parser.parse(bytes));
+ assertTrue(parser.isEmpty());
+
+ // Parse byte by byte.
+ assertThrows(IllegalArgumentException.class, () ->
+ {
+ for (byte b : bytes)
+ {
+ parser.parse(new byte[]{b});
+ }
+ });
+ assertTrue(parser.isEmpty());
+ }
+
+ @ParameterizedTest(name = "[{index}] {0} -> {1}")
+ @MethodSource("validArrays")
+ public void testParseArray(String json, List> expected)
+ {
+ byte[] bytes = json.getBytes(UTF_8);
+ AsyncJSON parser = newAsyncJSON();
+
+ // Parse the whole input.
+ assertTrue(parser.parse(bytes));
+ assertEquals(expected, parser.eof());
+ assertTrue(parser.isEmpty());
+ ByteBuffer buffer = ByteBuffer.wrap(bytes);
+ assertTrue(parser.parse(buffer));
+ assertFalse(buffer.hasRemaining());
+ assertEquals(expected, parser.eof());
+ assertTrue(parser.isEmpty());
+
+ // Parse byte by byte.
+ for (byte b : bytes)
+ {
+ parser.parse(new byte[]{b});
+ }
+ assertEquals(expected, parser.eof());
+ assertTrue(parser.isEmpty());
+ }
+
+ public static List validArrays()
+ {
+ List result = new ArrayList<>();
+
+ List expected = Collections.emptyList();
+ result.add(new Object[]{"[]", expected});
+ result.add(new Object[]{"[] \n", expected});
+
+ expected = new ArrayList<>();
+ expected.add(Collections.emptyList());
+ result.add(new Object[]{"[[]]", expected});
+
+ expected = new ArrayList<>();
+ expected.add("first");
+ expected.add(5D);
+ expected.add(null);
+ expected.add(true);
+ expected.add(false);
+ expected.add(new HashMap<>());
+ HashMap last = new HashMap<>();
+ last.put("a", new ArrayList<>());
+ expected.add(last);
+ result.add(new Object[]{"[\"first\", 5E+0, null, true, false, {}, {\"a\":[]}]", expected});
+
+ return result;
+ }
+
+ @ParameterizedTest
+ @ValueSource(strings = {"[", "]", "[[,]", " [ 1,2,[ "})
+ public void testParseInvalidArray(String json)
+ {
+ byte[] bytes = json.getBytes(UTF_8);
+ AsyncJSON parser = newAsyncJSON();
+
+ // Parse the whole input.
+ assertThrows(IllegalArgumentException.class, () ->
+ {
+ parser.parse(bytes);
+ parser.eof();
+ });
+ assertTrue(parser.isEmpty());
+
+ // Parse byte by byte.
+ assertThrows(IllegalArgumentException.class, () ->
+ {
+ for (byte b : bytes)
+ {
+ parser.parse(new byte[]{b});
+ }
+ parser.eof();
+ });
+ assertTrue(parser.isEmpty());
+ }
+
+ @ParameterizedTest(name = "[{index}] {0} -> {1}")
+ @MethodSource("validObjects")
+ public void testParseObject(String json, Object expected)
+ {
+ byte[] bytes = json.getBytes(UTF_8);
+ AsyncJSON parser = newAsyncJSON();
+
+ // Parse the whole input.
+ assertTrue(parser.parse(bytes));
+ assertEquals(expected, parser.eof());
+ assertTrue(parser.isEmpty());
+
+ // Parse byte by byte.
+ for (int i = 0; i < bytes.length; ++i)
+ {
+ byte b = bytes[i];
+ if (i == bytes.length - 1)
+ {
+ assertTrue(parser.parse(new byte[]{b}));
+ }
+ else
+ {
+ assertFalse(parser.parse(new byte[]{b}));
+ }
+ }
+ assertEquals(expected, parser.eof());
+ assertTrue(parser.isEmpty());
+ }
+
+ public static List validObjects()
+ {
+ List result = new ArrayList<>();
+
+ HashMap expected = new HashMap<>();
+ result.add(new Object[]{"{}", expected});
+
+ expected = new HashMap<>();
+ expected.put("", 0L);
+ result.add(new Object[]{"{\"\":0}", expected});
+
+ expected = new HashMap<>();
+ expected.put("name", "value");
+ result.add(new Object[]{"{ \"name\": \"value\" }", expected});
+
+ expected = new HashMap<>();
+ expected.put("name", null);
+ expected.put("valid", true);
+ expected.put("secure", false);
+ expected.put("value", 42L);
+ result.add(new Object[]{
+ "{, \"name\": null, \"valid\": true\n , \"secure\": false\r\n,\n \"value\":42, }", expected
+ });
+
+ return result;
+ }
+
+ @ParameterizedTest
+ @ValueSource(strings = {"{", "}", "{{,}", "{:\"s\"}", "{[]:0}", "{1:0}", " {\": 0} ", "{\"a: \"b\"}"})
+ public void testParseInvalidObject(String json)
+ {
+ byte[] bytes = json.getBytes(UTF_8);
+ AsyncJSON parser = newAsyncJSON();
+
+ // Parse the whole input.
+ assertThrows(IllegalArgumentException.class, () ->
+ {
+ parser.parse(bytes);
+ parser.eof();
+ });
+ assertTrue(parser.isEmpty());
+
+ // Parse byte by byte.
+ assertThrows(IllegalArgumentException.class, () ->
+ {
+ for (byte b : bytes)
+ {
+ parser.parse(new byte[]{b});
+ }
+ parser.eof();
+ });
+ assertTrue(parser.isEmpty());
+ }
+
+ @ParameterizedTest(name = "[{index}] {0} -> {1}")
+ @MethodSource("validNumbers")
+ public void testParseNumber(String json, Number expected)
+ {
+ byte[] bytes = json.getBytes(UTF_8);
+ AsyncJSON parser = newAsyncJSON();
+
+ // Parse the whole input.
+ parser.parse(bytes);
+ assertEquals(expected, parser.eof());
+ assertTrue(parser.isEmpty());
+ ByteBuffer buffer = ByteBuffer.wrap(bytes);
+ parser.parse(buffer);
+ assertEquals(expected, parser.eof());
+ assertFalse(buffer.hasRemaining());
+ assertTrue(parser.isEmpty());
+
+ // Parse byte by byte.
+ for (byte b : bytes)
+ {
+ parser.parse(new byte[]{b});
+ }
+ assertEquals(expected, parser.eof());
+ assertTrue(parser.isEmpty());
+ }
+
+ public static List validNumbers()
+ {
+ List result = new ArrayList<>();
+
+ result.add(new Object[]{"0", 0L});
+ result.add(new Object[]{"-0", -0L});
+ result.add(new Object[]{"13\n", 13L});
+ result.add(new Object[]{"-42", -42L});
+ result.add(new Object[]{"123.456", 123.456D});
+ result.add(new Object[]{"-234.567", -234.567D});
+ result.add(new Object[]{"9e0", 9D});
+ result.add(new Object[]{"8E+1\t", 80D});
+ result.add(new Object[]{"-7E-2 ", -0.07D});
+ result.add(new Object[]{"70.5E-1", 7.05D});
+
+ return result;
+ }
+
+ @ParameterizedTest
+ @ValueSource(strings = {"--", "--1", ".5", "e0", "1a1", "3-7", "1+2", "1e0e1", "1.2.3"})
+ public void testParseInvalidNumber(String json)
+ {
+ byte[] bytes = json.getBytes(UTF_8);
+ AsyncJSON parser = newAsyncJSON();
+
+ // Parse the whole input.
+ assertThrows(IllegalArgumentException.class, () ->
+ {
+ parser.parse(bytes);
+ parser.eof();
+ });
+ assertTrue(parser.isEmpty());
+
+ // Parse byte by byte.
+ assertThrows(IllegalArgumentException.class, () ->
+ {
+ for (byte b : bytes)
+ {
+ parser.parse(new byte[]{b});
+ }
+ parser.eof();
+ });
+ assertTrue(parser.isEmpty());
+ }
+
+ @Test
+ public void testParseObjectWithConvertor()
+ {
+ AsyncJSON.Factory factory = new AsyncJSON.Factory();
+ CustomConvertor convertor = new CustomConvertor();
+ factory.putConvertor(CustomConvertor.class.getName(), convertor);
+
+ String json = "{" +
+ "\"f1\": {\"class\":\"" + CustomConvertible.class.getName() + "\", \"field\": \"value\"}," +
+ "\"f2\": {\"class\":\"" + CustomConvertor.class.getName() + "\"}" +
+ "}";
+
+ AsyncJSON parser = factory.newAsyncJSON();
+ assertTrue(parser.parse(UTF_8.encode(json)));
+ Map result = parser.eof();
+
+ Object value1 = result.get("f1");
+ assertTrue(value1 instanceof CustomConvertible);
+ assertEquals("value", ((CustomConvertible)value1).field);
+ Object value2 = result.get("f2");
+ assertTrue(value2 instanceof CustomConvertor.Custom);
+
+ assertSame(convertor, factory.removeConvertor(CustomConvertor.class.getName()));
+ assertTrue(parser.parse(UTF_8.encode(json)));
+ result = parser.eof();
+
+ value1 = result.get("f1");
+ assertTrue(value1 instanceof CustomConvertible);
+ assertEquals("value", ((CustomConvertible)value1).field);
+ value2 = result.get("f2");
+ assertTrue(value2 instanceof Map);
+ @SuppressWarnings("unchecked")
+ Map map2 = (Map)value2;
+ assertEquals(CustomConvertor.class.getName(), map2.get("class"));
+ }
+
+ public static class CustomConvertible implements JSON.Convertible
+ {
+ private Object field;
+
+ @Override
+ public void toJSON(JSON.Output out)
+ {
+ }
+
+ @Override
+ public void fromJSON(Map map)
+ {
+ this.field = map.get("field");
+ }
+ }
+
+ public static class CustomConvertor implements JSON.Convertor
+ {
+ @Override
+ public void toJSON(Object obj, JSON.Output out)
+ {
+ }
+
+ @Override
+ public Object fromJSON(Map map)
+ {
+ return new Custom();
+ }
+
+ public static class Custom
+ {
+ }
+ }
+
+ @Test
+ public void testContext()
+ {
+ AsyncJSON.Factory factory = new AsyncJSON.Factory()
+ {
+ @Override
+ public AsyncJSON newAsyncJSON()
+ {
+ return new AsyncJSON(this)
+ {
+ @Override
+ protected Map newObject(Context context)
+ {
+ if (context.depth() == 1)
+ {
+ return new CustomMap();
+ }
+ return super.newObject(context);
+ }
+ };
+ }
+ };
+ AsyncJSON parser = factory.newAsyncJSON();
+
+ String json = "[{" +
+ "\"channel\": \"/meta/handshake\"," +
+ "\"version\": \"1.0\"," +
+ "\"supportedConnectionTypes\": [\"long-polling\"]," +
+ "\"advice\": {\"timeout\": 0}" +
+ "}]";
+
+ assertTrue(parser.parse(UTF_8.encode(json)));
+ List messages = parser.eof();
+
+ for (CustomMap message : messages)
+ {
+ @SuppressWarnings("unchecked")
+ Map advice = (Map)message.get("advice");
+ assertFalse(advice instanceof CustomMap);
+ }
+ }
+
+ public static class CustomMap extends HashMap
+ {
+ }
+
+ @Test
+ public void testCaching()
+ {
+ AsyncJSON.Factory factory = new AsyncJSON.Factory();
+ String foo = "foo";
+ factory.cache(foo);
+ AsyncJSON parser = factory.newAsyncJSON();
+
+ String json = "{\"foo\": [\"foo\", \"foo\"]}";
+ parser.parse(UTF_8.encode(json));
+ Map object = parser.eof();
+
+ Map.Entry entry = object.entrySet().iterator().next();
+ assertSame(foo, entry.getKey());
+ @SuppressWarnings("unchecked")
+ List array = (List)entry.getValue();
+ for (String item : array)
+ {
+ assertSame(foo, item);
+ }
+ }
+}
From caf2592587d5c2ff2e94091ce6cfb672a861beaa Mon Sep 17 00:00:00 2001
From: Simone Bordet
Date: Wed, 20 May 2020 13:00:29 +0200
Subject: [PATCH 49/77] Fixes #4892 - Non-blocking JSON parser.
Fixed copyright header.
Signed-off-by: Simone Bordet
---
.../jetty/util/ajax/AsyncJSONTest.java | 33 ++++++++++---------
1 file changed, 18 insertions(+), 15 deletions(-)
diff --git a/jetty-util-ajax/src/test/java/org/eclipse/jetty/util/ajax/AsyncJSONTest.java b/jetty-util-ajax/src/test/java/org/eclipse/jetty/util/ajax/AsyncJSONTest.java
index 07b2ccadce8..cbc70bc13af 100644
--- a/jetty-util-ajax/src/test/java/org/eclipse/jetty/util/ajax/AsyncJSONTest.java
+++ b/jetty-util-ajax/src/test/java/org/eclipse/jetty/util/ajax/AsyncJSONTest.java
@@ -1,18 +1,21 @@
-/*
- * Copyright (c) 2008-2020 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
+//
+// ========================================================================
+// Copyright (c) 1995-2020 Mort Bay Consulting Pty Ltd and others.
+// ------------------------------------------------------------------------
+// All rights reserved. This program and the accompanying materials
+// are made available under the terms of the Eclipse Public License v1.0
+// and Apache License v2.0 which accompanies this distribution.
+//
+// The Eclipse Public License is available at
+// http://www.eclipse.org/legal/epl-v10.html
+//
+// The Apache License v2.0 is available at
+// http://www.opensource.org/licenses/apache2.0.php
+//
+// You may elect to redistribute this code under either of these licenses.
+// ========================================================================
+//
+
package org.eclipse.jetty.util.ajax;
import java.nio.ByteBuffer;
From bed046f01ce8019b61694ef62de867bed84a7d27 Mon Sep 17 00:00:00 2001
From: Simone Bordet
Date: Wed, 20 May 2020 13:08:02 +0200
Subject: [PATCH 50/77] Fixes #4892 - Non-blocking JSON parser.
Fixed checkstyle.
Signed-off-by: Simone Bordet
---
.../java/org/eclipse/jetty/util/ajax/AsyncJSONTest.java | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/jetty-util-ajax/src/test/java/org/eclipse/jetty/util/ajax/AsyncJSONTest.java b/jetty-util-ajax/src/test/java/org/eclipse/jetty/util/ajax/AsyncJSONTest.java
index cbc70bc13af..d808ea400c4 100644
--- a/jetty-util-ajax/src/test/java/org/eclipse/jetty/util/ajax/AsyncJSONTest.java
+++ b/jetty-util-ajax/src/test/java/org/eclipse/jetty/util/ajax/AsyncJSONTest.java
@@ -68,7 +68,6 @@ public class AsyncJSONTest
assertTrue(parser.isEmpty());
}
-
@ParameterizedTest(name = "[{index}] ''{0}'' -> ''{1}''")
@MethodSource("validStrings")
public void testParseString(String string, String expected)
@@ -100,11 +99,11 @@ public class AsyncJSONTest
List result = new ArrayList<>();
result.add(new Object[]{"", ""});
result.add(new Object[]{" \t\r\n", " \t\r\n"});
- result.add(new Object[]{"\u20AC", "\u20AC"});
- result.add(new Object[]{"\\u20AC", "\u20AC"});
+ result.add(new Object[]{"\u20AC", "\u20AC"}); // euro symbol
+ result.add(new Object[]{"\\u20AC", "\u20AC"}); // euro symbol
result.add(new Object[]{"/foo", "/foo"});
result.add(new Object[]{"123E+01", "123E+01"});
- result.add(new Object[]{"A\\u20AC/foo\\t\\n", "A\u20AC/foo\t\n"});
+ result.add(new Object[]{"A\\u20AC/foo\\t\\n", "A\u20AC/foo\t\n"}); // euro symbol
result.add(new Object[]{" ABC ", " ABC "});
return result;
}
From f2ef054b289167c98e51f49867eaf32ebdf6dca3 Mon Sep 17 00:00:00 2001
From: Simone Bordet
Date: Wed, 20 May 2020 14:03:30 +0200
Subject: [PATCH 51/77] Fixes #4892 - Non-blocking JSON parser.
Added javadocs.
Signed-off-by: Simone Bordet
---
.../eclipse/jetty/util/ajax/AsyncJSON.java | 148 +++++++++++++++++-
1 file changed, 140 insertions(+), 8 deletions(-)
diff --git a/jetty-util-ajax/src/main/java/org/eclipse/jetty/util/ajax/AsyncJSON.java b/jetty-util-ajax/src/main/java/org/eclipse/jetty/util/ajax/AsyncJSON.java
index 8dba7382402..00b83b4063e 100644
--- a/jetty-util-ajax/src/main/java/org/eclipse/jetty/util/ajax/AsyncJSON.java
+++ b/jetty-util-ajax/src/main/java/org/eclipse/jetty/util/ajax/AsyncJSON.java
@@ -32,25 +32,76 @@ import org.eclipse.jetty.util.Loader;
import org.eclipse.jetty.util.Trie;
import org.eclipse.jetty.util.TypeUtil;
import org.eclipse.jetty.util.Utf8StringBuilder;
+import org.eclipse.jetty.util.ajax.JSON.Convertible;
+import org.eclipse.jetty.util.ajax.JSON.Convertor;
+/**
+ *
A non-blocking JSON parser that can parse partial JSON strings.
+ *
Usage:
+ *
+ * AsyncJSON parser = new AsyncJSON.Factory().newAsyncJSON();
+ *
+ * // Feed the parser with partial JSON string content.
+ * parser.parse(chunk1);
+ * parser.parse(chunk2);
+ *
+ * // Tell the parser that the JSON string content
+ * // is terminated and get the JSON object back.
+ * Map<String, Object> object = parser.eof();
+ *
+ *
After the call to {@link #eof()} the parser can be reused to parse
+ * another JSON string.
+ *
Custom objects can be created by specifying a {@code "class"} or
+ * {@code "x-class"} field:
Class {@code com.acme.Person} must either implement {@link Convertible},
+ * or be mapped with a {@link Convertor} via {@link Factory#putConvertor(String, Convertor)}.
+ */
public class AsyncJSON
{
+ /**
+ *
The factory that creates AsyncJSON instances.
+ *
The factory can be configured with custom {@link Convertor}s,
+ * and with cached strings that will not be allocated if they can
+ * be looked up from the cache.
+ */
public static class Factory
{
private Trie cache;
- private Map convertors;
+ private Map convertors;
private boolean detailedParseException;
+ /**
+ * @return whether a parse failure should report the whole JSON string or just the last chunk
+ */
public boolean isDetailedParseException()
{
return detailedParseException;
}
+ /**
+ * @param detailedParseException whether a parse failure should report the whole JSON string or just the last chunk
+ */
public void setDetailedParseException(boolean detailedParseException)
{
this.detailedParseException = detailedParseException;
}
+ /**
+ * @param value the string to cache
+ */
public void cache(String value)
{
if (cache == null)
@@ -58,6 +109,16 @@ public class AsyncJSON
cache.put("\"" + value + "\"", value);
}
+ /**
+ *
Attempts to return a cached string from the buffer bytes.
+ *
In case of a cache hit, the string is returned and the buffer
+ * position updated.
+ *
In case of cache miss, {@code null} is returned and the buffer
+ * position is left unaltered.
+ *
+ * @param buffer the buffer to lookup the string from
+ * @return a cached string or {@code null}
+ */
public String cached(ByteBuffer buffer)
{
if (cache != null)
@@ -72,24 +133,50 @@ public class AsyncJSON
return null;
}
+ /**
+ * @return a new parser instance
+ */
public AsyncJSON newAsyncJSON()
{
return new AsyncJSON(this);
}
- public void putConvertor(String className, JSON.Convertor convertor)
+ /**
+ *
Associates the given {@link Convertor} to the given class name.
+ *
+ * @param className the domain class name such as {@code com.acme.Person}
+ * @param convertor the {@link Convertor} that converts {@code Map} to domain objects
+ */
+ public void putConvertor(String className, Convertor convertor)
{
if (convertors == null)
convertors = new ConcurrentHashMap<>();
convertors.put(className, convertor);
}
- public JSON.Convertor removeConvertor(String className)
+ /**
+ *
Removes the {@link Convertor} associated with the given class name.
+ *
+ * @param className the class name associated with the {@link Convertor}
+ * @return the {@link Convertor} associated with the class name, or {@code null}
+ */
+ public Convertor removeConvertor(String className)
{
if (convertors != null)
return convertors.remove(className);
return null;
}
+
+ /**
+ *
Returns the {@link Convertor} associated with the given class name, if any.
+ *
+ * @param className the class name associated with the {@link Convertor}
+ * @return the {@link Convertor} associated with the class name, or {@code null}
+ */
+ public Convertor getConvertor(String className)
+ {
+ return convertors == null ? null : convertors.get(className);
+ }
}
private static final Object UNSET = new Object();
@@ -113,11 +200,24 @@ public class AsyncJSON
return stack.isEmpty();
}
+ /**
+ *
Feeds the parser with the given bytes chunk.
+ *
+ * @param bytes the bytes to parse
+ * @return whether the JSON parsing was complete
+ */
public boolean parse(byte[] bytes)
{
return parse(ByteBuffer.wrap(bytes));
}
+ /**
+ *
Feeds the parser with the given buffer chunk.
+ *
+ * @param buffer the buffer to parse
+ * @return whether the JSON parsing was complete
+ * @throws IllegalArgumentException if the JSON is malformed
+ */
public boolean parse(ByteBuffer buffer)
{
try
@@ -251,6 +351,16 @@ public class AsyncJSON
}
}
+ /**
+ *
Signals to the parser that the parse data is complete, and returns
+ * the object parsed from the JSON chunks passed to the {@code parse()}
+ * methods.
+ *
+ * @param the type the result is cast to
+ * @return the result of the JSON parsing
+ * @throws IllegalArgumentException if the JSON is malformed
+ * @throws IllegalStateException if the no JSON was passed to the {@code parse()} methods
+ */
public R eof()
{
try
@@ -290,11 +400,27 @@ public class AsyncJSON
}
}
+ /**
+ *
When a JSON { is encountered during parsing,
+ * this method is called to create a new {@code Map} instance.
+ *
Subclasses may override to return a custom {@code Map} instance.
Class {@code com.acme.Person} must either implement {@link Convertible},
* or be mapped with a {@link Convertor} via {@link Factory#putConvertor(String, Convertor)}.
@@ -119,7 +119,7 @@ public class AsyncJSON
* @param buffer the buffer to lookup the string from
* @return a cached string or {@code null}
*/
- public String cached(ByteBuffer buffer)
+ private String cached(ByteBuffer buffer)
{
if (cache != null)
{
@@ -270,7 +270,7 @@ public class AsyncJSON
{
int position = buffer.position();
byte peek = buffer.get(position);
- if (Character.isWhitespace((char)peek))
+ if (isWhitespace(peek))
buffer.position(position + 1);
else
throw newInvalidJSON(buffer, "invalid character after JSON data");
@@ -374,7 +374,7 @@ public class AsyncJSON
* @throws IllegalArgumentException if the JSON is malformed
* @throws IllegalStateException if the no JSON was passed to the {@code parse()} methods
*/
- public R eof()
+ public R complete()
{
try
{
@@ -397,7 +397,7 @@ public class AsyncJSON
{
if (stack.peek().value == UNSET)
throw new IllegalStateException("invalid state " + state);
- return (R)complete();
+ return (R)end();
}
default:
{
@@ -439,7 +439,7 @@ public class AsyncJSON
return new ArrayList<>();
}
- private Object complete()
+ private Object end()
{
Object result = stack.peek().value;
reset();
@@ -498,7 +498,7 @@ public class AsyncJSON
return true;
break;
default:
- if (Character.isWhitespace(peek))
+ if (isWhitespace(peek))
{
buffer.get();
break;
@@ -854,7 +854,7 @@ public class AsyncJSON
}
default:
{
- if (Character.isWhitespace(peek))
+ if (isWhitespace(peek))
{
buffer.get();
break;
@@ -904,7 +904,7 @@ public class AsyncJSON
}
default:
{
- if (Character.isWhitespace(currentByte))
+ if (isWhitespace(currentByte))
{
break;
}
@@ -947,7 +947,7 @@ public class AsyncJSON
}
default:
{
- if (Character.isWhitespace(peek))
+ if (isWhitespace(peek))
{
buffer.get();
break;
@@ -1002,7 +1002,7 @@ public class AsyncJSON
}
default:
{
- if (Character.isWhitespace(peek))
+ if (isWhitespace(peek))
{
buffer.get();
break;
@@ -1115,6 +1115,20 @@ public class AsyncJSON
return new IllegalArgumentException(builder.toString());
}
+ private static boolean isWhitespace(byte ws)
+ {
+ switch (ws)
+ {
+ case ' ':
+ case '\n':
+ case '\r':
+ case '\t':
+ return true;
+ default:
+ return false;
+ }
+ }
+
/**
*
The state of JSON parsing.
*/
diff --git a/jetty-util-ajax/src/test/java/org/eclipse/jetty/util/ajax/AsyncJSONTest.java b/jetty-util-ajax/src/test/java/org/eclipse/jetty/util/ajax/AsyncJSONTest.java
index d808ea400c4..fa93463b1f5 100644
--- a/jetty-util-ajax/src/test/java/org/eclipse/jetty/util/ajax/AsyncJSONTest.java
+++ b/jetty-util-ajax/src/test/java/org/eclipse/jetty/util/ajax/AsyncJSONTest.java
@@ -78,7 +78,7 @@ public class AsyncJSONTest
// Parse the whole input.
assertTrue(parser.parse(bytes));
- assertEquals(expected, parser.eof());
+ assertEquals(expected, parser.complete());
assertTrue(parser.isEmpty());
// Parse byte by byte.
@@ -90,7 +90,7 @@ public class AsyncJSONTest
else
assertFalse(parser.parse(new byte[]{b}));
}
- assertEquals(expected, parser.eof());
+ assertEquals(expected, parser.complete());
assertTrue(parser.isEmpty());
}
@@ -140,12 +140,12 @@ public class AsyncJSONTest
// Parse the whole input.
assertTrue(parser.parse(bytes));
- assertEquals(expected, parser.eof());
+ assertEquals(expected, parser.complete());
assertTrue(parser.isEmpty());
ByteBuffer buffer = ByteBuffer.wrap(bytes);
assertTrue(parser.parse(buffer));
assertFalse(buffer.hasRemaining());
- assertEquals(expected, parser.eof());
+ assertEquals(expected, parser.complete());
assertTrue(parser.isEmpty());
// Parse byte by byte.
@@ -153,7 +153,7 @@ public class AsyncJSONTest
{
parser.parse(new byte[]{b});
}
- assertEquals(expected, parser.eof());
+ assertEquals(expected, parser.complete());
assertTrue(parser.isEmpty());
}
@@ -195,7 +195,7 @@ public class AsyncJSONTest
assertThrows(IllegalArgumentException.class, () ->
{
parser.parse(bytes);
- parser.eof();
+ parser.complete();
});
assertTrue(parser.isEmpty());
@@ -206,7 +206,7 @@ public class AsyncJSONTest
{
parser.parse(new byte[]{b});
}
- parser.eof();
+ parser.complete();
});
assertTrue(parser.isEmpty());
}
@@ -220,7 +220,7 @@ public class AsyncJSONTest
// Parse the whole input.
assertTrue(parser.parse(bytes));
- assertEquals(expected, parser.eof());
+ assertEquals(expected, parser.complete());
assertTrue(parser.isEmpty());
// Parse byte by byte.
@@ -236,7 +236,7 @@ public class AsyncJSONTest
assertFalse(parser.parse(new byte[]{b}));
}
}
- assertEquals(expected, parser.eof());
+ assertEquals(expected, parser.complete());
assertTrue(parser.isEmpty());
}
@@ -278,7 +278,7 @@ public class AsyncJSONTest
assertThrows(IllegalArgumentException.class, () ->
{
parser.parse(bytes);
- parser.eof();
+ parser.complete();
});
assertTrue(parser.isEmpty());
@@ -289,7 +289,7 @@ public class AsyncJSONTest
{
parser.parse(new byte[]{b});
}
- parser.eof();
+ parser.complete();
});
assertTrue(parser.isEmpty());
}
@@ -303,11 +303,11 @@ public class AsyncJSONTest
// Parse the whole input.
parser.parse(bytes);
- assertEquals(expected, parser.eof());
+ assertEquals(expected, parser.complete());
assertTrue(parser.isEmpty());
ByteBuffer buffer = ByteBuffer.wrap(bytes);
parser.parse(buffer);
- assertEquals(expected, parser.eof());
+ assertEquals(expected, parser.complete());
assertFalse(buffer.hasRemaining());
assertTrue(parser.isEmpty());
@@ -316,7 +316,7 @@ public class AsyncJSONTest
{
parser.parse(new byte[]{b});
}
- assertEquals(expected, parser.eof());
+ assertEquals(expected, parser.complete());
assertTrue(parser.isEmpty());
}
@@ -349,7 +349,7 @@ public class AsyncJSONTest
assertThrows(IllegalArgumentException.class, () ->
{
parser.parse(bytes);
- parser.eof();
+ parser.complete();
});
assertTrue(parser.isEmpty());
@@ -360,7 +360,7 @@ public class AsyncJSONTest
{
parser.parse(new byte[]{b});
}
- parser.eof();
+ parser.complete();
});
assertTrue(parser.isEmpty());
}
@@ -379,7 +379,7 @@ public class AsyncJSONTest
AsyncJSON parser = factory.newAsyncJSON();
assertTrue(parser.parse(UTF_8.encode(json)));
- Map result = parser.eof();
+ Map result = parser.complete();
Object value1 = result.get("f1");
assertTrue(value1 instanceof CustomConvertible);
@@ -389,7 +389,7 @@ public class AsyncJSONTest
assertSame(convertor, factory.removeConvertor(CustomConvertor.class.getName()));
assertTrue(parser.parse(UTF_8.encode(json)));
- result = parser.eof();
+ result = parser.complete();
value1 = result.get("f1");
assertTrue(value1 instanceof CustomConvertible);
@@ -467,7 +467,7 @@ public class AsyncJSONTest
"}]";
assertTrue(parser.parse(UTF_8.encode(json)));
- List messages = parser.eof();
+ List messages = parser.complete();
for (CustomMap message : messages)
{
@@ -491,7 +491,7 @@ public class AsyncJSONTest
String json = "{\"foo\": [\"foo\", \"foo\"]}";
parser.parse(UTF_8.encode(json));
- Map object = parser.eof();
+ Map object = parser.complete();
Map.Entry entry = object.entrySet().iterator().next();
assertSame(foo, entry.getKey());
From b9466823c8b7dc9e4a01b78ee8eec900b24f201b Mon Sep 17 00:00:00 2001
From: Greg Wilkins
Date: Thu, 21 May 2020 11:44:30 +0200
Subject: [PATCH 57/77] Issue #4892 Async JSON
Handle encoded cached strings (or not).
Signed-off-by: Greg Wilkins
---
.../eclipse/jetty/util/ajax/AsyncJSON.java | 45 ++++++++++++++++---
.../jetty/util/ajax/AsyncJSONTest.java | 23 ++++++++++
.../eclipse/jetty/util/ArrayTernaryTrie.java | 2 +-
3 files changed, 62 insertions(+), 8 deletions(-)
diff --git a/jetty-util-ajax/src/main/java/org/eclipse/jetty/util/ajax/AsyncJSON.java b/jetty-util-ajax/src/main/java/org/eclipse/jetty/util/ajax/AsyncJSON.java
index be701f3ca6a..444fc25b223 100644
--- a/jetty-util-ajax/src/main/java/org/eclipse/jetty/util/ajax/AsyncJSON.java
+++ b/jetty-util-ajax/src/main/java/org/eclipse/jetty/util/ajax/AsyncJSON.java
@@ -79,7 +79,7 @@ public class AsyncJSON
*/
public static class Factory
{
- private Trie cache;
+ private Trie cache;
private Map convertors;
private boolean detailedParseException;
@@ -101,12 +101,20 @@ public class AsyncJSON
/**
* @param value the string to cache
+ * @return whether the value can be cached
*/
- public void cache(String value)
+ public boolean cache(String value)
{
if (cache == null)
cache = new ArrayTernaryTrie.Growing<>(false, 64, 64);
- cache.put("\"" + value + "\"", value);
+
+ CachedString cached = new CachedString(value);
+ if (cached.isCacheable())
+ {
+ cache.put(cached.encoded, cached);
+ return true;
+ }
+ return false;
}
/**
@@ -119,15 +127,15 @@ public class AsyncJSON
* @param buffer the buffer to lookup the string from
* @return a cached string or {@code null}
*/
- private String cached(ByteBuffer buffer)
+ protected String cached(ByteBuffer buffer)
{
if (cache != null)
{
- String result = cache.getBest(buffer, 0, buffer.remaining());
+ CachedString result = cache.getBest(buffer, 0, buffer.remaining());
if (result != null)
{
- buffer.position(buffer.position() + result.length() + 2);
- return result;
+ buffer.position(buffer.position() + result.encoded.length());
+ return result.value;
}
}
return null;
@@ -177,6 +185,29 @@ public class AsyncJSON
{
return convertors == null ? null : convertors.get(className);
}
+
+ private static class CachedString
+ {
+ private final String encoded;
+ private final String value;
+
+ private CachedString(String value)
+ {
+ this.encoded = JSON.toString(value);
+ this.value = value;
+ }
+
+ private boolean isCacheable()
+ {
+ for (int i = encoded.length(); i-- > 0;)
+ {
+ char c = encoded.charAt(i);
+ if (c > 127)
+ return false;
+ }
+ return true;
+ }
+ }
}
private static final Object UNSET = new Object();
diff --git a/jetty-util-ajax/src/test/java/org/eclipse/jetty/util/ajax/AsyncJSONTest.java b/jetty-util-ajax/src/test/java/org/eclipse/jetty/util/ajax/AsyncJSONTest.java
index fa93463b1f5..af66f6aae98 100644
--- a/jetty-util-ajax/src/test/java/org/eclipse/jetty/util/ajax/AsyncJSONTest.java
+++ b/jetty-util-ajax/src/test/java/org/eclipse/jetty/util/ajax/AsyncJSONTest.java
@@ -502,4 +502,27 @@ public class AsyncJSONTest
assertSame(foo, item);
}
}
+
+ @Test
+ public void testEncodedCaching()
+ {
+ AsyncJSON.Factory factory = new AsyncJSON.Factory();
+ assertFalse(factory.cache("yèck"));
+ String foo = "foo\\yuck";
+ assertTrue(factory.cache(foo));
+ AsyncJSON parser = factory.newAsyncJSON();
+
+ String json = "{\"foo\\\\yuck\": [\"foo\\\\yuck\", \"foo\\\\yuck\"]}";
+ parser.parse(UTF_8.encode(json));
+ Map object = parser.complete();
+
+ Map.Entry entry = object.entrySet().iterator().next();
+ assertSame(foo, entry.getKey());
+ @SuppressWarnings("unchecked")
+ List array = (List)entry.getValue();
+ for (String item : array)
+ {
+ assertSame(foo, item);
+ }
+ }
}
diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/ArrayTernaryTrie.java b/jetty-util/src/main/java/org/eclipse/jetty/util/ArrayTernaryTrie.java
index fa63c727ae9..a1eecc1846c 100644
--- a/jetty-util/src/main/java/org/eclipse/jetty/util/ArrayTernaryTrie.java
+++ b/jetty-util/src/main/java/org/eclipse/jetty/util/ArrayTernaryTrie.java
@@ -632,7 +632,7 @@ public class ArrayTernaryTrie extends AbstractTrie
boolean added = _trie.put(s, v);
while (!added && _growby > 0)
{
- ArrayTernaryTrie bigger = new ArrayTernaryTrie<>(_trie._key.length + _growby);
+ ArrayTernaryTrie bigger = new ArrayTernaryTrie<>(_trie.isCaseInsensitive(), _trie._key.length + _growby);
for (Map.Entry entry : _trie.entrySet())
{
bigger.put(entry.getKey(), entry.getValue());
From 77c232aed8a45c818fd27232278d9f95a021095e Mon Sep 17 00:00:00 2001
From: Joakim Erdfelt
Date: Thu, 21 May 2020 12:04:14 -0500
Subject: [PATCH 58/77] Updating to version 9.4.29.v20200521
---
VERSION.txt | 28 +++-
aggregates/jetty-all-compact3/pom.xml | 2 +-
aggregates/jetty-all/pom.xml | 2 +-
apache-jsp/pom.xml | 2 +-
apache-jstl/pom.xml | 2 +-
build-resources/pom.xml | 2 +-
examples/async-rest/async-rest-jar/pom.xml | 2 +-
examples/async-rest/async-rest-webapp/pom.xml | 2 +-
examples/async-rest/pom.xml | 2 +-
examples/embedded/pom.xml | 2 +-
examples/pom.xml | 2 +-
jetty-alpn/jetty-alpn-client/pom.xml | 2 +-
.../jetty-alpn-conscrypt-client/pom.xml | 2 +-
.../jetty-alpn-conscrypt-server/pom.xml | 2 +-
jetty-alpn/jetty-alpn-java-client/pom.xml | 2 +-
jetty-alpn/jetty-alpn-java-server/pom.xml | 2 +-
jetty-alpn/jetty-alpn-openjdk8-client/pom.xml | 2 +-
jetty-alpn/jetty-alpn-openjdk8-server/pom.xml | 2 +-
jetty-alpn/jetty-alpn-server/pom.xml | 2 +-
jetty-alpn/pom.xml | 2 +-
jetty-annotations/pom.xml | 2 +-
jetty-ant/pom.xml | 2 +-
jetty-bom/pom.xml | 134 +++++++++---------
jetty-cdi/pom.xml | 2 +-
jetty-client/pom.xml | 2 +-
jetty-continuation/pom.xml | 2 +-
jetty-deploy/pom.xml | 2 +-
jetty-distribution/pom.xml | 2 +-
jetty-documentation/pom.xml | 2 +-
jetty-fcgi/fcgi-client/pom.xml | 2 +-
jetty-fcgi/fcgi-server/pom.xml | 2 +-
jetty-fcgi/pom.xml | 2 +-
.../jetty-gcloud-session-manager/pom.xml | 2 +-
jetty-gcloud/pom.xml | 2 +-
jetty-hazelcast/pom.xml | 2 +-
jetty-home/pom.xml | 2 +-
jetty-http-spi/pom.xml | 2 +-
jetty-http/pom.xml | 2 +-
jetty-http2/http2-alpn-tests/pom.xml | 2 +-
jetty-http2/http2-client/pom.xml | 2 +-
jetty-http2/http2-common/pom.xml | 2 +-
jetty-http2/http2-hpack/pom.xml | 2 +-
.../http2-http-client-transport/pom.xml | 2 +-
jetty-http2/http2-server/pom.xml | 2 +-
jetty-http2/pom.xml | 2 +-
jetty-infinispan/infinispan-common/pom.xml | 2 +-
.../infinispan-embedded-query/pom.xml | 2 +-
jetty-infinispan/infinispan-embedded/pom.xml | 2 +-
.../infinispan-remote-query/pom.xml | 2 +-
jetty-infinispan/infinispan-remote/pom.xml | 2 +-
jetty-infinispan/pom.xml | 2 +-
jetty-io/pom.xml | 2 +-
jetty-jaas/pom.xml | 2 +-
jetty-jaspi/pom.xml | 2 +-
jetty-jmh/pom.xml | 2 +-
jetty-jmx/pom.xml | 2 +-
jetty-jndi/pom.xml | 2 +-
jetty-jspc-maven-plugin/pom.xml | 2 +-
jetty-maven-plugin/pom.xml | 2 +-
.../jetty-memcached-sessions/pom.xml | 2 +-
jetty-memcached/pom.xml | 2 +-
jetty-nosql/pom.xml | 2 +-
jetty-openid/pom.xml | 2 +-
jetty-osgi/jetty-osgi-alpn/pom.xml | 2 +-
jetty-osgi/jetty-osgi-boot-jsp/pom.xml | 2 +-
jetty-osgi/jetty-osgi-boot-warurl/pom.xml | 2 +-
jetty-osgi/jetty-osgi-boot/pom.xml | 2 +-
jetty-osgi/jetty-osgi-httpservice/pom.xml | 2 +-
jetty-osgi/pom.xml | 2 +-
jetty-osgi/test-jetty-osgi-context/pom.xml | 2 +-
jetty-osgi/test-jetty-osgi-fragment/pom.xml | 2 +-
jetty-osgi/test-jetty-osgi-server/pom.xml | 2 +-
jetty-osgi/test-jetty-osgi-webapp/pom.xml | 2 +-
jetty-osgi/test-jetty-osgi/pom.xml | 2 +-
jetty-plus/pom.xml | 2 +-
jetty-proxy/pom.xml | 2 +-
jetty-quickstart/pom.xml | 2 +-
jetty-rewrite/pom.xml | 2 +-
jetty-runner/pom.xml | 2 +-
jetty-security/pom.xml | 2 +-
jetty-server/pom.xml | 2 +-
jetty-servlet/pom.xml | 2 +-
jetty-servlets/pom.xml | 2 +-
jetty-spring/pom.xml | 2 +-
jetty-start/pom.xml | 2 +-
jetty-unixsocket/pom.xml | 2 +-
jetty-util-ajax/pom.xml | 2 +-
jetty-util/pom.xml | 2 +-
jetty-webapp/pom.xml | 2 +-
.../javax-websocket-client-impl/pom.xml | 2 +-
.../javax-websocket-server-impl/pom.xml | 2 +-
jetty-websocket/jetty-websocket-tests/pom.xml | 2 +-
jetty-websocket/pom.xml | 2 +-
jetty-websocket/websocket-api/pom.xml | 2 +-
jetty-websocket/websocket-client/pom.xml | 2 +-
jetty-websocket/websocket-common/pom.xml | 2 +-
jetty-websocket/websocket-server/pom.xml | 2 +-
jetty-websocket/websocket-servlet/pom.xml | 2 +-
jetty-xml/pom.xml | 2 +-
pom.xml | 2 +-
tests/pom.xml | 2 +-
tests/test-continuation/pom.xml | 2 +-
tests/test-distribution/pom.xml | 2 +-
tests/test-http-client-transport/pom.xml | 2 +-
tests/test-integration/pom.xml | 2 +-
tests/test-jmx/jmx-webapp-it/pom.xml | 2 +-
tests/test-jmx/jmx-webapp/pom.xml | 2 +-
tests/test-jmx/pom.xml | 2 +-
tests/test-loginservice/pom.xml | 2 +-
tests/test-quickstart/pom.xml | 2 +-
tests/test-sessions/pom.xml | 2 +-
.../test-sessions/test-file-sessions/pom.xml | 2 +-
.../test-gcloud-sessions/pom.xml | 2 +-
.../test-hazelcast-sessions/pom.xml | 2 +-
.../test-infinispan-sessions/pom.xml | 2 +-
.../test-sessions/test-jdbc-sessions/pom.xml | 2 +-
.../test-memcached-sessions/pom.xml | 2 +-
.../test-mongodb-sessions/pom.xml | 2 +-
.../test-sessions-common/pom.xml | 2 +-
tests/test-webapps/pom.xml | 2 +-
.../test-cdi-common-webapp/pom.xml | 2 +-
tests/test-webapps/test-felix-webapp/pom.xml | 2 +-
tests/test-webapps/test-http2-webapp/pom.xml | 2 +-
tests/test-webapps/test-jaas-webapp/pom.xml | 2 +-
tests/test-webapps/test-jetty-webapp/pom.xml | 2 +-
tests/test-webapps/test-jndi-webapp/pom.xml | 2 +-
.../test-webapps/test-mock-resources/pom.xml | 2 +-
.../test-webapps/test-owb-cdi-webapp/pom.xml | 2 +-
tests/test-webapps/test-proxy-webapp/pom.xml | 2 +-
tests/test-webapps/test-servlet-spec/pom.xml | 2 +-
.../test-container-initializer/pom.xml | 2 +-
.../test-spec-webapp/pom.xml | 2 +-
.../test-web-fragment/pom.xml | 2 +-
tests/test-webapps/test-simple-webapp/pom.xml | 2 +-
.../test-webapps/test-webapp-rfc2616/pom.xml | 2 +-
.../test-webapps/test-weld-cdi-webapp/pom.xml | 2 +-
136 files changed, 227 insertions(+), 203 deletions(-)
diff --git a/VERSION.txt b/VERSION.txt
index c5f5ce782ea..009f6013f1a 100644
--- a/VERSION.txt
+++ b/VERSION.txt
@@ -1,4 +1,28 @@
-jetty-9.4.29-SNAPSHOT
+jetty-9.4.29.v20200521 - 21 May 2020
+ + 2188 Lock contention creating HTTP/2 streams
+ + 4235 communicate the reason of failure to the OpenID error page
+ + 4695 HttpChannel recycling in h2
+ + 4764 HTTP2 Jetty Server does not send back content-length
+ + 4778 Enforcing SNI when there are only non-wildcards certificates
+ + 4787 Make org.eclipse.jetty.client.HttpRequest's host name writable
+ + 4789 org.eclipse.jetty.util.thread.ShutdownThread should use an appropriate
+ name to identify itself in Thread dump
+ + 4798 Better handling of fatal Selector failures
+ + 4814 Allow a ConnectionFactory (eg SslConnectionFactory) to automatically
+ add a Customizer
+ + 4820 Jetty OSGi DefaultJettyAtJettyHomeHelper refers to non-existent
+ config file
+ + 4824 WebSocket server outgoing message queue memory growth
+ + 4828 NIO ByteBuffer corruption in embedded Jetty server
+ + 4835 GzipHandler and GzipHttpOutputInterceptor do not flush response when
+ body is empty
+ + 4860 org.eclipse.jetty.server.HttpChannel busyloop on HttpFields
+ NullPointerException
+ + 4861 Combine `AttributesMap` and `Attributes.Wrapper`
+ + 4868 Update to asm 7.3.1
+ + 4892 Non-blocking JSON parser
+ + 4895 AbstractSessionCache.setFlushOnResponseCommit(true) can write an
+ invalid session to the backing store
jetty-9.4.28.v20200408 - 08 April 2020
+ 847 Setting async timeout on WebSocketClient does not seem to timeout writes
@@ -8,7 +32,7 @@ jetty-9.4.28.v20200408 - 08 April 2020
+ 4529 ErrorHandler showing servlet info, can not be disabled unless
overriding most of its functionality
+ 4542 servlet context root mapping incorrect
- + 4619 Inconsistent library versions notice.
+ + 4619 Inconsistent library versions notice
+ 4620 Using console-capture with StdErrLog results in empty log file
+ 4621 jetty-jaspi in jetty-all uber aggregate artifact requires
javax.security.auth.message.AuthException which cannot be included
diff --git a/aggregates/jetty-all-compact3/pom.xml b/aggregates/jetty-all-compact3/pom.xml
index 9aa8de61f7d..5a27d149698 100644
--- a/aggregates/jetty-all-compact3/pom.xml
+++ b/aggregates/jetty-all-compact3/pom.xml
@@ -2,7 +2,7 @@
org.eclipse.jettyjetty-project
- 9.4.29-SNAPSHOT
+ 9.4.29.v20200521../../pom.xml4.0.0
diff --git a/aggregates/jetty-all/pom.xml b/aggregates/jetty-all/pom.xml
index c7ba43155b5..1524b48dfc3 100644
--- a/aggregates/jetty-all/pom.xml
+++ b/aggregates/jetty-all/pom.xml
@@ -2,7 +2,7 @@
org.eclipse.jettyjetty-project
- 9.4.29-SNAPSHOT
+ 9.4.29.v20200521../../pom.xml4.0.0
diff --git a/apache-jsp/pom.xml b/apache-jsp/pom.xml
index d65d9fbcbcc..2d75087709a 100644
--- a/apache-jsp/pom.xml
+++ b/apache-jsp/pom.xml
@@ -2,7 +2,7 @@
org.eclipse.jettyjetty-project
- 9.4.29-SNAPSHOT
+ 9.4.29.v202005214.0.0apache-jsp
diff --git a/apache-jstl/pom.xml b/apache-jstl/pom.xml
index 7ddb0b852a2..295b9f53d9c 100644
--- a/apache-jstl/pom.xml
+++ b/apache-jstl/pom.xml
@@ -2,7 +2,7 @@
org.eclipse.jettyjetty-project
- 9.4.29-SNAPSHOT
+ 9.4.29.v202005214.0.0apache-jstl
diff --git a/build-resources/pom.xml b/build-resources/pom.xml
index 2c9845d2625..46b88407b79 100644
--- a/build-resources/pom.xml
+++ b/build-resources/pom.xml
@@ -2,7 +2,7 @@
4.0.0org.eclipse.jettybuild-resources
- 9.4.29-SNAPSHOT
+ 9.4.29.v20200521jarJetty :: Build Resources
diff --git a/examples/async-rest/async-rest-jar/pom.xml b/examples/async-rest/async-rest-jar/pom.xml
index 85d69939487..288785f42d5 100644
--- a/examples/async-rest/async-rest-jar/pom.xml
+++ b/examples/async-rest/async-rest-jar/pom.xml
@@ -2,7 +2,7 @@
org.eclipse.jettyexample-async-rest
- 9.4.29-SNAPSHOT
+ 9.4.29.v202005214.0.0
diff --git a/examples/async-rest/async-rest-webapp/pom.xml b/examples/async-rest/async-rest-webapp/pom.xml
index 19486ffe653..040aaec8303 100644
--- a/examples/async-rest/async-rest-webapp/pom.xml
+++ b/examples/async-rest/async-rest-webapp/pom.xml
@@ -2,7 +2,7 @@
org.eclipse.jettyexample-async-rest
- 9.4.29-SNAPSHOT
+ 9.4.29.v202005214.0.0
diff --git a/examples/async-rest/pom.xml b/examples/async-rest/pom.xml
index 799db801363..f40892d591d 100644
--- a/examples/async-rest/pom.xml
+++ b/examples/async-rest/pom.xml
@@ -2,7 +2,7 @@
org.eclipse.jetty.examplesexamples-parent
- 9.4.29-SNAPSHOT
+ 9.4.29.v202005214.0.0
diff --git a/examples/embedded/pom.xml b/examples/embedded/pom.xml
index ef0b4eba461..17734a264f4 100644
--- a/examples/embedded/pom.xml
+++ b/examples/embedded/pom.xml
@@ -2,7 +2,7 @@
org.eclipse.jetty.examplesexamples-parent
- 9.4.29-SNAPSHOT
+ 9.4.29.v20200521../pom.xml4.0.0
diff --git a/examples/pom.xml b/examples/pom.xml
index 284ef573fee..8d3fc417bc6 100644
--- a/examples/pom.xml
+++ b/examples/pom.xml
@@ -3,7 +3,7 @@
org.eclipse.jettyjetty-project
- 9.4.29-SNAPSHOT
+ 9.4.29.v202005214.0.0
diff --git a/jetty-alpn/jetty-alpn-client/pom.xml b/jetty-alpn/jetty-alpn-client/pom.xml
index 8886bd3d421..bccf8a700db 100644
--- a/jetty-alpn/jetty-alpn-client/pom.xml
+++ b/jetty-alpn/jetty-alpn-client/pom.xml
@@ -2,7 +2,7 @@
org.eclipse.jettyjetty-alpn-parent
- 9.4.29-SNAPSHOT
+ 9.4.29.v202005214.0.0jetty-alpn-client
diff --git a/jetty-alpn/jetty-alpn-conscrypt-client/pom.xml b/jetty-alpn/jetty-alpn-conscrypt-client/pom.xml
index a6f273200ae..daef0477762 100644
--- a/jetty-alpn/jetty-alpn-conscrypt-client/pom.xml
+++ b/jetty-alpn/jetty-alpn-conscrypt-client/pom.xml
@@ -4,7 +4,7 @@
org.eclipse.jettyjetty-alpn-parent
- 9.4.29-SNAPSHOT
+ 9.4.29.v202005214.0.0
diff --git a/jetty-alpn/jetty-alpn-conscrypt-server/pom.xml b/jetty-alpn/jetty-alpn-conscrypt-server/pom.xml
index 585cfcec66d..2f395f4d1ed 100644
--- a/jetty-alpn/jetty-alpn-conscrypt-server/pom.xml
+++ b/jetty-alpn/jetty-alpn-conscrypt-server/pom.xml
@@ -3,7 +3,7 @@
org.eclipse.jettyjetty-alpn-parent
- 9.4.29-SNAPSHOT
+ 9.4.29.v202005214.0.0
diff --git a/jetty-alpn/jetty-alpn-java-client/pom.xml b/jetty-alpn/jetty-alpn-java-client/pom.xml
index 17a626e7e11..c790d1ff1ae 100644
--- a/jetty-alpn/jetty-alpn-java-client/pom.xml
+++ b/jetty-alpn/jetty-alpn-java-client/pom.xml
@@ -4,7 +4,7 @@
org.eclipse.jettyjetty-alpn-parent
- 9.4.29-SNAPSHOT
+ 9.4.29.v202005214.0.0
diff --git a/jetty-alpn/jetty-alpn-java-server/pom.xml b/jetty-alpn/jetty-alpn-java-server/pom.xml
index af2f2fbe46e..341d8b1a99a 100644
--- a/jetty-alpn/jetty-alpn-java-server/pom.xml
+++ b/jetty-alpn/jetty-alpn-java-server/pom.xml
@@ -3,7 +3,7 @@
org.eclipse.jettyjetty-alpn-parent
- 9.4.29-SNAPSHOT
+ 9.4.29.v202005214.0.0
diff --git a/jetty-alpn/jetty-alpn-openjdk8-client/pom.xml b/jetty-alpn/jetty-alpn-openjdk8-client/pom.xml
index e7b25f6c49f..423ff07e2ab 100644
--- a/jetty-alpn/jetty-alpn-openjdk8-client/pom.xml
+++ b/jetty-alpn/jetty-alpn-openjdk8-client/pom.xml
@@ -4,7 +4,7 @@
org.eclipse.jettyjetty-alpn-parent
- 9.4.29-SNAPSHOT
+ 9.4.29.v202005214.0.0
diff --git a/jetty-alpn/jetty-alpn-openjdk8-server/pom.xml b/jetty-alpn/jetty-alpn-openjdk8-server/pom.xml
index 4a646c4078a..59e1fdfc687 100644
--- a/jetty-alpn/jetty-alpn-openjdk8-server/pom.xml
+++ b/jetty-alpn/jetty-alpn-openjdk8-server/pom.xml
@@ -3,7 +3,7 @@
org.eclipse.jettyjetty-alpn-parent
- 9.4.29-SNAPSHOT
+ 9.4.29.v202005214.0.0
diff --git a/jetty-alpn/jetty-alpn-server/pom.xml b/jetty-alpn/jetty-alpn-server/pom.xml
index 9d79ac35845..268321da26b 100644
--- a/jetty-alpn/jetty-alpn-server/pom.xml
+++ b/jetty-alpn/jetty-alpn-server/pom.xml
@@ -2,7 +2,7 @@
org.eclipse.jettyjetty-alpn-parent
- 9.4.29-SNAPSHOT
+ 9.4.29.v202005214.0.0jetty-alpn-server
diff --git a/jetty-alpn/pom.xml b/jetty-alpn/pom.xml
index 5744bbbbf71..dd35154f804 100644
--- a/jetty-alpn/pom.xml
+++ b/jetty-alpn/pom.xml
@@ -2,7 +2,7 @@
org.eclipse.jettyjetty-project
- 9.4.29-SNAPSHOT
+ 9.4.29.v202005214.0.0jetty-alpn-parent
diff --git a/jetty-annotations/pom.xml b/jetty-annotations/pom.xml
index fe43d65faeb..6f0b05fad28 100644
--- a/jetty-annotations/pom.xml
+++ b/jetty-annotations/pom.xml
@@ -2,7 +2,7 @@
org.eclipse.jettyjetty-project
- 9.4.29-SNAPSHOT
+ 9.4.29.v202005214.0.0jetty-annotations
diff --git a/jetty-ant/pom.xml b/jetty-ant/pom.xml
index 5bb1b54ea29..f6cb9787b3f 100644
--- a/jetty-ant/pom.xml
+++ b/jetty-ant/pom.xml
@@ -2,7 +2,7 @@
org.eclipse.jettyjetty-project
- 9.4.29-SNAPSHOT
+ 9.4.29.v202005214.0.0jetty-ant
diff --git a/jetty-bom/pom.xml b/jetty-bom/pom.xml
index 25fb9d37eb3..24841e21d35 100644
--- a/jetty-bom/pom.xml
+++ b/jetty-bom/pom.xml
@@ -9,7 +9,7 @@
org.eclipse.jettyjetty-project
- 9.4.29-SNAPSHOT
+ 9.4.29.v20200521
@@ -53,336 +53,336 @@
org.eclipse.jettyapache-jsp
- 9.4.29-SNAPSHOT
+ 9.4.29.v20200521org.eclipse.jettyapache-jstl
- 9.4.29-SNAPSHOT
+ 9.4.29.v20200521org.eclipse.jettyjetty-alpn-client
- 9.4.29-SNAPSHOT
+ 9.4.29.v20200521org.eclipse.jettyjetty-alpn-java-client
- 9.4.29-SNAPSHOT
+ 9.4.29.v20200521org.eclipse.jettyjetty-alpn-java-server
- 9.4.29-SNAPSHOT
+ 9.4.29.v20200521org.eclipse.jettyjetty-alpn-openjdk8-client
- 9.4.29-SNAPSHOT
+ 9.4.29.v20200521org.eclipse.jettyjetty-alpn-openjdk8-server
- 9.4.29-SNAPSHOT
+ 9.4.29.v20200521org.eclipse.jettyjetty-alpn-conscrypt-client
- 9.4.29-SNAPSHOT
+ 9.4.29.v20200521org.eclipse.jettyjetty-alpn-conscrypt-server
- 9.4.29-SNAPSHOT
+ 9.4.29.v20200521org.eclipse.jettyjetty-alpn-server
- 9.4.29-SNAPSHOT
+ 9.4.29.v20200521org.eclipse.jettyjetty-annotations
- 9.4.29-SNAPSHOT
+ 9.4.29.v20200521org.eclipse.jettyjetty-ant
- 9.4.29-SNAPSHOT
+ 9.4.29.v20200521org.eclipse.jettyjetty-client
- 9.4.29-SNAPSHOT
+ 9.4.29.v20200521org.eclipse.jettyjetty-continuation
- 9.4.29-SNAPSHOT
+ 9.4.29.v20200521org.eclipse.jettyjetty-deploy
- 9.4.29-SNAPSHOT
+ 9.4.29.v20200521org.eclipse.jettyjetty-distribution
- 9.4.29-SNAPSHOT
+ 9.4.29.v20200521ziporg.eclipse.jettyjetty-distribution
- 9.4.29-SNAPSHOT
+ 9.4.29.v20200521tar.gzorg.eclipse.jetty.fcgifcgi-client
- 9.4.29-SNAPSHOT
+ 9.4.29.v20200521org.eclipse.jetty.fcgifcgi-server
- 9.4.29-SNAPSHOT
+ 9.4.29.v20200521org.eclipse.jetty.gcloudjetty-gcloud-session-manager
- 9.4.29-SNAPSHOT
+ 9.4.29.v20200521org.eclipse.jettyjetty-home
- 9.4.29-SNAPSHOT
+ 9.4.29.v20200521ziporg.eclipse.jettyjetty-home
- 9.4.29-SNAPSHOT
+ 9.4.29.v20200521tar.gzorg.eclipse.jettyjetty-http
- 9.4.29-SNAPSHOT
+ 9.4.29.v20200521org.eclipse.jetty.http2http2-client
- 9.4.29-SNAPSHOT
+ 9.4.29.v20200521org.eclipse.jetty.http2http2-common
- 9.4.29-SNAPSHOT
+ 9.4.29.v20200521org.eclipse.jetty.http2http2-hpack
- 9.4.29-SNAPSHOT
+ 9.4.29.v20200521org.eclipse.jetty.http2http2-http-client-transport
- 9.4.29-SNAPSHOT
+ 9.4.29.v20200521org.eclipse.jetty.http2http2-server
- 9.4.29-SNAPSHOT
+ 9.4.29.v20200521org.eclipse.jettyjetty-http-spi
- 9.4.29-SNAPSHOT
+ 9.4.29.v20200521org.eclipse.jettyinfinispan-common
- 9.4.29-SNAPSHOT
+ 9.4.29.v20200521org.eclipse.jettyinfinispan-remote-query
- 9.4.29-SNAPSHOT
+ 9.4.29.v20200521org.eclipse.jettyinfinispan-embedded-query
- 9.4.29-SNAPSHOT
+ 9.4.29.v20200521org.eclipse.jettyjetty-hazelcast
- 9.4.29-SNAPSHOT
+ 9.4.29.v20200521org.eclipse.jettyjetty-io
- 9.4.29-SNAPSHOT
+ 9.4.29.v20200521org.eclipse.jettyjetty-jaas
- 9.4.29-SNAPSHOT
+ 9.4.29.v20200521org.eclipse.jettyjetty-jaspi
- 9.4.29-SNAPSHOT
+ 9.4.29.v20200521org.eclipse.jettyjetty-jmx
- 9.4.29-SNAPSHOT
+ 9.4.29.v20200521org.eclipse.jettyjetty-jndi
- 9.4.29-SNAPSHOT
+ 9.4.29.v20200521org.eclipse.jetty.memcachedjetty-memcached-sessions
- 9.4.29-SNAPSHOT
+ 9.4.29.v20200521org.eclipse.jettyjetty-nosql
- 9.4.29-SNAPSHOT
+ 9.4.29.v20200521org.eclipse.jetty.osgijetty-osgi-boot
- 9.4.29-SNAPSHOT
+ 9.4.29.v20200521org.eclipse.jetty.osgijetty-osgi-boot-jsp
- 9.4.29-SNAPSHOT
+ 9.4.29.v20200521org.eclipse.jetty.osgijetty-osgi-boot-warurl
- 9.4.29-SNAPSHOT
+ 9.4.29.v20200521org.eclipse.jetty.osgijetty-httpservice
- 9.4.29-SNAPSHOT
+ 9.4.29.v20200521org.eclipse.jettyjetty-plus
- 9.4.29-SNAPSHOT
+ 9.4.29.v20200521org.eclipse.jettyjetty-proxy
- 9.4.29-SNAPSHOT
+ 9.4.29.v20200521org.eclipse.jettyjetty-quickstart
- 9.4.29-SNAPSHOT
+ 9.4.29.v20200521org.eclipse.jettyjetty-rewrite
- 9.4.29-SNAPSHOT
+ 9.4.29.v20200521org.eclipse.jettyjetty-security
- 9.4.29-SNAPSHOT
+ 9.4.29.v20200521org.eclipse.jettyjetty-openid
- 9.4.29-SNAPSHOT
+ 9.4.29.v20200521org.eclipse.jettyjetty-server
- 9.4.29-SNAPSHOT
+ 9.4.29.v20200521org.eclipse.jettyjetty-servlet
- 9.4.29-SNAPSHOT
+ 9.4.29.v20200521org.eclipse.jettyjetty-servlets
- 9.4.29-SNAPSHOT
+ 9.4.29.v20200521org.eclipse.jettyjetty-spring
- 9.4.29-SNAPSHOT
+ 9.4.29.v20200521org.eclipse.jettyjetty-unixsocket
- 9.4.29-SNAPSHOT
+ 9.4.29.v20200521org.eclipse.jettyjetty-util
- 9.4.29-SNAPSHOT
+ 9.4.29.v20200521org.eclipse.jettyjetty-util-ajax
- 9.4.29-SNAPSHOT
+ 9.4.29.v20200521org.eclipse.jettyjetty-webapp
- 9.4.29-SNAPSHOT
+ 9.4.29.v20200521org.eclipse.jetty.websocketjavax-websocket-client-impl
- 9.4.29-SNAPSHOT
+ 9.4.29.v20200521org.eclipse.jetty.websocketjavax-websocket-server-impl
- 9.4.29-SNAPSHOT
+ 9.4.29.v20200521org.eclipse.jetty.websocketwebsocket-api
- 9.4.29-SNAPSHOT
+ 9.4.29.v20200521org.eclipse.jetty.websocketwebsocket-client
- 9.4.29-SNAPSHOT
+ 9.4.29.v20200521org.eclipse.jetty.websocketwebsocket-common
- 9.4.29-SNAPSHOT
+ 9.4.29.v20200521org.eclipse.jetty.websocketwebsocket-server
- 9.4.29-SNAPSHOT
+ 9.4.29.v20200521org.eclipse.jetty.websocketwebsocket-servlet
- 9.4.29-SNAPSHOT
+ 9.4.29.v20200521org.eclipse.jettyjetty-xml
- 9.4.29-SNAPSHOT
+ 9.4.29.v20200521
diff --git a/jetty-cdi/pom.xml b/jetty-cdi/pom.xml
index 192eeba6002..be078af41ce 100644
--- a/jetty-cdi/pom.xml
+++ b/jetty-cdi/pom.xml
@@ -2,7 +2,7 @@
org.eclipse.jettyjetty-project
- 9.4.29-SNAPSHOT
+ 9.4.29.v202005214.0.0org.eclipse.jetty
diff --git a/jetty-client/pom.xml b/jetty-client/pom.xml
index 76409b9bfa7..801de2fc76e 100644
--- a/jetty-client/pom.xml
+++ b/jetty-client/pom.xml
@@ -2,7 +2,7 @@
org.eclipse.jettyjetty-project
- 9.4.29-SNAPSHOT
+ 9.4.29.v202005214.0.0
diff --git a/jetty-continuation/pom.xml b/jetty-continuation/pom.xml
index 0c1e7a6540d..9a4b6cc34ae 100644
--- a/jetty-continuation/pom.xml
+++ b/jetty-continuation/pom.xml
@@ -2,7 +2,7 @@
org.eclipse.jettyjetty-project
- 9.4.29-SNAPSHOT
+ 9.4.29.v202005214.0.0jetty-continuation
diff --git a/jetty-deploy/pom.xml b/jetty-deploy/pom.xml
index aac2955999a..b70712b0529 100644
--- a/jetty-deploy/pom.xml
+++ b/jetty-deploy/pom.xml
@@ -2,7 +2,7 @@
org.eclipse.jettyjetty-project
- 9.4.29-SNAPSHOT
+ 9.4.29.v202005214.0.0jetty-deploy
diff --git a/jetty-distribution/pom.xml b/jetty-distribution/pom.xml
index 1e60b7b3190..82f2400494d 100644
--- a/jetty-distribution/pom.xml
+++ b/jetty-distribution/pom.xml
@@ -2,7 +2,7 @@
org.eclipse.jettyjetty-project
- 9.4.29-SNAPSHOT
+ 9.4.29.v202005214.0.0jetty-distribution
diff --git a/jetty-documentation/pom.xml b/jetty-documentation/pom.xml
index 62da69a54b1..48c07479ec4 100644
--- a/jetty-documentation/pom.xml
+++ b/jetty-documentation/pom.xml
@@ -4,7 +4,7 @@
org.eclipse.jettyjetty-project
- 9.4.29-SNAPSHOT
+ 9.4.29.v20200521jetty-documentationJetty :: Documentation
diff --git a/jetty-fcgi/fcgi-client/pom.xml b/jetty-fcgi/fcgi-client/pom.xml
index 8519df4d6f2..a0ccde50b09 100644
--- a/jetty-fcgi/fcgi-client/pom.xml
+++ b/jetty-fcgi/fcgi-client/pom.xml
@@ -3,7 +3,7 @@
org.eclipse.jetty.fcgifcgi-parent
- 9.4.29-SNAPSHOT
+ 9.4.29.v202005214.0.0
diff --git a/jetty-fcgi/fcgi-server/pom.xml b/jetty-fcgi/fcgi-server/pom.xml
index 72775eaae08..82e1cd52e70 100644
--- a/jetty-fcgi/fcgi-server/pom.xml
+++ b/jetty-fcgi/fcgi-server/pom.xml
@@ -3,7 +3,7 @@
org.eclipse.jetty.fcgifcgi-parent
- 9.4.29-SNAPSHOT
+ 9.4.29.v202005214.0.0
diff --git a/jetty-fcgi/pom.xml b/jetty-fcgi/pom.xml
index 93483624a72..3aa17095190 100644
--- a/jetty-fcgi/pom.xml
+++ b/jetty-fcgi/pom.xml
@@ -3,7 +3,7 @@
org.eclipse.jettyjetty-project
- 9.4.29-SNAPSHOT
+ 9.4.29.v202005214.0.0
diff --git a/jetty-gcloud/jetty-gcloud-session-manager/pom.xml b/jetty-gcloud/jetty-gcloud-session-manager/pom.xml
index 07bc061d319..32ff10ac7da 100644
--- a/jetty-gcloud/jetty-gcloud-session-manager/pom.xml
+++ b/jetty-gcloud/jetty-gcloud-session-manager/pom.xml
@@ -3,7 +3,7 @@
org.eclipse.jetty.gcloudgcloud-parent
- 9.4.29-SNAPSHOT
+ 9.4.29.v202005214.0.0
diff --git a/jetty-gcloud/pom.xml b/jetty-gcloud/pom.xml
index db7045d9a4a..f3132c971e9 100644
--- a/jetty-gcloud/pom.xml
+++ b/jetty-gcloud/pom.xml
@@ -3,7 +3,7 @@
jetty-projectorg.eclipse.jetty
- 9.4.29-SNAPSHOT
+ 9.4.29.v202005214.0.0
diff --git a/jetty-hazelcast/pom.xml b/jetty-hazelcast/pom.xml
index 33fc3863baa..d00416504c7 100644
--- a/jetty-hazelcast/pom.xml
+++ b/jetty-hazelcast/pom.xml
@@ -3,7 +3,7 @@
org.eclipse.jettyjetty-project
- 9.4.29-SNAPSHOT
+ 9.4.29.v202005214.0.0
diff --git a/jetty-home/pom.xml b/jetty-home/pom.xml
index e97c7dbf02f..520e3f1e95f 100644
--- a/jetty-home/pom.xml
+++ b/jetty-home/pom.xml
@@ -3,7 +3,7 @@
jetty-projectorg.eclipse.jetty
- 9.4.29-SNAPSHOT
+ 9.4.29.v202005214.0.0jetty-home
diff --git a/jetty-http-spi/pom.xml b/jetty-http-spi/pom.xml
index bc4f4b040bd..7dd188ad63a 100644
--- a/jetty-http-spi/pom.xml
+++ b/jetty-http-spi/pom.xml
@@ -2,7 +2,7 @@
org.eclipse.jettyjetty-project
- 9.4.29-SNAPSHOT
+ 9.4.29.v202005214.0.0jetty-http-spi
diff --git a/jetty-http/pom.xml b/jetty-http/pom.xml
index d5c97ec4f16..db7ec5c5644 100644
--- a/jetty-http/pom.xml
+++ b/jetty-http/pom.xml
@@ -3,7 +3,7 @@
jetty-projectorg.eclipse.jetty
- 9.4.29-SNAPSHOT
+ 9.4.29.v202005214.0.0jetty-http
diff --git a/jetty-http2/http2-alpn-tests/pom.xml b/jetty-http2/http2-alpn-tests/pom.xml
index d397a5e22d1..db20cb8218b 100644
--- a/jetty-http2/http2-alpn-tests/pom.xml
+++ b/jetty-http2/http2-alpn-tests/pom.xml
@@ -3,7 +3,7 @@
org.eclipse.jetty.http2http2-parent
- 9.4.29-SNAPSHOT
+ 9.4.29.v202005214.0.0
diff --git a/jetty-http2/http2-client/pom.xml b/jetty-http2/http2-client/pom.xml
index b57b00b5a24..bb8ca86c719 100644
--- a/jetty-http2/http2-client/pom.xml
+++ b/jetty-http2/http2-client/pom.xml
@@ -3,7 +3,7 @@
org.eclipse.jetty.http2http2-parent
- 9.4.29-SNAPSHOT
+ 9.4.29.v202005214.0.0
diff --git a/jetty-http2/http2-common/pom.xml b/jetty-http2/http2-common/pom.xml
index a8e58c545b7..2a40e987988 100644
--- a/jetty-http2/http2-common/pom.xml
+++ b/jetty-http2/http2-common/pom.xml
@@ -3,7 +3,7 @@
org.eclipse.jetty.http2http2-parent
- 9.4.29-SNAPSHOT
+ 9.4.29.v202005214.0.0
diff --git a/jetty-http2/http2-hpack/pom.xml b/jetty-http2/http2-hpack/pom.xml
index add16c2afd1..331304ce56b 100644
--- a/jetty-http2/http2-hpack/pom.xml
+++ b/jetty-http2/http2-hpack/pom.xml
@@ -3,7 +3,7 @@
org.eclipse.jetty.http2http2-parent
- 9.4.29-SNAPSHOT
+ 9.4.29.v202005214.0.0
diff --git a/jetty-http2/http2-http-client-transport/pom.xml b/jetty-http2/http2-http-client-transport/pom.xml
index 3f8490b9ab8..2c82b6989c6 100644
--- a/jetty-http2/http2-http-client-transport/pom.xml
+++ b/jetty-http2/http2-http-client-transport/pom.xml
@@ -3,7 +3,7 @@
org.eclipse.jetty.http2http2-parent
- 9.4.29-SNAPSHOT
+ 9.4.29.v202005214.0.0
diff --git a/jetty-http2/http2-server/pom.xml b/jetty-http2/http2-server/pom.xml
index 77eb61f3b35..d94ebad7d88 100644
--- a/jetty-http2/http2-server/pom.xml
+++ b/jetty-http2/http2-server/pom.xml
@@ -3,7 +3,7 @@
org.eclipse.jetty.http2http2-parent
- 9.4.29-SNAPSHOT
+ 9.4.29.v202005214.0.0
diff --git a/jetty-http2/pom.xml b/jetty-http2/pom.xml
index d11f82a9f25..c1726a2f61b 100644
--- a/jetty-http2/pom.xml
+++ b/jetty-http2/pom.xml
@@ -3,7 +3,7 @@
jetty-projectorg.eclipse.jetty
- 9.4.29-SNAPSHOT
+ 9.4.29.v202005214.0.0
diff --git a/jetty-infinispan/infinispan-common/pom.xml b/jetty-infinispan/infinispan-common/pom.xml
index 620748bdb67..aad511097ac 100644
--- a/jetty-infinispan/infinispan-common/pom.xml
+++ b/jetty-infinispan/infinispan-common/pom.xml
@@ -2,7 +2,7 @@
org.eclipse.jettyinfinispan-parent
- 9.4.29-SNAPSHOT
+ 9.4.29.v202005214.0.0infinispan-common
diff --git a/jetty-infinispan/infinispan-embedded-query/pom.xml b/jetty-infinispan/infinispan-embedded-query/pom.xml
index d2555f9d845..587d3364dd4 100644
--- a/jetty-infinispan/infinispan-embedded-query/pom.xml
+++ b/jetty-infinispan/infinispan-embedded-query/pom.xml
@@ -2,7 +2,7 @@
org.eclipse.jettyinfinispan-parent
- 9.4.29-SNAPSHOT
+ 9.4.29.v202005214.0.0infinispan-embedded-query
diff --git a/jetty-infinispan/infinispan-embedded/pom.xml b/jetty-infinispan/infinispan-embedded/pom.xml
index f33d4474e97..04602741f6e 100644
--- a/jetty-infinispan/infinispan-embedded/pom.xml
+++ b/jetty-infinispan/infinispan-embedded/pom.xml
@@ -2,7 +2,7 @@
org.eclipse.jettyinfinispan-parent
- 9.4.29-SNAPSHOT
+ 9.4.29.v202005214.0.0infinispan-embedded
diff --git a/jetty-infinispan/infinispan-remote-query/pom.xml b/jetty-infinispan/infinispan-remote-query/pom.xml
index 4cb8d9bbb6a..5d6d55913b4 100644
--- a/jetty-infinispan/infinispan-remote-query/pom.xml
+++ b/jetty-infinispan/infinispan-remote-query/pom.xml
@@ -2,7 +2,7 @@
org.eclipse.jettyinfinispan-parent
- 9.4.29-SNAPSHOT
+ 9.4.29.v202005214.0.0infinispan-remote-query
diff --git a/jetty-infinispan/infinispan-remote/pom.xml b/jetty-infinispan/infinispan-remote/pom.xml
index 63235a66170..f16050564b7 100644
--- a/jetty-infinispan/infinispan-remote/pom.xml
+++ b/jetty-infinispan/infinispan-remote/pom.xml
@@ -2,7 +2,7 @@
org.eclipse.jettyinfinispan-parent
- 9.4.29-SNAPSHOT
+ 9.4.29.v202005214.0.0infinispan-remote
diff --git a/jetty-infinispan/pom.xml b/jetty-infinispan/pom.xml
index 75103e182df..82db4ae4350 100644
--- a/jetty-infinispan/pom.xml
+++ b/jetty-infinispan/pom.xml
@@ -3,7 +3,7 @@
org.eclipse.jettyjetty-project
- 9.4.29-SNAPSHOT
+ 9.4.29.v202005214.0.0
diff --git a/jetty-io/pom.xml b/jetty-io/pom.xml
index 5efa95c6c7e..b8eaed018b3 100644
--- a/jetty-io/pom.xml
+++ b/jetty-io/pom.xml
@@ -3,7 +3,7 @@
jetty-projectorg.eclipse.jetty
- 9.4.29-SNAPSHOT
+ 9.4.29.v202005214.0.0jetty-io
diff --git a/jetty-jaas/pom.xml b/jetty-jaas/pom.xml
index 72b221acfc5..72f5c92c068 100644
--- a/jetty-jaas/pom.xml
+++ b/jetty-jaas/pom.xml
@@ -2,7 +2,7 @@
org.eclipse.jettyjetty-project
- 9.4.29-SNAPSHOT
+ 9.4.29.v202005214.0.0jetty-jaas
diff --git a/jetty-jaspi/pom.xml b/jetty-jaspi/pom.xml
index eb3f6deedc1..e25bd8a11f3 100644
--- a/jetty-jaspi/pom.xml
+++ b/jetty-jaspi/pom.xml
@@ -2,7 +2,7 @@
org.eclipse.jettyjetty-project
- 9.4.29-SNAPSHOT
+ 9.4.29.v202005214.0.0
diff --git a/jetty-jmh/pom.xml b/jetty-jmh/pom.xml
index ab479d23d85..46f52e8664e 100644
--- a/jetty-jmh/pom.xml
+++ b/jetty-jmh/pom.xml
@@ -2,7 +2,7 @@
org.eclipse.jettyjetty-project
- 9.4.29-SNAPSHOT
+ 9.4.29.v202005214.0.0
diff --git a/jetty-jmx/pom.xml b/jetty-jmx/pom.xml
index 3a650bd610b..2e44b2b53c5 100644
--- a/jetty-jmx/pom.xml
+++ b/jetty-jmx/pom.xml
@@ -2,7 +2,7 @@
org.eclipse.jettyjetty-project
- 9.4.29-SNAPSHOT
+ 9.4.29.v202005214.0.0jetty-jmx
diff --git a/jetty-jndi/pom.xml b/jetty-jndi/pom.xml
index 5a8c24718a2..74b8408491f 100644
--- a/jetty-jndi/pom.xml
+++ b/jetty-jndi/pom.xml
@@ -2,7 +2,7 @@
org.eclipse.jettyjetty-project
- 9.4.29-SNAPSHOT
+ 9.4.29.v202005214.0.0jetty-jndi
diff --git a/jetty-jspc-maven-plugin/pom.xml b/jetty-jspc-maven-plugin/pom.xml
index c75714cf367..8c3cbb29e86 100644
--- a/jetty-jspc-maven-plugin/pom.xml
+++ b/jetty-jspc-maven-plugin/pom.xml
@@ -3,7 +3,7 @@
org.eclipse.jettyjetty-project
- 9.4.29-SNAPSHOT
+ 9.4.29.v202005214.0.0jetty-jspc-maven-plugin
diff --git a/jetty-maven-plugin/pom.xml b/jetty-maven-plugin/pom.xml
index ff00b926c2d..55d955a5a99 100644
--- a/jetty-maven-plugin/pom.xml
+++ b/jetty-maven-plugin/pom.xml
@@ -2,7 +2,7 @@
org.eclipse.jettyjetty-project
- 9.4.29-SNAPSHOT
+ 9.4.29.v202005214.0.0jetty-maven-plugin
diff --git a/jetty-memcached/jetty-memcached-sessions/pom.xml b/jetty-memcached/jetty-memcached-sessions/pom.xml
index 270f026712a..74e2b10d10c 100644
--- a/jetty-memcached/jetty-memcached-sessions/pom.xml
+++ b/jetty-memcached/jetty-memcached-sessions/pom.xml
@@ -3,7 +3,7 @@
org.eclipse.jetty.memcachedmemcached-parent
- 9.4.29-SNAPSHOT
+ 9.4.29.v202005214.0.0
diff --git a/jetty-memcached/pom.xml b/jetty-memcached/pom.xml
index e96cf2d6061..a2ed70b2435 100644
--- a/jetty-memcached/pom.xml
+++ b/jetty-memcached/pom.xml
@@ -3,7 +3,7 @@
jetty-projectorg.eclipse.jetty
- 9.4.29-SNAPSHOT
+ 9.4.29.v202005214.0.0
diff --git a/jetty-nosql/pom.xml b/jetty-nosql/pom.xml
index 8b6c28b4465..15504b4d1d9 100644
--- a/jetty-nosql/pom.xml
+++ b/jetty-nosql/pom.xml
@@ -2,7 +2,7 @@
org.eclipse.jettyjetty-project
- 9.4.29-SNAPSHOT
+ 9.4.29.v202005214.0.0jetty-nosql
diff --git a/jetty-openid/pom.xml b/jetty-openid/pom.xml
index 32f4dda6715..4f9c95e5683 100644
--- a/jetty-openid/pom.xml
+++ b/jetty-openid/pom.xml
@@ -2,7 +2,7 @@
org.eclipse.jettyjetty-project
- 9.4.29-SNAPSHOT
+ 9.4.29.v202005214.0.0
diff --git a/jetty-osgi/jetty-osgi-alpn/pom.xml b/jetty-osgi/jetty-osgi-alpn/pom.xml
index 921e25a3a70..6cef6fc11aa 100644
--- a/jetty-osgi/jetty-osgi-alpn/pom.xml
+++ b/jetty-osgi/jetty-osgi-alpn/pom.xml
@@ -2,7 +2,7 @@
org.eclipse.jetty.osgijetty-osgi-project
- 9.4.29-SNAPSHOT
+ 9.4.29.v202005214.0.0jetty-osgi-alpn
diff --git a/jetty-osgi/jetty-osgi-boot-jsp/pom.xml b/jetty-osgi/jetty-osgi-boot-jsp/pom.xml
index f9214dab3b1..8744773dc2f 100644
--- a/jetty-osgi/jetty-osgi-boot-jsp/pom.xml
+++ b/jetty-osgi/jetty-osgi-boot-jsp/pom.xml
@@ -2,7 +2,7 @@
org.eclipse.jetty.osgijetty-osgi-project
- 9.4.29-SNAPSHOT
+ 9.4.29.v202005214.0.0jetty-osgi-boot-jsp
diff --git a/jetty-osgi/jetty-osgi-boot-warurl/pom.xml b/jetty-osgi/jetty-osgi-boot-warurl/pom.xml
index ba3721467c0..fd55cc944d5 100644
--- a/jetty-osgi/jetty-osgi-boot-warurl/pom.xml
+++ b/jetty-osgi/jetty-osgi-boot-warurl/pom.xml
@@ -2,7 +2,7 @@
org.eclipse.jetty.osgijetty-osgi-project
- 9.4.29-SNAPSHOT
+ 9.4.29.v20200521../pom.xml4.0.0
diff --git a/jetty-osgi/jetty-osgi-boot/pom.xml b/jetty-osgi/jetty-osgi-boot/pom.xml
index e31b62d64d7..bce0accc623 100644
--- a/jetty-osgi/jetty-osgi-boot/pom.xml
+++ b/jetty-osgi/jetty-osgi-boot/pom.xml
@@ -2,7 +2,7 @@
org.eclipse.jetty.osgijetty-osgi-project
- 9.4.29-SNAPSHOT
+ 9.4.29.v202005214.0.0jetty-osgi-boot
diff --git a/jetty-osgi/jetty-osgi-httpservice/pom.xml b/jetty-osgi/jetty-osgi-httpservice/pom.xml
index 4d20c4f092a..dd763ba3568 100644
--- a/jetty-osgi/jetty-osgi-httpservice/pom.xml
+++ b/jetty-osgi/jetty-osgi-httpservice/pom.xml
@@ -2,7 +2,7 @@
org.eclipse.jetty.osgijetty-osgi-project
- 9.4.29-SNAPSHOT
+ 9.4.29.v202005214.0.0jetty-httpservice
diff --git a/jetty-osgi/pom.xml b/jetty-osgi/pom.xml
index eade9567f7e..4492f1321f6 100644
--- a/jetty-osgi/pom.xml
+++ b/jetty-osgi/pom.xml
@@ -2,7 +2,7 @@
org.eclipse.jettyjetty-project
- 9.4.29-SNAPSHOT
+ 9.4.29.v202005214.0.0
diff --git a/jetty-osgi/test-jetty-osgi-context/pom.xml b/jetty-osgi/test-jetty-osgi-context/pom.xml
index 5cc2e8d5fea..6ad1567e934 100644
--- a/jetty-osgi/test-jetty-osgi-context/pom.xml
+++ b/jetty-osgi/test-jetty-osgi-context/pom.xml
@@ -2,7 +2,7 @@
org.eclipse.jetty.osgijetty-osgi-project
- 9.4.29-SNAPSHOT
+ 9.4.29.v202005214.0.0test-jetty-osgi-context
diff --git a/jetty-osgi/test-jetty-osgi-fragment/pom.xml b/jetty-osgi/test-jetty-osgi-fragment/pom.xml
index ff6c269a776..ce7125e8387 100644
--- a/jetty-osgi/test-jetty-osgi-fragment/pom.xml
+++ b/jetty-osgi/test-jetty-osgi-fragment/pom.xml
@@ -2,7 +2,7 @@
org.eclipse.jetty.osgijetty-osgi-project
- 9.4.29-SNAPSHOT
+ 9.4.29.v20200521../pom.xml4.0.0
diff --git a/jetty-osgi/test-jetty-osgi-server/pom.xml b/jetty-osgi/test-jetty-osgi-server/pom.xml
index 1ca62e2f40f..56cc7c511d0 100644
--- a/jetty-osgi/test-jetty-osgi-server/pom.xml
+++ b/jetty-osgi/test-jetty-osgi-server/pom.xml
@@ -2,7 +2,7 @@
org.eclipse.jetty.osgijetty-osgi-project
- 9.4.29-SNAPSHOT
+ 9.4.29.v202005214.0.0test-jetty-osgi-server
diff --git a/jetty-osgi/test-jetty-osgi-webapp/pom.xml b/jetty-osgi/test-jetty-osgi-webapp/pom.xml
index a2c965a77a2..582bb496d37 100644
--- a/jetty-osgi/test-jetty-osgi-webapp/pom.xml
+++ b/jetty-osgi/test-jetty-osgi-webapp/pom.xml
@@ -2,7 +2,7 @@
org.eclipse.jetty.osgijetty-osgi-project
- 9.4.29-SNAPSHOT
+ 9.4.29.v20200521../pom.xml4.0.0
diff --git a/jetty-osgi/test-jetty-osgi/pom.xml b/jetty-osgi/test-jetty-osgi/pom.xml
index 4bfcd4ea4f8..2b5dc1438c0 100644
--- a/jetty-osgi/test-jetty-osgi/pom.xml
+++ b/jetty-osgi/test-jetty-osgi/pom.xml
@@ -2,7 +2,7 @@
org.eclipse.jetty.osgijetty-osgi-project
- 9.4.29-SNAPSHOT
+ 9.4.29.v20200521../pom.xml4.0.0
diff --git a/jetty-plus/pom.xml b/jetty-plus/pom.xml
index 40959c65258..aa2283f5580 100644
--- a/jetty-plus/pom.xml
+++ b/jetty-plus/pom.xml
@@ -2,7 +2,7 @@
org.eclipse.jettyjetty-project
- 9.4.29-SNAPSHOT
+ 9.4.29.v202005214.0.0jetty-plus
diff --git a/jetty-proxy/pom.xml b/jetty-proxy/pom.xml
index 43cc78553d8..b2d3a2f10bb 100644
--- a/jetty-proxy/pom.xml
+++ b/jetty-proxy/pom.xml
@@ -2,7 +2,7 @@
org.eclipse.jettyjetty-project
- 9.4.29-SNAPSHOT
+ 9.4.29.v202005214.0.0jetty-proxy
diff --git a/jetty-quickstart/pom.xml b/jetty-quickstart/pom.xml
index 8b9619227d0..a4af19179ba 100644
--- a/jetty-quickstart/pom.xml
+++ b/jetty-quickstart/pom.xml
@@ -2,7 +2,7 @@
org.eclipse.jettyjetty-project
- 9.4.29-SNAPSHOT
+ 9.4.29.v202005214.0.0org.eclipse.jetty
diff --git a/jetty-rewrite/pom.xml b/jetty-rewrite/pom.xml
index 2d9265edf06..d51e608017b 100644
--- a/jetty-rewrite/pom.xml
+++ b/jetty-rewrite/pom.xml
@@ -2,7 +2,7 @@
org.eclipse.jettyjetty-project
- 9.4.29-SNAPSHOT
+ 9.4.29.v202005214.0.0jetty-rewrite
diff --git a/jetty-runner/pom.xml b/jetty-runner/pom.xml
index 4bd67315249..68087d1dee4 100644
--- a/jetty-runner/pom.xml
+++ b/jetty-runner/pom.xml
@@ -2,7 +2,7 @@
org.eclipse.jettyjetty-project
- 9.4.29-SNAPSHOT
+ 9.4.29.v202005214.0.0jetty-runner
diff --git a/jetty-security/pom.xml b/jetty-security/pom.xml
index 8a74827cb50..9f7e054a745 100644
--- a/jetty-security/pom.xml
+++ b/jetty-security/pom.xml
@@ -2,7 +2,7 @@
org.eclipse.jettyjetty-project
- 9.4.29-SNAPSHOT
+ 9.4.29.v202005214.0.0jetty-security
diff --git a/jetty-server/pom.xml b/jetty-server/pom.xml
index 8e549a01400..cde53f550cf 100644
--- a/jetty-server/pom.xml
+++ b/jetty-server/pom.xml
@@ -2,7 +2,7 @@
org.eclipse.jettyjetty-project
- 9.4.29-SNAPSHOT
+ 9.4.29.v202005214.0.0jetty-server
diff --git a/jetty-servlet/pom.xml b/jetty-servlet/pom.xml
index 54eee174c55..5ee46f24f08 100644
--- a/jetty-servlet/pom.xml
+++ b/jetty-servlet/pom.xml
@@ -3,7 +3,7 @@
jetty-projectorg.eclipse.jetty
- 9.4.29-SNAPSHOT
+ 9.4.29.v202005214.0.0jetty-servlet
diff --git a/jetty-servlets/pom.xml b/jetty-servlets/pom.xml
index 4a97a896d45..55b095ec4cb 100644
--- a/jetty-servlets/pom.xml
+++ b/jetty-servlets/pom.xml
@@ -3,7 +3,7 @@
jetty-projectorg.eclipse.jetty
- 9.4.29-SNAPSHOT
+ 9.4.29.v202005214.0.0jetty-servlets
diff --git a/jetty-spring/pom.xml b/jetty-spring/pom.xml
index 6bbbbfb8752..050098239eb 100644
--- a/jetty-spring/pom.xml
+++ b/jetty-spring/pom.xml
@@ -2,7 +2,7 @@
org.eclipse.jettyjetty-project
- 9.4.29-SNAPSHOT
+ 9.4.29.v202005214.0.0jetty-spring
diff --git a/jetty-start/pom.xml b/jetty-start/pom.xml
index e4f9c8adda1..9c34bcd1078 100644
--- a/jetty-start/pom.xml
+++ b/jetty-start/pom.xml
@@ -2,7 +2,7 @@
org.eclipse.jettyjetty-project
- 9.4.29-SNAPSHOT
+ 9.4.29.v202005214.0.0jetty-start
diff --git a/jetty-unixsocket/pom.xml b/jetty-unixsocket/pom.xml
index 5f7bfe1722d..1cc142a97cf 100644
--- a/jetty-unixsocket/pom.xml
+++ b/jetty-unixsocket/pom.xml
@@ -2,7 +2,7 @@
org.eclipse.jettyjetty-project
- 9.4.29-SNAPSHOT
+ 9.4.29.v202005214.0.0jetty-unixsocket
diff --git a/jetty-util-ajax/pom.xml b/jetty-util-ajax/pom.xml
index bb793877902..53bdcca695e 100644
--- a/jetty-util-ajax/pom.xml
+++ b/jetty-util-ajax/pom.xml
@@ -2,7 +2,7 @@
org.eclipse.jettyjetty-project
- 9.4.29-SNAPSHOT
+ 9.4.29.v202005214.0.0jetty-util-ajax
diff --git a/jetty-util/pom.xml b/jetty-util/pom.xml
index 8c4eed9715e..cf98fb8566b 100644
--- a/jetty-util/pom.xml
+++ b/jetty-util/pom.xml
@@ -2,7 +2,7 @@
org.eclipse.jettyjetty-project
- 9.4.29-SNAPSHOT
+ 9.4.29.v202005214.0.0jetty-util
diff --git a/jetty-webapp/pom.xml b/jetty-webapp/pom.xml
index f405910ae23..275c5febb47 100644
--- a/jetty-webapp/pom.xml
+++ b/jetty-webapp/pom.xml
@@ -2,7 +2,7 @@
org.eclipse.jettyjetty-project
- 9.4.29-SNAPSHOT
+ 9.4.29.v202005214.0.0jetty-webapp
diff --git a/jetty-websocket/javax-websocket-client-impl/pom.xml b/jetty-websocket/javax-websocket-client-impl/pom.xml
index 045ef095e7b..b7df9e27860 100644
--- a/jetty-websocket/javax-websocket-client-impl/pom.xml
+++ b/jetty-websocket/javax-websocket-client-impl/pom.xml
@@ -3,7 +3,7 @@
org.eclipse.jetty.websocketwebsocket-parent
- 9.4.29-SNAPSHOT
+ 9.4.29.v202005214.0.0
diff --git a/jetty-websocket/javax-websocket-server-impl/pom.xml b/jetty-websocket/javax-websocket-server-impl/pom.xml
index abeb0bc434e..42b3700471c 100644
--- a/jetty-websocket/javax-websocket-server-impl/pom.xml
+++ b/jetty-websocket/javax-websocket-server-impl/pom.xml
@@ -3,7 +3,7 @@
org.eclipse.jetty.websocketwebsocket-parent
- 9.4.29-SNAPSHOT
+ 9.4.29.v202005214.0.0
diff --git a/jetty-websocket/jetty-websocket-tests/pom.xml b/jetty-websocket/jetty-websocket-tests/pom.xml
index ac4e5befd7b..cf211116780 100644
--- a/jetty-websocket/jetty-websocket-tests/pom.xml
+++ b/jetty-websocket/jetty-websocket-tests/pom.xml
@@ -3,7 +3,7 @@
org.eclipse.jetty.websocketwebsocket-parent
- 9.4.29-SNAPSHOT
+ 9.4.29.v202005214.0.0
diff --git a/jetty-websocket/pom.xml b/jetty-websocket/pom.xml
index 1215318c6c7..d64de08be04 100644
--- a/jetty-websocket/pom.xml
+++ b/jetty-websocket/pom.xml
@@ -3,7 +3,7 @@
jetty-projectorg.eclipse.jetty
- 9.4.29-SNAPSHOT
+ 9.4.29.v202005214.0.0
diff --git a/jetty-websocket/websocket-api/pom.xml b/jetty-websocket/websocket-api/pom.xml
index 975d700d283..1917cc3671e 100644
--- a/jetty-websocket/websocket-api/pom.xml
+++ b/jetty-websocket/websocket-api/pom.xml
@@ -3,7 +3,7 @@
org.eclipse.jetty.websocketwebsocket-parent
- 9.4.29-SNAPSHOT
+ 9.4.29.v202005214.0.0
diff --git a/jetty-websocket/websocket-client/pom.xml b/jetty-websocket/websocket-client/pom.xml
index a5c7894f114..0339ce5e92d 100644
--- a/jetty-websocket/websocket-client/pom.xml
+++ b/jetty-websocket/websocket-client/pom.xml
@@ -3,7 +3,7 @@
org.eclipse.jetty.websocketwebsocket-parent
- 9.4.29-SNAPSHOT
+ 9.4.29.v202005214.0.0
diff --git a/jetty-websocket/websocket-common/pom.xml b/jetty-websocket/websocket-common/pom.xml
index ced91037eab..a8225873a0b 100644
--- a/jetty-websocket/websocket-common/pom.xml
+++ b/jetty-websocket/websocket-common/pom.xml
@@ -3,7 +3,7 @@
org.eclipse.jetty.websocketwebsocket-parent
- 9.4.29-SNAPSHOT
+ 9.4.29.v202005214.0.0
diff --git a/jetty-websocket/websocket-server/pom.xml b/jetty-websocket/websocket-server/pom.xml
index 48ec0c302cc..fc81d4f36f3 100644
--- a/jetty-websocket/websocket-server/pom.xml
+++ b/jetty-websocket/websocket-server/pom.xml
@@ -3,7 +3,7 @@
org.eclipse.jetty.websocketwebsocket-parent
- 9.4.29-SNAPSHOT
+ 9.4.29.v202005214.0.0
diff --git a/jetty-websocket/websocket-servlet/pom.xml b/jetty-websocket/websocket-servlet/pom.xml
index 52759d5c128..a2bea8efcf4 100644
--- a/jetty-websocket/websocket-servlet/pom.xml
+++ b/jetty-websocket/websocket-servlet/pom.xml
@@ -3,7 +3,7 @@
org.eclipse.jetty.websocketwebsocket-parent
- 9.4.29-SNAPSHOT
+ 9.4.29.v202005214.0.0
diff --git a/jetty-xml/pom.xml b/jetty-xml/pom.xml
index 5c1653c42cd..405b0843332 100644
--- a/jetty-xml/pom.xml
+++ b/jetty-xml/pom.xml
@@ -2,7 +2,7 @@
org.eclipse.jettyjetty-project
- 9.4.29-SNAPSHOT
+ 9.4.29.v202005214.0.0jetty-xml
diff --git a/pom.xml b/pom.xml
index b8986db6a86..b7d0a991c73 100644
--- a/pom.xml
+++ b/pom.xml
@@ -4,7 +4,7 @@
4.0.0org.eclipse.jettyjetty-project
- 9.4.29-SNAPSHOT
+ 9.4.29.v20200521Jetty :: ProjectThe Eclipse Jetty Projectpom
diff --git a/tests/pom.xml b/tests/pom.xml
index c13d4db6ea4..2c399a0c77e 100644
--- a/tests/pom.xml
+++ b/tests/pom.xml
@@ -4,7 +4,7 @@
org.eclipse.jettyjetty-project
- 9.4.29-SNAPSHOT
+ 9.4.29.v20200521../pom.xmlorg.eclipse.jetty.tests
diff --git a/tests/test-continuation/pom.xml b/tests/test-continuation/pom.xml
index 1494e53b224..384786bac12 100644
--- a/tests/test-continuation/pom.xml
+++ b/tests/test-continuation/pom.xml
@@ -3,7 +3,7 @@
org.eclipse.jetty.teststests-parent
- 9.4.29-SNAPSHOT
+ 9.4.29.v20200521../pom.xml4.0.0
diff --git a/tests/test-distribution/pom.xml b/tests/test-distribution/pom.xml
index 85d592e07c6..1bbcd8b131c 100644
--- a/tests/test-distribution/pom.xml
+++ b/tests/test-distribution/pom.xml
@@ -2,7 +2,7 @@
tests-parentorg.eclipse.jetty.tests
- 9.4.29-SNAPSHOT
+ 9.4.29.v202005214.0.0
diff --git a/tests/test-http-client-transport/pom.xml b/tests/test-http-client-transport/pom.xml
index 55fc990bddc..2d2acd0842e 100644
--- a/tests/test-http-client-transport/pom.xml
+++ b/tests/test-http-client-transport/pom.xml
@@ -3,7 +3,7 @@
org.eclipse.jetty.teststests-parent
- 9.4.29-SNAPSHOT
+ 9.4.29.v202005214.0.0
diff --git a/tests/test-integration/pom.xml b/tests/test-integration/pom.xml
index 6a1feabddbc..6dc699bae03 100644
--- a/tests/test-integration/pom.xml
+++ b/tests/test-integration/pom.xml
@@ -3,7 +3,7 @@
org.eclipse.jetty.teststests-parent
- 9.4.29-SNAPSHOT
+ 9.4.29.v202005214.0.0test-integration
diff --git a/tests/test-jmx/jmx-webapp-it/pom.xml b/tests/test-jmx/jmx-webapp-it/pom.xml
index 5046fcdde62..918bae001ef 100644
--- a/tests/test-jmx/jmx-webapp-it/pom.xml
+++ b/tests/test-jmx/jmx-webapp-it/pom.xml
@@ -3,7 +3,7 @@
org.eclipse.jetty.teststest-jmx-parent
- 9.4.29-SNAPSHOT
+ 9.4.29.v202005214.0.0jmx-webapp-it
diff --git a/tests/test-jmx/jmx-webapp/pom.xml b/tests/test-jmx/jmx-webapp/pom.xml
index 01c5fdc2fe0..2f0f3d49346 100644
--- a/tests/test-jmx/jmx-webapp/pom.xml
+++ b/tests/test-jmx/jmx-webapp/pom.xml
@@ -4,7 +4,7 @@
org.eclipse.jetty.teststest-jmx-parent
- 9.4.29-SNAPSHOT
+ 9.4.29.v20200521jmx-webappwar
diff --git a/tests/test-jmx/pom.xml b/tests/test-jmx/pom.xml
index 0604c93a4c9..33a2fab6a66 100644
--- a/tests/test-jmx/pom.xml
+++ b/tests/test-jmx/pom.xml
@@ -3,7 +3,7 @@
org.eclipse.jetty.teststests-parent
- 9.4.29-SNAPSHOT
+ 9.4.29.v202005214.0.0test-jmx-parent
diff --git a/tests/test-loginservice/pom.xml b/tests/test-loginservice/pom.xml
index e64495991a7..4cf3f85e9e5 100644
--- a/tests/test-loginservice/pom.xml
+++ b/tests/test-loginservice/pom.xml
@@ -4,7 +4,7 @@
org.eclipse.jetty.teststests-parent
- 9.4.29-SNAPSHOT
+ 9.4.29.v20200521test-loginserviceJetty Tests :: Login Service
diff --git a/tests/test-quickstart/pom.xml b/tests/test-quickstart/pom.xml
index a748977848b..3e4cfbfd78c 100644
--- a/tests/test-quickstart/pom.xml
+++ b/tests/test-quickstart/pom.xml
@@ -3,7 +3,7 @@
org.eclipse.jetty.teststests-parent
- 9.4.29-SNAPSHOT
+ 9.4.29.v20200521../pom.xml4.0.0
diff --git a/tests/test-sessions/pom.xml b/tests/test-sessions/pom.xml
index 0ca22dcd1c2..e2a353c045d 100644
--- a/tests/test-sessions/pom.xml
+++ b/tests/test-sessions/pom.xml
@@ -4,7 +4,7 @@
org.eclipse.jetty.teststests-parent
- 9.4.29-SNAPSHOT
+ 9.4.29.v20200521test-sessions-parentJetty Tests :: Sessions :: Parent
diff --git a/tests/test-sessions/test-file-sessions/pom.xml b/tests/test-sessions/test-file-sessions/pom.xml
index b828eb93c93..febc24f80b3 100644
--- a/tests/test-sessions/test-file-sessions/pom.xml
+++ b/tests/test-sessions/test-file-sessions/pom.xml
@@ -4,7 +4,7 @@
org.eclipse.jetty.teststest-sessions-parent
- 9.4.29-SNAPSHOT
+ 9.4.29.v20200521test-file-sessionsJetty Tests :: Sessions :: File
diff --git a/tests/test-sessions/test-gcloud-sessions/pom.xml b/tests/test-sessions/test-gcloud-sessions/pom.xml
index ae19f2de755..e740ea941b6 100644
--- a/tests/test-sessions/test-gcloud-sessions/pom.xml
+++ b/tests/test-sessions/test-gcloud-sessions/pom.xml
@@ -4,7 +4,7 @@
org.eclipse.jetty.teststest-sessions-parent
- 9.4.29-SNAPSHOT
+ 9.4.29.v20200521test-gcloud-sessionsJetty Tests :: Sessions :: GCloud
diff --git a/tests/test-sessions/test-hazelcast-sessions/pom.xml b/tests/test-sessions/test-hazelcast-sessions/pom.xml
index 56db185935a..a4164dc4f62 100644
--- a/tests/test-sessions/test-hazelcast-sessions/pom.xml
+++ b/tests/test-sessions/test-hazelcast-sessions/pom.xml
@@ -4,7 +4,7 @@
org.eclipse.jetty.teststest-sessions-parent
- 9.4.29-SNAPSHOT
+ 9.4.29.v20200521test-hazelcast-sessionsJetty Tests :: Sessions :: Hazelcast
diff --git a/tests/test-sessions/test-infinispan-sessions/pom.xml b/tests/test-sessions/test-infinispan-sessions/pom.xml
index ba31c16285f..f42af52e40c 100644
--- a/tests/test-sessions/test-infinispan-sessions/pom.xml
+++ b/tests/test-sessions/test-infinispan-sessions/pom.xml
@@ -4,7 +4,7 @@
org.eclipse.jetty.teststest-sessions-parent
- 9.4.29-SNAPSHOT
+ 9.4.29.v20200521test-infinispan-sessionsJetty Tests :: Sessions :: Infinispan
diff --git a/tests/test-sessions/test-jdbc-sessions/pom.xml b/tests/test-sessions/test-jdbc-sessions/pom.xml
index 1b60ce85229..fe2c887e8d4 100644
--- a/tests/test-sessions/test-jdbc-sessions/pom.xml
+++ b/tests/test-sessions/test-jdbc-sessions/pom.xml
@@ -4,7 +4,7 @@
org.eclipse.jetty.teststest-sessions-parent
- 9.4.29-SNAPSHOT
+ 9.4.29.v20200521test-jdbc-sessionsJetty Tests :: Sessions :: JDBC
diff --git a/tests/test-sessions/test-memcached-sessions/pom.xml b/tests/test-sessions/test-memcached-sessions/pom.xml
index 2a691adc0f6..f8964fce9b3 100644
--- a/tests/test-sessions/test-memcached-sessions/pom.xml
+++ b/tests/test-sessions/test-memcached-sessions/pom.xml
@@ -4,7 +4,7 @@
org.eclipse.jetty.teststest-sessions-parent
- 9.4.29-SNAPSHOT
+ 9.4.29.v20200521test-memcached-sessionsJetty Tests :: Sessions :: Memcached
diff --git a/tests/test-sessions/test-mongodb-sessions/pom.xml b/tests/test-sessions/test-mongodb-sessions/pom.xml
index ade0d5a343b..9bacbc7d259 100644
--- a/tests/test-sessions/test-mongodb-sessions/pom.xml
+++ b/tests/test-sessions/test-mongodb-sessions/pom.xml
@@ -4,7 +4,7 @@
org.eclipse.jetty.teststest-sessions-parent
- 9.4.29-SNAPSHOT
+ 9.4.29.v20200521test-mongodb-sessionsJetty Tests :: Sessions :: Mongo
diff --git a/tests/test-sessions/test-sessions-common/pom.xml b/tests/test-sessions/test-sessions-common/pom.xml
index aa45c63cc2a..a534e5df8ee 100644
--- a/tests/test-sessions/test-sessions-common/pom.xml
+++ b/tests/test-sessions/test-sessions-common/pom.xml
@@ -4,7 +4,7 @@
org.eclipse.jetty.teststest-sessions-parent
- 9.4.29-SNAPSHOT
+ 9.4.29.v20200521test-sessions-commonJetty Tests :: Sessions :: Common
diff --git a/tests/test-webapps/pom.xml b/tests/test-webapps/pom.xml
index e69c4c8566a..4bb674b1469 100644
--- a/tests/test-webapps/pom.xml
+++ b/tests/test-webapps/pom.xml
@@ -4,7 +4,7 @@
org.eclipse.jetty.teststests-parent
- 9.4.29-SNAPSHOT
+ 9.4.29.v20200521../pom.xmltest-webapps-parent
diff --git a/tests/test-webapps/test-cdi-common-webapp/pom.xml b/tests/test-webapps/test-cdi-common-webapp/pom.xml
index 7a10f068c71..be0ad0aeae3 100644
--- a/tests/test-webapps/test-cdi-common-webapp/pom.xml
+++ b/tests/test-webapps/test-cdi-common-webapp/pom.xml
@@ -3,7 +3,7 @@
org.eclipse.jetty.teststest-webapps-parent
- 9.4.29-SNAPSHOT
+ 9.4.29.v202005214.0.0
diff --git a/tests/test-webapps/test-felix-webapp/pom.xml b/tests/test-webapps/test-felix-webapp/pom.xml
index e170509eff9..ed58abb0fbe 100644
--- a/tests/test-webapps/test-felix-webapp/pom.xml
+++ b/tests/test-webapps/test-felix-webapp/pom.xml
@@ -3,7 +3,7 @@
org.eclipse.jetty.teststest-webapps-parent
- 9.4.29-SNAPSHOT
+ 9.4.29.v202005214.0.0
diff --git a/tests/test-webapps/test-http2-webapp/pom.xml b/tests/test-webapps/test-http2-webapp/pom.xml
index a7e2a1c358c..a3b84d89b4f 100644
--- a/tests/test-webapps/test-http2-webapp/pom.xml
+++ b/tests/test-webapps/test-http2-webapp/pom.xml
@@ -3,7 +3,7 @@
org.eclipse.jetty.teststest-webapps-parent
- 9.4.29-SNAPSHOT
+ 9.4.29.v202005214.0.0
diff --git a/tests/test-webapps/test-jaas-webapp/pom.xml b/tests/test-webapps/test-jaas-webapp/pom.xml
index 82adc28bbfc..d6f2251b982 100644
--- a/tests/test-webapps/test-jaas-webapp/pom.xml
+++ b/tests/test-webapps/test-jaas-webapp/pom.xml
@@ -4,7 +4,7 @@
org.eclipse.jetty.teststest-webapps-parent
- 9.4.29-SNAPSHOT
+ 9.4.29.v20200521test-jaas-webappJetty Tests :: WebApp :: JAAS
diff --git a/tests/test-webapps/test-jetty-webapp/pom.xml b/tests/test-webapps/test-jetty-webapp/pom.xml
index e37b5b22de6..c7383f610fd 100644
--- a/tests/test-webapps/test-jetty-webapp/pom.xml
+++ b/tests/test-webapps/test-jetty-webapp/pom.xml
@@ -3,7 +3,7 @@
org.eclipse.jetty.teststest-webapps-parent
- 9.4.29-SNAPSHOT
+ 9.4.29.v20200521../pom.xml4.0.0
diff --git a/tests/test-webapps/test-jndi-webapp/pom.xml b/tests/test-webapps/test-jndi-webapp/pom.xml
index 07c04f866e9..848eae6c11e 100644
--- a/tests/test-webapps/test-jndi-webapp/pom.xml
+++ b/tests/test-webapps/test-jndi-webapp/pom.xml
@@ -4,7 +4,7 @@
org.eclipse.jetty.teststest-webapps-parent
- 9.4.29-SNAPSHOT
+ 9.4.29.v20200521test-jndi-webappJetty Tests :: WebApp :: JNDI
diff --git a/tests/test-webapps/test-mock-resources/pom.xml b/tests/test-webapps/test-mock-resources/pom.xml
index 0607935a35f..c9db8291d53 100644
--- a/tests/test-webapps/test-mock-resources/pom.xml
+++ b/tests/test-webapps/test-mock-resources/pom.xml
@@ -3,7 +3,7 @@
org.eclipse.jetty.teststest-webapps-parent
- 9.4.29-SNAPSHOT
+ 9.4.29.v20200521Jetty Tests :: WebApp :: Mock Resourcestest-mock-resources
diff --git a/tests/test-webapps/test-owb-cdi-webapp/pom.xml b/tests/test-webapps/test-owb-cdi-webapp/pom.xml
index a673347d33e..c6819695b22 100644
--- a/tests/test-webapps/test-owb-cdi-webapp/pom.xml
+++ b/tests/test-webapps/test-owb-cdi-webapp/pom.xml
@@ -3,7 +3,7 @@
org.eclipse.jetty.teststest-webapps-parent
- 9.4.29-SNAPSHOT
+ 9.4.29.v202005214.0.0
diff --git a/tests/test-webapps/test-proxy-webapp/pom.xml b/tests/test-webapps/test-proxy-webapp/pom.xml
index 884d0b1afab..acae710987a 100644
--- a/tests/test-webapps/test-proxy-webapp/pom.xml
+++ b/tests/test-webapps/test-proxy-webapp/pom.xml
@@ -3,7 +3,7 @@
org.eclipse.jetty.teststest-webapps-parent
- 9.4.29-SNAPSHOT
+ 9.4.29.v20200521../pom.xml4.0.0
diff --git a/tests/test-webapps/test-servlet-spec/pom.xml b/tests/test-webapps/test-servlet-spec/pom.xml
index 2dec350ab6c..1e44e3e3581 100644
--- a/tests/test-webapps/test-servlet-spec/pom.xml
+++ b/tests/test-webapps/test-servlet-spec/pom.xml
@@ -4,7 +4,7 @@
org.eclipse.jetty.teststest-webapps-parent
- 9.4.29-SNAPSHOT
+ 9.4.29.v20200521test-servlet-spec-parentJetty Tests :: Spec Test WebApp :: Parent
diff --git a/tests/test-webapps/test-servlet-spec/test-container-initializer/pom.xml b/tests/test-webapps/test-servlet-spec/test-container-initializer/pom.xml
index efd55e56e25..229b3e9558f 100644
--- a/tests/test-webapps/test-servlet-spec/test-container-initializer/pom.xml
+++ b/tests/test-webapps/test-servlet-spec/test-container-initializer/pom.xml
@@ -3,7 +3,7 @@
org.eclipse.jetty.teststest-servlet-spec-parent
- 9.4.29-SNAPSHOT
+ 9.4.29.v20200521test-container-initializerjar
diff --git a/tests/test-webapps/test-servlet-spec/test-spec-webapp/pom.xml b/tests/test-webapps/test-servlet-spec/test-spec-webapp/pom.xml
index 71aa95c4066..ede32dfcc05 100644
--- a/tests/test-webapps/test-servlet-spec/test-spec-webapp/pom.xml
+++ b/tests/test-webapps/test-servlet-spec/test-spec-webapp/pom.xml
@@ -4,7 +4,7 @@
org.eclipse.jetty.teststest-servlet-spec-parent
- 9.4.29-SNAPSHOT
+ 9.4.29.v20200521Jetty Tests :: Webapps :: Spec Webapptest-spec-webapp
diff --git a/tests/test-webapps/test-servlet-spec/test-web-fragment/pom.xml b/tests/test-webapps/test-servlet-spec/test-web-fragment/pom.xml
index a225644e50c..a5e54b009e7 100644
--- a/tests/test-webapps/test-servlet-spec/test-web-fragment/pom.xml
+++ b/tests/test-webapps/test-servlet-spec/test-web-fragment/pom.xml
@@ -3,7 +3,7 @@
org.eclipse.jetty.teststest-servlet-spec-parent
- 9.4.29-SNAPSHOT
+ 9.4.29.v20200521Jetty Tests :: WebApp :: Servlet Spec :: Fragment Jar
diff --git a/tests/test-webapps/test-simple-webapp/pom.xml b/tests/test-webapps/test-simple-webapp/pom.xml
index ddea1b73710..16289299d84 100644
--- a/tests/test-webapps/test-simple-webapp/pom.xml
+++ b/tests/test-webapps/test-simple-webapp/pom.xml
@@ -4,7 +4,7 @@
org.eclipse.jetty.teststest-webapps-parent
- 9.4.29-SNAPSHOT
+ 9.4.29.v20200521test-simple-webapp
diff --git a/tests/test-webapps/test-webapp-rfc2616/pom.xml b/tests/test-webapps/test-webapp-rfc2616/pom.xml
index 11f24e990bd..3dbc91e7436 100644
--- a/tests/test-webapps/test-webapp-rfc2616/pom.xml
+++ b/tests/test-webapps/test-webapp-rfc2616/pom.xml
@@ -4,7 +4,7 @@
org.eclipse.jetty.teststest-webapps-parent
- 9.4.29-SNAPSHOT
+ 9.4.29.v20200521test-webapp-rfc2616Jetty Tests :: WebApp :: RFC2616
diff --git a/tests/test-webapps/test-weld-cdi-webapp/pom.xml b/tests/test-webapps/test-weld-cdi-webapp/pom.xml
index 32013b4fe89..69164f00955 100644
--- a/tests/test-webapps/test-weld-cdi-webapp/pom.xml
+++ b/tests/test-webapps/test-weld-cdi-webapp/pom.xml
@@ -3,7 +3,7 @@
org.eclipse.jetty.teststest-webapps-parent
- 9.4.29-SNAPSHOT
+ 9.4.29.v202005214.0.0
From 5d6f3e2ddc0832e6107543dfd9858c9c6b0c8d6e Mon Sep 17 00:00:00 2001
From: Joakim Erdfelt
Date: Thu, 21 May 2020 13:42:25 -0500
Subject: [PATCH 59/77] Updating to version 9.4.30-SNAPSHOT
---
VERSION.txt | 2 +
aggregates/jetty-all-compact3/pom.xml | 2 +-
aggregates/jetty-all/pom.xml | 2 +-
apache-jsp/pom.xml | 2 +-
apache-jstl/pom.xml | 2 +-
build-resources/pom.xml | 2 +-
examples/async-rest/async-rest-jar/pom.xml | 2 +-
examples/async-rest/async-rest-webapp/pom.xml | 2 +-
examples/async-rest/pom.xml | 2 +-
examples/embedded/pom.xml | 2 +-
examples/pom.xml | 2 +-
jetty-alpn/jetty-alpn-client/pom.xml | 2 +-
.../jetty-alpn-conscrypt-client/pom.xml | 2 +-
.../jetty-alpn-conscrypt-server/pom.xml | 2 +-
jetty-alpn/jetty-alpn-java-client/pom.xml | 2 +-
jetty-alpn/jetty-alpn-java-server/pom.xml | 2 +-
jetty-alpn/jetty-alpn-openjdk8-client/pom.xml | 2 +-
jetty-alpn/jetty-alpn-openjdk8-server/pom.xml | 2 +-
jetty-alpn/jetty-alpn-server/pom.xml | 2 +-
jetty-alpn/pom.xml | 2 +-
jetty-annotations/pom.xml | 2 +-
jetty-ant/pom.xml | 2 +-
jetty-bom/pom.xml | 134 +++++++++---------
jetty-cdi/pom.xml | 2 +-
jetty-client/pom.xml | 2 +-
jetty-continuation/pom.xml | 2 +-
jetty-deploy/pom.xml | 2 +-
jetty-distribution/pom.xml | 2 +-
jetty-documentation/pom.xml | 2 +-
jetty-fcgi/fcgi-client/pom.xml | 2 +-
jetty-fcgi/fcgi-server/pom.xml | 2 +-
jetty-fcgi/pom.xml | 2 +-
.../jetty-gcloud-session-manager/pom.xml | 2 +-
jetty-gcloud/pom.xml | 2 +-
jetty-hazelcast/pom.xml | 2 +-
jetty-home/pom.xml | 2 +-
jetty-http-spi/pom.xml | 2 +-
jetty-http/pom.xml | 2 +-
jetty-http2/http2-alpn-tests/pom.xml | 2 +-
jetty-http2/http2-client/pom.xml | 2 +-
jetty-http2/http2-common/pom.xml | 2 +-
jetty-http2/http2-hpack/pom.xml | 2 +-
.../http2-http-client-transport/pom.xml | 2 +-
jetty-http2/http2-server/pom.xml | 2 +-
jetty-http2/pom.xml | 2 +-
jetty-infinispan/infinispan-common/pom.xml | 2 +-
.../infinispan-embedded-query/pom.xml | 2 +-
jetty-infinispan/infinispan-embedded/pom.xml | 2 +-
.../infinispan-remote-query/pom.xml | 2 +-
jetty-infinispan/infinispan-remote/pom.xml | 2 +-
jetty-infinispan/pom.xml | 2 +-
jetty-io/pom.xml | 2 +-
jetty-jaas/pom.xml | 2 +-
jetty-jaspi/pom.xml | 2 +-
jetty-jmh/pom.xml | 2 +-
jetty-jmx/pom.xml | 2 +-
jetty-jndi/pom.xml | 2 +-
jetty-jspc-maven-plugin/pom.xml | 2 +-
jetty-maven-plugin/pom.xml | 2 +-
.../jetty-memcached-sessions/pom.xml | 2 +-
jetty-memcached/pom.xml | 2 +-
jetty-nosql/pom.xml | 2 +-
jetty-openid/pom.xml | 2 +-
jetty-osgi/jetty-osgi-alpn/pom.xml | 2 +-
jetty-osgi/jetty-osgi-boot-jsp/pom.xml | 2 +-
jetty-osgi/jetty-osgi-boot-warurl/pom.xml | 2 +-
jetty-osgi/jetty-osgi-boot/pom.xml | 2 +-
jetty-osgi/jetty-osgi-httpservice/pom.xml | 2 +-
jetty-osgi/pom.xml | 2 +-
jetty-osgi/test-jetty-osgi-context/pom.xml | 2 +-
jetty-osgi/test-jetty-osgi-fragment/pom.xml | 2 +-
jetty-osgi/test-jetty-osgi-server/pom.xml | 2 +-
jetty-osgi/test-jetty-osgi-webapp/pom.xml | 2 +-
jetty-osgi/test-jetty-osgi/pom.xml | 2 +-
jetty-plus/pom.xml | 2 +-
jetty-proxy/pom.xml | 2 +-
jetty-quickstart/pom.xml | 2 +-
jetty-rewrite/pom.xml | 2 +-
jetty-runner/pom.xml | 2 +-
jetty-security/pom.xml | 2 +-
jetty-server/pom.xml | 2 +-
jetty-servlet/pom.xml | 2 +-
jetty-servlets/pom.xml | 2 +-
jetty-spring/pom.xml | 2 +-
jetty-start/pom.xml | 2 +-
jetty-unixsocket/pom.xml | 2 +-
jetty-util-ajax/pom.xml | 2 +-
jetty-util/pom.xml | 2 +-
jetty-webapp/pom.xml | 2 +-
.../javax-websocket-client-impl/pom.xml | 2 +-
.../javax-websocket-server-impl/pom.xml | 2 +-
jetty-websocket/jetty-websocket-tests/pom.xml | 2 +-
jetty-websocket/pom.xml | 2 +-
jetty-websocket/websocket-api/pom.xml | 2 +-
jetty-websocket/websocket-client/pom.xml | 2 +-
jetty-websocket/websocket-common/pom.xml | 2 +-
jetty-websocket/websocket-server/pom.xml | 2 +-
jetty-websocket/websocket-servlet/pom.xml | 2 +-
jetty-xml/pom.xml | 2 +-
pom.xml | 2 +-
tests/pom.xml | 2 +-
tests/test-continuation/pom.xml | 2 +-
tests/test-distribution/pom.xml | 2 +-
tests/test-http-client-transport/pom.xml | 2 +-
tests/test-integration/pom.xml | 2 +-
tests/test-jmx/jmx-webapp-it/pom.xml | 2 +-
tests/test-jmx/jmx-webapp/pom.xml | 2 +-
tests/test-jmx/pom.xml | 2 +-
tests/test-loginservice/pom.xml | 2 +-
tests/test-quickstart/pom.xml | 2 +-
tests/test-sessions/pom.xml | 2 +-
.../test-sessions/test-file-sessions/pom.xml | 2 +-
.../test-gcloud-sessions/pom.xml | 2 +-
.../test-hazelcast-sessions/pom.xml | 2 +-
.../test-infinispan-sessions/pom.xml | 2 +-
.../test-sessions/test-jdbc-sessions/pom.xml | 2 +-
.../test-memcached-sessions/pom.xml | 2 +-
.../test-mongodb-sessions/pom.xml | 2 +-
.../test-sessions-common/pom.xml | 2 +-
tests/test-webapps/pom.xml | 2 +-
.../test-cdi-common-webapp/pom.xml | 2 +-
tests/test-webapps/test-felix-webapp/pom.xml | 2 +-
tests/test-webapps/test-http2-webapp/pom.xml | 2 +-
tests/test-webapps/test-jaas-webapp/pom.xml | 2 +-
tests/test-webapps/test-jetty-webapp/pom.xml | 2 +-
tests/test-webapps/test-jndi-webapp/pom.xml | 2 +-
.../test-webapps/test-mock-resources/pom.xml | 2 +-
.../test-webapps/test-owb-cdi-webapp/pom.xml | 2 +-
tests/test-webapps/test-proxy-webapp/pom.xml | 2 +-
tests/test-webapps/test-servlet-spec/pom.xml | 2 +-
.../test-container-initializer/pom.xml | 2 +-
.../test-spec-webapp/pom.xml | 2 +-
.../test-web-fragment/pom.xml | 2 +-
tests/test-webapps/test-simple-webapp/pom.xml | 2 +-
.../test-webapps/test-webapp-rfc2616/pom.xml | 2 +-
.../test-webapps/test-weld-cdi-webapp/pom.xml | 2 +-
136 files changed, 203 insertions(+), 201 deletions(-)
diff --git a/VERSION.txt b/VERSION.txt
index 009f6013f1a..ec0c39fc05d 100644
--- a/VERSION.txt
+++ b/VERSION.txt
@@ -1,3 +1,5 @@
+jetty-9.4.30-SNAPSHOT
+
jetty-9.4.29.v20200521 - 21 May 2020
+ 2188 Lock contention creating HTTP/2 streams
+ 4235 communicate the reason of failure to the OpenID error page
diff --git a/aggregates/jetty-all-compact3/pom.xml b/aggregates/jetty-all-compact3/pom.xml
index 5a27d149698..19627dc1a0a 100644
--- a/aggregates/jetty-all-compact3/pom.xml
+++ b/aggregates/jetty-all-compact3/pom.xml
@@ -2,7 +2,7 @@
org.eclipse.jettyjetty-project
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOT../../pom.xml4.0.0
diff --git a/aggregates/jetty-all/pom.xml b/aggregates/jetty-all/pom.xml
index 1524b48dfc3..a44bf82d2d7 100644
--- a/aggregates/jetty-all/pom.xml
+++ b/aggregates/jetty-all/pom.xml
@@ -2,7 +2,7 @@
org.eclipse.jettyjetty-project
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOT../../pom.xml4.0.0
diff --git a/apache-jsp/pom.xml b/apache-jsp/pom.xml
index 2d75087709a..e67340f0561 100644
--- a/apache-jsp/pom.xml
+++ b/apache-jsp/pom.xml
@@ -2,7 +2,7 @@
org.eclipse.jettyjetty-project
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOT4.0.0apache-jsp
diff --git a/apache-jstl/pom.xml b/apache-jstl/pom.xml
index 295b9f53d9c..ab6f8643902 100644
--- a/apache-jstl/pom.xml
+++ b/apache-jstl/pom.xml
@@ -2,7 +2,7 @@
org.eclipse.jettyjetty-project
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOT4.0.0apache-jstl
diff --git a/build-resources/pom.xml b/build-resources/pom.xml
index 46b88407b79..2c0b4401442 100644
--- a/build-resources/pom.xml
+++ b/build-resources/pom.xml
@@ -2,7 +2,7 @@
4.0.0org.eclipse.jettybuild-resources
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOTjarJetty :: Build Resources
diff --git a/examples/async-rest/async-rest-jar/pom.xml b/examples/async-rest/async-rest-jar/pom.xml
index 288785f42d5..0d8656fcd47 100644
--- a/examples/async-rest/async-rest-jar/pom.xml
+++ b/examples/async-rest/async-rest-jar/pom.xml
@@ -2,7 +2,7 @@
org.eclipse.jettyexample-async-rest
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOT4.0.0
diff --git a/examples/async-rest/async-rest-webapp/pom.xml b/examples/async-rest/async-rest-webapp/pom.xml
index 040aaec8303..531495d6d6f 100644
--- a/examples/async-rest/async-rest-webapp/pom.xml
+++ b/examples/async-rest/async-rest-webapp/pom.xml
@@ -2,7 +2,7 @@
org.eclipse.jettyexample-async-rest
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOT4.0.0
diff --git a/examples/async-rest/pom.xml b/examples/async-rest/pom.xml
index f40892d591d..f90ea27236c 100644
--- a/examples/async-rest/pom.xml
+++ b/examples/async-rest/pom.xml
@@ -2,7 +2,7 @@
org.eclipse.jetty.examplesexamples-parent
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOT4.0.0
diff --git a/examples/embedded/pom.xml b/examples/embedded/pom.xml
index 17734a264f4..c9882987422 100644
--- a/examples/embedded/pom.xml
+++ b/examples/embedded/pom.xml
@@ -2,7 +2,7 @@
org.eclipse.jetty.examplesexamples-parent
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOT../pom.xml4.0.0
diff --git a/examples/pom.xml b/examples/pom.xml
index 8d3fc417bc6..b5985e89716 100644
--- a/examples/pom.xml
+++ b/examples/pom.xml
@@ -3,7 +3,7 @@
org.eclipse.jettyjetty-project
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOT4.0.0
diff --git a/jetty-alpn/jetty-alpn-client/pom.xml b/jetty-alpn/jetty-alpn-client/pom.xml
index bccf8a700db..38192c766fa 100644
--- a/jetty-alpn/jetty-alpn-client/pom.xml
+++ b/jetty-alpn/jetty-alpn-client/pom.xml
@@ -2,7 +2,7 @@
org.eclipse.jettyjetty-alpn-parent
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOT4.0.0jetty-alpn-client
diff --git a/jetty-alpn/jetty-alpn-conscrypt-client/pom.xml b/jetty-alpn/jetty-alpn-conscrypt-client/pom.xml
index daef0477762..ecb9f6e1ea5 100644
--- a/jetty-alpn/jetty-alpn-conscrypt-client/pom.xml
+++ b/jetty-alpn/jetty-alpn-conscrypt-client/pom.xml
@@ -4,7 +4,7 @@
org.eclipse.jettyjetty-alpn-parent
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOT4.0.0
diff --git a/jetty-alpn/jetty-alpn-conscrypt-server/pom.xml b/jetty-alpn/jetty-alpn-conscrypt-server/pom.xml
index 2f395f4d1ed..363ef215ea9 100644
--- a/jetty-alpn/jetty-alpn-conscrypt-server/pom.xml
+++ b/jetty-alpn/jetty-alpn-conscrypt-server/pom.xml
@@ -3,7 +3,7 @@
org.eclipse.jettyjetty-alpn-parent
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOT4.0.0
diff --git a/jetty-alpn/jetty-alpn-java-client/pom.xml b/jetty-alpn/jetty-alpn-java-client/pom.xml
index c790d1ff1ae..bfe7c9adbfb 100644
--- a/jetty-alpn/jetty-alpn-java-client/pom.xml
+++ b/jetty-alpn/jetty-alpn-java-client/pom.xml
@@ -4,7 +4,7 @@
org.eclipse.jettyjetty-alpn-parent
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOT4.0.0
diff --git a/jetty-alpn/jetty-alpn-java-server/pom.xml b/jetty-alpn/jetty-alpn-java-server/pom.xml
index 341d8b1a99a..f86286c2739 100644
--- a/jetty-alpn/jetty-alpn-java-server/pom.xml
+++ b/jetty-alpn/jetty-alpn-java-server/pom.xml
@@ -3,7 +3,7 @@
org.eclipse.jettyjetty-alpn-parent
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOT4.0.0
diff --git a/jetty-alpn/jetty-alpn-openjdk8-client/pom.xml b/jetty-alpn/jetty-alpn-openjdk8-client/pom.xml
index 423ff07e2ab..b96b43e811a 100644
--- a/jetty-alpn/jetty-alpn-openjdk8-client/pom.xml
+++ b/jetty-alpn/jetty-alpn-openjdk8-client/pom.xml
@@ -4,7 +4,7 @@
org.eclipse.jettyjetty-alpn-parent
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOT4.0.0
diff --git a/jetty-alpn/jetty-alpn-openjdk8-server/pom.xml b/jetty-alpn/jetty-alpn-openjdk8-server/pom.xml
index 59e1fdfc687..25b68c8b2df 100644
--- a/jetty-alpn/jetty-alpn-openjdk8-server/pom.xml
+++ b/jetty-alpn/jetty-alpn-openjdk8-server/pom.xml
@@ -3,7 +3,7 @@
org.eclipse.jettyjetty-alpn-parent
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOT4.0.0
diff --git a/jetty-alpn/jetty-alpn-server/pom.xml b/jetty-alpn/jetty-alpn-server/pom.xml
index 268321da26b..8abaae6142d 100644
--- a/jetty-alpn/jetty-alpn-server/pom.xml
+++ b/jetty-alpn/jetty-alpn-server/pom.xml
@@ -2,7 +2,7 @@
org.eclipse.jettyjetty-alpn-parent
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOT4.0.0jetty-alpn-server
diff --git a/jetty-alpn/pom.xml b/jetty-alpn/pom.xml
index dd35154f804..5f64c50f1a2 100644
--- a/jetty-alpn/pom.xml
+++ b/jetty-alpn/pom.xml
@@ -2,7 +2,7 @@
org.eclipse.jettyjetty-project
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOT4.0.0jetty-alpn-parent
diff --git a/jetty-annotations/pom.xml b/jetty-annotations/pom.xml
index 6f0b05fad28..5307e86146c 100644
--- a/jetty-annotations/pom.xml
+++ b/jetty-annotations/pom.xml
@@ -2,7 +2,7 @@
org.eclipse.jettyjetty-project
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOT4.0.0jetty-annotations
diff --git a/jetty-ant/pom.xml b/jetty-ant/pom.xml
index f6cb9787b3f..2c9cc5878c4 100644
--- a/jetty-ant/pom.xml
+++ b/jetty-ant/pom.xml
@@ -2,7 +2,7 @@
org.eclipse.jettyjetty-project
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOT4.0.0jetty-ant
diff --git a/jetty-bom/pom.xml b/jetty-bom/pom.xml
index 24841e21d35..88250c98eef 100644
--- a/jetty-bom/pom.xml
+++ b/jetty-bom/pom.xml
@@ -9,7 +9,7 @@
org.eclipse.jettyjetty-project
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOT
@@ -53,336 +53,336 @@
org.eclipse.jettyapache-jsp
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOTorg.eclipse.jettyapache-jstl
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOTorg.eclipse.jettyjetty-alpn-client
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOTorg.eclipse.jettyjetty-alpn-java-client
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOTorg.eclipse.jettyjetty-alpn-java-server
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOTorg.eclipse.jettyjetty-alpn-openjdk8-client
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOTorg.eclipse.jettyjetty-alpn-openjdk8-server
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOTorg.eclipse.jettyjetty-alpn-conscrypt-client
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOTorg.eclipse.jettyjetty-alpn-conscrypt-server
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOTorg.eclipse.jettyjetty-alpn-server
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOTorg.eclipse.jettyjetty-annotations
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOTorg.eclipse.jettyjetty-ant
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOTorg.eclipse.jettyjetty-client
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOTorg.eclipse.jettyjetty-continuation
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOTorg.eclipse.jettyjetty-deploy
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOTorg.eclipse.jettyjetty-distribution
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOTziporg.eclipse.jettyjetty-distribution
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOTtar.gzorg.eclipse.jetty.fcgifcgi-client
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOTorg.eclipse.jetty.fcgifcgi-server
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOTorg.eclipse.jetty.gcloudjetty-gcloud-session-manager
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOTorg.eclipse.jettyjetty-home
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOTziporg.eclipse.jettyjetty-home
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOTtar.gzorg.eclipse.jettyjetty-http
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOTorg.eclipse.jetty.http2http2-client
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOTorg.eclipse.jetty.http2http2-common
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOTorg.eclipse.jetty.http2http2-hpack
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOTorg.eclipse.jetty.http2http2-http-client-transport
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOTorg.eclipse.jetty.http2http2-server
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOTorg.eclipse.jettyjetty-http-spi
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOTorg.eclipse.jettyinfinispan-common
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOTorg.eclipse.jettyinfinispan-remote-query
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOTorg.eclipse.jettyinfinispan-embedded-query
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOTorg.eclipse.jettyjetty-hazelcast
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOTorg.eclipse.jettyjetty-io
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOTorg.eclipse.jettyjetty-jaas
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOTorg.eclipse.jettyjetty-jaspi
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOTorg.eclipse.jettyjetty-jmx
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOTorg.eclipse.jettyjetty-jndi
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOTorg.eclipse.jetty.memcachedjetty-memcached-sessions
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOTorg.eclipse.jettyjetty-nosql
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOTorg.eclipse.jetty.osgijetty-osgi-boot
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOTorg.eclipse.jetty.osgijetty-osgi-boot-jsp
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOTorg.eclipse.jetty.osgijetty-osgi-boot-warurl
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOTorg.eclipse.jetty.osgijetty-httpservice
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOTorg.eclipse.jettyjetty-plus
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOTorg.eclipse.jettyjetty-proxy
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOTorg.eclipse.jettyjetty-quickstart
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOTorg.eclipse.jettyjetty-rewrite
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOTorg.eclipse.jettyjetty-security
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOTorg.eclipse.jettyjetty-openid
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOTorg.eclipse.jettyjetty-server
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOTorg.eclipse.jettyjetty-servlet
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOTorg.eclipse.jettyjetty-servlets
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOTorg.eclipse.jettyjetty-spring
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOTorg.eclipse.jettyjetty-unixsocket
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOTorg.eclipse.jettyjetty-util
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOTorg.eclipse.jettyjetty-util-ajax
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOTorg.eclipse.jettyjetty-webapp
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOTorg.eclipse.jetty.websocketjavax-websocket-client-impl
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOTorg.eclipse.jetty.websocketjavax-websocket-server-impl
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOTorg.eclipse.jetty.websocketwebsocket-api
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOTorg.eclipse.jetty.websocketwebsocket-client
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOTorg.eclipse.jetty.websocketwebsocket-common
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOTorg.eclipse.jetty.websocketwebsocket-server
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOTorg.eclipse.jetty.websocketwebsocket-servlet
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOTorg.eclipse.jettyjetty-xml
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOT
diff --git a/jetty-cdi/pom.xml b/jetty-cdi/pom.xml
index be078af41ce..5f195a05203 100644
--- a/jetty-cdi/pom.xml
+++ b/jetty-cdi/pom.xml
@@ -2,7 +2,7 @@
org.eclipse.jettyjetty-project
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOT4.0.0org.eclipse.jetty
diff --git a/jetty-client/pom.xml b/jetty-client/pom.xml
index 801de2fc76e..4994894d4e4 100644
--- a/jetty-client/pom.xml
+++ b/jetty-client/pom.xml
@@ -2,7 +2,7 @@
org.eclipse.jettyjetty-project
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOT4.0.0
diff --git a/jetty-continuation/pom.xml b/jetty-continuation/pom.xml
index 9a4b6cc34ae..f7df28c549a 100644
--- a/jetty-continuation/pom.xml
+++ b/jetty-continuation/pom.xml
@@ -2,7 +2,7 @@
org.eclipse.jettyjetty-project
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOT4.0.0jetty-continuation
diff --git a/jetty-deploy/pom.xml b/jetty-deploy/pom.xml
index b70712b0529..ad8277204f0 100644
--- a/jetty-deploy/pom.xml
+++ b/jetty-deploy/pom.xml
@@ -2,7 +2,7 @@
org.eclipse.jettyjetty-project
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOT4.0.0jetty-deploy
diff --git a/jetty-distribution/pom.xml b/jetty-distribution/pom.xml
index 82f2400494d..2c0fc3a9ecd 100644
--- a/jetty-distribution/pom.xml
+++ b/jetty-distribution/pom.xml
@@ -2,7 +2,7 @@
org.eclipse.jettyjetty-project
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOT4.0.0jetty-distribution
diff --git a/jetty-documentation/pom.xml b/jetty-documentation/pom.xml
index 48c07479ec4..949077cc623 100644
--- a/jetty-documentation/pom.xml
+++ b/jetty-documentation/pom.xml
@@ -4,7 +4,7 @@
org.eclipse.jettyjetty-project
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOTjetty-documentationJetty :: Documentation
diff --git a/jetty-fcgi/fcgi-client/pom.xml b/jetty-fcgi/fcgi-client/pom.xml
index a0ccde50b09..6eeba32210b 100644
--- a/jetty-fcgi/fcgi-client/pom.xml
+++ b/jetty-fcgi/fcgi-client/pom.xml
@@ -3,7 +3,7 @@
org.eclipse.jetty.fcgifcgi-parent
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOT4.0.0
diff --git a/jetty-fcgi/fcgi-server/pom.xml b/jetty-fcgi/fcgi-server/pom.xml
index 82e1cd52e70..2c3d43fa56f 100644
--- a/jetty-fcgi/fcgi-server/pom.xml
+++ b/jetty-fcgi/fcgi-server/pom.xml
@@ -3,7 +3,7 @@
org.eclipse.jetty.fcgifcgi-parent
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOT4.0.0
diff --git a/jetty-fcgi/pom.xml b/jetty-fcgi/pom.xml
index 3aa17095190..c7722607f1e 100644
--- a/jetty-fcgi/pom.xml
+++ b/jetty-fcgi/pom.xml
@@ -3,7 +3,7 @@
org.eclipse.jettyjetty-project
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOT4.0.0
diff --git a/jetty-gcloud/jetty-gcloud-session-manager/pom.xml b/jetty-gcloud/jetty-gcloud-session-manager/pom.xml
index 32ff10ac7da..6f06e4603bc 100644
--- a/jetty-gcloud/jetty-gcloud-session-manager/pom.xml
+++ b/jetty-gcloud/jetty-gcloud-session-manager/pom.xml
@@ -3,7 +3,7 @@
org.eclipse.jetty.gcloudgcloud-parent
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOT4.0.0
diff --git a/jetty-gcloud/pom.xml b/jetty-gcloud/pom.xml
index f3132c971e9..22461b9c5e0 100644
--- a/jetty-gcloud/pom.xml
+++ b/jetty-gcloud/pom.xml
@@ -3,7 +3,7 @@
jetty-projectorg.eclipse.jetty
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOT4.0.0
diff --git a/jetty-hazelcast/pom.xml b/jetty-hazelcast/pom.xml
index d00416504c7..a1929600e04 100644
--- a/jetty-hazelcast/pom.xml
+++ b/jetty-hazelcast/pom.xml
@@ -3,7 +3,7 @@
org.eclipse.jettyjetty-project
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOT4.0.0
diff --git a/jetty-home/pom.xml b/jetty-home/pom.xml
index 520e3f1e95f..f6c1602642a 100644
--- a/jetty-home/pom.xml
+++ b/jetty-home/pom.xml
@@ -3,7 +3,7 @@
jetty-projectorg.eclipse.jetty
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOT4.0.0jetty-home
diff --git a/jetty-http-spi/pom.xml b/jetty-http-spi/pom.xml
index 7dd188ad63a..f967c5b06cb 100644
--- a/jetty-http-spi/pom.xml
+++ b/jetty-http-spi/pom.xml
@@ -2,7 +2,7 @@
org.eclipse.jettyjetty-project
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOT4.0.0jetty-http-spi
diff --git a/jetty-http/pom.xml b/jetty-http/pom.xml
index db7ec5c5644..ebd567b29b1 100644
--- a/jetty-http/pom.xml
+++ b/jetty-http/pom.xml
@@ -3,7 +3,7 @@
jetty-projectorg.eclipse.jetty
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOT4.0.0jetty-http
diff --git a/jetty-http2/http2-alpn-tests/pom.xml b/jetty-http2/http2-alpn-tests/pom.xml
index db20cb8218b..b2ab4bc423d 100644
--- a/jetty-http2/http2-alpn-tests/pom.xml
+++ b/jetty-http2/http2-alpn-tests/pom.xml
@@ -3,7 +3,7 @@
org.eclipse.jetty.http2http2-parent
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOT4.0.0
diff --git a/jetty-http2/http2-client/pom.xml b/jetty-http2/http2-client/pom.xml
index bb8ca86c719..f4ada14f09e 100644
--- a/jetty-http2/http2-client/pom.xml
+++ b/jetty-http2/http2-client/pom.xml
@@ -3,7 +3,7 @@
org.eclipse.jetty.http2http2-parent
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOT4.0.0
diff --git a/jetty-http2/http2-common/pom.xml b/jetty-http2/http2-common/pom.xml
index 2a40e987988..01058c481ca 100644
--- a/jetty-http2/http2-common/pom.xml
+++ b/jetty-http2/http2-common/pom.xml
@@ -3,7 +3,7 @@
org.eclipse.jetty.http2http2-parent
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOT4.0.0
diff --git a/jetty-http2/http2-hpack/pom.xml b/jetty-http2/http2-hpack/pom.xml
index 331304ce56b..94de2632c00 100644
--- a/jetty-http2/http2-hpack/pom.xml
+++ b/jetty-http2/http2-hpack/pom.xml
@@ -3,7 +3,7 @@
org.eclipse.jetty.http2http2-parent
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOT4.0.0
diff --git a/jetty-http2/http2-http-client-transport/pom.xml b/jetty-http2/http2-http-client-transport/pom.xml
index 2c82b6989c6..e0c85976e60 100644
--- a/jetty-http2/http2-http-client-transport/pom.xml
+++ b/jetty-http2/http2-http-client-transport/pom.xml
@@ -3,7 +3,7 @@
org.eclipse.jetty.http2http2-parent
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOT4.0.0
diff --git a/jetty-http2/http2-server/pom.xml b/jetty-http2/http2-server/pom.xml
index d94ebad7d88..55226c52499 100644
--- a/jetty-http2/http2-server/pom.xml
+++ b/jetty-http2/http2-server/pom.xml
@@ -3,7 +3,7 @@
org.eclipse.jetty.http2http2-parent
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOT4.0.0
diff --git a/jetty-http2/pom.xml b/jetty-http2/pom.xml
index c1726a2f61b..fc8972c2c68 100644
--- a/jetty-http2/pom.xml
+++ b/jetty-http2/pom.xml
@@ -3,7 +3,7 @@
jetty-projectorg.eclipse.jetty
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOT4.0.0
diff --git a/jetty-infinispan/infinispan-common/pom.xml b/jetty-infinispan/infinispan-common/pom.xml
index aad511097ac..46ec6df09c6 100644
--- a/jetty-infinispan/infinispan-common/pom.xml
+++ b/jetty-infinispan/infinispan-common/pom.xml
@@ -2,7 +2,7 @@
org.eclipse.jettyinfinispan-parent
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOT4.0.0infinispan-common
diff --git a/jetty-infinispan/infinispan-embedded-query/pom.xml b/jetty-infinispan/infinispan-embedded-query/pom.xml
index 587d3364dd4..6c9f367aed1 100644
--- a/jetty-infinispan/infinispan-embedded-query/pom.xml
+++ b/jetty-infinispan/infinispan-embedded-query/pom.xml
@@ -2,7 +2,7 @@
org.eclipse.jettyinfinispan-parent
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOT4.0.0infinispan-embedded-query
diff --git a/jetty-infinispan/infinispan-embedded/pom.xml b/jetty-infinispan/infinispan-embedded/pom.xml
index 04602741f6e..5130dd2f6ef 100644
--- a/jetty-infinispan/infinispan-embedded/pom.xml
+++ b/jetty-infinispan/infinispan-embedded/pom.xml
@@ -2,7 +2,7 @@
org.eclipse.jettyinfinispan-parent
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOT4.0.0infinispan-embedded
diff --git a/jetty-infinispan/infinispan-remote-query/pom.xml b/jetty-infinispan/infinispan-remote-query/pom.xml
index 5d6d55913b4..0003b9c67c4 100644
--- a/jetty-infinispan/infinispan-remote-query/pom.xml
+++ b/jetty-infinispan/infinispan-remote-query/pom.xml
@@ -2,7 +2,7 @@
org.eclipse.jettyinfinispan-parent
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOT4.0.0infinispan-remote-query
diff --git a/jetty-infinispan/infinispan-remote/pom.xml b/jetty-infinispan/infinispan-remote/pom.xml
index f16050564b7..30796a0c9e5 100644
--- a/jetty-infinispan/infinispan-remote/pom.xml
+++ b/jetty-infinispan/infinispan-remote/pom.xml
@@ -2,7 +2,7 @@
org.eclipse.jettyinfinispan-parent
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOT4.0.0infinispan-remote
diff --git a/jetty-infinispan/pom.xml b/jetty-infinispan/pom.xml
index 82db4ae4350..fa12d193a1e 100644
--- a/jetty-infinispan/pom.xml
+++ b/jetty-infinispan/pom.xml
@@ -3,7 +3,7 @@
org.eclipse.jettyjetty-project
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOT4.0.0
diff --git a/jetty-io/pom.xml b/jetty-io/pom.xml
index b8eaed018b3..6228d3a57c0 100644
--- a/jetty-io/pom.xml
+++ b/jetty-io/pom.xml
@@ -3,7 +3,7 @@
jetty-projectorg.eclipse.jetty
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOT4.0.0jetty-io
diff --git a/jetty-jaas/pom.xml b/jetty-jaas/pom.xml
index 72f5c92c068..af4099f1476 100644
--- a/jetty-jaas/pom.xml
+++ b/jetty-jaas/pom.xml
@@ -2,7 +2,7 @@
org.eclipse.jettyjetty-project
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOT4.0.0jetty-jaas
diff --git a/jetty-jaspi/pom.xml b/jetty-jaspi/pom.xml
index e25bd8a11f3..d221e40df71 100644
--- a/jetty-jaspi/pom.xml
+++ b/jetty-jaspi/pom.xml
@@ -2,7 +2,7 @@
org.eclipse.jettyjetty-project
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOT4.0.0
diff --git a/jetty-jmh/pom.xml b/jetty-jmh/pom.xml
index 46f52e8664e..aaf78a8c53b 100644
--- a/jetty-jmh/pom.xml
+++ b/jetty-jmh/pom.xml
@@ -2,7 +2,7 @@
org.eclipse.jettyjetty-project
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOT4.0.0
diff --git a/jetty-jmx/pom.xml b/jetty-jmx/pom.xml
index 2e44b2b53c5..6c16e0b42b8 100644
--- a/jetty-jmx/pom.xml
+++ b/jetty-jmx/pom.xml
@@ -2,7 +2,7 @@
org.eclipse.jettyjetty-project
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOT4.0.0jetty-jmx
diff --git a/jetty-jndi/pom.xml b/jetty-jndi/pom.xml
index 74b8408491f..6cf3c478b65 100644
--- a/jetty-jndi/pom.xml
+++ b/jetty-jndi/pom.xml
@@ -2,7 +2,7 @@
org.eclipse.jettyjetty-project
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOT4.0.0jetty-jndi
diff --git a/jetty-jspc-maven-plugin/pom.xml b/jetty-jspc-maven-plugin/pom.xml
index 8c3cbb29e86..ac255f8fa55 100644
--- a/jetty-jspc-maven-plugin/pom.xml
+++ b/jetty-jspc-maven-plugin/pom.xml
@@ -3,7 +3,7 @@
org.eclipse.jettyjetty-project
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOT4.0.0jetty-jspc-maven-plugin
diff --git a/jetty-maven-plugin/pom.xml b/jetty-maven-plugin/pom.xml
index 55d955a5a99..9c12c55e8a0 100644
--- a/jetty-maven-plugin/pom.xml
+++ b/jetty-maven-plugin/pom.xml
@@ -2,7 +2,7 @@
org.eclipse.jettyjetty-project
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOT4.0.0jetty-maven-plugin
diff --git a/jetty-memcached/jetty-memcached-sessions/pom.xml b/jetty-memcached/jetty-memcached-sessions/pom.xml
index 74e2b10d10c..fef40a31bd1 100644
--- a/jetty-memcached/jetty-memcached-sessions/pom.xml
+++ b/jetty-memcached/jetty-memcached-sessions/pom.xml
@@ -3,7 +3,7 @@
org.eclipse.jetty.memcachedmemcached-parent
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOT4.0.0
diff --git a/jetty-memcached/pom.xml b/jetty-memcached/pom.xml
index a2ed70b2435..83ed94f59b8 100644
--- a/jetty-memcached/pom.xml
+++ b/jetty-memcached/pom.xml
@@ -3,7 +3,7 @@
jetty-projectorg.eclipse.jetty
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOT4.0.0
diff --git a/jetty-nosql/pom.xml b/jetty-nosql/pom.xml
index 15504b4d1d9..cc4aa30c88d 100644
--- a/jetty-nosql/pom.xml
+++ b/jetty-nosql/pom.xml
@@ -2,7 +2,7 @@
org.eclipse.jettyjetty-project
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOT4.0.0jetty-nosql
diff --git a/jetty-openid/pom.xml b/jetty-openid/pom.xml
index 4f9c95e5683..dd494834763 100644
--- a/jetty-openid/pom.xml
+++ b/jetty-openid/pom.xml
@@ -2,7 +2,7 @@
org.eclipse.jettyjetty-project
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOT4.0.0
diff --git a/jetty-osgi/jetty-osgi-alpn/pom.xml b/jetty-osgi/jetty-osgi-alpn/pom.xml
index 6cef6fc11aa..2d768ec7e67 100644
--- a/jetty-osgi/jetty-osgi-alpn/pom.xml
+++ b/jetty-osgi/jetty-osgi-alpn/pom.xml
@@ -2,7 +2,7 @@
org.eclipse.jetty.osgijetty-osgi-project
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOT4.0.0jetty-osgi-alpn
diff --git a/jetty-osgi/jetty-osgi-boot-jsp/pom.xml b/jetty-osgi/jetty-osgi-boot-jsp/pom.xml
index 8744773dc2f..d851f8ab19b 100644
--- a/jetty-osgi/jetty-osgi-boot-jsp/pom.xml
+++ b/jetty-osgi/jetty-osgi-boot-jsp/pom.xml
@@ -2,7 +2,7 @@
org.eclipse.jetty.osgijetty-osgi-project
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOT4.0.0jetty-osgi-boot-jsp
diff --git a/jetty-osgi/jetty-osgi-boot-warurl/pom.xml b/jetty-osgi/jetty-osgi-boot-warurl/pom.xml
index fd55cc944d5..05422b44eed 100644
--- a/jetty-osgi/jetty-osgi-boot-warurl/pom.xml
+++ b/jetty-osgi/jetty-osgi-boot-warurl/pom.xml
@@ -2,7 +2,7 @@
org.eclipse.jetty.osgijetty-osgi-project
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOT../pom.xml4.0.0
diff --git a/jetty-osgi/jetty-osgi-boot/pom.xml b/jetty-osgi/jetty-osgi-boot/pom.xml
index bce0accc623..e7fcf5c539c 100644
--- a/jetty-osgi/jetty-osgi-boot/pom.xml
+++ b/jetty-osgi/jetty-osgi-boot/pom.xml
@@ -2,7 +2,7 @@
org.eclipse.jetty.osgijetty-osgi-project
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOT4.0.0jetty-osgi-boot
diff --git a/jetty-osgi/jetty-osgi-httpservice/pom.xml b/jetty-osgi/jetty-osgi-httpservice/pom.xml
index dd763ba3568..0cdb74deb14 100644
--- a/jetty-osgi/jetty-osgi-httpservice/pom.xml
+++ b/jetty-osgi/jetty-osgi-httpservice/pom.xml
@@ -2,7 +2,7 @@
org.eclipse.jetty.osgijetty-osgi-project
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOT4.0.0jetty-httpservice
diff --git a/jetty-osgi/pom.xml b/jetty-osgi/pom.xml
index 4492f1321f6..db1c9237515 100644
--- a/jetty-osgi/pom.xml
+++ b/jetty-osgi/pom.xml
@@ -2,7 +2,7 @@
org.eclipse.jettyjetty-project
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOT4.0.0
diff --git a/jetty-osgi/test-jetty-osgi-context/pom.xml b/jetty-osgi/test-jetty-osgi-context/pom.xml
index 6ad1567e934..bd7d5e5e1e5 100644
--- a/jetty-osgi/test-jetty-osgi-context/pom.xml
+++ b/jetty-osgi/test-jetty-osgi-context/pom.xml
@@ -2,7 +2,7 @@
org.eclipse.jetty.osgijetty-osgi-project
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOT4.0.0test-jetty-osgi-context
diff --git a/jetty-osgi/test-jetty-osgi-fragment/pom.xml b/jetty-osgi/test-jetty-osgi-fragment/pom.xml
index ce7125e8387..1a520f830a3 100644
--- a/jetty-osgi/test-jetty-osgi-fragment/pom.xml
+++ b/jetty-osgi/test-jetty-osgi-fragment/pom.xml
@@ -2,7 +2,7 @@
org.eclipse.jetty.osgijetty-osgi-project
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOT../pom.xml4.0.0
diff --git a/jetty-osgi/test-jetty-osgi-server/pom.xml b/jetty-osgi/test-jetty-osgi-server/pom.xml
index 56cc7c511d0..a8671e31435 100644
--- a/jetty-osgi/test-jetty-osgi-server/pom.xml
+++ b/jetty-osgi/test-jetty-osgi-server/pom.xml
@@ -2,7 +2,7 @@
org.eclipse.jetty.osgijetty-osgi-project
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOT4.0.0test-jetty-osgi-server
diff --git a/jetty-osgi/test-jetty-osgi-webapp/pom.xml b/jetty-osgi/test-jetty-osgi-webapp/pom.xml
index 582bb496d37..d80ca168896 100644
--- a/jetty-osgi/test-jetty-osgi-webapp/pom.xml
+++ b/jetty-osgi/test-jetty-osgi-webapp/pom.xml
@@ -2,7 +2,7 @@
org.eclipse.jetty.osgijetty-osgi-project
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOT../pom.xml4.0.0
diff --git a/jetty-osgi/test-jetty-osgi/pom.xml b/jetty-osgi/test-jetty-osgi/pom.xml
index 2b5dc1438c0..0cb455e6644 100644
--- a/jetty-osgi/test-jetty-osgi/pom.xml
+++ b/jetty-osgi/test-jetty-osgi/pom.xml
@@ -2,7 +2,7 @@
org.eclipse.jetty.osgijetty-osgi-project
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOT../pom.xml4.0.0
diff --git a/jetty-plus/pom.xml b/jetty-plus/pom.xml
index aa2283f5580..96d84003b6f 100644
--- a/jetty-plus/pom.xml
+++ b/jetty-plus/pom.xml
@@ -2,7 +2,7 @@
org.eclipse.jettyjetty-project
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOT4.0.0jetty-plus
diff --git a/jetty-proxy/pom.xml b/jetty-proxy/pom.xml
index b2d3a2f10bb..787ddf6b7cb 100644
--- a/jetty-proxy/pom.xml
+++ b/jetty-proxy/pom.xml
@@ -2,7 +2,7 @@
org.eclipse.jettyjetty-project
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOT4.0.0jetty-proxy
diff --git a/jetty-quickstart/pom.xml b/jetty-quickstart/pom.xml
index a4af19179ba..1e8ffe21677 100644
--- a/jetty-quickstart/pom.xml
+++ b/jetty-quickstart/pom.xml
@@ -2,7 +2,7 @@
org.eclipse.jettyjetty-project
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOT4.0.0org.eclipse.jetty
diff --git a/jetty-rewrite/pom.xml b/jetty-rewrite/pom.xml
index d51e608017b..a02ef67dff8 100644
--- a/jetty-rewrite/pom.xml
+++ b/jetty-rewrite/pom.xml
@@ -2,7 +2,7 @@
org.eclipse.jettyjetty-project
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOT4.0.0jetty-rewrite
diff --git a/jetty-runner/pom.xml b/jetty-runner/pom.xml
index 68087d1dee4..47ee5853da7 100644
--- a/jetty-runner/pom.xml
+++ b/jetty-runner/pom.xml
@@ -2,7 +2,7 @@
org.eclipse.jettyjetty-project
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOT4.0.0jetty-runner
diff --git a/jetty-security/pom.xml b/jetty-security/pom.xml
index 9f7e054a745..4ebda80383d 100644
--- a/jetty-security/pom.xml
+++ b/jetty-security/pom.xml
@@ -2,7 +2,7 @@
org.eclipse.jettyjetty-project
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOT4.0.0jetty-security
diff --git a/jetty-server/pom.xml b/jetty-server/pom.xml
index cde53f550cf..d571f5a0cc4 100644
--- a/jetty-server/pom.xml
+++ b/jetty-server/pom.xml
@@ -2,7 +2,7 @@
org.eclipse.jettyjetty-project
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOT4.0.0jetty-server
diff --git a/jetty-servlet/pom.xml b/jetty-servlet/pom.xml
index 5ee46f24f08..287f82b64cb 100644
--- a/jetty-servlet/pom.xml
+++ b/jetty-servlet/pom.xml
@@ -3,7 +3,7 @@
jetty-projectorg.eclipse.jetty
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOT4.0.0jetty-servlet
diff --git a/jetty-servlets/pom.xml b/jetty-servlets/pom.xml
index 55b095ec4cb..3d90f75be85 100644
--- a/jetty-servlets/pom.xml
+++ b/jetty-servlets/pom.xml
@@ -3,7 +3,7 @@
jetty-projectorg.eclipse.jetty
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOT4.0.0jetty-servlets
diff --git a/jetty-spring/pom.xml b/jetty-spring/pom.xml
index 050098239eb..2451c70c63d 100644
--- a/jetty-spring/pom.xml
+++ b/jetty-spring/pom.xml
@@ -2,7 +2,7 @@
org.eclipse.jettyjetty-project
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOT4.0.0jetty-spring
diff --git a/jetty-start/pom.xml b/jetty-start/pom.xml
index 9c34bcd1078..fb15e4e7a92 100644
--- a/jetty-start/pom.xml
+++ b/jetty-start/pom.xml
@@ -2,7 +2,7 @@
org.eclipse.jettyjetty-project
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOT4.0.0jetty-start
diff --git a/jetty-unixsocket/pom.xml b/jetty-unixsocket/pom.xml
index 1cc142a97cf..454ee582bcf 100644
--- a/jetty-unixsocket/pom.xml
+++ b/jetty-unixsocket/pom.xml
@@ -2,7 +2,7 @@
org.eclipse.jettyjetty-project
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOT4.0.0jetty-unixsocket
diff --git a/jetty-util-ajax/pom.xml b/jetty-util-ajax/pom.xml
index 53bdcca695e..cf1cd084c11 100644
--- a/jetty-util-ajax/pom.xml
+++ b/jetty-util-ajax/pom.xml
@@ -2,7 +2,7 @@
org.eclipse.jettyjetty-project
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOT4.0.0jetty-util-ajax
diff --git a/jetty-util/pom.xml b/jetty-util/pom.xml
index cf98fb8566b..a428ec6e985 100644
--- a/jetty-util/pom.xml
+++ b/jetty-util/pom.xml
@@ -2,7 +2,7 @@
org.eclipse.jettyjetty-project
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOT4.0.0jetty-util
diff --git a/jetty-webapp/pom.xml b/jetty-webapp/pom.xml
index 275c5febb47..516df08336b 100644
--- a/jetty-webapp/pom.xml
+++ b/jetty-webapp/pom.xml
@@ -2,7 +2,7 @@
org.eclipse.jettyjetty-project
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOT4.0.0jetty-webapp
diff --git a/jetty-websocket/javax-websocket-client-impl/pom.xml b/jetty-websocket/javax-websocket-client-impl/pom.xml
index b7df9e27860..1d5bd11f43c 100644
--- a/jetty-websocket/javax-websocket-client-impl/pom.xml
+++ b/jetty-websocket/javax-websocket-client-impl/pom.xml
@@ -3,7 +3,7 @@
org.eclipse.jetty.websocketwebsocket-parent
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOT4.0.0
diff --git a/jetty-websocket/javax-websocket-server-impl/pom.xml b/jetty-websocket/javax-websocket-server-impl/pom.xml
index 42b3700471c..4f830672efe 100644
--- a/jetty-websocket/javax-websocket-server-impl/pom.xml
+++ b/jetty-websocket/javax-websocket-server-impl/pom.xml
@@ -3,7 +3,7 @@
org.eclipse.jetty.websocketwebsocket-parent
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOT4.0.0
diff --git a/jetty-websocket/jetty-websocket-tests/pom.xml b/jetty-websocket/jetty-websocket-tests/pom.xml
index cf211116780..427ca3f6d71 100644
--- a/jetty-websocket/jetty-websocket-tests/pom.xml
+++ b/jetty-websocket/jetty-websocket-tests/pom.xml
@@ -3,7 +3,7 @@
org.eclipse.jetty.websocketwebsocket-parent
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOT4.0.0
diff --git a/jetty-websocket/pom.xml b/jetty-websocket/pom.xml
index d64de08be04..c68098170c1 100644
--- a/jetty-websocket/pom.xml
+++ b/jetty-websocket/pom.xml
@@ -3,7 +3,7 @@
jetty-projectorg.eclipse.jetty
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOT4.0.0
diff --git a/jetty-websocket/websocket-api/pom.xml b/jetty-websocket/websocket-api/pom.xml
index 1917cc3671e..caef2d7427c 100644
--- a/jetty-websocket/websocket-api/pom.xml
+++ b/jetty-websocket/websocket-api/pom.xml
@@ -3,7 +3,7 @@
org.eclipse.jetty.websocketwebsocket-parent
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOT4.0.0
diff --git a/jetty-websocket/websocket-client/pom.xml b/jetty-websocket/websocket-client/pom.xml
index 0339ce5e92d..a6d3e0926c7 100644
--- a/jetty-websocket/websocket-client/pom.xml
+++ b/jetty-websocket/websocket-client/pom.xml
@@ -3,7 +3,7 @@
org.eclipse.jetty.websocketwebsocket-parent
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOT4.0.0
diff --git a/jetty-websocket/websocket-common/pom.xml b/jetty-websocket/websocket-common/pom.xml
index a8225873a0b..e301836b307 100644
--- a/jetty-websocket/websocket-common/pom.xml
+++ b/jetty-websocket/websocket-common/pom.xml
@@ -3,7 +3,7 @@
org.eclipse.jetty.websocketwebsocket-parent
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOT4.0.0
diff --git a/jetty-websocket/websocket-server/pom.xml b/jetty-websocket/websocket-server/pom.xml
index fc81d4f36f3..0f24a948577 100644
--- a/jetty-websocket/websocket-server/pom.xml
+++ b/jetty-websocket/websocket-server/pom.xml
@@ -3,7 +3,7 @@
org.eclipse.jetty.websocketwebsocket-parent
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOT4.0.0
diff --git a/jetty-websocket/websocket-servlet/pom.xml b/jetty-websocket/websocket-servlet/pom.xml
index a2bea8efcf4..3b3402d140d 100644
--- a/jetty-websocket/websocket-servlet/pom.xml
+++ b/jetty-websocket/websocket-servlet/pom.xml
@@ -3,7 +3,7 @@
org.eclipse.jetty.websocketwebsocket-parent
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOT4.0.0
diff --git a/jetty-xml/pom.xml b/jetty-xml/pom.xml
index 405b0843332..32836152bab 100644
--- a/jetty-xml/pom.xml
+++ b/jetty-xml/pom.xml
@@ -2,7 +2,7 @@
org.eclipse.jettyjetty-project
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOT4.0.0jetty-xml
diff --git a/pom.xml b/pom.xml
index b7d0a991c73..f46bfd8e471 100644
--- a/pom.xml
+++ b/pom.xml
@@ -4,7 +4,7 @@
4.0.0org.eclipse.jettyjetty-project
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOTJetty :: ProjectThe Eclipse Jetty Projectpom
diff --git a/tests/pom.xml b/tests/pom.xml
index 2c399a0c77e..7f484aea18c 100644
--- a/tests/pom.xml
+++ b/tests/pom.xml
@@ -4,7 +4,7 @@
org.eclipse.jettyjetty-project
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOT../pom.xmlorg.eclipse.jetty.tests
diff --git a/tests/test-continuation/pom.xml b/tests/test-continuation/pom.xml
index 384786bac12..bb383b3426b 100644
--- a/tests/test-continuation/pom.xml
+++ b/tests/test-continuation/pom.xml
@@ -3,7 +3,7 @@
org.eclipse.jetty.teststests-parent
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOT../pom.xml4.0.0
diff --git a/tests/test-distribution/pom.xml b/tests/test-distribution/pom.xml
index 1bbcd8b131c..f488019325a 100644
--- a/tests/test-distribution/pom.xml
+++ b/tests/test-distribution/pom.xml
@@ -2,7 +2,7 @@
tests-parentorg.eclipse.jetty.tests
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOT4.0.0
diff --git a/tests/test-http-client-transport/pom.xml b/tests/test-http-client-transport/pom.xml
index 2d2acd0842e..2b8a2fd9324 100644
--- a/tests/test-http-client-transport/pom.xml
+++ b/tests/test-http-client-transport/pom.xml
@@ -3,7 +3,7 @@
org.eclipse.jetty.teststests-parent
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOT4.0.0
diff --git a/tests/test-integration/pom.xml b/tests/test-integration/pom.xml
index 6dc699bae03..fe6cf597a5d 100644
--- a/tests/test-integration/pom.xml
+++ b/tests/test-integration/pom.xml
@@ -3,7 +3,7 @@
org.eclipse.jetty.teststests-parent
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOT4.0.0test-integration
diff --git a/tests/test-jmx/jmx-webapp-it/pom.xml b/tests/test-jmx/jmx-webapp-it/pom.xml
index 918bae001ef..f3837572a1d 100644
--- a/tests/test-jmx/jmx-webapp-it/pom.xml
+++ b/tests/test-jmx/jmx-webapp-it/pom.xml
@@ -3,7 +3,7 @@
org.eclipse.jetty.teststest-jmx-parent
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOT4.0.0jmx-webapp-it
diff --git a/tests/test-jmx/jmx-webapp/pom.xml b/tests/test-jmx/jmx-webapp/pom.xml
index 2f0f3d49346..f07e5ae684b 100644
--- a/tests/test-jmx/jmx-webapp/pom.xml
+++ b/tests/test-jmx/jmx-webapp/pom.xml
@@ -4,7 +4,7 @@
org.eclipse.jetty.teststest-jmx-parent
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOTjmx-webappwar
diff --git a/tests/test-jmx/pom.xml b/tests/test-jmx/pom.xml
index 33a2fab6a66..e4f40c7901b 100644
--- a/tests/test-jmx/pom.xml
+++ b/tests/test-jmx/pom.xml
@@ -3,7 +3,7 @@
org.eclipse.jetty.teststests-parent
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOT4.0.0test-jmx-parent
diff --git a/tests/test-loginservice/pom.xml b/tests/test-loginservice/pom.xml
index 4cf3f85e9e5..cefcc7dfcee 100644
--- a/tests/test-loginservice/pom.xml
+++ b/tests/test-loginservice/pom.xml
@@ -4,7 +4,7 @@
org.eclipse.jetty.teststests-parent
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOTtest-loginserviceJetty Tests :: Login Service
diff --git a/tests/test-quickstart/pom.xml b/tests/test-quickstart/pom.xml
index 3e4cfbfd78c..53402a35c5b 100644
--- a/tests/test-quickstart/pom.xml
+++ b/tests/test-quickstart/pom.xml
@@ -3,7 +3,7 @@
org.eclipse.jetty.teststests-parent
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOT../pom.xml4.0.0
diff --git a/tests/test-sessions/pom.xml b/tests/test-sessions/pom.xml
index e2a353c045d..cc5fa73ee31 100644
--- a/tests/test-sessions/pom.xml
+++ b/tests/test-sessions/pom.xml
@@ -4,7 +4,7 @@
org.eclipse.jetty.teststests-parent
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOTtest-sessions-parentJetty Tests :: Sessions :: Parent
diff --git a/tests/test-sessions/test-file-sessions/pom.xml b/tests/test-sessions/test-file-sessions/pom.xml
index febc24f80b3..05e9cf030ce 100644
--- a/tests/test-sessions/test-file-sessions/pom.xml
+++ b/tests/test-sessions/test-file-sessions/pom.xml
@@ -4,7 +4,7 @@
org.eclipse.jetty.teststest-sessions-parent
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOTtest-file-sessionsJetty Tests :: Sessions :: File
diff --git a/tests/test-sessions/test-gcloud-sessions/pom.xml b/tests/test-sessions/test-gcloud-sessions/pom.xml
index e740ea941b6..b09b7bc8179 100644
--- a/tests/test-sessions/test-gcloud-sessions/pom.xml
+++ b/tests/test-sessions/test-gcloud-sessions/pom.xml
@@ -4,7 +4,7 @@
org.eclipse.jetty.teststest-sessions-parent
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOTtest-gcloud-sessionsJetty Tests :: Sessions :: GCloud
diff --git a/tests/test-sessions/test-hazelcast-sessions/pom.xml b/tests/test-sessions/test-hazelcast-sessions/pom.xml
index a4164dc4f62..b38e8961233 100644
--- a/tests/test-sessions/test-hazelcast-sessions/pom.xml
+++ b/tests/test-sessions/test-hazelcast-sessions/pom.xml
@@ -4,7 +4,7 @@
org.eclipse.jetty.teststest-sessions-parent
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOTtest-hazelcast-sessionsJetty Tests :: Sessions :: Hazelcast
diff --git a/tests/test-sessions/test-infinispan-sessions/pom.xml b/tests/test-sessions/test-infinispan-sessions/pom.xml
index f42af52e40c..e51920e3276 100644
--- a/tests/test-sessions/test-infinispan-sessions/pom.xml
+++ b/tests/test-sessions/test-infinispan-sessions/pom.xml
@@ -4,7 +4,7 @@
org.eclipse.jetty.teststest-sessions-parent
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOTtest-infinispan-sessionsJetty Tests :: Sessions :: Infinispan
diff --git a/tests/test-sessions/test-jdbc-sessions/pom.xml b/tests/test-sessions/test-jdbc-sessions/pom.xml
index fe2c887e8d4..5afd5a55d69 100644
--- a/tests/test-sessions/test-jdbc-sessions/pom.xml
+++ b/tests/test-sessions/test-jdbc-sessions/pom.xml
@@ -4,7 +4,7 @@
org.eclipse.jetty.teststest-sessions-parent
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOTtest-jdbc-sessionsJetty Tests :: Sessions :: JDBC
diff --git a/tests/test-sessions/test-memcached-sessions/pom.xml b/tests/test-sessions/test-memcached-sessions/pom.xml
index f8964fce9b3..015264a0c81 100644
--- a/tests/test-sessions/test-memcached-sessions/pom.xml
+++ b/tests/test-sessions/test-memcached-sessions/pom.xml
@@ -4,7 +4,7 @@
org.eclipse.jetty.teststest-sessions-parent
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOTtest-memcached-sessionsJetty Tests :: Sessions :: Memcached
diff --git a/tests/test-sessions/test-mongodb-sessions/pom.xml b/tests/test-sessions/test-mongodb-sessions/pom.xml
index 9bacbc7d259..7ca4b0311e5 100644
--- a/tests/test-sessions/test-mongodb-sessions/pom.xml
+++ b/tests/test-sessions/test-mongodb-sessions/pom.xml
@@ -4,7 +4,7 @@
org.eclipse.jetty.teststest-sessions-parent
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOTtest-mongodb-sessionsJetty Tests :: Sessions :: Mongo
diff --git a/tests/test-sessions/test-sessions-common/pom.xml b/tests/test-sessions/test-sessions-common/pom.xml
index a534e5df8ee..f4dcbc820cd 100644
--- a/tests/test-sessions/test-sessions-common/pom.xml
+++ b/tests/test-sessions/test-sessions-common/pom.xml
@@ -4,7 +4,7 @@
org.eclipse.jetty.teststest-sessions-parent
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOTtest-sessions-commonJetty Tests :: Sessions :: Common
diff --git a/tests/test-webapps/pom.xml b/tests/test-webapps/pom.xml
index 4bb674b1469..f28bb41696e 100644
--- a/tests/test-webapps/pom.xml
+++ b/tests/test-webapps/pom.xml
@@ -4,7 +4,7 @@
org.eclipse.jetty.teststests-parent
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOT../pom.xmltest-webapps-parent
diff --git a/tests/test-webapps/test-cdi-common-webapp/pom.xml b/tests/test-webapps/test-cdi-common-webapp/pom.xml
index be0ad0aeae3..cfbce8e433e 100644
--- a/tests/test-webapps/test-cdi-common-webapp/pom.xml
+++ b/tests/test-webapps/test-cdi-common-webapp/pom.xml
@@ -3,7 +3,7 @@
org.eclipse.jetty.teststest-webapps-parent
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOT4.0.0
diff --git a/tests/test-webapps/test-felix-webapp/pom.xml b/tests/test-webapps/test-felix-webapp/pom.xml
index ed58abb0fbe..921d8b8a20c 100644
--- a/tests/test-webapps/test-felix-webapp/pom.xml
+++ b/tests/test-webapps/test-felix-webapp/pom.xml
@@ -3,7 +3,7 @@
org.eclipse.jetty.teststest-webapps-parent
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOT4.0.0
diff --git a/tests/test-webapps/test-http2-webapp/pom.xml b/tests/test-webapps/test-http2-webapp/pom.xml
index a3b84d89b4f..6124c78844d 100644
--- a/tests/test-webapps/test-http2-webapp/pom.xml
+++ b/tests/test-webapps/test-http2-webapp/pom.xml
@@ -3,7 +3,7 @@
org.eclipse.jetty.teststest-webapps-parent
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOT4.0.0
diff --git a/tests/test-webapps/test-jaas-webapp/pom.xml b/tests/test-webapps/test-jaas-webapp/pom.xml
index d6f2251b982..0bf1980f984 100644
--- a/tests/test-webapps/test-jaas-webapp/pom.xml
+++ b/tests/test-webapps/test-jaas-webapp/pom.xml
@@ -4,7 +4,7 @@
org.eclipse.jetty.teststest-webapps-parent
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOTtest-jaas-webappJetty Tests :: WebApp :: JAAS
diff --git a/tests/test-webapps/test-jetty-webapp/pom.xml b/tests/test-webapps/test-jetty-webapp/pom.xml
index c7383f610fd..dde6c38cee8 100644
--- a/tests/test-webapps/test-jetty-webapp/pom.xml
+++ b/tests/test-webapps/test-jetty-webapp/pom.xml
@@ -3,7 +3,7 @@
org.eclipse.jetty.teststest-webapps-parent
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOT../pom.xml4.0.0
diff --git a/tests/test-webapps/test-jndi-webapp/pom.xml b/tests/test-webapps/test-jndi-webapp/pom.xml
index 848eae6c11e..5926d0c191b 100644
--- a/tests/test-webapps/test-jndi-webapp/pom.xml
+++ b/tests/test-webapps/test-jndi-webapp/pom.xml
@@ -4,7 +4,7 @@
org.eclipse.jetty.teststest-webapps-parent
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOTtest-jndi-webappJetty Tests :: WebApp :: JNDI
diff --git a/tests/test-webapps/test-mock-resources/pom.xml b/tests/test-webapps/test-mock-resources/pom.xml
index c9db8291d53..83f0ccf406b 100644
--- a/tests/test-webapps/test-mock-resources/pom.xml
+++ b/tests/test-webapps/test-mock-resources/pom.xml
@@ -3,7 +3,7 @@
org.eclipse.jetty.teststest-webapps-parent
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOTJetty Tests :: WebApp :: Mock Resourcestest-mock-resources
diff --git a/tests/test-webapps/test-owb-cdi-webapp/pom.xml b/tests/test-webapps/test-owb-cdi-webapp/pom.xml
index c6819695b22..38fa5d0084b 100644
--- a/tests/test-webapps/test-owb-cdi-webapp/pom.xml
+++ b/tests/test-webapps/test-owb-cdi-webapp/pom.xml
@@ -3,7 +3,7 @@
org.eclipse.jetty.teststest-webapps-parent
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOT4.0.0
diff --git a/tests/test-webapps/test-proxy-webapp/pom.xml b/tests/test-webapps/test-proxy-webapp/pom.xml
index acae710987a..9af777ed222 100644
--- a/tests/test-webapps/test-proxy-webapp/pom.xml
+++ b/tests/test-webapps/test-proxy-webapp/pom.xml
@@ -3,7 +3,7 @@
org.eclipse.jetty.teststest-webapps-parent
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOT../pom.xml4.0.0
diff --git a/tests/test-webapps/test-servlet-spec/pom.xml b/tests/test-webapps/test-servlet-spec/pom.xml
index 1e44e3e3581..021892c725c 100644
--- a/tests/test-webapps/test-servlet-spec/pom.xml
+++ b/tests/test-webapps/test-servlet-spec/pom.xml
@@ -4,7 +4,7 @@
org.eclipse.jetty.teststest-webapps-parent
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOTtest-servlet-spec-parentJetty Tests :: Spec Test WebApp :: Parent
diff --git a/tests/test-webapps/test-servlet-spec/test-container-initializer/pom.xml b/tests/test-webapps/test-servlet-spec/test-container-initializer/pom.xml
index 229b3e9558f..4a0fcbd86f8 100644
--- a/tests/test-webapps/test-servlet-spec/test-container-initializer/pom.xml
+++ b/tests/test-webapps/test-servlet-spec/test-container-initializer/pom.xml
@@ -3,7 +3,7 @@
org.eclipse.jetty.teststest-servlet-spec-parent
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOTtest-container-initializerjar
diff --git a/tests/test-webapps/test-servlet-spec/test-spec-webapp/pom.xml b/tests/test-webapps/test-servlet-spec/test-spec-webapp/pom.xml
index ede32dfcc05..b5090948173 100644
--- a/tests/test-webapps/test-servlet-spec/test-spec-webapp/pom.xml
+++ b/tests/test-webapps/test-servlet-spec/test-spec-webapp/pom.xml
@@ -4,7 +4,7 @@
org.eclipse.jetty.teststest-servlet-spec-parent
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOTJetty Tests :: Webapps :: Spec Webapptest-spec-webapp
diff --git a/tests/test-webapps/test-servlet-spec/test-web-fragment/pom.xml b/tests/test-webapps/test-servlet-spec/test-web-fragment/pom.xml
index a5e54b009e7..90973abebb1 100644
--- a/tests/test-webapps/test-servlet-spec/test-web-fragment/pom.xml
+++ b/tests/test-webapps/test-servlet-spec/test-web-fragment/pom.xml
@@ -3,7 +3,7 @@
org.eclipse.jetty.teststest-servlet-spec-parent
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOTJetty Tests :: WebApp :: Servlet Spec :: Fragment Jar
diff --git a/tests/test-webapps/test-simple-webapp/pom.xml b/tests/test-webapps/test-simple-webapp/pom.xml
index 16289299d84..83f80b9470b 100644
--- a/tests/test-webapps/test-simple-webapp/pom.xml
+++ b/tests/test-webapps/test-simple-webapp/pom.xml
@@ -4,7 +4,7 @@
org.eclipse.jetty.teststest-webapps-parent
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOTtest-simple-webapp
diff --git a/tests/test-webapps/test-webapp-rfc2616/pom.xml b/tests/test-webapps/test-webapp-rfc2616/pom.xml
index 3dbc91e7436..aade486f5d9 100644
--- a/tests/test-webapps/test-webapp-rfc2616/pom.xml
+++ b/tests/test-webapps/test-webapp-rfc2616/pom.xml
@@ -4,7 +4,7 @@
org.eclipse.jetty.teststest-webapps-parent
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOTtest-webapp-rfc2616Jetty Tests :: WebApp :: RFC2616
diff --git a/tests/test-webapps/test-weld-cdi-webapp/pom.xml b/tests/test-webapps/test-weld-cdi-webapp/pom.xml
index 69164f00955..473d90e6011 100644
--- a/tests/test-webapps/test-weld-cdi-webapp/pom.xml
+++ b/tests/test-webapps/test-weld-cdi-webapp/pom.xml
@@ -3,7 +3,7 @@
org.eclipse.jetty.teststest-webapps-parent
- 9.4.29.v20200521
+ 9.4.30-SNAPSHOT4.0.0
From 74f9b464a6a7c3ddbb026988a0e490607f171870 Mon Sep 17 00:00:00 2001
From: Lachlan Roberts
Date: Fri, 22 May 2020 10:49:42 +1000
Subject: [PATCH 60/77] Issue #4873 - generalize test for all ThreadPools
Signed-off-by: Lachlan Roberts
---
.../util/thread/AbstractThreadPoolTest.java | 28 +++++++++++++++++++
.../util/thread/ExecutorThreadPoolTest.java | 24 ----------------
2 files changed, 28 insertions(+), 24 deletions(-)
diff --git a/jetty-util/src/test/java/org/eclipse/jetty/util/thread/AbstractThreadPoolTest.java b/jetty-util/src/test/java/org/eclipse/jetty/util/thread/AbstractThreadPoolTest.java
index cfdd556f063..c321d4f4aa5 100644
--- a/jetty-util/src/test/java/org/eclipse/jetty/util/thread/AbstractThreadPoolTest.java
+++ b/jetty-util/src/test/java/org/eclipse/jetty/util/thread/AbstractThreadPoolTest.java
@@ -18,7 +18,11 @@
package org.eclipse.jetty.util.thread;
+import java.time.Duration;
+
import org.eclipse.jetty.util.ProcessorUtils;
+import org.eclipse.jetty.util.component.ContainerLifeCycle;
+import org.eclipse.jetty.util.component.LifeCycle;
import org.eclipse.jetty.util.thread.ThreadPool.SizedThreadPool;
import org.hamcrest.Matchers;
import org.junit.jupiter.api.AfterAll;
@@ -26,6 +30,8 @@ import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import static org.hamcrest.MatcherAssert.assertThat;
+import static org.junit.jupiter.api.Assertions.assertThrows;
+import static org.junit.jupiter.api.Assertions.assertTimeoutPreemptively;
import static org.junit.jupiter.api.Assertions.fail;
public abstract class AbstractThreadPoolTest
@@ -87,4 +93,26 @@ public abstract class AbstractThreadPoolTest
assertThat(pool.getMaxThreads(), Matchers.is(3));
}
+
+ @Test
+ public void testJoinWithStopTimeout()
+ {
+ // ThreadPool must be an implement ContainerLifeCycle for this test to be valid.
+ SizedThreadPool threadPool = newPool(3);
+ if (!(threadPool instanceof ContainerLifeCycle))
+ return;
+
+ final long stopTimeout = 100;
+ ((ContainerLifeCycle)threadPool).setStopTimeout(100);
+ LifeCycle.start(threadPool);
+
+ // Verify that join does not timeout after waiting twice the stopTimeout.
+ assertThrows(Throwable.class, () ->
+ assertTimeoutPreemptively(Duration.ofMillis(stopTimeout * 2), threadPool::join)
+ );
+
+ // After stopping the ThreadPool join should unblock.
+ LifeCycle.stop(threadPool);
+ assertTimeoutPreemptively(Duration.ofMillis(stopTimeout), threadPool::join);
+ }
}
diff --git a/jetty-util/src/test/java/org/eclipse/jetty/util/thread/ExecutorThreadPoolTest.java b/jetty-util/src/test/java/org/eclipse/jetty/util/thread/ExecutorThreadPoolTest.java
index a495d719bb0..95ab6a22aab 100644
--- a/jetty-util/src/test/java/org/eclipse/jetty/util/thread/ExecutorThreadPoolTest.java
+++ b/jetty-util/src/test/java/org/eclipse/jetty/util/thread/ExecutorThreadPoolTest.java
@@ -18,13 +18,7 @@
package org.eclipse.jetty.util.thread;
-import java.time.Duration;
-
import org.eclipse.jetty.util.thread.ThreadPool.SizedThreadPool;
-import org.junit.jupiter.api.Test;
-
-import static org.junit.jupiter.api.Assertions.assertThrows;
-import static org.junit.jupiter.api.Assertions.assertTimeoutPreemptively;
public class ExecutorThreadPoolTest extends AbstractThreadPoolTest
{
@@ -33,22 +27,4 @@ public class ExecutorThreadPoolTest extends AbstractThreadPoolTest
{
return new ExecutorThreadPool(max);
}
-
- @Test
- public void testJoin() throws Exception
- {
- final long stopTimeout = 100;
- ExecutorThreadPool executorThreadPool = new ExecutorThreadPool(10);
- executorThreadPool.setStopTimeout(stopTimeout);
- executorThreadPool.start();
-
- // Verify that join does not timeout after waiting twice the stopTimeout.
- assertThrows(Throwable.class, () ->
- assertTimeoutPreemptively(Duration.ofMillis(stopTimeout * 2), executorThreadPool::join)
- );
-
- // After stopping the ThreadPool join should unblock.
- executorThreadPool.stop();
- assertTimeoutPreemptively(Duration.ofMillis(stopTimeout), executorThreadPool::join);
- }
}
From 28a588b8bd7c08499c9a695e822b961919ab443a Mon Sep 17 00:00:00 2001
From: Lachlan Roberts
Date: Mon, 25 May 2020 12:27:49 +1000
Subject: [PATCH 61/77] Issue #4903 - Better errors for non public endpoints
Signed-off-by: Lachlan Roberts
---
.../websocket/jsr356/server/JsrCreator.java | 3 +-
.../jsr356/server/ServerContainer.java | 55 ++++---
.../jsr356/server/PrivateEndpointTest.java | 147 ++++++++++++++++++
3 files changed, 178 insertions(+), 27 deletions(-)
create mode 100644 jetty-websocket/javax-websocket-server-impl/src/test/java/org/eclipse/jetty/websocket/jsr356/server/PrivateEndpointTest.java
diff --git a/jetty-websocket/javax-websocket-server-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/server/JsrCreator.java b/jetty-websocket/javax-websocket-server-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/server/JsrCreator.java
index aa5341d7ffe..990ebc25ef0 100644
--- a/jetty-websocket/javax-websocket-server-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/server/JsrCreator.java
+++ b/jetty-websocket/javax-websocket-server-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/server/JsrCreator.java
@@ -159,8 +159,7 @@ public class JsrCreator implements WebSocketCreator
}
catch (InstantiationException e)
{
- if (LOG.isDebugEnabled())
- LOG.debug("Unable to create websocket: " + config.getEndpointClass().getName(), e);
+ LOG.warn("Unable to create websocket: " + config.getEndpointClass().getName(), e);
return null;
}
}
diff --git a/jetty-websocket/javax-websocket-server-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/server/ServerContainer.java b/jetty-websocket/javax-websocket-server-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/server/ServerContainer.java
index 9db239b7905..6365d92be71 100644
--- a/jetty-websocket/javax-websocket-server-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/server/ServerContainer.java
+++ b/jetty-websocket/javax-websocket-server-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/server/ServerContainer.java
@@ -18,6 +18,7 @@
package org.eclipse.jetty.websocket.jsr356.server;
+import java.lang.reflect.Modifier;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.Executor;
@@ -137,6 +138,9 @@ public class ServerContainer extends ClientContainer implements javax.websocket.
private void addEndpoint(ServerEndpointMetadata metadata) throws DeploymentException
{
+ if (!Modifier.isPublic(metadata.getEndpointClass().getModifiers()))
+ throw new DeploymentException("Class modifier must be public");
+
JsrCreator creator = new JsrCreator(this, metadata, this.configuration.getFactory().getExtensionFactory());
this.configuration.addMapping("uri-template|" + metadata.getPath(), creator);
}
@@ -191,35 +195,36 @@ public class ServerContainer extends ClientContainer implements javax.websocket.
public ServerEndpointMetadata getServerEndpointMetadata(final Class> endpoint, final ServerEndpointConfig config) throws DeploymentException
{
- ServerEndpointMetadata metadata = null;
+ try
+ {
+ ServerEndpointMetadata metadata;
+ ServerEndpoint anno = endpoint.getAnnotation(ServerEndpoint.class);
+ if (anno != null)
+ {
+ // Annotated takes precedence here
+ AnnotatedServerEndpointMetadata ametadata = new AnnotatedServerEndpointMetadata(this, endpoint, config);
+ AnnotatedEndpointScanner scanner = new AnnotatedEndpointScanner<>(ametadata);
+ metadata = ametadata;
+ scanner.scan();
+ }
+ else if (Endpoint.class.isAssignableFrom(endpoint))
+ {
+ // extends Endpoint
+ @SuppressWarnings("unchecked")
+ Class extends Endpoint> eendpoint = (Class extends Endpoint>)endpoint;
+ metadata = new SimpleServerEndpointMetadata(eendpoint, config);
+ }
+ else
+ {
+ throw new DeploymentException("Unable to identify as valid Endpoint: " + endpoint);
+ }
- ServerEndpoint anno = endpoint.getAnnotation(ServerEndpoint.class);
- if (anno != null)
- {
- // Annotated takes precedence here
- AnnotatedServerEndpointMetadata ametadata = new AnnotatedServerEndpointMetadata(this, endpoint, config);
- AnnotatedEndpointScanner scanner = new AnnotatedEndpointScanner<>(ametadata);
- metadata = ametadata;
- scanner.scan();
+ return metadata;
}
- else if (Endpoint.class.isAssignableFrom(endpoint))
+ catch (RuntimeException e)
{
- // extends Endpoint
- @SuppressWarnings("unchecked")
- Class extends Endpoint> eendpoint = (Class extends Endpoint>)endpoint;
- metadata = new SimpleServerEndpointMetadata(eendpoint, config);
+ throw new DeploymentException(e.getMessage(), e);
}
- else
- {
- StringBuilder err = new StringBuilder();
- err.append("Not a recognized websocket [");
- err.append(endpoint.getName());
- err.append("] does not extend @").append(ServerEndpoint.class.getName());
- err.append(" or extend from ").append(Endpoint.class.getName());
- throw new DeploymentException("Unable to identify as valid Endpoint: " + endpoint);
- }
-
- return metadata;
}
@Override
diff --git a/jetty-websocket/javax-websocket-server-impl/src/test/java/org/eclipse/jetty/websocket/jsr356/server/PrivateEndpointTest.java b/jetty-websocket/javax-websocket-server-impl/src/test/java/org/eclipse/jetty/websocket/jsr356/server/PrivateEndpointTest.java
new file mode 100644
index 00000000000..79d7b771664
--- /dev/null
+++ b/jetty-websocket/javax-websocket-server-impl/src/test/java/org/eclipse/jetty/websocket/jsr356/server/PrivateEndpointTest.java
@@ -0,0 +1,147 @@
+//
+// ========================================================================
+// Copyright (c) 1995-2020 Mort Bay Consulting Pty Ltd and others.
+// ------------------------------------------------------------------------
+// All rights reserved. This program and the accompanying materials
+// are made available under the terms of the Eclipse Public License v1.0
+// and Apache License v2.0 which accompanies this distribution.
+//
+// The Eclipse Public License is available at
+// http://www.eclipse.org/legal/epl-v10.html
+//
+// The Apache License v2.0 is available at
+// http://www.opensource.org/licenses/apache2.0.php
+//
+// You may elect to redistribute this code under either of these licenses.
+// ========================================================================
+//
+
+package org.eclipse.jetty.websocket.jsr356.server;
+
+import javax.websocket.ContainerProvider;
+import javax.websocket.DeploymentException;
+import javax.websocket.Endpoint;
+import javax.websocket.EndpointConfig;
+import javax.websocket.MessageHandler;
+import javax.websocket.OnMessage;
+import javax.websocket.Session;
+import javax.websocket.WebSocketContainer;
+import javax.websocket.server.ServerEndpoint;
+import javax.websocket.server.ServerEndpointConfig;
+
+import org.eclipse.jetty.server.Server;
+import org.eclipse.jetty.server.ServerConnector;
+import org.eclipse.jetty.servlet.ServletContextHandler;
+import org.eclipse.jetty.util.component.LifeCycle;
+import org.eclipse.jetty.websocket.jsr356.server.deploy.WebSocketServerContainerInitializer;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.containsString;
+import static org.hamcrest.Matchers.instanceOf;
+import static org.junit.jupiter.api.Assertions.assertThrows;
+
+public class PrivateEndpointTest
+{
+ private Server server;
+ private WebSocketContainer client;
+ private ServletContextHandler contextHandler;
+
+ @BeforeEach
+ public void before()
+ {
+ server = new Server();
+ ServerConnector connector = new ServerConnector(server);
+ server.addConnector(connector);
+
+ contextHandler = new ServletContextHandler();
+ contextHandler.setContextPath("/");
+ server.setHandler(contextHandler);
+ client = ContainerProvider.getWebSocketContainer();
+ }
+
+ @AfterEach
+ public void after() throws Exception
+ {
+ LifeCycle.stop(client);
+ server.stop();
+ }
+
+ public interface CheckedConsumer
+ {
+ void accept(T t) throws DeploymentException;
+ }
+
+ public void start(CheckedConsumer containerConsumer) throws Exception
+ {
+ WebSocketServerContainerInitializer.configure(contextHandler, (context, container) -> containerConsumer.accept(container));
+ server.start();
+ }
+
+ private static class ServerSocket extends Endpoint implements MessageHandler.Whole
+ {
+ @Override
+ public void onOpen(Session session, EndpointConfig config)
+ {
+ session.addMessageHandler(this);
+ }
+
+ @Override
+ public void onMessage(String message)
+ {
+ }
+ }
+
+ @ServerEndpoint("/annotated")
+ private static class AnnotatedServerSocket
+ {
+ @OnMessage
+ public void onMessage(String message)
+ {
+ }
+ }
+
+ @ServerEndpoint("/annotatedMethod")
+ public static class AnnotatedServerMethod
+ {
+ @OnMessage
+ private void onMessage(String message)
+ {
+ }
+ }
+
+ @Test
+ public void testEndpoint()
+ {
+ RuntimeException error = assertThrows(RuntimeException.class, () ->
+ start(container -> container.addEndpoint(ServerEndpointConfig.Builder.create(ServerSocket.class, "/").build())));
+
+ assertThat(error.getCause(), instanceOf(DeploymentException.class));
+ DeploymentException deploymentException = (DeploymentException)error.getCause();
+ assertThat(deploymentException.getMessage(), containsString("Class modifier must be public"));
+ }
+
+ @Test
+ public void testAnnotatedEndpoint()
+ {
+ RuntimeException error = assertThrows(RuntimeException.class, () ->
+ start(container -> container.addEndpoint(AnnotatedServerSocket.class)));
+
+ assertThat(error.getCause(), instanceOf(DeploymentException.class));
+ DeploymentException deploymentException = (DeploymentException)error.getCause();
+ assertThat(deploymentException.getMessage(), containsString("Class modifier must be public"));
+ }
+
+ @Test
+ public void testAnnotatedMethod()
+ {
+ RuntimeException error = assertThrows(RuntimeException.class, () ->
+ start(container -> container.addEndpoint(AnnotatedServerMethod.class)));
+
+ assertThat(error.getCause(), instanceOf(DeploymentException.class));
+ DeploymentException deploymentException = (DeploymentException)error.getCause();
+ assertThat(deploymentException.getMessage(), containsString("Method modifier must be public"));
+ }
+}
From add00c9dd8750c4e97508ac0ab6fbe84f9d0b82a Mon Sep 17 00:00:00 2001
From: Lachlan Roberts
Date: Mon, 25 May 2020 13:57:41 +1000
Subject: [PATCH 62/77] Issue #4903 - check endpoint class is default
constructable
Signed-off-by: Lachlan Roberts
---
.../jsr356/server/ServerContainer.java | 6 ++--
.../jsr356/server/PrivateEndpointTest.java | 32 +++++++++++++++++--
2 files changed, 32 insertions(+), 6 deletions(-)
diff --git a/jetty-websocket/javax-websocket-server-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/server/ServerContainer.java b/jetty-websocket/javax-websocket-server-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/server/ServerContainer.java
index 6365d92be71..f0cca5e66af 100644
--- a/jetty-websocket/javax-websocket-server-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/server/ServerContainer.java
+++ b/jetty-websocket/javax-websocket-server-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/server/ServerContainer.java
@@ -18,7 +18,6 @@
package org.eclipse.jetty.websocket.jsr356.server;
-import java.lang.reflect.Modifier;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.Executor;
@@ -35,6 +34,7 @@ import org.eclipse.jetty.util.annotation.ManagedObject;
import org.eclipse.jetty.util.log.Log;
import org.eclipse.jetty.util.log.Logger;
import org.eclipse.jetty.websocket.common.events.EventDriverFactory;
+import org.eclipse.jetty.websocket.common.util.ReflectUtils;
import org.eclipse.jetty.websocket.jsr356.ClientContainer;
import org.eclipse.jetty.websocket.jsr356.JsrSessionFactory;
import org.eclipse.jetty.websocket.jsr356.annotations.AnnotatedEndpointScanner;
@@ -138,8 +138,8 @@ public class ServerContainer extends ClientContainer implements javax.websocket.
private void addEndpoint(ServerEndpointMetadata metadata) throws DeploymentException
{
- if (!Modifier.isPublic(metadata.getEndpointClass().getModifiers()))
- throw new DeploymentException("Class modifier must be public");
+ if (!ReflectUtils.isDefaultConstructable(metadata.getEndpointClass()))
+ throw new DeploymentException("Cannot access default constructor for the Endpoint class");
JsrCreator creator = new JsrCreator(this, metadata, this.configuration.getFactory().getExtensionFactory());
this.configuration.addMapping("uri-template|" + metadata.getPath(), creator);
diff --git a/jetty-websocket/javax-websocket-server-impl/src/test/java/org/eclipse/jetty/websocket/jsr356/server/PrivateEndpointTest.java b/jetty-websocket/javax-websocket-server-impl/src/test/java/org/eclipse/jetty/websocket/jsr356/server/PrivateEndpointTest.java
index 79d7b771664..33e7b349590 100644
--- a/jetty-websocket/javax-websocket-server-impl/src/test/java/org/eclipse/jetty/websocket/jsr356/server/PrivateEndpointTest.java
+++ b/jetty-websocket/javax-websocket-server-impl/src/test/java/org/eclipse/jetty/websocket/jsr356/server/PrivateEndpointTest.java
@@ -94,6 +94,21 @@ public class PrivateEndpointTest
}
}
+ @SuppressWarnings("InnerClassMayBeStatic")
+ public class ServerSocketNonStatic extends Endpoint implements MessageHandler.Whole
+ {
+ @Override
+ public void onOpen(Session session, EndpointConfig config)
+ {
+ session.addMessageHandler(this);
+ }
+
+ @Override
+ public void onMessage(String message)
+ {
+ }
+ }
+
@ServerEndpoint("/annotated")
private static class AnnotatedServerSocket
{
@@ -120,7 +135,18 @@ public class PrivateEndpointTest
assertThat(error.getCause(), instanceOf(DeploymentException.class));
DeploymentException deploymentException = (DeploymentException)error.getCause();
- assertThat(deploymentException.getMessage(), containsString("Class modifier must be public"));
+ assertThat(deploymentException.getMessage(), containsString("Cannot access default constructor for the Endpoint class"));
+ }
+
+ @Test
+ public void testInnerEndpoint()
+ {
+ RuntimeException error = assertThrows(RuntimeException.class, () ->
+ start(container -> container.addEndpoint(ServerEndpointConfig.Builder.create(ServerSocketNonStatic.class, "/").build())));
+
+ assertThat(error.getCause(), instanceOf(DeploymentException.class));
+ DeploymentException deploymentException = (DeploymentException)error.getCause();
+ assertThat(deploymentException.getMessage(), containsString("Cannot access default constructor for the Endpoint class"));
}
@Test
@@ -131,7 +157,7 @@ public class PrivateEndpointTest
assertThat(error.getCause(), instanceOf(DeploymentException.class));
DeploymentException deploymentException = (DeploymentException)error.getCause();
- assertThat(deploymentException.getMessage(), containsString("Class modifier must be public"));
+ assertThat(deploymentException.getMessage(), containsString("Cannot access default constructor for the Endpoint class"));
}
@Test
@@ -144,4 +170,4 @@ public class PrivateEndpointTest
DeploymentException deploymentException = (DeploymentException)error.getCause();
assertThat(deploymentException.getMessage(), containsString("Method modifier must be public"));
}
-}
+}
\ No newline at end of file
From 470d948504daef688da39a8038a5ee8da6ff43e4 Mon Sep 17 00:00:00 2001
From: Lachlan Roberts
Date: Tue, 26 May 2020 09:35:17 +1000
Subject: [PATCH 63/77] Issue #4903 - changes from review
Signed-off-by: Lachlan Roberts
---
.../jetty/websocket/jsr356/server/ServerContainer.java | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/jetty-websocket/javax-websocket-server-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/server/ServerContainer.java b/jetty-websocket/javax-websocket-server-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/server/ServerContainer.java
index f0cca5e66af..167c4e2befe 100644
--- a/jetty-websocket/javax-websocket-server-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/server/ServerContainer.java
+++ b/jetty-websocket/javax-websocket-server-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/server/ServerContainer.java
@@ -130,7 +130,7 @@ public class ServerContainer extends ClientContainer implements javax.websocket.
{
if (deferredEndpointClasses == null)
{
- deferredEndpointClasses = new ArrayList>();
+ deferredEndpointClasses = new ArrayList<>();
}
deferredEndpointClasses.add(endpointClass);
}
@@ -161,7 +161,7 @@ public class ServerContainer extends ClientContainer implements javax.websocket.
{
if (deferredEndpointConfigs == null)
{
- deferredEndpointConfigs = new ArrayList();
+ deferredEndpointConfigs = new ArrayList<>();
}
deferredEndpointConfigs.add(config);
}
@@ -216,7 +216,10 @@ public class ServerContainer extends ClientContainer implements javax.websocket.
}
else
{
- throw new DeploymentException("Unable to identify as valid Endpoint: " + endpoint);
+ String err = "Not a recognized websocket [" + endpoint.getName() +
+ "] does not extend @" + ServerEndpoint.class.getName() +
+ " or extend from " + Endpoint.class.getName();
+ throw new DeploymentException(err);
}
return metadata;
From c41560c7cd30f9ce5e79fd307763b1e6f9072817 Mon Sep 17 00:00:00 2001
From: Lachlan Roberts
Date: Tue, 26 May 2020 15:35:39 +1000
Subject: [PATCH 64/77] Issue #4903 - add cause to Exception when creating
endpoint instance
Signed-off-by: Lachlan Roberts
---
.../jsr356/server/ContainerDefaultConfigurator.java | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/jetty-websocket/javax-websocket-server-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/server/ContainerDefaultConfigurator.java b/jetty-websocket/javax-websocket-server-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/server/ContainerDefaultConfigurator.java
index e25916d5170..0fc08fe2622 100644
--- a/jetty-websocket/javax-websocket-server-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/server/ContainerDefaultConfigurator.java
+++ b/jetty-websocket/javax-websocket-server-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/server/ContainerDefaultConfigurator.java
@@ -72,7 +72,10 @@ public final class ContainerDefaultConfigurator extends Configurator
}
catch (Exception e)
{
- throw new InstantiationException(String.format("%s: %s", e.getClass().getName(), e.getMessage()));
+ String errorMsg = String.format("%s: %s", e.getClass().getName(), e.getMessage());
+ InstantiationException instantiationException = new InstantiationException(errorMsg);
+ instantiationException.initCause(e);
+ throw instantiationException;
}
}
From 5c63b0ef7810634378a977fb9d198558da07d657 Mon Sep 17 00:00:00 2001
From: Lachlan Roberts
Date: Tue, 26 May 2020 17:37:04 +1000
Subject: [PATCH 65/77] Issue #4903 - catch Throwable instead of
RuntimeException
Signed-off-by: Lachlan Roberts
---
.../jetty/websocket/jsr356/server/ServerContainer.java | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/jetty-websocket/javax-websocket-server-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/server/ServerContainer.java b/jetty-websocket/javax-websocket-server-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/server/ServerContainer.java
index 167c4e2befe..3e2f3492873 100644
--- a/jetty-websocket/javax-websocket-server-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/server/ServerContainer.java
+++ b/jetty-websocket/javax-websocket-server-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/server/ServerContainer.java
@@ -224,9 +224,11 @@ public class ServerContainer extends ClientContainer implements javax.websocket.
return metadata;
}
- catch (RuntimeException e)
+ catch (Throwable t)
{
- throw new DeploymentException(e.getMessage(), e);
+ if (t instanceof DeploymentException)
+ throw t;
+ throw new DeploymentException(t.getMessage(), t);
}
}
From a11c7f554c50dc26d29b4b1d69ee5aabded80960 Mon Sep 17 00:00:00 2001
From: Lachlan Roberts
Date: Wed, 27 May 2020 09:42:44 +1000
Subject: [PATCH 66/77] Issue #4903 - cleanup catch statement from review
Signed-off-by: Lachlan Roberts
---
.../jetty/websocket/jsr356/server/ServerContainer.java | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/jetty-websocket/javax-websocket-server-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/server/ServerContainer.java b/jetty-websocket/javax-websocket-server-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/server/ServerContainer.java
index 3e2f3492873..4e79073c34f 100644
--- a/jetty-websocket/javax-websocket-server-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/server/ServerContainer.java
+++ b/jetty-websocket/javax-websocket-server-impl/src/main/java/org/eclipse/jetty/websocket/jsr356/server/ServerContainer.java
@@ -224,10 +224,12 @@ public class ServerContainer extends ClientContainer implements javax.websocket.
return metadata;
}
+ catch (DeploymentException e)
+ {
+ throw e;
+ }
catch (Throwable t)
{
- if (t instanceof DeploymentException)
- throw t;
throw new DeploymentException(t.getMessage(), t);
}
}
From c05bd6c26d036aced86defad8294a3dccd9f8f17 Mon Sep 17 00:00:00 2001
From: olivier lamy
Date: Sat, 23 May 2020 15:09:28 +1000
Subject: [PATCH 67/77] use testcontainers/docker to run jdbc sessions tests
with Mariadb remote
Signed-off-by: olivier lamy
---
.../jetty/server/session/DatabaseAdaptor.java | 25 +++-
pom.xml | 5 +-
.../test-sessions/test-jdbc-sessions/pom.xml | 63 +++++++++-
.../jetty/server/session/JdbcTestHelper.java | 112 ++++++++++++------
.../session/SessionTableSchemaTest.java | 47 +++++---
.../test/resources/simplelogger.properties | 3 +
6 files changed, 202 insertions(+), 53 deletions(-)
create mode 100644 tests/test-sessions/test-jdbc-sessions/src/test/resources/simplelogger.properties
diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/session/DatabaseAdaptor.java b/jetty-server/src/main/java/org/eclipse/jetty/server/session/DatabaseAdaptor.java
index 82f39cf081c..4bcf2217530 100644
--- a/jetty-server/src/main/java/org/eclipse/jetty/server/session/DatabaseAdaptor.java
+++ b/jetty-server/src/main/java/org/eclipse/jetty/server/session/DatabaseAdaptor.java
@@ -60,6 +60,8 @@ public class DatabaseAdaptor
private String _connectionUrl;
private Driver _driver;
private DataSource _datasource;
+ private String _username;
+ private String _password;
private String _jndiName;
@@ -257,6 +259,26 @@ public class DatabaseAdaptor
return _connectionUrl;
}
+ public String getUsername()
+ {
+ return _username;
+ }
+
+ public void setUsername(String username)
+ {
+ this._username = username;
+ }
+
+ public String getPassword()
+ {
+ return _password;
+ }
+
+ public void setPassword(String password)
+ {
+ this._password = password;
+ }
+
public void initialize()
throws Exception
{
@@ -302,7 +324,8 @@ public class DatabaseAdaptor
if (_datasource != null)
return _datasource.getConnection();
else
- return DriverManager.getConnection(_connectionUrl);
+ return _username == null ? DriverManager.getConnection(_connectionUrl)
+ : DriverManager.getConnection(_connectionUrl, _username, _password);
}
/**
diff --git a/pom.xml b/pom.xml
index f46bfd8e471..91559f53c20 100644
--- a/pom.xml
+++ b/pom.xml
@@ -63,6 +63,7 @@
${project.build.directory}/local-reposrc/it/settings.xml0
+ 1.14.2
@@ -1083,12 +1084,12 @@
org.testcontainerstestcontainers
- 1.14.1
+ ${testcontainers.version}org.testcontainersjunit-jupiter
- 1.14.1
+ ${testcontainers.version}
diff --git a/tests/test-sessions/test-jdbc-sessions/pom.xml b/tests/test-sessions/test-jdbc-sessions/pom.xml
index 5afd5a55d69..3bec9345b71 100644
--- a/tests/test-sessions/test-jdbc-sessions/pom.xml
+++ b/tests/test-sessions/test-jdbc-sessions/pom.xml
@@ -8,9 +8,9 @@
test-jdbc-sessionsJetty Tests :: Sessions :: JDBC
- http://www.eclipse.org/jetty${project.groupId}.sessions.jdbc
+ 10.3.6
@@ -22,6 +22,15 @@
true
+
+ org.apache.maven.plugins
+ maven-surefire-plugin
+
+
+ false
+
+
+
@@ -60,5 +69,57 @@
jetty-test-helpertest
+
+ org.testcontainers
+ testcontainers
+ test
+
+
+ org.testcontainers
+ mariadb
+ ${testcontainers.version}
+ test
+
+
+ org.testcontainers
+ junit-jupiter
+ test
+
+
+ org.slf4j
+ slf4j-simple
+ test
+
+
+ org.mariadb.jdbc
+ mariadb-java-client
+ 2.6.0
+ test
+
+
+
+ remote-session-tests
+
+
+ mariadb.enabled
+ true
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-surefire-plugin
+
+
+ ${mariadb.docker.version}
+ true
+
+
+
+
+
+
+
diff --git a/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/JdbcTestHelper.java b/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/JdbcTestHelper.java
index ec9b2235e99..0affc485e3f 100644
--- a/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/JdbcTestHelper.java
+++ b/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/JdbcTestHelper.java
@@ -33,6 +33,11 @@ import java.util.Set;
import org.eclipse.jetty.toolchain.test.MavenTestingUtils;
import org.eclipse.jetty.util.ClassLoadingObjectInputStream;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.testcontainers.containers.GenericContainer;
+import org.testcontainers.containers.MariaDBContainer;
+import org.testcontainers.containers.output.Slf4jLogConsumer;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
@@ -42,9 +47,14 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
*/
public class JdbcTestHelper
{
- public static final String DRIVER_CLASS = "org.apache.derby.jdbc.EmbeddedDriver";
- public static final String DEFAULT_CONNECTION_URL = "jdbc:derby:memory:sessions;create=true";
- public static final String DEFAULT_SHUTDOWN_URL = "jdbc:derby:memory:sessions;drop=true";
+ public static final boolean USE_MARIADB = Boolean.getBoolean("mariadb.enabled");
+
+ private static final Logger LOG = LoggerFactory.getLogger(JdbcTestHelper.class);
+ private static final Logger MARIADB_LOG = LoggerFactory.getLogger("org.eclipse.jetty.server.session.MariaDbLogs");
+
+ public static String DRIVER_CLASS = "org.apache.derby.jdbc.EmbeddedDriver";
+ public static String DEFAULT_CONNECTION_URL = "jdbc:derby:memory:sessions;create=true";
+ public static String DEFAULT_SHUTDOWN_URL = "jdbc:derby:memory:sessions;drop=true";
public static final int STALE_INTERVAL = 1;
public static final String EXPIRY_COL = "extime";
@@ -60,6 +70,33 @@ public class JdbcTestHelper
public static final String COOKIE_COL = "cooktime";
public static final String CREATE_COL = "ctime";
+ static MariaDBContainer MARIAD_DB =
+ new MariaDBContainer("mariadb:" + System.getProperty("mariadb.docker.version", "10.3.6"))
+ .withDatabaseName("sessions");
+
+ static
+ {
+ if (USE_MARIADB)
+ {
+ try
+ {
+ long start = System.currentTimeMillis();
+ MARIAD_DB.withLogConsumer(new Slf4jLogConsumer(MARIADB_LOG)).start();
+ String containerIpAddress = MARIAD_DB.getContainerIpAddress();
+ int mariadbPort = MARIAD_DB.getMappedPort(3306);
+ DEFAULT_CONNECTION_URL = MARIAD_DB.getJdbcUrl();
+ DRIVER_CLASS = MARIAD_DB.getDriverClassName();
+ LOG.info("Mariadb container started for {}:{} - {}ms", containerIpAddress, mariadbPort,
+ System.currentTimeMillis() - start);
+ }
+ catch (Exception e)
+ {
+ LOG.error(e.getMessage(), e);
+ throw new RuntimeException(e.getMessage(), e);
+ }
+ }
+ }
+
static
{
System.setProperty("derby.system.home", MavenTestingUtils.getTargetFile("test-derby").getAbsolutePath());
@@ -68,6 +105,14 @@ public class JdbcTestHelper
public static void shutdown(String connectionUrl)
throws Exception
{
+ if (USE_MARIADB)
+ {
+ try (Connection connection = getConnection())
+ {
+ connection.prepareStatement("truncate table " + TABLE).executeUpdate();
+ }
+ return;
+ }
if (connectionUrl == null)
connectionUrl = DEFAULT_SHUTDOWN_URL;
@@ -84,14 +129,34 @@ public class JdbcTestHelper
}
}
+ public static DatabaseAdaptor buildDatabaseAdaptor()
+ {
+ DatabaseAdaptor da = new DatabaseAdaptor();
+ if (USE_MARIADB)
+ {
+ da.setUsername(MARIAD_DB.getUsername());
+ da.setPassword(MARIAD_DB.getPassword());
+ }
+ da.setDriverInfo(DRIVER_CLASS, DEFAULT_CONNECTION_URL);
+ return da;
+ }
+
+ public static Connection getConnection()
+ throws Exception
+ {
+ Class.forName(DRIVER_CLASS);
+ return USE_MARIADB ? DriverManager.getConnection(DEFAULT_CONNECTION_URL,
+ MARIAD_DB.getUsername(),
+ MARIAD_DB.getPassword())
+ : DriverManager.getConnection(DEFAULT_CONNECTION_URL);
+ }
+
/**
* @return a fresh JDBCSessionDataStoreFactory
*/
public static SessionDataStoreFactory newSessionDataStoreFactory()
{
- DatabaseAdaptor da = new DatabaseAdaptor();
- da.setDriverInfo(DRIVER_CLASS, DEFAULT_CONNECTION_URL);
- return newSessionDataStoreFactory(da);
+ return newSessionDataStoreFactory(buildDatabaseAdaptor());
}
public static SessionDataStoreFactory newSessionDataStoreFactory(DatabaseAdaptor da)
@@ -123,8 +188,7 @@ public class JdbcTestHelper
public static void prepareTables() throws SQLException
{
- DatabaseAdaptor da = new DatabaseAdaptor();
- da.setDriverInfo(DRIVER_CLASS, DEFAULT_CONNECTION_URL);
+ DatabaseAdaptor da = buildDatabaseAdaptor();
JDBCSessionDataStore.SessionTableSchema sessionTableSchema = newSessionTableSchema();
sessionTableSchema.setDatabaseAdaptor(da);
@@ -163,11 +227,8 @@ public class JdbcTestHelper
public static boolean existsInSessionTable(String id, boolean verbose)
throws Exception
{
- Class.forName(DRIVER_CLASS);
- Connection con = null;
- try
+ try (Connection con = getConnection())
{
- con = DriverManager.getConnection(DEFAULT_CONNECTION_URL);
PreparedStatement statement = con.prepareStatement("select * from " +
TABLE +
" where " + ID_COL + " = ?");
@@ -186,21 +247,15 @@ public class JdbcTestHelper
else
return result.next();
}
- finally
- {
- if (con != null)
- con.close();
- }
}
@SuppressWarnings("unchecked")
public static boolean checkSessionPersisted(SessionData data)
throws Exception
{
- Class.forName(DRIVER_CLASS);
PreparedStatement statement = null;
ResultSet result = null;
- try (Connection con = DriverManager.getConnection(DEFAULT_CONNECTION_URL);)
+ try (Connection con = getConnection())
{
statement = con.prepareStatement("select * from " + TABLE +
" where " + ID_COL + " = ? and " + CONTEXT_COL +
@@ -264,9 +319,7 @@ public class JdbcTestHelper
public static void insertSession(SessionData data) throws Exception
{
-
- Class.forName(DRIVER_CLASS);
- try (Connection con = DriverManager.getConnection(DEFAULT_CONNECTION_URL);)
+ try (Connection con = getConnection())
{
PreparedStatement statement = con.prepareStatement("insert into " + TABLE +
" (" + ID_COL + ", " + CONTEXT_COL + ", virtualHost, " + LAST_NODE_COL +
@@ -310,8 +363,7 @@ public class JdbcTestHelper
long cookieSet, long lastSaved)
throws Exception
{
- Class.forName(DRIVER_CLASS);
- try (Connection con = DriverManager.getConnection(DEFAULT_CONNECTION_URL);)
+ try (Connection con = getConnection())
{
PreparedStatement statement = con.prepareStatement("insert into " + TABLE +
" (" + ID_COL + ", " + CONTEXT_COL + ", virtualHost, " + LAST_NODE_COL +
@@ -343,12 +395,9 @@ public class JdbcTestHelper
public static Set getSessionIds()
throws Exception
{
- HashSet ids = new HashSet();
- Class.forName(DRIVER_CLASS);
- Connection con = null;
- try
+ HashSet ids = new HashSet<>();
+ try (Connection con = getConnection())
{
- con = DriverManager.getConnection(DEFAULT_CONNECTION_URL);
PreparedStatement statement = con.prepareStatement("select " + ID_COL + " from " + TABLE);
ResultSet result = statement.executeQuery();
while (result.next())
@@ -357,10 +406,5 @@ public class JdbcTestHelper
}
return ids;
}
- finally
- {
- if (con != null)
- con.close();
- }
}
}
diff --git a/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/SessionTableSchemaTest.java b/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/SessionTableSchemaTest.java
index a6755e7754f..09f8e728c8d 100644
--- a/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/SessionTableSchemaTest.java
+++ b/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/SessionTableSchemaTest.java
@@ -29,6 +29,7 @@ import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
+import static org.eclipse.jetty.server.session.JdbcTestHelper.USE_MARIADB;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;
@@ -60,6 +61,11 @@ public class SessionTableSchemaTest
return true; //test special handling for oracle
}
};
+ if (USE_MARIADB)
+ {
+ _da.setUsername(JdbcTestHelper.MARIAD_DB.getUsername());
+ _da.setPassword(JdbcTestHelper.MARIAD_DB.getPassword());
+ }
_da.setDriverInfo(JdbcTestHelper.DRIVER_CLASS, JdbcTestHelper.DEFAULT_CONNECTION_URL);
_tableSchema = JdbcTestHelper.newSessionTableSchema();
_tableSchema.setDatabaseAdaptor(_da);
@@ -84,8 +90,7 @@ public class SessionTableSchemaTest
public static void insertSessionWithoutAttributes(String id, String contextPath, String vhost)
throws Exception
{
- Class.forName(JdbcTestHelper.DRIVER_CLASS);
- try (Connection con = DriverManager.getConnection(JdbcTestHelper.DEFAULT_CONNECTION_URL);)
+ try (Connection con = JdbcTestHelper.getConnection())
{
PreparedStatement statement = con.prepareStatement("insert into " + JdbcTestHelper.TABLE +
" (" + JdbcTestHelper.ID_COL + ", " + JdbcTestHelper.CONTEXT_COL + ", virtualHost, " + JdbcTestHelper.LAST_NODE_COL +
@@ -119,8 +124,10 @@ public class SessionTableSchemaTest
_da.initialize();
_tableSchema.prepareTables();
+ String id = Long.toString(System.nanoTime());
+
//insert a fake session at the root context
- insertSessionWithoutAttributes("1234", "/", "0.0.0.0");
+ insertSessionWithoutAttributes(id, "/", "0.0.0.0");
//test if it can be seen
try (Connection con = _da.getConnection())
@@ -130,7 +137,7 @@ public class SessionTableSchemaTest
handler.setContextPath("/");
SessionContext sc = new SessionContext("0", handler.getServletContext());
//test the load statement
- PreparedStatement s = _tableSchema.getLoadStatement(con, "1234", sc);
+ PreparedStatement s = _tableSchema.getLoadStatement(con, id, sc);
ResultSet rs = s.executeQuery();
assertTrue(rs.next());
}
@@ -144,8 +151,10 @@ public class SessionTableSchemaTest
_da.initialize();
_tableSchema.prepareTables();
+ String id = Long.toString(System.nanoTime());
+
//insert a fake session at the root context
- insertSessionWithoutAttributes("1234", "/", "0.0.0.0");
+ insertSessionWithoutAttributes(id, "/", "0.0.0.0");
//test if it can be seen
try (Connection con = _da.getConnection())
@@ -154,7 +163,7 @@ public class SessionTableSchemaTest
handler.setContextPath("/");
SessionContext sc = new SessionContext("0", handler.getServletContext());
PreparedStatement s = _tableSchema.getCheckSessionExistsStatement(con, sc);
- s.setString(1, "1234");
+ s.setString(1, id);
ResultSet rs = s.executeQuery();
assertTrue(rs.next());
}
@@ -168,8 +177,10 @@ public class SessionTableSchemaTest
_da.initialize();
_tableSchema.prepareTables();
+ String id = Long.toString(System.nanoTime());
+
//insert a fake session at the root context
- insertSessionWithoutAttributes("1234", "/", "0.0.0.0");
+ insertSessionWithoutAttributes(id, "/", "0.0.0.0");
//test if it can be deleted
try (Connection con = _da.getConnection())
@@ -177,10 +188,10 @@ public class SessionTableSchemaTest
ContextHandler handler = new ContextHandler();
handler.setContextPath("/");
SessionContext sc = new SessionContext("0", handler.getServletContext());
- PreparedStatement s = _tableSchema.getDeleteStatement(con, "1234", sc);
+ PreparedStatement s = _tableSchema.getDeleteStatement(con, id, sc);
assertEquals(1, s.executeUpdate());
- assertFalse(JdbcTestHelper.existsInSessionTable("1234", false));
+ assertFalse(JdbcTestHelper.existsInSessionTable(id, false));
}
}
@@ -192,8 +203,10 @@ public class SessionTableSchemaTest
_da.initialize();
_tableSchema.prepareTables();
+ String id = Long.toString(System.nanoTime());
+
//insert a fake session at the root context
- insertSessionWithoutAttributes("1234", "/", "0.0.0.0");
+ insertSessionWithoutAttributes(id, "/", "0.0.0.0");
try (Connection con = _da.getConnection())
{
@@ -206,7 +219,7 @@ public class SessionTableSchemaTest
(System.currentTimeMillis() + 100L));
ResultSet rs = s.executeQuery();
assertTrue(rs.next());
- assertEquals("1234", rs.getString(1));
+ assertEquals(id, rs.getString(1));
}
}
@@ -218,8 +231,10 @@ public class SessionTableSchemaTest
_da.initialize();
_tableSchema.prepareTables();
+ String id = Long.toString(System.nanoTime());
+
//insert a fake session at the root context
- insertSessionWithoutAttributes("1234", "/", "0.0.0.0");
+ insertSessionWithoutAttributes(id, "/", "0.0.0.0");
try (Connection con = _da.getConnection())
{
@@ -231,7 +246,7 @@ public class SessionTableSchemaTest
(System.currentTimeMillis() + 100L));
ResultSet rs = s.executeQuery();
assertTrue(rs.next());
- assertEquals("1234", rs.getString(1));
+ assertEquals(id, rs.getString(1));
}
}
@@ -243,8 +258,10 @@ public class SessionTableSchemaTest
_da.initialize();
_tableSchema.prepareTables();
+ String id = Long.toString(System.nanoTime());
+
//insert a fake session at the root context
- insertSessionWithoutAttributes("1234", "/", "0.0.0.0");
+ insertSessionWithoutAttributes(id, "/", "0.0.0.0");
try (Connection con = _da.getConnection())
{
@@ -252,7 +269,7 @@ public class SessionTableSchemaTest
handler.setContextPath("/");
SessionContext sc = new SessionContext("0", handler.getServletContext());
PreparedStatement s = _tableSchema.getUpdateStatement(con,
- "1234",
+ id,
sc);
s.setString(1, "0");//should be my node id
diff --git a/tests/test-sessions/test-jdbc-sessions/src/test/resources/simplelogger.properties b/tests/test-sessions/test-jdbc-sessions/src/test/resources/simplelogger.properties
new file mode 100644
index 00000000000..6f00400db97
--- /dev/null
+++ b/tests/test-sessions/test-jdbc-sessions/src/test/resources/simplelogger.properties
@@ -0,0 +1,3 @@
+org.slf4j.simpleLogger.defaultLogLevel=info
+org.slf4j.simpleLogger.log.org.eclipse.jetty.server.session.MariaDbLogs=error
+org.slf4j.simpleLogger.log.org.eclipse.jetty.server.session.JdbcTestHelper=info
From 1249763aadaea73e64cfefad123ef6237000b936 Mon Sep 17 00:00:00 2001
From: olivier lamy
Date: Tue, 26 May 2020 15:58:38 +1000
Subject: [PATCH 68/77] remove changes to DatabaseAdaptor with new fields
username/password, use our own username/password in maria_db tests
Signed-off-by: olivier lamy
---
.../jetty/server/session/DatabaseAdaptor.java | 25 +------------------
.../jetty/server/session/JdbcTestHelper.java | 25 ++++++++++---------
.../session/SessionTableSchemaTest.java | 5 ----
3 files changed, 14 insertions(+), 41 deletions(-)
diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/session/DatabaseAdaptor.java b/jetty-server/src/main/java/org/eclipse/jetty/server/session/DatabaseAdaptor.java
index 4bcf2217530..82f39cf081c 100644
--- a/jetty-server/src/main/java/org/eclipse/jetty/server/session/DatabaseAdaptor.java
+++ b/jetty-server/src/main/java/org/eclipse/jetty/server/session/DatabaseAdaptor.java
@@ -60,8 +60,6 @@ public class DatabaseAdaptor
private String _connectionUrl;
private Driver _driver;
private DataSource _datasource;
- private String _username;
- private String _password;
private String _jndiName;
@@ -259,26 +257,6 @@ public class DatabaseAdaptor
return _connectionUrl;
}
- public String getUsername()
- {
- return _username;
- }
-
- public void setUsername(String username)
- {
- this._username = username;
- }
-
- public String getPassword()
- {
- return _password;
- }
-
- public void setPassword(String password)
- {
- this._password = password;
- }
-
public void initialize()
throws Exception
{
@@ -324,8 +302,7 @@ public class DatabaseAdaptor
if (_datasource != null)
return _datasource.getConnection();
else
- return _username == null ? DriverManager.getConnection(_connectionUrl)
- : DriverManager.getConnection(_connectionUrl, _username, _password);
+ return DriverManager.getConnection(_connectionUrl);
}
/**
diff --git a/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/JdbcTestHelper.java b/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/JdbcTestHelper.java
index 0affc485e3f..f4172c24c39 100644
--- a/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/JdbcTestHelper.java
+++ b/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/JdbcTestHelper.java
@@ -70,9 +70,10 @@ public class JdbcTestHelper
public static final String COOKIE_COL = "cooktime";
public static final String CREATE_COL = "ctime";
- static MariaDBContainer MARIAD_DB =
- new MariaDBContainer("mariadb:" + System.getProperty("mariadb.docker.version", "10.3.6"))
- .withDatabaseName("sessions");
+ static MariaDBContainer MARIAD_DB;
+
+ static final String MARIA_DB_USER = "beer";
+ static final String MARIA_DB_PASSWORD = "pacific_ale";
static
{
@@ -81,6 +82,11 @@ public class JdbcTestHelper
try
{
long start = System.currentTimeMillis();
+ MARIAD_DB =
+ new MariaDBContainer("mariadb:" + System.getProperty("mariadb.docker.version", "10.3.6"))
+ .withUsername(MARIA_DB_USER)
+ .withPassword(MARIA_DB_PASSWORD)
+ .withDatabaseName("sessions");
MARIAD_DB.withLogConsumer(new Slf4jLogConsumer(MARIADB_LOG)).start();
String containerIpAddress = MARIAD_DB.getContainerIpAddress();
int mariadbPort = MARIAD_DB.getMappedPort(3306);
@@ -88,6 +94,9 @@ public class JdbcTestHelper
DRIVER_CLASS = MARIAD_DB.getDriverClassName();
LOG.info("Mariadb container started for {}:{} - {}ms", containerIpAddress, mariadbPort,
System.currentTimeMillis() - start);
+ DEFAULT_CONNECTION_URL = DEFAULT_CONNECTION_URL + "?user=" + MARIA_DB_USER +
+ "&password=" + MARIA_DB_PASSWORD;
+ LOG.info("DEFAULT_CONNECTION_URL: {}", DEFAULT_CONNECTION_URL);
}
catch (Exception e)
{
@@ -132,11 +141,6 @@ public class JdbcTestHelper
public static DatabaseAdaptor buildDatabaseAdaptor()
{
DatabaseAdaptor da = new DatabaseAdaptor();
- if (USE_MARIADB)
- {
- da.setUsername(MARIAD_DB.getUsername());
- da.setPassword(MARIAD_DB.getPassword());
- }
da.setDriverInfo(DRIVER_CLASS, DEFAULT_CONNECTION_URL);
return da;
}
@@ -145,10 +149,7 @@ public class JdbcTestHelper
throws Exception
{
Class.forName(DRIVER_CLASS);
- return USE_MARIADB ? DriverManager.getConnection(DEFAULT_CONNECTION_URL,
- MARIAD_DB.getUsername(),
- MARIAD_DB.getPassword())
- : DriverManager.getConnection(DEFAULT_CONNECTION_URL);
+ return DriverManager.getConnection(DEFAULT_CONNECTION_URL);
}
/**
diff --git a/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/SessionTableSchemaTest.java b/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/SessionTableSchemaTest.java
index 09f8e728c8d..4bbd29561b4 100644
--- a/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/SessionTableSchemaTest.java
+++ b/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/SessionTableSchemaTest.java
@@ -61,11 +61,6 @@ public class SessionTableSchemaTest
return true; //test special handling for oracle
}
};
- if (USE_MARIADB)
- {
- _da.setUsername(JdbcTestHelper.MARIAD_DB.getUsername());
- _da.setPassword(JdbcTestHelper.MARIAD_DB.getPassword());
- }
_da.setDriverInfo(JdbcTestHelper.DRIVER_CLASS, JdbcTestHelper.DEFAULT_CONNECTION_URL);
_tableSchema = JdbcTestHelper.newSessionTableSchema();
_tableSchema.setDatabaseAdaptor(_da);
From 389f46c8263464754489a8675f19f6b0d856412c Mon Sep 17 00:00:00 2001
From: olivier lamy
Date: Tue, 26 May 2020 18:32:14 +1000
Subject: [PATCH 69/77] bye bye Derby tests, only use mariadb via container
Signed-off-by: olivier lamy
---
.../test-sessions/test-jdbc-sessions/pom.xml | 16 +---
.../jetty/server/session/JdbcTestHelper.java | 77 +++++++------------
.../session/SessionTableSchemaTest.java | 2 -
3 files changed, 29 insertions(+), 66 deletions(-)
diff --git a/tests/test-sessions/test-jdbc-sessions/pom.xml b/tests/test-sessions/test-jdbc-sessions/pom.xml
index 3bec9345b71..d6fe28174ab 100644
--- a/tests/test-sessions/test-jdbc-sessions/pom.xml
+++ b/tests/test-sessions/test-jdbc-sessions/pom.xml
@@ -26,9 +26,7 @@
org.apache.maven.pluginsmaven-surefire-plugin
-
- false
-
+ true
@@ -54,16 +52,6 @@
test-sessions-common${project.version}
-
- org.apache.derby
- derby
- test
-
-
- org.apache.derby
- derbytools
- test
- org.eclipse.jetty.toolchainjetty-test-helper
@@ -112,9 +100,9 @@
org.apache.maven.pluginsmaven-surefire-plugin
+ false${mariadb.docker.version}
- true
diff --git a/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/JdbcTestHelper.java b/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/JdbcTestHelper.java
index f4172c24c39..541f43c69c4 100644
--- a/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/JdbcTestHelper.java
+++ b/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/JdbcTestHelper.java
@@ -47,14 +47,12 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
*/
public class JdbcTestHelper
{
- public static final boolean USE_MARIADB = Boolean.getBoolean("mariadb.enabled");
-
private static final Logger LOG = LoggerFactory.getLogger(JdbcTestHelper.class);
private static final Logger MARIADB_LOG = LoggerFactory.getLogger("org.eclipse.jetty.server.session.MariaDbLogs");
- public static String DRIVER_CLASS = "org.apache.derby.jdbc.EmbeddedDriver";
- public static String DEFAULT_CONNECTION_URL = "jdbc:derby:memory:sessions;create=true";
- public static String DEFAULT_SHUTDOWN_URL = "jdbc:derby:memory:sessions;drop=true";
+ public static String DRIVER_CLASS;
+ public static String DEFAULT_CONNECTION_URL;
+
public static final int STALE_INTERVAL = 1;
public static final String EXPIRY_COL = "extime";
@@ -77,32 +75,29 @@ public class JdbcTestHelper
static
{
- if (USE_MARIADB)
+ try
{
- try
- {
- long start = System.currentTimeMillis();
- MARIAD_DB =
- new MariaDBContainer("mariadb:" + System.getProperty("mariadb.docker.version", "10.3.6"))
- .withUsername(MARIA_DB_USER)
- .withPassword(MARIA_DB_PASSWORD)
- .withDatabaseName("sessions");
- MARIAD_DB.withLogConsumer(new Slf4jLogConsumer(MARIADB_LOG)).start();
- String containerIpAddress = MARIAD_DB.getContainerIpAddress();
- int mariadbPort = MARIAD_DB.getMappedPort(3306);
- DEFAULT_CONNECTION_URL = MARIAD_DB.getJdbcUrl();
- DRIVER_CLASS = MARIAD_DB.getDriverClassName();
- LOG.info("Mariadb container started for {}:{} - {}ms", containerIpAddress, mariadbPort,
- System.currentTimeMillis() - start);
- DEFAULT_CONNECTION_URL = DEFAULT_CONNECTION_URL + "?user=" + MARIA_DB_USER +
- "&password=" + MARIA_DB_PASSWORD;
- LOG.info("DEFAULT_CONNECTION_URL: {}", DEFAULT_CONNECTION_URL);
- }
- catch (Exception e)
- {
- LOG.error(e.getMessage(), e);
- throw new RuntimeException(e.getMessage(), e);
- }
+ long start = System.currentTimeMillis();
+ MARIAD_DB =
+ new MariaDBContainer("mariadb:" + System.getProperty("mariadb.docker.version", "10.3.6"))
+ .withUsername(MARIA_DB_USER)
+ .withPassword(MARIA_DB_PASSWORD)
+ .withDatabaseName("sessions");
+ MARIAD_DB.withLogConsumer(new Slf4jLogConsumer(MARIADB_LOG)).start();
+ String containerIpAddress = MARIAD_DB.getContainerIpAddress();
+ int mariadbPort = MARIAD_DB.getMappedPort(3306);
+ DEFAULT_CONNECTION_URL = MARIAD_DB.getJdbcUrl();
+ DRIVER_CLASS = MARIAD_DB.getDriverClassName();
+ LOG.info("Mariadb container started for {}:{} - {}ms", containerIpAddress, mariadbPort,
+ System.currentTimeMillis() - start);
+ DEFAULT_CONNECTION_URL = DEFAULT_CONNECTION_URL + "?user=" + MARIA_DB_USER +
+ "&password=" + MARIA_DB_PASSWORD;
+ LOG.info("DEFAULT_CONNECTION_URL: {}", DEFAULT_CONNECTION_URL);
+ }
+ catch (Exception e)
+ {
+ LOG.error(e.getMessage(), e);
+ throw new RuntimeException(e.getMessage(), e);
}
}
@@ -114,27 +109,9 @@ public class JdbcTestHelper
public static void shutdown(String connectionUrl)
throws Exception
{
- if (USE_MARIADB)
+ try (Connection connection = getConnection())
{
- try (Connection connection = getConnection())
- {
- connection.prepareStatement("truncate table " + TABLE).executeUpdate();
- }
- return;
- }
- if (connectionUrl == null)
- connectionUrl = DEFAULT_SHUTDOWN_URL;
-
- try
- {
- DriverManager.getConnection(connectionUrl);
- }
- catch (SQLException expected)
- {
- if (!"08006".equals(expected.getSQLState()))
- {
- throw expected;
- }
+ connection.prepareStatement("truncate table " + TABLE).executeUpdate();
}
}
diff --git a/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/SessionTableSchemaTest.java b/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/SessionTableSchemaTest.java
index 4bbd29561b4..224d93cde7d 100644
--- a/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/SessionTableSchemaTest.java
+++ b/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/SessionTableSchemaTest.java
@@ -20,7 +20,6 @@ package org.eclipse.jetty.server.session;
import java.io.ByteArrayInputStream;
import java.sql.Connection;
-import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
@@ -29,7 +28,6 @@ import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
-import static org.eclipse.jetty.server.session.JdbcTestHelper.USE_MARIADB;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;
From 7cc3573ceb69e52eff272e746050201b03828eeb Mon Sep 17 00:00:00 2001
From: olivier lamy
Date: Wed, 27 May 2020 07:29:15 +1000
Subject: [PATCH 70/77] remove derby system property
Signed-off-by: olivier lamy
---
.../org/eclipse/jetty/server/session/JdbcTestHelper.java | 5 -----
1 file changed, 5 deletions(-)
diff --git a/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/JdbcTestHelper.java b/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/JdbcTestHelper.java
index 541f43c69c4..ae951339e36 100644
--- a/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/JdbcTestHelper.java
+++ b/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/JdbcTestHelper.java
@@ -101,11 +101,6 @@ public class JdbcTestHelper
}
}
- static
- {
- System.setProperty("derby.system.home", MavenTestingUtils.getTargetFile("test-derby").getAbsolutePath());
- }
-
public static void shutdown(String connectionUrl)
throws Exception
{
From 2b1fa80b63e5e0491830c9871fc67e3d41154d3d Mon Sep 17 00:00:00 2001
From: olivier lamy
Date: Wed, 27 May 2020 07:35:32 +1000
Subject: [PATCH 71/77] always run the test except if Docker not available
Signed-off-by: olivier lamy
---
.../test-sessions/test-jdbc-sessions/pom.xml | 29 ++-----------------
.../ClusteredInvalidationSessionTest.java | 2 ++
.../session/ClusteredOrphanedSessionTest.java | 2 ++
.../ClusteredSessionMigrationTest.java | 2 ++
.../ClusteredSessionScavengingTest.java | 2 ++
.../session/JDBCSessionDataStoreTest.java | 2 ++
.../ReloadedSessionMissingClassTest.java | 2 ++
.../session/SessionTableSchemaTest.java | 2 ++
.../session/WebAppObjectInSessionTest.java | 2 ++
9 files changed, 19 insertions(+), 26 deletions(-)
diff --git a/tests/test-sessions/test-jdbc-sessions/pom.xml b/tests/test-sessions/test-jdbc-sessions/pom.xml
index d6fe28174ab..a99398a0601 100644
--- a/tests/test-sessions/test-jdbc-sessions/pom.xml
+++ b/tests/test-sessions/test-jdbc-sessions/pom.xml
@@ -26,7 +26,9 @@
org.apache.maven.pluginsmaven-surefire-plugin
- true
+
+ ${mariadb.docker.version}
+
@@ -85,29 +87,4 @@
test
-
-
- remote-session-tests
-
-
- mariadb.enabled
- true
-
-
-
-
-
- org.apache.maven.plugins
- maven-surefire-plugin
-
- false
-
- ${mariadb.docker.version}
-
-
-
-
-
-
-
diff --git a/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/ClusteredInvalidationSessionTest.java b/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/ClusteredInvalidationSessionTest.java
index 5107ed56079..a2d2d3f48ca 100644
--- a/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/ClusteredInvalidationSessionTest.java
+++ b/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/ClusteredInvalidationSessionTest.java
@@ -19,10 +19,12 @@
package org.eclipse.jetty.server.session;
import org.junit.jupiter.api.AfterEach;
+import org.testcontainers.junit.jupiter.Testcontainers;
/**
* ClusteredInvalidationSessionTest
*/
+@Testcontainers(disabledWithoutDocker = true)
public class ClusteredInvalidationSessionTest extends AbstractClusteredInvalidationSessionTest
{
diff --git a/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/ClusteredOrphanedSessionTest.java b/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/ClusteredOrphanedSessionTest.java
index 9ab354ad180..4a55fd495ff 100644
--- a/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/ClusteredOrphanedSessionTest.java
+++ b/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/ClusteredOrphanedSessionTest.java
@@ -19,10 +19,12 @@
package org.eclipse.jetty.server.session;
import org.junit.jupiter.api.AfterEach;
+import org.testcontainers.junit.jupiter.Testcontainers;
/**
* ClusteredOrphanedSessionTest
*/
+@Testcontainers(disabledWithoutDocker = true)
public class ClusteredOrphanedSessionTest extends AbstractClusteredOrphanedSessionTest
{
/**
diff --git a/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/ClusteredSessionMigrationTest.java b/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/ClusteredSessionMigrationTest.java
index b1ae366c8b2..2fc4ccb5c21 100644
--- a/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/ClusteredSessionMigrationTest.java
+++ b/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/ClusteredSessionMigrationTest.java
@@ -31,6 +31,7 @@ import org.eclipse.jetty.client.api.ContentResponse;
import org.eclipse.jetty.client.api.Request;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Test;
+import org.testcontainers.junit.jupiter.Testcontainers;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
@@ -45,6 +46,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
* Rather, it tests all of the machinery above the SessionDataStore. Thus,
* to reduce test time, we only apply it to the JDBCSessionDataStore.
*/
+@Testcontainers(disabledWithoutDocker = true)
public class ClusteredSessionMigrationTest extends AbstractTestBase
{
diff --git a/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/ClusteredSessionScavengingTest.java b/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/ClusteredSessionScavengingTest.java
index aaab3eac778..45542dacfaa 100644
--- a/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/ClusteredSessionScavengingTest.java
+++ b/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/ClusteredSessionScavengingTest.java
@@ -19,10 +19,12 @@
package org.eclipse.jetty.server.session;
import org.junit.jupiter.api.AfterEach;
+import org.testcontainers.junit.jupiter.Testcontainers;
/**
* ClusteredSessionScavengingTest
*/
+@Testcontainers(disabledWithoutDocker = true)
public class ClusteredSessionScavengingTest extends AbstractClusteredSessionScavengingTest
{
/**
diff --git a/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/JDBCSessionDataStoreTest.java b/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/JDBCSessionDataStoreTest.java
index 845ddc750e7..6fa37149a8c 100644
--- a/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/JDBCSessionDataStoreTest.java
+++ b/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/JDBCSessionDataStoreTest.java
@@ -20,10 +20,12 @@ package org.eclipse.jetty.server.session;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
+import org.testcontainers.junit.jupiter.Testcontainers;
/**
* JDBCSessionDataStoreTest
*/
+@Testcontainers(disabledWithoutDocker = true)
public class JDBCSessionDataStoreTest extends AbstractSessionDataStoreTest
{
diff --git a/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/ReloadedSessionMissingClassTest.java b/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/ReloadedSessionMissingClassTest.java
index 27f1fad3c6a..50976c1c131 100644
--- a/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/ReloadedSessionMissingClassTest.java
+++ b/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/ReloadedSessionMissingClassTest.java
@@ -37,6 +37,7 @@ import org.eclipse.jetty.webapp.WebAppContext;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
+import org.testcontainers.junit.jupiter.Testcontainers;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
@@ -47,6 +48,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
* ReloadedSessionMissingClassTest
*/
@ExtendWith(WorkDirExtension.class)
+@Testcontainers(disabledWithoutDocker = true)
public class ReloadedSessionMissingClassTest
{
public WorkDir testdir;
diff --git a/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/SessionTableSchemaTest.java b/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/SessionTableSchemaTest.java
index 224d93cde7d..2319e4e861c 100644
--- a/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/SessionTableSchemaTest.java
+++ b/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/SessionTableSchemaTest.java
@@ -27,6 +27,7 @@ import org.eclipse.jetty.server.handler.ContextHandler;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
+import org.testcontainers.junit.jupiter.Testcontainers;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
@@ -38,6 +39,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
* Test the SessionTableSchema behaviour when the database treats "" as a NULL,
* like Oracle does.
*/
+@Testcontainers(disabledWithoutDocker = true)
public class SessionTableSchemaTest
{
DatabaseAdaptor _da;
diff --git a/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/WebAppObjectInSessionTest.java b/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/WebAppObjectInSessionTest.java
index e17e495002b..85b0525babd 100644
--- a/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/WebAppObjectInSessionTest.java
+++ b/tests/test-sessions/test-jdbc-sessions/src/test/java/org/eclipse/jetty/server/session/WebAppObjectInSessionTest.java
@@ -21,10 +21,12 @@ package org.eclipse.jetty.server.session;
import org.eclipse.jetty.util.resource.Resource;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Test;
+import org.testcontainers.junit.jupiter.Testcontainers;
/**
* WebAppObjectInSessionTest
*/
+@Testcontainers(disabledWithoutDocker = true)
public class WebAppObjectInSessionTest extends AbstractWebAppObjectInSessionTest
{
From e82cacfdb6ce69291c0369f22291a917248e06b0 Mon Sep 17 00:00:00 2001
From: Greg Wilkins
Date: Wed, 27 May 2020 09:53:13 +0200
Subject: [PATCH 72/77] Jetty 9.4.x single context optimisation (#4909)
* Optimisation for single context
It is a frequent deployment mode to have only a single context.
In that case, the ContextHandlerCollection can bypass a bit of
looping/matching/selecting and just call the single context,
which it works out itself anyway if the request applies to it.
Signed-off-by: Greg Wilkins
* Optimisation for single context
updates from review
Signed-off-by: Greg Wilkins
---
.../handler/ContextHandlerCollection.java | 25 +++++++++++++------
1 file changed, 18 insertions(+), 7 deletions(-)
diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ContextHandlerCollection.java b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ContextHandlerCollection.java
index adc32da6368..e2e57efc8c9 100644
--- a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ContextHandlerCollection.java
+++ b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ContextHandlerCollection.java
@@ -176,11 +176,23 @@ public class ContextHandlerCollection extends HandlerCollection
@Override
public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
{
- Handlers handlers = _handlers.get();
- if (handlers == null)
+ Mapping mapping = (Mapping)_handlers.get();
+
+ // Handle no contexts
+ if (mapping == null)
+ return;
+ Handler[] handlers = mapping.getHandlers();
+ if (handlers == null || handlers.length == 0)
return;
- Mapping mapping = (Mapping)handlers;
+ // handle only a single context.
+ if (handlers.length == 1)
+ {
+ handlers[0].handle(target, baseRequest, request, response);
+ return;
+ }
+
+ // handle async dispatch to specific context
HttpChannelState async = baseRequest.getHttpChannelState();
if (async.isAsync())
{
@@ -197,6 +209,7 @@ public class ContextHandlerCollection extends HandlerCollection
}
}
+ // handle many contexts
if (target.startsWith("/"))
{
Trie> pathBranches = mapping._pathBranches;
@@ -229,11 +242,9 @@ public class ContextHandlerCollection extends HandlerCollection
}
else
{
- if (mapping.getHandlers() == null)
- return;
- for (int i = 0; i < mapping.getHandlers().length; i++)
+ for (Handler handler : handlers)
{
- mapping.getHandlers()[i].handle(target, baseRequest, request, response);
+ handler.handle(target, baseRequest, request, response);
if (baseRequest.isHandled())
return;
}
From 65dbcc7c86abf2cb87376245f127b185efd769f2 Mon Sep 17 00:00:00 2001
From: olivier lamy
Date: Wed, 27 May 2020 18:26:08 +1000
Subject: [PATCH 73/77] fix merge
Signed-off-by: olivier lamy
---
pom.xml | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/pom.xml b/pom.xml
index c16f0cd42ca..d45feef7e64 100644
--- a/pom.xml
+++ b/pom.xml
@@ -65,6 +65,7 @@
${project.build.directory}/local-reposrc/it/settings.xml0
+ 1.4.2
@@ -1065,12 +1066,12 @@
org.testcontainerstestcontainers
- 1.14.1
+ ${testcontainers.version}org.testcontainersjunit-jupiter
- 1.14.1
+ ${testcontainers.version}
From 423777ed020ba8c51235500b2220b866504d8e58 Mon Sep 17 00:00:00 2001
From: Lachlan Roberts
Date: Wed, 27 May 2020 19:35:38 +1000
Subject: [PATCH 74/77] fix AbstractThreadPoolTest from merge from 9.4.x
Signed-off-by: Lachlan Roberts
---
.../util/thread/AbstractThreadPoolTest.java | 28 -------------------
.../util/thread/QueuedThreadPoolTest.java | 21 ++++++++++++++
2 files changed, 21 insertions(+), 28 deletions(-)
diff --git a/jetty-util/src/test/java/org/eclipse/jetty/util/thread/AbstractThreadPoolTest.java b/jetty-util/src/test/java/org/eclipse/jetty/util/thread/AbstractThreadPoolTest.java
index b46ef15b6bd..8ee09014ae9 100644
--- a/jetty-util/src/test/java/org/eclipse/jetty/util/thread/AbstractThreadPoolTest.java
+++ b/jetty-util/src/test/java/org/eclipse/jetty/util/thread/AbstractThreadPoolTest.java
@@ -18,11 +18,7 @@
package org.eclipse.jetty.util.thread;
-import java.time.Duration;
-
import org.eclipse.jetty.util.ProcessorUtils;
-import org.eclipse.jetty.util.component.ContainerLifeCycle;
-import org.eclipse.jetty.util.component.LifeCycle;
import org.eclipse.jetty.util.thread.ThreadPool.SizedThreadPool;
import org.hamcrest.Matchers;
import org.junit.jupiter.api.AfterAll;
@@ -30,8 +26,6 @@ import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import static org.hamcrest.MatcherAssert.assertThat;
-import static org.junit.jupiter.api.Assertions.assertThrows;
-import static org.junit.jupiter.api.Assertions.assertTimeoutPreemptively;
import static org.junit.jupiter.api.Assertions.fail;
public abstract class AbstractThreadPoolTest
@@ -93,26 +87,4 @@ public abstract class AbstractThreadPoolTest
assertThat(pool.getMaxThreads(), Matchers.is(3));
}
-
- @Test
- public void testJoinWithStopTimeout()
- {
- // ThreadPool must be an implement ContainerLifeCycle for this test to be valid.
- SizedThreadPool threadPool = newPool(3);
- if (!(threadPool instanceof ContainerLifeCycle))
- return;
-
- final long stopTimeout = 100;
- ((ContainerLifeCycle)threadPool).setStopTimeout(100);
- LifeCycle.start(threadPool);
-
- // Verify that join does not timeout after waiting twice the stopTimeout.
- assertThrows(Throwable.class, () ->
- assertTimeoutPreemptively(Duration.ofMillis(stopTimeout * 2), threadPool::join)
- );
-
- // After stopping the ThreadPool join should unblock.
- LifeCycle.stop(threadPool);
- assertTimeoutPreemptively(Duration.ofMillis(stopTimeout), threadPool::join);
- }
}
diff --git a/jetty-util/src/test/java/org/eclipse/jetty/util/thread/QueuedThreadPoolTest.java b/jetty-util/src/test/java/org/eclipse/jetty/util/thread/QueuedThreadPoolTest.java
index 770a481b675..ef6b13efc66 100644
--- a/jetty-util/src/test/java/org/eclipse/jetty/util/thread/QueuedThreadPoolTest.java
+++ b/jetty-util/src/test/java/org/eclipse/jetty/util/thread/QueuedThreadPoolTest.java
@@ -19,11 +19,13 @@
package org.eclipse.jetty.util.thread;
import java.io.Closeable;
+import java.time.Duration;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
import org.eclipse.jetty.logging.StacklessLogging;
+import org.eclipse.jetty.util.component.LifeCycle;
import org.eclipse.jetty.util.thread.ThreadPool.SizedThreadPool;
import org.junit.jupiter.api.Test;
import org.slf4j.Logger;
@@ -36,6 +38,7 @@ import static org.hamcrest.Matchers.lessThan;
import static org.hamcrest.core.StringContains.containsString;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertThrows;
+import static org.junit.jupiter.api.Assertions.assertTimeoutPreemptively;
import static org.junit.jupiter.api.Assertions.assertTrue;
public class QueuedThreadPoolTest extends AbstractThreadPoolTest
@@ -753,6 +756,24 @@ public class QueuedThreadPoolTest extends AbstractThreadPoolTest
assertThrows(IllegalArgumentException.class, () -> new QueuedThreadPool(4, 8));
}
+ @Test
+ public void testJoinWithStopTimeout() throws Exception
+ {
+ final long stopTimeout = 100;
+ QueuedThreadPool threadPool = new QueuedThreadPool();
+ threadPool.setStopTimeout(100);
+ threadPool.start();
+
+ // Verify that join does not timeout after waiting twice the stopTimeout.
+ assertThrows(Throwable.class, () ->
+ assertTimeoutPreemptively(Duration.ofMillis(stopTimeout * 2), threadPool::join)
+ );
+
+ // After stopping the ThreadPool join should unblock.
+ LifeCycle.stop(threadPool);
+ assertTimeoutPreemptively(Duration.ofMillis(stopTimeout), threadPool::join);
+ }
+
@Test
public void testDump() throws Exception
{
From 85b500fc15db9cd39640dab4adbc7a2840994e01 Mon Sep 17 00:00:00 2001
From: olivier lamy
Date: Wed, 27 May 2020 20:27:14 +1000
Subject: [PATCH 75/77] cleanup unused imports
Signed-off-by: olivier lamy
---
.../server/session/infinispan/RemoteQueryManagerTest.java | 4 ----
1 file changed, 4 deletions(-)
diff --git a/jetty-infinispan/infinispan-remote-query/src/test/java/org/eclipse/jetty/server/session/infinispan/RemoteQueryManagerTest.java b/jetty-infinispan/infinispan-remote-query/src/test/java/org/eclipse/jetty/server/session/infinispan/RemoteQueryManagerTest.java
index 53b04adeb25..603142c51cf 100644
--- a/jetty-infinispan/infinispan-remote-query/src/test/java/org/eclipse/jetty/server/session/infinispan/RemoteQueryManagerTest.java
+++ b/jetty-infinispan/infinispan-remote-query/src/test/java/org/eclipse/jetty/server/session/infinispan/RemoteQueryManagerTest.java
@@ -41,18 +41,14 @@ import org.infinispan.client.hotrod.configuration.ConfigurationBuilder;
import org.infinispan.client.hotrod.marshall.ProtoStreamMarshaller;
import org.infinispan.protostream.FileDescriptorSource;
import org.infinispan.protostream.SerializationContext;
-import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.AfterEach;
-import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
-import org.junit.runner.RunWith;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.testcontainers.containers.GenericContainer;
import org.testcontainers.containers.output.Slf4jLogConsumer;
import org.testcontainers.containers.wait.strategy.LogMessageWaitStrategy;
-import org.testcontainers.utility.MountableFile;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
From d6c77a8a44285922e0609e5242c6e95adef37d0f Mon Sep 17 00:00:00 2001
From: olivier lamy
Date: Wed, 27 May 2020 20:41:15 +1000
Subject: [PATCH 76/77] fix merge from 9.4.x
Signed-off-by: olivier lamy
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index d45feef7e64..9a824ca94c3 100644
--- a/pom.xml
+++ b/pom.xml
@@ -65,7 +65,7 @@
${project.build.directory}/local-reposrc/it/settings.xml0
- 1.4.2
+ 1.14.2
From aae64f181c4c33be994bfad6cb920f1b959f7b05 Mon Sep 17 00:00:00 2001
From: Jan Bartel
Date: Wed, 27 May 2020 13:42:01 +0200
Subject: [PATCH 77/77] Issue #4894 use schema and/or catalog name when
creating sessions table (#4908)
Signed-off-by: Jan Bartel
---
.../sessions/session-configuration-jdbc.adoc | 22 ++++++-
.../etc/sessions/jdbc/session-store.xml | 6 ++
.../config/modules/session-store-jdbc.mod | 11 ++++
.../server/session/JDBCSessionDataStore.java | 61 +++++++++++++++----
4 files changed, 86 insertions(+), 14 deletions(-)
diff --git a/jetty-documentation/src/main/asciidoc/administration/sessions/session-configuration-jdbc.adoc b/jetty-documentation/src/main/asciidoc/administration/sessions/session-configuration-jdbc.adoc
index e02c04ca5e2..533cc88e061 100644
--- a/jetty-documentation/src/main/asciidoc/administration/sessions/session-configuration-jdbc.adoc
+++ b/jetty-documentation/src/main/asciidoc/administration/sessions/session-configuration-jdbc.adoc
@@ -85,6 +85,16 @@ db-connection-type=datasource
#jetty.session.jdbc.schema.maxIntervalColumn=maxInterval
#jetty.session.jdbc.schema.mapColumn=map
#jetty.session.jdbc.schema.table=JettySessions
+# Optional name of the schema used to identify where the session table is defined in the database:
+# "" - empty string, no schema name
+# "INFERRED" - special string meaning infer from the current db connection
+# name - a string defined by the user
+#jetty.session.jdbc.schema.schemaName
+# Optional name of the catalog used to identify where the session table is defined in the database:
+# "" - empty string, no catalog name
+# "INFERRED" - special string meaning infer from the current db connection
+# name - a string defined by the user
+#jetty.session.jdbc.schema.catalogName
----
jetty.session.gracePeriod.seconds::
@@ -111,4 +121,14 @@ jetty.session.jdbc.driverUrl::
Url of the database which includes the driver type, host name and port, service name and any specific attributes unique to the database, such as a username.
As an example, here is a mysql connection with the username appended: `jdbc:mysql://127.0.0.1:3306/sessions?user=sessionsadmin`.
-The `jetty.sessionTableSchema` values represent the names for the columns in the JDBC database and can be changed to suit your environment.
+The `jetty.session.jdbc.schema.*` values represent the names of the table and columns in the JDBC database used to store sessions and can be changed to suit your environment.
+
+There are also two special, optional properties: `jetty.session.jdbc.schema.schemaName` and `jetty.session.jdbc.schema.catalogName`.
+The exact meaning of these two properties is dependent on your database vendor, but can broadly be described as further scoping for the session table name.
+See https://en.wikipedia.org/wiki/Database_schema and https://en.wikipedia.org/wiki/Database_catalog.
+These extra scoping names can come into play at startup time when jetty determines if the session table already exists, or otherwise creates it on-the-fly.
+If you have employed either of these concepts when you pre-created the session table, or you want to ensure that jetty uses them when it auto-creates the session table, then you have two options: either set them explicitly, or let jetty infer them from a database connection (obtained using either a Datasource or Driver according to the `db-connection-type` you have configured).
+To set them explicitly, uncomment and supply appropriate values for the `jetty.session.jdbc.schema.schemaName` and/or `jetty.session.jdbc.schema.catalogName` properties.
+To allow jetty to infer them from a database connection, use the special string `INFERRED` instead.
+If you leave them blank or commented out, then the sessions table will not be scoped by schema or catalog name.
+
diff --git a/jetty-server/src/main/config/etc/sessions/jdbc/session-store.xml b/jetty-server/src/main/config/etc/sessions/jdbc/session-store.xml
index 2bc8295ec5b..6a96d65f167 100644
--- a/jetty-server/src/main/config/etc/sessions/jdbc/session-store.xml
+++ b/jetty-server/src/main/config/etc/sessions/jdbc/session-store.xml
@@ -54,6 +54,12 @@
+
+
+
+
+
+
diff --git a/jetty-server/src/main/config/modules/session-store-jdbc.mod b/jetty-server/src/main/config/modules/session-store-jdbc.mod
index e97457d0781..b367e364309 100644
--- a/jetty-server/src/main/config/modules/session-store-jdbc.mod
+++ b/jetty-server/src/main/config/modules/session-store-jdbc.mod
@@ -55,3 +55,14 @@ db-connection-type=datasource
#jetty.session.jdbc.schema.maxIntervalColumn=maxInterval
#jetty.session.jdbc.schema.mapColumn=map
#jetty.session.jdbc.schema.table=JettySessions
+# Optional name of the schema used to identify where the session table is defined in the database:
+# "" - empty string, no schema name
+# "INFERRED" - special string meaning infer from the current db connection
+# name - a string defined by the user
+#jetty.session.jdbc.schema.schemaName
+# Optional name of the catalog used to identify where the session table is defined in the database:
+# "" - empty string, no catalog name
+# "INFERRED" - special string meaning infer from the current db connection
+# name - a string defined by the user
+#jetty.session.jdbc.schema.catalogName
+
diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/session/JDBCSessionDataStore.java b/jetty-server/src/main/java/org/eclipse/jetty/server/session/JDBCSessionDataStore.java
index 54e6b5354a7..0fb2f3830f8 100644
--- a/jetty-server/src/main/java/org/eclipse/jetty/server/session/JDBCSessionDataStore.java
+++ b/jetty-server/src/main/java/org/eclipse/jetty/server/session/JDBCSessionDataStore.java
@@ -66,9 +66,11 @@ public class JDBCSessionDataStore extends AbstractSessionDataStore
public static class SessionTableSchema
{
public static final int MAX_INTERVAL_NOT_SET = -999;
+ public static final String INFERRED = "INFERRED";
protected DatabaseAdaptor _dbAdaptor;
protected String _schemaName = null;
+ protected String _catalogName = null;
protected String _tableName = "JettySessions";
protected String _idColumn = "sessionId";
protected String _contextPathColumn = "contextPath";
@@ -87,7 +89,20 @@ public class JDBCSessionDataStore extends AbstractSessionDataStore
{
_dbAdaptor = dbadaptor;
}
+
+ public void setCatalogName(String catalogName)
+ {
+ if (catalogName != null && StringUtil.isBlank(catalogName))
+ _catalogName = null;
+ else
+ _catalogName = catalogName;
+ }
+ public String getCatalogName()
+ {
+ return _catalogName;
+ }
+
public String getSchemaName()
{
return _schemaName;
@@ -95,8 +110,10 @@ public class JDBCSessionDataStore extends AbstractSessionDataStore
public void setSchemaName(String schemaName)
{
- checkNotNull(schemaName);
- _schemaName = schemaName;
+ if (schemaName != null && StringUtil.isBlank(schemaName))
+ _schemaName = null;
+ else
+ _schemaName = schemaName;
}
public String getTableName()
@@ -484,28 +501,48 @@ public class JDBCSessionDataStore extends AbstractSessionDataStore
//make the session table if necessary
String tableName = _dbAdaptor.convertIdentifier(getTableName());
+
String schemaName = _dbAdaptor.convertIdentifier(getSchemaName());
- try (ResultSet result = metaData.getTables(null, schemaName, tableName, null))
+ if (INFERRED.equalsIgnoreCase(schemaName))
+ {
+ //use the value from the connection -
+ //NOTE that this value will also now be prepended to ALL
+ //table names in queries/updates.
+ schemaName = connection.getSchema();
+ setSchemaName(schemaName);
+ }
+ String catalogName = _dbAdaptor.convertIdentifier(getCatalogName());
+ if (INFERRED.equalsIgnoreCase(catalogName))
+ {
+ //use the value from the connection
+ catalogName = connection.getCatalog();
+ setCatalogName(catalogName);
+ }
+
+ try (ResultSet result = metaData.getTables(catalogName, schemaName, tableName, null))
{
if (!result.next())
{
+ if (LOG.isDebugEnabled())
+ LOG.debug("Creating table {} schema={} catalog={}", tableName, schemaName, catalogName);
//table does not exist, so create it
statement.executeUpdate(getCreateStatementAsString());
}
else
{
+ if (LOG.isDebugEnabled())
+ LOG.debug("Not creating table {} schema={} catalog={}", tableName, schemaName, catalogName);
//session table exists, check it has maxinterval column
ResultSet colResult = null;
try
{
- colResult = metaData.getColumns(null, schemaName, tableName,
+ colResult = metaData.getColumns(catalogName, schemaName, tableName,
_dbAdaptor.convertIdentifier(getMaxIntervalColumn()));
}
catch (SQLException sqlEx)
{
- LOG.warn("Problem checking if " + getTableName() +
- " table contains " + getMaxIntervalColumn() + " column. Ensure table contains column definition: \"" +
- getMaxIntervalColumn() + " long not null default -999\"");
+ LOG.warn("Problem checking if {} table contains {} column. Ensure table contains column with definition: long not null default -999",
+ getTableName(), getMaxIntervalColumn());
throw sqlEx;
}
try
@@ -519,9 +556,7 @@ public class JDBCSessionDataStore extends AbstractSessionDataStore
}
catch (SQLException sqlEx)
{
- LOG.warn("Problem adding " + getMaxIntervalColumn() +
- " column. Ensure table contains column definition: \"" + getMaxIntervalColumn() +
- " long not null default -999\"");
+ LOG.warn("Problem adding {} column. Ensure table contains column definition: long not null default -999", getMaxIntervalColumn());
throw sqlEx;
}
}
@@ -538,7 +573,7 @@ public class JDBCSessionDataStore extends AbstractSessionDataStore
boolean index1Exists = false;
boolean index2Exists = false;
- try (ResultSet result = metaData.getIndexInfo(null, schemaName, tableName, false, true))
+ try (ResultSet result = metaData.getIndexInfo(catalogName, schemaName, tableName, false, true))
{
while (result.next())
{
@@ -559,8 +594,8 @@ public class JDBCSessionDataStore extends AbstractSessionDataStore
@Override
public String toString()
{
- return String.format("%s[%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s]", super.toString(),
- _schemaName, _tableName, _idColumn, _contextPathColumn, _virtualHostColumn, _cookieTimeColumn, _createTimeColumn,
+ return String.format("%s[%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s]", super.toString(),
+ _catalogName, _schemaName, _tableName, _idColumn, _contextPathColumn, _virtualHostColumn, _cookieTimeColumn, _createTimeColumn,
_expiryTimeColumn, _accessTimeColumn, _lastAccessTimeColumn, _lastNodeColumn, _lastSavedTimeColumn, _maxIntervalColumn);
}
}