[jboss-cvs] JBossCache/src/org/jboss/cache/notifications ...
Manik Surtani
manik at jboss.org
Wed May 23 06:28:58 EDT 2007
User: msurtani
Date: 07/05/23 06:28:58
Modified: src/org/jboss/cache/notifications Notifier.java
Log:
Initiated a bunch of performance fixes, including replacing CopyOnWriteArraySets with org.jboss.cache.util.concurrent.ConcurrentHashSet.
Also ran an imports optimiser on the code base - there were a lot of unused imports floating about.
Revision Changes Path
1.20 +4 -4 JBossCache/src/org/jboss/cache/notifications/Notifier.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: Notifier.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/notifications/Notifier.java,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -b -r1.19 -r1.20
--- Notifier.java 17 Apr 2007 06:09:13 -0000 1.19
+++ Notifier.java 23 May 2007 10:28:58 -0000 1.20
@@ -15,6 +15,7 @@
import org.jboss.cache.InvocationContext;
import org.jboss.cache.marshall.MethodCall;
import org.jboss.cache.util.MapCopy;
+import org.jboss.cache.util.concurrent.ConcurrentHashSet;
import org.jgroups.View;
import java.lang.reflect.Method;
@@ -22,7 +23,6 @@
import java.util.List;
import java.util.Map;
import java.util.Set;
-import java.util.concurrent.CopyOnWriteArraySet;
/**
* Helper class that handles all notifications to registered listeners.
@@ -43,7 +43,7 @@
// and there are less frequently other listeners so optimization is justified
private CacheListener evictionPolicyListener;
- private final Set<CacheListener> listeners = new CopyOnWriteArraySet<CacheListener>();
+ private final Set<CacheListener> listeners = new ConcurrentHashSet<CacheListener>();
private CacheImpl cache;
private InvocationContext tempCtx;
private static final Log log = LogFactory.getLog(Notifier.class);
@@ -557,7 +557,7 @@
* <li>It is null</li>
* <li>It is an instance of {@link org.jboss.cache.util.MapCopy}, which is immutable</li>
* <li>It is an instance of {@link java.util.Collections#emptyMap()}, which is also immutable</li>
- * <li>It is an instance of {@link java.util.Collections#singletonMap()}, which is also immutable</li>
+ * <li>It is an instance of {@link java.util.Collections#singletonMap(Object,Object)}, which is also immutable</li>
* </ul>
*
* @param map
More information about the jboss-cvs-commits
mailing list