Commit a7776b60 authored by Gaston Dombiak's avatar Gaston Dombiak Committed by gaston

Replaced HashMap with ConcurrentHashMap to make the class thread-safe. Now...

Replaced HashMap with ConcurrentHashMap to make the class thread-safe. Now it's safe to add&remove components while the server is up and running (i.e. hot deploy).


git-svn-id: http://svn.igniterealtime.org/svn/repos/messenger/trunk@328 b35dd754-fafc-0310-a699-88a17e54d16e
parent 1d70f5d3
...@@ -2,10 +2,12 @@ package org.jivesoftware.messenger; ...@@ -2,10 +2,12 @@ package org.jivesoftware.messenger;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import org.jivesoftware.util.StringUtils; import org.jivesoftware.util.StringUtils;
public class ComponentManager { public class ComponentManager {
private Map<String, Component> components = new HashMap<String, Component>(); private Map<String, Component> components = new ConcurrentHashMap<String, Component>();
static private ComponentManager singleton; static private ComponentManager singleton;
private final static Object LOCK = new Object(); private final static Object LOCK = new Object();
......
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