Commit e2caf903 authored by Matt Tucker's avatar Matt Tucker Committed by matt

More logging.

git-svn-id: http://svn.igniterealtime.org/svn/repos/wildfire/trunk@5930 b35dd754-fafc-0310-a699-88a17e54d16e
parent 9a7f0d7a
...@@ -11,10 +11,7 @@ ...@@ -11,10 +11,7 @@
package org.jivesoftware.wildfire; package org.jivesoftware.wildfire;
import org.jivesoftware.util.JiveGlobals; import org.jivesoftware.util.*;
import org.jivesoftware.util.Log;
import org.jivesoftware.util.PropertyEventDispatcher;
import org.jivesoftware.util.PropertyEventListener;
import org.jivesoftware.wildfire.net.SSLConfig; import org.jivesoftware.wildfire.net.SSLConfig;
import org.mortbay.jetty.Connector; import org.mortbay.jetty.Connector;
import org.mortbay.jetty.Server; import org.mortbay.jetty.Server;
...@@ -143,8 +140,14 @@ public class HttpServerManager { ...@@ -143,8 +140,14 @@ public class HttpServerManager {
if (loadConnectors) { if (loadConnectors) {
Collection<Connector> connectors = createAdminConsoleConnectors(port, securePort); Collection<Connector> connectors = createAdminConsoleConnectors(port, securePort);
if(connectors.size() == 0) { if (connectors.size() == 0) {
adminServer = null; adminServer = null;
// Log warning.
String warning = LocaleUtils.getLocalizedString("admin.console.warning");
Log.info(warning);
System.out.println(warning);
return; return;
} }
...@@ -152,6 +155,40 @@ public class HttpServerManager { ...@@ -152,6 +155,40 @@ public class HttpServerManager {
adminServer.addConnector(connector); adminServer.addConnector(connector);
} }
} }
// Log what ports the admin console is running on.
String listening = LocaleUtils.getLocalizedString("admin.console.listening");
boolean isPlainStarted = false;
boolean isSecureStarted = false;
for (Connector connector : adminServer.getConnectors()) {
if (connector.getPort() == port) {
isPlainStarted = true;
}
else if (connector.getPort() == securePort) {
isSecureStarted = true;
}
}
if (isPlainStarted && isSecureStarted) {
String msg = listening + ":" + System.getProperty("line.separator") +
" http://" + XMPPServer.getInstance().getServerInfo().getName() + ":" +
port + System.getProperty("line.separator") +
" https://" + XMPPServer.getInstance().getServerInfo().getName() + ":" +
securePort;
Log.info(msg);
System.out.println(msg);
}
else if (isSecureStarted) {
Log.info(listening + " https://" +
XMPPServer.getInstance().getServerInfo().getName() + ":" + securePort);
System.out.println(listening + " https://" +
XMPPServer.getInstance().getServerInfo().getName() + ":" + securePort);
}
else if (isPlainStarted) {
Log.info(listening + " http://" +
XMPPServer.getInstance().getServerInfo().getName() + ":" + port);
System.out.println(listening + " http://" +
XMPPServer.getInstance().getServerInfo().getName() + ":" + port);
}
} }
private boolean checkPorts(int [] httpBindPorts, int [] adminConsolePorts) { private boolean checkPorts(int [] httpBindPorts, int [] adminConsolePorts) {
...@@ -161,10 +198,10 @@ public class HttpServerManager { ...@@ -161,10 +198,10 @@ public class HttpServerManager {
} }
public void startup() { public void startup() {
if(httpBindContext != null && isHttpBindServiceEnabled()) { if (httpBindContext != null && isHttpBindServiceEnabled()) {
createHttpBindServer(); createHttpBindServer();
} }
if(adminConsoleContext != null) { if (adminConsoleContext != null) {
createAdminConsoleServer(); createAdminConsoleServer();
} }
......
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