Commit cf128584 authored by Alex Wenckus's avatar Alex Wenckus Committed by alex

Small tweaks.

git-svn-id: http://svn.igniterealtime.org/svn/repos/wildfire/trunk@6104 b35dd754-fafc-0310-a699-88a17e54d16e
parent 5c06b7a8
...@@ -322,10 +322,13 @@ public class HttpServerManager { ...@@ -322,10 +322,13 @@ public class HttpServerManager {
ADMIN_CONSOLE_SECURE_PORT_DEFAULT); ADMIN_CONSOLE_SECURE_PORT_DEFAULT);
boolean loadConnectors = true; boolean loadConnectors = true;
if (httpBindServer != null) { if (httpBindServer != null) {
// Admin console and HTTP binding running on the same ports
if (adminPort == bindPort && adminSecurePort == bindSecurePort) { if (adminPort == bindPort && adminSecurePort == bindSecurePort) {
adminServer = httpBindServer; adminServer = httpBindServer;
loadConnectors = false; loadConnectors = false;
} }
// Only one of the two ports is shared between the servers, we will start them both
// on the Admin console ports and log a warning saying that you can't do that.
else if (checkPorts(new int[]{adminPort, adminSecurePort}, else if (checkPorts(new int[]{adminPort, adminSecurePort},
new int[]{bindPort, bindSecurePort})) new int[]{bindPort, bindSecurePort}))
{ {
...@@ -335,6 +338,8 @@ public class HttpServerManager { ...@@ -335,6 +338,8 @@ public class HttpServerManager {
httpBindServer = new Server(); httpBindServer = new Server();
adminServer = httpBindServer; adminServer = httpBindServer;
} }
// The admin server ports are distinct from the HTTP ports so we can start the admin
// console seperatly
else { else {
adminServer = new Server(); adminServer = new Server();
} }
...@@ -348,12 +353,8 @@ public class HttpServerManager { ...@@ -348,12 +353,8 @@ public class HttpServerManager {
Connector httpsConnector = createSSLConnector(adminSecurePort); Connector httpsConnector = createSSLConnector(adminSecurePort);
if (httpConnector == null && httpsConnector == null) { if (httpConnector == null && httpsConnector == null) {
adminServer = null; adminServer = null;
// Log warning. // Log warning.
String warning = LocaleUtils.getLocalizedString("admin.console.warning"); log(LocaleUtils.getLocalizedString("admin.console.warning"));
Log.info(warning);
System.out.println(warning);
return; return;
} }
if (httpConnector != null) { if (httpConnector != null) {
...@@ -367,6 +368,11 @@ public class HttpServerManager { ...@@ -367,6 +368,11 @@ public class HttpServerManager {
logAdminConsolePorts(); logAdminConsolePorts();
} }
private void log(String string) {
Log.info(string);
System.out.println(string);
}
private void logAdminConsolePorts() { private void logAdminConsolePorts() {
// Log what ports the admin console is running on. // Log what ports the admin console is running on.
String listening = LocaleUtils.getLocalizedString("admin.console.listening"); String listening = LocaleUtils.getLocalizedString("admin.console.listening");
...@@ -382,24 +388,18 @@ public class HttpServerManager { ...@@ -382,24 +388,18 @@ public class HttpServerManager {
} }
if (isPlainStarted && isSecureStarted) { if (isPlainStarted && isSecureStarted) {
String msg = listening + ":" + System.getProperty("line.separator") + log(listening + ":" + System.getProperty("line.separator") +
" http://" + XMPPServer.getInstance().getServerInfo().getName() + ":" + " http://" + XMPPServer.getInstance().getServerInfo().getName() + ":" +
adminPort + System.getProperty("line.separator") + adminPort + System.getProperty("line.separator") +
" https://" + XMPPServer.getInstance().getServerInfo().getName() + ":" + " https://" + XMPPServer.getInstance().getServerInfo().getName() + ":" +
adminSecurePort; adminSecurePort);
Log.info(msg);
System.out.println(msg);
} }
else if (isSecureStarted) { else if (isSecureStarted) {
Log.info(listening + " https://" + log(listening + " https://" +
XMPPServer.getInstance().getServerInfo().getName() + ":" + adminSecurePort);
System.out.println(listening + " https://" +
XMPPServer.getInstance().getServerInfo().getName() + ":" + adminSecurePort); XMPPServer.getInstance().getServerInfo().getName() + ":" + adminSecurePort);
} }
else if (isPlainStarted) { else if (isPlainStarted) {
Log.info(listening + " http://" + log(listening + " http://" +
XMPPServer.getInstance().getServerInfo().getName() + ":" + adminPort);
System.out.println(listening + " http://" +
XMPPServer.getInstance().getServerInfo().getName() + ":" + adminPort); XMPPServer.getInstance().getServerInfo().getName() + ":" + adminPort);
} }
} }
...@@ -437,6 +437,11 @@ public class HttpServerManager { ...@@ -437,6 +437,11 @@ public class HttpServerManager {
} }
} }
/**
* Removes the HTTP-bind servlet from the Admin console servlet mappings.
*
* @param adminConsoleContext The admin console context.
*/
private void removeHttpBindServlet(Context adminConsoleContext) { private void removeHttpBindServlet(Context adminConsoleContext) {
ServletHandler handler = adminConsoleContext.getServletHandler(); ServletHandler handler = adminConsoleContext.getServletHandler();
ServletMapping[] servletMappings = handler.getServletMappings(); ServletMapping[] servletMappings = handler.getServletMappings();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment