Commit 238fce69 authored by Gaston Dombiak's avatar Gaston Dombiak Committed by gaston

Fixed problem that prevented to server to start up from a jar file.


git-svn-id: http://svn.igniterealtime.org/svn/repos/messenger/trunk@978 b35dd754-fafc-0310-a699-88a17e54d16e
parent fdf3ed27
......@@ -42,7 +42,7 @@ public class InternalComponentManager implements ComponentManager, RoutableChann
private Map<String, Component> components = new ConcurrentHashMap<String, Component>();
private Map<JID, JID> presenceMap = new ConcurrentHashMap<JID, JID>();
private static InternalComponentManager instance;
private static InternalComponentManager instance = new InternalComponentManager();
/**
* XMPP address of this internal service. The address is of the form: component.[domain]
*/
......@@ -53,22 +53,22 @@ public class InternalComponentManager implements ComponentManager, RoutableChann
*/
private String serverDomain;
static {
instance = new InternalComponentManager();
ComponentManagerFactory.setComponentManager(instance);
}
public static InternalComponentManager getInstance() {
return instance;
}
private InternalComponentManager() {
public void start() {
// Set this ComponentManager as the current component manager
ComponentManagerFactory.setComponentManager(instance);
XMPPServer server = XMPPServer.getInstance();
serverDomain = server.getServerInfo().getName();
// Set the address of this internal service. component.[domain]
serviceAddress = new JID(null, "component." + serverDomain, null);
// Add a route to this service
server.getRoutingTable().addRoute(getAddress(), this);
if (!server.isSetupMode()) {
// Add a route to this service
server.getRoutingTable().addRoute(getAddress(), this);
}
}
public void addComponent(String subdomain, Component component) {
......
......@@ -198,7 +198,7 @@ public class XMPPServer {
startModules();
}
// Load plugins. First, initialize component manager.
InternalComponentManager.getInstance();
InternalComponentManager.getInstance().start();
File pluginDir = new File(messengerHome, "plugins");
pluginManager = new PluginManager(pluginDir);
pluginManager.start();
......
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