diff --git a/jetty-ee9/jetty-ee9-runner/pom.xml b/jetty-ee9/jetty-ee9-runner/pom.xml index ec1ad6c779d..e30f4f3992c 100644 --- a/jetty-ee9/jetty-ee9-runner/pom.xml +++ b/jetty-ee9/jetty-ee9-runner/pom.xml @@ -106,7 +106,7 @@ - org.eclipse.jetty.runner.Runner + org.eclipse.jetty.ee9.runner.Runner Jetty Runner @@ -132,7 +132,7 @@ jetty-ee9-jaas - org.eclipse.jetty.ee9 + org.eclipse.jetty.ee9.websocket jetty-ee9-websocket-jetty-server @@ -158,7 +158,7 @@ org.eclipse.jetty.ee9.demos - demo-simple-webapp + jetty-ee9-demo-simple-webapp war test diff --git a/jetty-ee9/jetty-ee9-runner/src/it/demo-simple-webapp-runner-with-path/pom.xml b/jetty-ee9/jetty-ee9-runner/src/it/demo-simple-webapp-runner-with-path/pom.xml index cb534d683f2..291083123e6 100644 --- a/jetty-ee9/jetty-ee9-runner/src/it/demo-simple-webapp-runner-with-path/pom.xml +++ b/jetty-ee9/jetty-ee9-runner/src/it/demo-simple-webapp-runner-with-path/pom.xml @@ -15,13 +15,13 @@ - org.eclipse.jetty - jetty-runner + org.eclipse.jetty.ee9 + jetty-ee9-runner @project.version@ - org.eclipse.jetty - jetty-runner + org.eclipse.jetty.ee9 + jetty-ee9-runner @project.version@ tests test-jar @@ -29,7 +29,7 @@ org.eclipse.jetty.ee9.demos - demo-simple-webapp + jetty-ee9-demo-simple-webapp @project.version@ war @@ -64,8 +64,8 @@ - org.eclipse.jetty - jetty-runner + org.eclipse.jetty.ee9 + jetty-ee9-runner @project.version@ jar false @@ -74,7 +74,7 @@ org.eclipse.jetty.ee9.demos - demo-simple-webapp + jetty-ee9-demo-simple-webapp @project.version@ war false @@ -130,7 +130,7 @@ - org.eclipse.jetty:jetty-runner + org.eclipse.jetty.ee9:jetty-ee9-runner diff --git a/jetty-ee9/jetty-ee9-runner/src/it/demo-simple-webapp-runner/pom.xml b/jetty-ee9/jetty-ee9-runner/src/it/demo-simple-webapp-runner/pom.xml index 3512452450c..ef643d9cdfb 100644 --- a/jetty-ee9/jetty-ee9-runner/src/it/demo-simple-webapp-runner/pom.xml +++ b/jetty-ee9/jetty-ee9-runner/src/it/demo-simple-webapp-runner/pom.xml @@ -15,13 +15,13 @@ - org.eclipse.jetty - jetty-runner + org.eclipse.jetty.ee9 + jetty-ee9-runner @project.version@ - org.eclipse.jetty - jetty-runner + org.eclipse.jetty.ee9 + jetty-ee9-runner @project.version@ tests test-jar @@ -29,7 +29,7 @@ org.eclipse.jetty.ee9.demos - demo-simple-webapp + jetty-ee9-demo-simple-webapp @project.version@ war @@ -64,8 +64,8 @@ - org.eclipse.jetty - jetty-runner + org.eclipse.jetty.ee9 + jetty-ee9-runner @project.version@ jar false @@ -74,7 +74,7 @@ org.eclipse.jetty.ee9.demos - demo-simple-webapp + jetty-ee9-demo-simple-webapp @project.version@ war false @@ -130,7 +130,7 @@ - org.eclipse.jetty:jetty-runner + org.eclipse.jetty.ee9:jetty-ee9-runner diff --git a/jetty-ee9/jetty-ee9-runner/src/it/test-jar-manifest/pom.xml b/jetty-ee9/jetty-ee9-runner/src/it/test-jar-manifest/pom.xml index d619f71a186..8aaf7d44782 100644 --- a/jetty-ee9/jetty-ee9-runner/src/it/test-jar-manifest/pom.xml +++ b/jetty-ee9/jetty-ee9-runner/src/it/test-jar-manifest/pom.xml @@ -15,8 +15,8 @@ - org.eclipse.jetty - jetty-runner + org.eclipse.jetty.ee9 + jetty-ee9-runner @project.version@ @@ -38,8 +38,8 @@ - org.eclipse.jetty - jetty-runner + org.eclipse.jetty.ee9 + jetty-ee9-runner @project.version@ jar false diff --git a/jetty-ee9/jetty-ee9-runner/src/it/test-jar-manifest/postbuild.groovy b/jetty-ee9/jetty-ee9-runner/src/it/test-jar-manifest/postbuild.groovy index c21ad606fb0..f4b9cb2420b 100644 --- a/jetty-ee9/jetty-ee9-runner/src/it/test-jar-manifest/postbuild.groovy +++ b/jetty-ee9/jetty-ee9-runner/src/it/test-jar-manifest/postbuild.groovy @@ -8,4 +8,4 @@ JarFile jar = new JarFile( artifact ); Attributes manifest = jar.getManifest().getMainAttributes(); -assert manifest.getValue( new Attributes.Name( "Main-Class" ) ).equals( "org.eclipse.jetty.runner.Runner" ) +assert manifest.getValue( new Attributes.Name( "Main-Class" ) ).equals( "org.eclipse.jetty.ee9.runner.Runner" ) diff --git a/jetty-ee9/jetty-ee9-runner/src/main/java/org/eclipse/jetty/ee9/runner/Runner.java b/jetty-ee9/jetty-ee9-runner/src/main/java/org/eclipse/jetty/ee9/runner/Runner.java index ebe13e85cf9..719ebf6d480 100644 --- a/jetty-ee9/jetty-ee9-runner/src/main/java/org/eclipse/jetty/ee9/runner/Runner.java +++ b/jetty-ee9/jetty-ee9-runner/src/main/java/org/eclipse/jetty/ee9/runner/Runner.java @@ -28,13 +28,13 @@ import java.util.Collections; import java.util.List; import java.util.Locale; +import org.eclipse.jetty.ee9.nested.ContextHandler; +import org.eclipse.jetty.ee9.nested.SessionHandler; import org.eclipse.jetty.ee9.security.ConstraintMapping; import org.eclipse.jetty.ee9.security.ConstraintSecurityHandler; import org.eclipse.jetty.ee9.security.HashLoginService; import org.eclipse.jetty.ee9.security.authentication.BasicAuthenticator; import org.eclipse.jetty.ee9.servlet.ServletContextHandler; -import org.eclipse.jetty.ee9.servlet.ServletHolder; -import org.eclipse.jetty.ee9.servlet.StatisticsServlet; import org.eclipse.jetty.ee9.webapp.MetaInfConfiguration; import org.eclipse.jetty.ee9.webapp.WebAppContext; import org.eclipse.jetty.io.ConnectionStatistics; @@ -45,12 +45,10 @@ import org.eclipse.jetty.server.Handler; import org.eclipse.jetty.server.Server; import org.eclipse.jetty.server.ServerConnector; import org.eclipse.jetty.server.ShutdownMonitor; -import org.eclipse.jetty.server.handler.ContextHandler; import org.eclipse.jetty.server.handler.ContextHandlerCollection; import org.eclipse.jetty.server.handler.DefaultHandler; -import org.eclipse.jetty.server.handler.HandlerCollection; import org.eclipse.jetty.server.handler.StatisticsHandler; -import org.eclipse.jetty.session.SessionHandler; +import org.eclipse.jetty.util.FileID; import org.eclipse.jetty.util.RolloverFileOutputStream; import org.eclipse.jetty.util.StringUtil; import org.eclipse.jetty.util.resource.Resource; @@ -322,15 +320,15 @@ public class Runner } //check that everything got configured, and if not, make the handlers - HandlerCollection handlers = _server.getChildHandlerByClass(HandlerCollection.class); + Handler.Sequence handlers = _server.getDescendant(Handler.Sequence.class); if (handlers == null) { - handlers = new HandlerList(); + handlers = new Handler.Sequence(); _server.setHandler(handlers); } //check if contexts already configured - _contexts = handlers.getChildHandlerByClass(ContextHandlerCollection.class); + _contexts = handlers.getDescendant(ContextHandlerCollection.class); if (_contexts == null) { _contexts = new ContextHandlerCollection(); @@ -340,16 +338,16 @@ public class Runner if (_enableStats) { //if no stats handler already configured - if (handlers.getChildHandlerByClass(StatisticsHandler.class) == null) + if (handlers.getDescendant(StatisticsHandler.class) == null) { StatisticsHandler statsHandler = new StatisticsHandler(); - + + Handler oldHandler = _server.getHandler(); statsHandler.setHandler(oldHandler); _server.setHandler(statsHandler); ServletContextHandler statsContext = new ServletContextHandler(_contexts, "/stats"); - statsContext.addServlet(new ServletHolder(new StatisticsServlet()), "/"); statsContext.setSessionHandler(new SessionHandler()); if (_statsPropFile != null) { @@ -375,7 +373,7 @@ public class Runner } //ensure a DefaultHandler is present - if (handlers.getChildHandlerByClass(DefaultHandler.class) == null) + if (handlers.getDescendant(DefaultHandler.class) == null) { handlers.addHandler(new DefaultHandler()); } @@ -493,15 +491,15 @@ public class Runner } } - protected void prependHandler(Handler handler, HandlerCollection handlers) + protected void prependHandler(Handler handler, Handler.Sequence handlers) { if (handler == null || handlers == null) return; - Handler[] existing = handlers.getChildHandlers(); - Handler[] children = new Handler[existing.length + 1]; - children[0] = handler; - System.arraycopy(existing, 0, children, 1, existing.length); + List existing = handlers.getHandlers(); + List children = new ArrayList<>(existing.size() + 1); + children.add(handler); + children.addAll(existing); handlers.setHandlers(children); } diff --git a/jetty-ee9/jetty-ee9-runner/src/test/java/org/eclipse/jetty/ee9/maven/jettyrunner/it/IntegrationTestJettyRunner.java b/jetty-ee9/jetty-ee9-runner/src/test/java/org/eclipse/jetty/ee9/maven/jettyrunner/it/IntegrationTestJettyRunner.java index 3b4e1df1192..1276ead4204 100644 --- a/jetty-ee9/jetty-ee9-runner/src/test/java/org/eclipse/jetty/ee9/maven/jettyrunner/it/IntegrationTestJettyRunner.java +++ b/jetty-ee9/jetty-ee9-runner/src/test/java/org/eclipse/jetty/ee9/maven/jettyrunner/it/IntegrationTestJettyRunner.java @@ -18,8 +18,8 @@ import java.nio.file.Path; import java.nio.file.Paths; import java.util.List; +import org.eclipse.jetty.client.ContentResponse; import org.eclipse.jetty.client.HttpClient; -import org.eclipse.jetty.client.api.ContentResponse; import org.hamcrest.Matchers; import org.junit.jupiter.api.Test; @@ -38,7 +38,7 @@ public class IntegrationTestJettyRunner httpClient.start(); ContentResponse response = httpClient.newRequest(serverUri).send(); String res = response.getContentAsString(); - assertThat(res, Matchers.containsString("Hello World!")); + assertThat(res, Matchers.containsString("Hello World EE9!")); } finally { @@ -62,5 +62,4 @@ public class IntegrationTestJettyRunner throw new Exception("cannot find started Jetty"); } - } diff --git a/jetty-ee9/pom.xml b/jetty-ee9/pom.xml index ef60d61c460..88d0a918846 100644 --- a/jetty-ee9/pom.xml +++ b/jetty-ee9/pom.xml @@ -65,7 +65,7 @@ jetty-ee9-plus jetty-ee9-proxy jetty-ee9-quickstart - + jetty-ee9-runner jetty-ee9-websocket jetty-ee9-tests jetty-ee9-bom