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