You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ranger.apache.org by sn...@apache.org on 2015/02/23 18:35:31 UTC
incubator-ranger git commit: RANGER-257: fixed a getConfig issue -
that prevented the default context name
Repository: incubator-ranger
Updated Branches:
refs/heads/master 5580ca24d -> 60cae1a74
RANGER-257: fixed a getConfig issue - that prevented the default context name
Project: http://git-wip-us.apache.org/repos/asf/incubator-ranger/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ranger/commit/60cae1a7
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ranger/tree/60cae1a7
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ranger/diff/60cae1a7
Branch: refs/heads/master
Commit: 60cae1a745cce961bc33c455fcba21e32739b31d
Parents: 5580ca2
Author: sneethiraj <sn...@apache.org>
Authored: Mon Feb 23 09:35:26 2015 -0800
Committer: sneethiraj <sn...@apache.org>
Committed: Mon Feb 23 09:35:26 2015 -0800
----------------------------------------------------------------------
.../ranger/server/tomcat/EmbeddedServer.java | 17 ++++++++---------
1 file changed, 8 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/60cae1a7/embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/EmbeddedServer.java
----------------------------------------------------------------------
diff --git a/embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/EmbeddedServer.java b/embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/EmbeddedServer.java
index b9b1951..75c80d5 100644
--- a/embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/EmbeddedServer.java
+++ b/embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/EmbeddedServer.java
@@ -164,13 +164,12 @@ public class EmbeddedServer {
}
String webContextName = getConfig("xa.webapp.contextName", "/") ;
- if (webContextName != null) {
- if (! webContextName.startsWith("/")) {
- LOG.info("Context Name [" + webContextName + "] is being loaded as [ /" + webContextName + "]");
- webContextName = "/" + webContextName ;
- }
- } else {
- webContextName = "/";
+ if (webContextName == null) {
+ webContextName = "/" ;
+ }
+ else if (! webContextName.startsWith("/")) {
+ LOG.info("Context Name [" + webContextName + "] is being loaded as [ /" + webContextName + "]");
+ webContextName = "/" + webContextName ;
}
File wad = new File (webapp_dir) ;
@@ -219,7 +218,7 @@ public class EmbeddedServer {
protected String getConfig(String key, String defaultValue) {
String ret = getConfig(key) ;
- if (key == null) {
+ if (ret == null) {
ret = defaultValue ;
}
return ret;
@@ -271,7 +270,7 @@ public class EmbeddedServer {
public void shutdownServer() {
- int timeWaitForShutdownInSeconds = getIntConfig("service.waitTimeForForceShutdownInSeconds", 120) ;
+ int timeWaitForShutdownInSeconds = getIntConfig("service.waitTimeForForceShutdownInSeconds", 0) ;
if (timeWaitForShutdownInSeconds > 0) {
long endTime = System.currentTimeMillis() + (timeWaitForShutdownInSeconds * 1000L) ;
LOG.info("Will wait for all threads to shutdown gracefully. Final shutdown Time: " + new Date(endTime)) ;