Last active
August 29, 2015 14:07
-
-
Save rajdavies/254b30930193f9f6f3ff to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static{ | |
String host = null; | |
String port = null; | |
try { | |
host = AccessController.doPrivileged(new PrivilegedAction<String>() { | |
@Override | |
public String run() { | |
String result = System.getProperty("org.apache.activemq.AMQ_HOST"); | |
result = (result==null||result.isEmpty()) ? System.getProperty("AMQ_HOST","localhost") : result; | |
return result; | |
} | |
}); | |
port = AccessController.doPrivileged(new PrivilegedAction<String>() { | |
@Override | |
public String run() { | |
String result = System.getProperty("org.apache.activemq.AMQ_PORT"); | |
result = (result==null||result.isEmpty()) ? System.getProperty("AMQ_PORT","61616") : result; | |
return result; | |
} | |
}); | |
}catch(Throwable e){ | |
LOG.debug("Failed to look up System properties for host and port",e); | |
} | |
host = (host == null || host.isEmpty()) ? "localhost" : host; | |
port = (port == null || port.isEmpty()) ? "61616" : port; | |
DEFAULT_BROKER_HOST = host; | |
DEFAULT_BROKER_PORT = Integer.parseInt(port); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment