diff options
author | Simon Brandhof <simon.brandhof@gmail.com> | 2013-10-17 15:04:27 +0200 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@gmail.com> | 2013-10-17 15:04:27 +0200 |
commit | 90847116853df9a95b568c8a202e9fd95553c540 (patch) | |
tree | cef276b25c46e136b31e042a51f11f7497f6eb6d | |
parent | ddd23db4e89d8e112bc268734269959b4a23eaf0 (diff) | |
download | sonarqube-90847116853df9a95b568c8a202e9fd95553c540.tar.gz sonarqube-90847116853df9a95b568c8a202e9fd95553c540.zip |
SONAR-4742 remove AJP support
3 files changed, 1 insertions, 55 deletions
diff --git a/sonar-application/src/main/assembly/conf/sonar.properties b/sonar-application/src/main/assembly/conf/sonar.properties index a663a5df2fa..3c4b407266b 100644 --- a/sonar-application/src/main/assembly/conf/sonar.properties +++ b/sonar-application/src/main/assembly/conf/sonar.properties @@ -96,9 +96,6 @@ sonar.jdbc.timeBetweenEvictionRunsMillis=30000 # TCP port for incoming HTTP connections. Disabled when value is -1. #sonar.web.port=9000 -# TCP port for AJP 1.3 protocol. Disabled when value is -1 (default). -#sonar.web.ajp.port=-1 - # TCP port for incoming HTTPS connections. Disabled when value is -1 (default). #sonar.web.https.port=-1 @@ -134,20 +131,17 @@ sonar.jdbc.timeBetweenEvictionRunsMillis=30000 # based on the sonar.web.connections.acceptCount property. The default value is 50 for each # enabled connector. #sonar.web.http.maxThreads=50 -#sonar.web.ajp.maxThreads=50 #sonar.web.https.maxThreads=50 # The minimum number of threads always kept running. The default value is 5 for each # enabled connector. #sonar.web.http.minThreads=5 -#sonar.web.ajp.minThreads=5 #sonar.web.https.minThreads=5 # The maximum queue length for incoming connection requests when all possible request processing # threads are in use. Any requests received when the queue is full will be refused. # The default value is 25 for each enabled connector. #sonar.web.http.acceptCount=25 -#sonar.web.ajp.acceptCount=25 #sonar.web.https.acceptCount=25 # Access logs are generated in the file logs/access.log. This file is rolled over when it's 5Mb. diff --git a/sonar-application/src/main/java/org/sonar/application/Connectors.java b/sonar-application/src/main/java/org/sonar/application/Connectors.java index a61ab9ce445..684d17c9b11 100644 --- a/sonar-application/src/main/java/org/sonar/application/Connectors.java +++ b/sonar-application/src/main/java/org/sonar/application/Connectors.java @@ -33,7 +33,6 @@ class Connectors { private static final int DISABLED_PORT = -1; static final String HTTP_PROTOCOL = "HTTP/1.1"; - static final String AJP_PROTOCOL = "AJP/1.3"; static void configure(Tomcat tomcat, Props props) { tomcat.getServer().setAddress(props.of("sonar.web.host", "0.0.0.0")); @@ -43,7 +42,7 @@ class Connectors { private static void configureConnectors(Tomcat tomcat, Props props) { List<Connector> connectors = new ArrayList<Connector>(); - connectors.addAll(Arrays.asList(newHttpConnector(props), newAjpConnector(props), newHttpsConnector(props))); + connectors.addAll(Arrays.asList(newHttpConnector(props), newHttpsConnector(props))); connectors.removeAll(Collections.singleton(null)); if (connectors.isEmpty()) { @@ -80,18 +79,6 @@ class Connectors { } @Nullable - private static Connector newAjpConnector(Props props) { - Connector connector = null; - int port = props.intOf("sonar.web.ajp.port", DISABLED_PORT); - if (port > DISABLED_PORT) { - connector = newConnector(props, AJP_PROTOCOL, "ajp"); - connector.setPort(port); - info("AJP connector is enabled on port " + port); - } - return connector; - } - - @Nullable private static Connector newHttpsConnector(Props props) { Connector connector = null; int port = props.intOf("sonar.web.https.port", DISABLED_PORT); diff --git a/sonar-application/src/test/java/org/sonar/application/ConnectorsTest.java b/sonar-application/src/test/java/org/sonar/application/ConnectorsTest.java index 823bc4f3b35..8ed7c4d0b9b 100644 --- a/sonar-application/src/test/java/org/sonar/application/ConnectorsTest.java +++ b/sonar-application/src/test/java/org/sonar/application/ConnectorsTest.java @@ -73,8 +73,6 @@ public class ConnectorsTest { Properties p = new Properties(); p.setProperty("sonar.web.port", "9000"); p.setProperty("sonar.web.http.minThreads", "2"); - p.setProperty("sonar.web.ajp.port", "9010"); - p.setProperty("sonar.web.ajp.minThreads", "4"); p.setProperty("sonar.web.https.port", "9443"); p.setProperty("sonar.web.https.minThreads", "5"); Props props = new Props(p); @@ -92,13 +90,6 @@ public class ConnectorsTest { @Override public boolean matches(Object o) { Connector c = (Connector) o; - return c.getPort() == 9010 && c.getProperty("minSpareThreads").equals(4); - } - })); - verify(tomcat.getService()).addConnector(argThat(new ArgumentMatcher<Connector>() { - @Override - public boolean matches(Object o) { - Connector c = (Connector) o; return c.getPort() == 9443 && c.getProperty("minSpareThreads").equals(5); } })); @@ -123,7 +114,6 @@ public class ConnectorsTest { public void only_https_is_enabled() { Properties p = new Properties(); p.setProperty("sonar.web.port", "-1"); - p.setProperty("sonar.web.ajp.port", "-1"); p.setProperty("sonar.web.https.port", "9443"); Props props = new Props(p); @@ -142,7 +132,6 @@ public class ConnectorsTest { public void all_connectors_are_enabled() { Properties p = new Properties(); p.setProperty("sonar.web.port", "9000"); - p.setProperty("sonar.web.ajp.port", "9010"); p.setProperty("sonar.web.https.port", "9443"); Props props = new Props(p); @@ -159,35 +148,11 @@ public class ConnectorsTest { @Override public boolean matches(Object o) { Connector c = (Connector) o; - return c.getScheme().equals("http") && c.getPort() == 9010 && c.getProtocol().equals(Connectors.AJP_PROTOCOL); - } - })); - verify(tomcat.getService()).addConnector(argThat(new ArgumentMatcher<Connector>() { - @Override - public boolean matches(Object o) { - Connector c = (Connector) o; return c.getScheme().equals("https") && c.getPort() == 9443 && c.getProtocol().equals(Connectors.HTTP_PROTOCOL); } })); } - @Test - public void ajp_connector_is_enabled() { - Properties p = new Properties(); - p.setProperty("sonar.web.ajp.port", "9010"); - Props props = new Props(p); - - Connectors.configure(tomcat, props); - - verify(tomcat.getService()).addConnector(argThat(new ArgumentMatcher<Connector>() { - @Override - public boolean matches(Object o) { - Connector c = (Connector) o; - return c.getScheme().equals("http") && c.getPort() == 9010 && c.getProtocol().equals(Connectors.AJP_PROTOCOL); - } - })); - } - //---- shutdown port |