openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rmannibu...@apache.org
Subject svn commit: r1765952 - /openwebbeans/microwave/trunk/microwave-core/src/main/java/org/apache/microwave/Microwave.java
Date Fri, 21 Oct 2016 08:44:39 GMT
Author: rmannibucau
Date: Fri Oct 21 08:44:39 2016
New Revision: 1765952

URL: http://svn.apache.org/viewvc?rev=1765952&view=rev
Log:
oops, idea didnt flush on last commit - sorry

Modified:
    openwebbeans/microwave/trunk/microwave-core/src/main/java/org/apache/microwave/Microwave.java

Modified: openwebbeans/microwave/trunk/microwave-core/src/main/java/org/apache/microwave/Microwave.java
URL: http://svn.apache.org/viewvc/openwebbeans/microwave/trunk/microwave-core/src/main/java/org/apache/microwave/Microwave.java?rev=1765952&r1=1765951&r2=1765952&view=diff
==============================================================================
--- openwebbeans/microwave/trunk/microwave-core/src/main/java/org/apache/microwave/Microwave.java
(original)
+++ openwebbeans/microwave/trunk/microwave-core/src/main/java/org/apache/microwave/Microwave.java
Fri Oct 21 08:44:39 2016
@@ -1417,14 +1417,20 @@ public class Microwave implements AutoCl
         private static final String HTTP_KEY = "HTTP";
         private static final String SECURED_SUFFIX = "S";
         private static final String HOST_KEY = "host";
+        private static final String DEFAULT_CONNECTOR_KEY = HTTP_KEY;
 
         private static final String DEFAULT_HTTP_PORT = "8080";
         private static final String DEFAULT_HTTPS_PORT = "8443";
         private static final String DEFAULT_STOP_PORT = "8005";
         private static final String DEFAULT_HOST = "localhost";
+        private static final String DEFAULT_APP_BASE = "webapps";
 
         private final Map<String, String> values = new TreeMap<String, String>(String.CASE_INSENSITIVE_ORDER);
 
+        private QuickServerXmlParser() { // ensure defaults are present
+            this(true);
+        }
+
         private QuickServerXmlParser(final boolean useDefaults) {
             if (useDefaults) {
                 values.put(STOP_KEY, DEFAULT_STOP_PORT);
@@ -1443,6 +1449,21 @@ public class Microwave implements AutoCl
                 } else {
                     values.put(STOP_KEY, DEFAULT_STOP_PORT);
                 }
+            } else if ("Connector".equalsIgnoreCase(localName)) {
+                String protocol = attributes.getValue("protocol");
+                if (protocol == null) {
+                    protocol = DEFAULT_CONNECTOR_KEY;
+                } else if (protocol.contains("/")) {
+                    protocol = protocol.substring(0, protocol.indexOf("/"));
+                }
+                final String port = attributes.getValue("port");
+                final String ssl = attributes.getValue("secure");
+
+                if (ssl == null || "false".equalsIgnoreCase(ssl)) {
+                    values.put(protocol.toUpperCase(), port);
+                } else {
+                    values.put(protocol.toUpperCase() + SECURED_SUFFIX, port);
+                }
             } else if ("Host".equalsIgnoreCase(localName)) {
                 final String host = attributes.getValue("name");
                 if (host != null) {



Mime
View raw message