Author: cziegeler
Date: Wed May 20 12:06:28 2015
New Revision: 1680533
URL: http://svn.apache.org/r1680533
Log:
SLING-4672 : Set port via property file when launching standalone. Apply patch
from Kevin A. Roll
Modified:
sling/trunk/launchpad/base/src/main/java/org/apache/sling/launchpad/base/app/MainDelegate.java
sling/trunk/launchpad/base/src/main/resources/sling.properties
Modified:
sling/trunk/launchpad/base/src/main/java/org/apache/sling/launchpad/base/app/MainDelegate.java
URL:
http://svn.apache.org/viewvc/sling/trunk/launchpad/base/src/main/java/org/apache/sling/launchpad/base/app/MainDelegate.java?rev=1680533&r1=1680532&r2=1680533&view=diff
==============================================================================
---
sling/trunk/launchpad/base/src/main/java/org/apache/sling/launchpad/base/app/MainDelegate.java
(original)
+++
sling/trunk/launchpad/base/src/main/java/org/apache/sling/launchpad/base/app/MainDelegate.java
Wed May 20 12:06:28 2015
@@ -113,7 +113,6 @@ public class MainDelegate implements Lau
public void setCommandLine(Map<String, String> args) {
commandLine = new HashMap<String, String>();
- commandLine.put(PROP_PORT, DEFAULT_PORT);
parseCommandLine(args, commandLine);
}
@@ -160,9 +159,6 @@ public class MainDelegate implements Lau
}
final Logger logger = new SlingLogger();
- // Display port number on console, in case HttpService doesn't
- info("HTTP server port: " + commandLine.get(PROP_PORT), null);
-
// default log level: prevent tons of needless WARN from the framework
logger.setLogLevel(Logger.LOG_ERROR);
if ( System.getProperty(PROP_BOOT_LOG_LEVEL) != null ) {
@@ -190,6 +186,11 @@ public class MainDelegate implements Lau
if (commandLine != null) {
properties.putAll(commandLine);
}
+
+ // Display port number on console, in case HttpService
doesn't. This is logged as late as
+ // possible in order to pick up defaults from the Sling
property files, although system
+ // property substitutions will be missed.
+ info("HTTP server port: " + properties.get(PROP_PORT),
null);
}
};
Modified: sling/trunk/launchpad/base/src/main/resources/sling.properties
URL:
http://svn.apache.org/viewvc/sling/trunk/launchpad/base/src/main/resources/sling.properties?rev=1680533&r1=1680532&r2=1680533&view=diff
==============================================================================
--- sling/trunk/launchpad/base/src/main/resources/sling.properties (original)
+++ sling/trunk/launchpad/base/src/main/resources/sling.properties Wed May 20
12:06:28 2015
@@ -25,6 +25,9 @@
# Property values may contain references to other properties using the standard
# ${<prop-name>} syntax.
+# Default port to listen on.
+org.osgi.service.http.port = 8080
+
#
# Default home directory ("sling"). It is expected for this property to be
# overwritten by the "sling.home" init-param of the web application.