summaryrefslogtreecommitdiffstats
path: root/sonar-application
diff options
context:
space:
mode:
authorJulien HENRY <julien.henry@sonarsource.com>2013-03-26 15:43:46 +0100
committerJulien HENRY <julien.henry@sonarsource.com>2013-03-26 15:51:41 +0100
commit2d1eedc2436244b879cba423a42a4fc2c57f7468 (patch)
tree46cdbf32b49219464f8d2447877bc57313d7f816 /sonar-application
parentea669e56c1939f38d001fa74a7378117a948e786 (diff)
downloadsonarqube-2d1eedc2436244b879cba423a42a4fc2c57f7468.tar.gz
sonarqube-2d1eedc2436244b879cba423a42a4fc2c57f7468.zip
SONAR-4157 Upgrade the embedded Jetty to version 8.1
Diffstat (limited to 'sonar-application')
-rw-r--r--sonar-application/src/main/java/org/sonar/application/JettyEmbedder.java24
1 files changed, 16 insertions, 8 deletions
diff --git a/sonar-application/src/main/java/org/sonar/application/JettyEmbedder.java b/sonar-application/src/main/java/org/sonar/application/JettyEmbedder.java
index b6ca00e5c1f..6774d34cafa 100644
--- a/sonar-application/src/main/java/org/sonar/application/JettyEmbedder.java
+++ b/sonar-application/src/main/java/org/sonar/application/JettyEmbedder.java
@@ -81,21 +81,29 @@ public class JettyEmbedder {
private Server configureProgrammatically() throws URISyntaxException {
configureServer();
- HandlerCollection handlers = new HandlerCollection();
- WebAppContext context = new WebAppContext(getPath("/war/sonar-server"), contextPath);
- String filenamePattern = configuration.getProperty("sonar.web.jettyRequestLogs");
- RequestLogHandler requestLogHandler = configureRequestLogHandler(filenamePattern);
+
+ List<Handler> handlers = new ArrayList<Handler>();
+
String shutdownCookie = System.getProperty("sonar.shutdownToken");
if (shutdownCookie != null && !"".equals(shutdownCookie)) {
System.out.println("Registering shutdown handler");
ShutdownHandler shutdownHandler = new ShutdownHandler(server, shutdownCookie);
shutdownHandler.setExitJvm(true);
- handlers.setHandlers(new Handler[] {shutdownHandler, context, requestLogHandler});
+ handlers.add(shutdownHandler);
}
- else {
- handlers.setHandlers(new Handler[] {context, requestLogHandler});
+
+ WebAppContext context = new WebAppContext(getPath("/war/sonar-server"), contextPath);
+ handlers.add(context);
+
+ String filenamePattern = configuration.getProperty("sonar.web.jettyRequestLogs");
+ if (filenamePattern != null) {
+ handlers.add(configureRequestLogHandler(filenamePattern));
}
- server.setHandler(handlers);
+
+ HandlerCollection handler = new HandlerCollection();
+ handler.setHandlers(handlers.toArray(new Handler[handlers.size()]));
+ server.setHandler(handler);
+
return server;
}