Commit 7719a088 authored by Alex Wenckus's avatar Alex Wenckus Committed by alex

We are up and running.

git-svn-id: http://svn.igniterealtime.org/svn/repos/wildfire/branches@5744 b35dd754-fafc-0310-a699-88a17e54d16e
parent dc0a6461
...@@ -19,6 +19,7 @@ junit.jar | 3.8.1 ...@@ -19,6 +19,7 @@ junit.jar | 3.8.1
jdic.jar | 0.9.1 (for windows only) jdic.jar | 0.9.1 (for windows only)
jstl.jar | Jakarta standard taglib 1.1.2 jstl.jar | Jakarta standard taglib 1.1.2
jmdns.jar | 1.0 RC1 jmdns.jar | 1.0 RC1
jsp-api.jar | Jetty 6.1.0 (2.0)
jtds.jar | 1.2 jtds.jar | 1.2
jzlib.jar | 1.0.7 jzlib.jar | 1.0.7
mysql.jar | 3.1.13 mysql.jar | 3.1.13
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
package org.jivesoftware.wildfire; package org.jivesoftware.wildfire;
import org.jivesoftware.wildfire.net.SocketReader; import org.jivesoftware.wildfire.net.SocketReader;
import org.mortbay.jetty.Server;
import java.io.IOException; import java.io.IOException;
import java.net.Socket; import java.net.Socket;
...@@ -208,4 +209,13 @@ public interface ConnectionManager { ...@@ -208,4 +209,13 @@ public interface ConnectionManager {
* @return the port to use for connection managers. * @return the port to use for connection managers.
*/ */
public int getConnectionManagerListenerPort(); public int getConnectionManagerListenerPort();
/**
* Returns the jetty server.
*
* @return the jetty server.
*/
Server getHttpServer();
void setHttpServer(Server server);
} }
...@@ -14,15 +14,15 @@ import org.jivesoftware.util.JiveGlobals; ...@@ -14,15 +14,15 @@ import org.jivesoftware.util.JiveGlobals;
import org.jivesoftware.util.LocaleUtils; import org.jivesoftware.util.LocaleUtils;
import org.jivesoftware.util.Log; import org.jivesoftware.util.Log;
import org.jivesoftware.wildfire.XMPPServer; import org.jivesoftware.wildfire.XMPPServer;
import org.mortbay.http.HttpContext; import org.jivesoftware.wildfire.ConnectionManager;
import org.mortbay.http.HttpListener; import org.jivesoftware.wildfire.net.SSLConfig;
import org.mortbay.http.SunJsseListener; import org.mortbay.jetty.Connector;
import org.mortbay.jetty.Server; import org.mortbay.jetty.Server;
import org.mortbay.log.Factory; import org.mortbay.jetty.nio.SelectChannelConnector;
import org.mortbay.log.LogImpl; import org.mortbay.jetty.security.SslSocketConnector;
import org.mortbay.log.OutputStreamLogSink; import org.mortbay.jetty.webapp.WebAppContext;
import org.mortbay.util.InetAddrPort;
import javax.net.ssl.SSLServerSocketFactory;
import java.io.File; import java.io.File;
/** /**
...@@ -33,19 +33,29 @@ import java.io.File; ...@@ -33,19 +33,29 @@ import java.io.File;
*/ */
public class AdminConsolePlugin implements Plugin { public class AdminConsolePlugin implements Plugin {
private static Server jetty = null; private static Server server = null;
private int port; private int port;
private int securePort; private int securePort;
private File pluginDir; private File pluginDir;
private HttpContext context = null; private WebAppContext context = null;
private HttpListener plainListener = null; private Connector plainListener = null;
private HttpListener secureListener = null; private Connector secureListener = null;
/** /**
* Create a jetty module. * Create a jetty module.
*/ */
public AdminConsolePlugin() { public AdminConsolePlugin() {
ConnectionManager manager = XMPPServer.getInstance().getConnectionManager();
if(manager != null) {
server = manager.getHttpServer();
}
if(server == null) {
server = new Server();
if(manager != null) {
manager.setHttpServer(server);
}
}
} }
public void restartListeners() { public void restartListeners() {
...@@ -54,33 +64,21 @@ public class AdminConsolePlugin implements Plugin { ...@@ -54,33 +64,21 @@ public class AdminConsolePlugin implements Plugin {
System.out.println(restarting); System.out.println(restarting);
Log.info(restarting); Log.info(restarting);
jetty.stop(); server.stop();
if (plainListener != null) { if (plainListener != null) {
jetty.removeListener(plainListener); server.removeConnector(plainListener);
plainListener = null; plainListener = null;
} }
if (secureListener != null) { if (secureListener != null) {
jetty.removeListener(secureListener); server.removeConnector(secureListener);
secureListener = null; secureListener = null;
} }
jetty.removeContext(context); server.removeHandler(context);
loadListeners(); loadListeners();
// Add web-app. Check to see if we're in development mode. If so, we don't context = createWebAppContext();
// add the normal web-app location, but the web-app in the project directory. server.addHandler(context);
if (Boolean.getBoolean("developmentMode")) { server.start();
System.out.println(LocaleUtils.getLocalizedString("admin.console.devmode"));
context = jetty.addWebApplication("/",
pluginDir.getParentFile().getParentFile().getParent() + File.separator + "src" +
File.separator + "web");
}
else {
context = jetty.addWebApplication("/",
pluginDir.getAbsoluteFile() + File.separator + "webapp");
}
context.setWelcomeFiles(new String[]{"index.jsp"});
jetty.start();
printListenerMessages(); printListenerMessages();
} }
...@@ -93,35 +91,33 @@ public class AdminConsolePlugin implements Plugin { ...@@ -93,35 +91,33 @@ public class AdminConsolePlugin implements Plugin {
// Configure HTTP socket listener. Setting the interface property to a // Configure HTTP socket listener. Setting the interface property to a
// non null value will imply that the Jetty server will only // non null value will imply that the Jetty server will only
// accept connect requests to that IP address. // accept connect requests to that IP address.
String interfaceName = JiveGlobals.getXMLProperty("network.interface"); // String interfaceName = JiveGlobals.getXMLProperty("network.interface");
port = JiveGlobals.getXMLProperty("adminConsole.port", 9090); port = JiveGlobals.getXMLProperty("adminConsole.port", 9090);
InetAddrPort address = new InetAddrPort(interfaceName, port); SelectChannelConnector connector = new SelectChannelConnector();
connector.setPort(port);
// InetAddrPort address = new InetAddrPort(interfaceName, port);
if (port > 0) { if (port > 0) {
plainListener = jetty.addListener(address); plainListener = connector;
server.addConnector(connector);
} }
try { try {
securePort = JiveGlobals.getXMLProperty("adminConsole.securePort", 9091); securePort = JiveGlobals.getXMLProperty("adminConsole.securePort", 9091);
if (securePort > 0) { if (securePort > 0) {
SunJsseListener listener = new SunJsseListener(); SslSocketConnector secureConnector = new JiveSslConnector();
// Get the keystore location. The default location is security/keystore secureConnector.setPort(securePort);
String keyStoreLocation = JiveGlobals.getProperty("xmpp.socket.ssl.keystore",
"resources" + File.separator + "security" + File.separator + "keystore");
// The location is relative to the home directory of the application.
keyStoreLocation = JiveGlobals.getHomeDirectory() + File.separator + keyStoreLocation;
// Get the keystore password. The default password is "changeit". secureConnector.setTrustPassword(SSLConfig.getTrustPassword());
String keypass = JiveGlobals.getProperty("xmpp.socket.ssl.keypass", "changeit"); secureConnector.setTruststoreType(SSLConfig.getStoreType());
keypass = keypass.trim(); secureConnector.setTruststore(SSLConfig.getTruststoreLocation());
secureConnector.setNeedClientAuth(false);
secureConnector.setWantClientAuth(false);
listener.setKeystore(keyStoreLocation); secureConnector.setKeyPassword(SSLConfig.getKeyPassword());
listener.setKeyPassword(keypass); secureConnector.setKeystoreType(SSLConfig.getStoreType());
listener.setPassword(keypass); secureConnector.setKeystore(SSLConfig.getKeystoreLocation());
secureListener = secureConnector;
listener.setHost(interfaceName); server.addConnector(secureListener);
listener.setPort(securePort);
secureListener = jetty.addListener(listener);
} }
} }
catch (Exception e) { catch (Exception e) {
...@@ -132,9 +128,7 @@ public class AdminConsolePlugin implements Plugin { ...@@ -132,9 +128,7 @@ public class AdminConsolePlugin implements Plugin {
public void initializePlugin(PluginManager manager, File pluginDir) { public void initializePlugin(PluginManager manager, File pluginDir) {
this.pluginDir = pluginDir; this.pluginDir = pluginDir;
try { try {
// Configure logging to a file, creating log dir if needed File logDir;
System.setProperty("org.apache.commons.logging.LogFactory", "org.mortbay.log.Factory");
File logDir = null;
String logDirectory = JiveGlobals.getXMLProperty("log.directory"); String logDirectory = JiveGlobals.getXMLProperty("log.directory");
// Check if the "log.directory" was defined // Check if the "log.directory" was defined
if (logDirectory != null) { if (logDirectory != null) {
...@@ -151,45 +145,28 @@ public class AdminConsolePlugin implements Plugin { ...@@ -151,45 +145,28 @@ public class AdminConsolePlugin implements Plugin {
if (!logDir.exists()) { if (!logDir.exists()) {
logDir.mkdirs(); logDir.mkdirs();
} }
File logFile = new File(logDir, "admin-console.log"); // File logFile = new File(logDir, "admin-console.log");
OutputStreamLogSink logSink = new OutputStreamLogSink(logFile.toString()); // OutputStreamLogSink logSink = new OutputStreamLogSink(logFile.toString());
logSink.start(); // logSink.start();
// In some cases, commons-logging settings can be stomped by other // // In some cases, commons-logging settings can be stomped by other
// libraries in the classpath. Make sure that hasn't happened before // // libraries in the classpath. Make sure that hasn't happened before
// setting configuration. // // setting configuration.
Object logImpl = Factory.getFactory().getInstance(""); // Logger log = (Logger) LogFactory.getFactory().getInstance("");
if (logImpl instanceof LogImpl) { // // Ignore INFO logs unless debugging turned on.
LogImpl log = (LogImpl)logImpl; // if (Log.isDebugEnabled() &&
// Ignore INFO logs unless debugging turned on. // JiveGlobals.getBooleanProperty("jetty.debug.enabled", true)) {
if (Log.isDebugEnabled() && // log.setVerbose(1);
JiveGlobals.getBooleanProperty("jetty.debug.enabled", true)) { // }
log.setVerbose(1); // else {
} // log.setVerbose(-1);
else { // }
log.setVerbose(-1); // log.add(logSink);
}
log.add(logSink);
}
jetty = new Server();
loadListeners(); loadListeners();
// Add web-app. Check to see if we're in development mode. If so, we don't context = createWebAppContext();
// add the normal web-app location, but the web-app in the project directory. server.addHandler(context);
if (Boolean.getBoolean("developmentMode")) { server.start();
System.out.println(LocaleUtils.getLocalizedString("admin.console.devmode"));
context = jetty.addWebApplication("/",
pluginDir.getParentFile().getParentFile().getParent() + File.separator + "src" +
File.separator + "web");
}
else {
context = jetty.addWebApplication("/",
pluginDir.getAbsoluteFile() + File.separator + "webapp");
}
context.setWelcomeFiles(new String[]{"index.jsp"});
jetty.start();
printListenerMessages(); printListenerMessages();
} }
...@@ -199,16 +176,34 @@ public class AdminConsolePlugin implements Plugin { ...@@ -199,16 +176,34 @@ public class AdminConsolePlugin implements Plugin {
} }
} }
private WebAppContext createWebAppContext() {
WebAppContext context;
// Add web-app. Check to see if we're in development mode. If so, we don't
// add the normal web-app location, but the web-app in the project directory.
if (Boolean.getBoolean("developmentMode")) {
System.out.println(LocaleUtils.getLocalizedString("admin.console.devmode"));
context = new WebAppContext(
pluginDir.getParentFile().getParentFile().getParent() + File.separator +
"src" + File.separator + "web", "/");
}
else {
context = new WebAppContext(pluginDir.getAbsoluteFile() + File.separator + "webapp",
"/");
}
context.setWelcomeFiles(new String[]{"index.jsp"});
return context;
}
public void destroyPlugin() { public void destroyPlugin() {
plainListener = null; plainListener = null;
secureListener = null; secureListener = null;
try { try {
if (jetty != null) { if (server != null) {
jetty.stop(); server.stop();
jetty = null; server = null;
} }
} }
catch (InterruptedException e) { catch (Exception e) {
Log.error(LocaleUtils.getLocalizedString("admin.error"), e); Log.error(LocaleUtils.getLocalizedString("admin.error"), e);
} }
} }
...@@ -219,7 +214,7 @@ public class AdminConsolePlugin implements Plugin { ...@@ -219,7 +214,7 @@ public class AdminConsolePlugin implements Plugin {
* @return the Jetty server instance. * @return the Jetty server instance.
*/ */
public static Server getJettyServer() { public static Server getJettyServer() {
return jetty; return server;
} }
/** /**
...@@ -255,4 +250,11 @@ public class AdminConsolePlugin implements Plugin { ...@@ -255,4 +250,11 @@ public class AdminConsolePlugin implements Plugin {
System.out.println(msg); System.out.println(msg);
} }
} }
public class JiveSslConnector extends SslSocketConnector {
@Override
protected SSLServerSocketFactory createFactory() throws Exception {
return SSLConfig.getServerSocketFactory();
}
}
} }
\ No newline at end of file
/**
* $RCSfile$
* $Revision: $
* $Date: $
*
* Copyright (C) 2006 Jive Software. All rights reserved.
*
* This software is published under the terms of the GNU Public License (GPL),
* a copy of which is included in this distribution.
*/
package org.jivesoftware.wildfire.http;
import org.mortbay.jetty.Server;
import org.mortbay.jetty.Connector;
import org.mortbay.jetty.Handler;
import org.mortbay.jetty.security.SslSocketConnector;
import org.mortbay.jetty.servlet.ServletHolder;
import org.mortbay.jetty.servlet.ServletHandler;
import org.mortbay.jetty.nio.SelectChannelConnector;
import org.jivesoftware.util.Log;
import org.jivesoftware.wildfire.net.SSLConfig;
import javax.net.ssl.SSLServerSocketFactory;
/**
* Manages connections to the server which use the HTTP Bind protocol specified in <a
* href="http://www.xmpp.org/extensions/xep-0124.html">XEP-0124</a>. The manager maps a servlet to
* an embedded servlet container using the ports provided in the constructor.
*
* @author Alexander Wenckus
*/
public class HttpBindManager {
private int plainPort;
private int sslPort;
private Server server;
private String serverName;
public HttpBindManager(String serverName, int plainPort, int sslPort) {
this.plainPort = plainPort;
this.sslPort = sslPort;
this.server = new Server();
this.serverName = serverName;
}
/**
* Starts the HTTP Bind service.
*
* @throws Exception if there is an error starting up the server.
*/
public void startup() throws Exception {
for(Connector connector : createConnectors()) {
server.addConnector(connector);
}
server.addHandler(createServletHandler());
server.start();
}
private Handler createServletHandler() {
ServletHolder servletHolder = new ServletHolder(
new HttpBindServlet(new HttpSessionManager(serverName)));
ServletHandler servletHandler = new ServletHandler();
servletHandler.addServletWithMapping(servletHolder, "/");
return servletHandler;
}
private Connector[] createConnectors() {
SelectChannelConnector connector = new SelectChannelConnector();
connector.setPort(plainPort);
if (sslPort > 0) {
try {
SslSocketConnector secureConnector = new JiveSslConnector();
secureConnector.setPort(sslPort);
secureConnector.setTrustPassword(SSLConfig.getTrustPassword());
secureConnector.setTruststoreType(SSLConfig.getStoreType());
secureConnector.setTruststore(SSLConfig.getTruststoreLocation());
secureConnector.setNeedClientAuth(false);
secureConnector.setWantClientAuth(false);
secureConnector.setKeyPassword(SSLConfig.getKeyPassword());
secureConnector.setKeystoreType(SSLConfig.getStoreType());
secureConnector.setKeystore(SSLConfig.getKeystoreLocation());
return new Connector[]{connector, secureConnector};
}
catch (Exception ex) {
Log.error("Error establishing SSL connector for HTTP Bind", ex);
}
}
return new Connector[]{connector};
}
/**
* Shutdown the HTTP Bind service, freeing any related resources.
*
* @throws Exception if there is an error shutting down the service.
*/
public void shutdown() throws Exception {
server.stop();
}
private class JiveSslConnector extends SslSocketConnector {
@Override
protected SSLServerSocketFactory createFactory() throws Exception {
return SSLConfig.getServerSocketFactory();
}
}
}
...@@ -46,7 +46,7 @@ public class HttpBindServlet extends HttpServlet { ...@@ -46,7 +46,7 @@ public class HttpBindServlet extends HttpServlet {
} }
} }
HttpBindServlet(HttpSessionManager sessionManager) { public HttpBindServlet(HttpSessionManager sessionManager) {
this.sessionManager = sessionManager; this.sessionManager = sessionManager;
} }
......
...@@ -134,11 +134,11 @@ public class HttpSession extends ClientSession { ...@@ -134,11 +134,11 @@ public class HttpSession extends ClientSession {
return null; return null;
} }
public void close() { public synchronized void close() {
conn.close(); conn.close();
} }
private synchronized void close(boolean isServerShuttingDown) { private synchronized void closeConnection() {
if(isClosed) { if(isClosed) {
return; return;
} }
...@@ -175,7 +175,7 @@ public class HttpSession extends ClientSession { ...@@ -175,7 +175,7 @@ public class HttpSession extends ClientSession {
deliver(new Deliverable(text)); deliver(new Deliverable(text));
} }
public synchronized void deliver(Packet stanza) { private synchronized void deliver(Packet stanza) {
deliver(new Deliverable(stanza)); deliver(new Deliverable(stanza));
} }
...@@ -332,7 +332,7 @@ public class HttpSession extends ClientSession { ...@@ -332,7 +332,7 @@ public class HttpSession extends ClientSession {
public static class HttpVirtualConnection extends VirtualConnection { public static class HttpVirtualConnection extends VirtualConnection {
public void closeVirtualConnection() { public void closeVirtualConnection() {
((HttpSession)session).close(false); ((HttpSession)session).closeConnection();
} }
public InetAddress getInetAddress() { public InetAddress getInetAddress() {
...@@ -340,7 +340,7 @@ public class HttpSession extends ClientSession { ...@@ -340,7 +340,7 @@ public class HttpSession extends ClientSession {
} }
public void systemShutdown() { public void systemShutdown() {
((HttpSession)session).close(true); ((HttpSession)session).closeConnection();
} }
public void deliver(Packet packet) throws UnauthorizedException { public void deliver(Packet packet) throws UnauthorizedException {
...@@ -353,7 +353,6 @@ public class HttpSession extends ClientSession { ...@@ -353,7 +353,6 @@ public class HttpSession extends ClientSession {
} }
private class Deliverable { private class Deliverable {
private final String text; private final String text;
private final Packet packet; private final Packet packet;
......
...@@ -55,7 +55,6 @@ public class HttpSessionManager { ...@@ -55,7 +55,6 @@ public class HttpSessionManager {
*/ */
private static int pollingInterval; private static int pollingInterval;
private String serverName;
private InactivityTimer timer = new InactivityTimer(); private InactivityTimer timer = new InactivityTimer();
private SessionManager sessionManager; private SessionManager sessionManager;
private Map<String, HttpSession> sessionMap = new HashMap<String, HttpSession>(); private Map<String, HttpSession> sessionMap = new HashMap<String, HttpSession>();
...@@ -67,8 +66,7 @@ public class HttpSessionManager { ...@@ -67,8 +66,7 @@ public class HttpSessionManager {
pollingInterval = JiveGlobals.getIntProperty("xmpp.httpbind.client.requests.polling", 5); pollingInterval = JiveGlobals.getIntProperty("xmpp.httpbind.client.requests.polling", 5);
} }
public HttpSessionManager(String serverName) { public HttpSessionManager() {
this.serverName = serverName;
this.sessionManager = SessionManager.getInstance(); this.sessionManager = SessionManager.getInstance();
} }
...@@ -90,7 +88,7 @@ public class HttpSessionManager { ...@@ -90,7 +88,7 @@ public class HttpSessionManager {
int wait = getIntAttribute(rootNode.attributeValue("wait"), 60); int wait = getIntAttribute(rootNode.attributeValue("wait"), 60);
int hold = getIntAttribute(rootNode.attributeValue("hold"), 1); int hold = getIntAttribute(rootNode.attributeValue("hold"), 1);
HttpSession session = createSession(serverName); HttpSession session = createSession();
session.setWait(wait); session.setWait(wait);
session.setHold(hold); session.setHold(hold);
session.setSecure(connection.isSecure()); session.setSecure(connection.isSecure());
...@@ -109,12 +107,11 @@ public class HttpSessionManager { ...@@ -109,12 +107,11 @@ public class HttpSessionManager {
return session; return session;
} }
private HttpSession createSession(String serverName) throws UnauthorizedException { private HttpSession createSession() throws UnauthorizedException {
// Create a ClientSession for this user. // Create a ClientSession for this user.
StreamID streamID = SessionManager.getInstance().nextStreamID(); StreamID streamID = SessionManager.getInstance().nextStreamID();
HttpSession session = new HttpSession(serverName, streamID);
// Send to the server that a new client session has been created // Send to the server that a new client session has been created
sessionManager.createClientHttpSession(streamID); HttpSession session = sessionManager.createClientHttpSession(streamID);
// Register that the new session is associated with the specified stream ID // Register that the new session is associated with the specified stream ID
sessionMap.put(streamID.getID(), session); sessionMap.put(streamID.getID(), session);
session.addSessionCloseListener(new SessionListener() { session.addSessionCloseListener(new SessionListener() {
......
...@@ -15,12 +15,16 @@ import org.jivesoftware.util.JiveGlobals; ...@@ -15,12 +15,16 @@ import org.jivesoftware.util.JiveGlobals;
import org.jivesoftware.util.LocaleUtils; import org.jivesoftware.util.LocaleUtils;
import org.jivesoftware.util.Log; import org.jivesoftware.util.Log;
import org.jivesoftware.wildfire.*; import org.jivesoftware.wildfire.*;
import org.jivesoftware.wildfire.http.HttpSessionManager;
import org.jivesoftware.wildfire.http.HttpBindServlet;
import org.jivesoftware.wildfire.container.BasicModule; import org.jivesoftware.wildfire.container.BasicModule;
import org.jivesoftware.wildfire.container.AdminConsolePlugin; import org.jivesoftware.wildfire.container.AdminConsolePlugin;
import org.jivesoftware.wildfire.multiplex.MultiplexerPacketDeliverer; import org.jivesoftware.wildfire.multiplex.MultiplexerPacketDeliverer;
import org.jivesoftware.wildfire.net.*; import org.jivesoftware.wildfire.net.*;
import org.mortbay.jetty.Server; import org.mortbay.jetty.Server;
import org.mortbay.jetty.Handler;
import org.mortbay.jetty.servlet.ServletHolder;
import org.mortbay.jetty.servlet.ServletHandler;
import java.io.IOException; import java.io.IOException;
import java.net.InetAddress; import java.net.InetAddress;
import java.net.Socket; import java.net.Socket;
...@@ -50,10 +54,12 @@ public class ConnectionManagerImpl extends BasicModule implements ConnectionMana ...@@ -50,10 +54,12 @@ public class ConnectionManagerImpl extends BasicModule implements ConnectionMana
private boolean isStarted = false; private boolean isStarted = false;
// Used to know if the sockets have been started // Used to know if the sockets have been started
private boolean isSocketStarted = false; private boolean isSocketStarted = false;
private Server jettyServer;
public ConnectionManagerImpl() { public ConnectionManagerImpl() {
super("Connection Manager"); super("Connection Manager");
ports = new ArrayList<ServerPort>(4); ports = new ArrayList<ServerPort>(4);
jettyServer = new Server();
} }
private void createSocket() { private void createSocket() {
...@@ -287,10 +293,22 @@ public class ConnectionManagerImpl extends BasicModule implements ConnectionMana ...@@ -287,10 +293,22 @@ public class ConnectionManagerImpl extends BasicModule implements ConnectionMana
} }
private void startHTTPBindListeners() { private void startHTTPBindListeners() {
Server jetty = AdminConsolePlugin.getJettyServer(); if(jettyServer == null) {
if(jetty == null) { jettyServer = AdminConsolePlugin.getJettyServer();
return; if(jettyServer == null) {
return;
}
} }
jettyServer.addHandler(createServletHandler());
}
private Handler createServletHandler() {
ServletHolder servletHolder = new ServletHolder(
new HttpBindServlet(new HttpSessionManager()));
ServletHandler servletHandler = new ServletHandler();
servletHandler.addServletWithMapping(servletHolder, "/http-bind/");
return servletHandler;
} }
public void initialize(XMPPServer server) { public void initialize(XMPPServer server) {
...@@ -502,6 +520,14 @@ public class ConnectionManagerImpl extends BasicModule implements ConnectionMana ...@@ -502,6 +520,14 @@ public class ConnectionManagerImpl extends BasicModule implements ConnectionMana
SocketAcceptThread.DEFAULT_MULTIPLEX_PORT); SocketAcceptThread.DEFAULT_MULTIPLEX_PORT);
} }
public Server getHttpServer() {
return jettyServer;
}
public void setHttpServer(Server server) {
this.jettyServer = server;
}
// ##################################################################### // #####################################################################
// Module management // Module management
// ##################################################################### // #####################################################################
......
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