[jboss-cvs] JBossCache/src/org/jboss/cache/notifications ...
Manik Surtani
msurtani at jboss.com
Sat Dec 30 12:50:06 EST 2006
User: msurtani
Date: 06/12/30 12:50:06
Modified: src/org/jboss/cache/notifications Notifier.java
Log:
Major changes to restructure cache and node object model
Revision Changes Path
1.12 +15 -19 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.11
retrieving revision 1.12
diff -u -b -r1.11 -r1.12
--- Notifier.java 20 Nov 2006 08:51:50 -0000 1.11
+++ Notifier.java 30 Dec 2006 17:50:06 -0000 1.12
@@ -8,22 +8,18 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.jboss.cache.CacheImpl;
import org.jboss.cache.CacheListener;
import org.jboss.cache.CacheSPI;
import org.jboss.cache.Fqn;
import org.jboss.cache.InvocationContext;
-import org.jboss.cache.TreeCache;
import org.jgroups.View;
-import java.util.concurrent.CopyOnWriteArraySet;
-import java.util.AbstractMap;
-import java.util.AbstractSet;
-import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
-import java.util.Iterator;
import java.util.Map;
import java.util.Set;
+import java.util.concurrent.CopyOnWriteArraySet;
/**
* Helper class that handles all notifications to registered listeners.
@@ -45,13 +41,13 @@
private CacheListener evictionPolicyListener;
private Set<CacheListener> listeners = new CopyOnWriteArraySet();
- private TreeCache treeCache;
+ private CacheImpl cache;
private InvocationContext tempCtx;
private Log log = LogFactory.getLog(Notifier.class);
- public Notifier(TreeCache treeCache)
+ public Notifier(CacheImpl cache)
{
- this.treeCache = treeCache;
+ this.cache = cache;
}
/**
@@ -120,7 +116,7 @@
public synchronized void notifyNodeCreated(Fqn fqn, boolean pre)
{
- boolean originLocal = treeCache.getInvocationContext().isOriginLocal();
+ boolean originLocal = cache.getInvocationContext().isOriginLocal();
resetInvocationContext();
if (evictionPolicyListener != null)
{
@@ -152,7 +148,7 @@
*/
public synchronized void notifyNodeModified(Fqn fqn, boolean pre, Map data)
{
- boolean originLocal = treeCache.getInvocationContext().isOriginLocal();
+ boolean originLocal = cache.getInvocationContext().isOriginLocal();
resetInvocationContext();
if (evictionPolicyListener != null)
{
@@ -177,7 +173,7 @@
*/
public synchronized void notifyNodeRemoved(Fqn fqn, boolean pre, Map data)
{
- boolean originLocal = treeCache.getInvocationContext().isOriginLocal();
+ boolean originLocal = cache.getInvocationContext().isOriginLocal();
resetInvocationContext();
if (evictionPolicyListener != null)
{
@@ -224,7 +220,7 @@
*/
public synchronized void notifyNodeEvicted(Fqn fqn, boolean pre)
{
- boolean originLocal = treeCache.getInvocationContext().isOriginLocal();
+ boolean originLocal = cache.getInvocationContext().isOriginLocal();
resetInvocationContext();
if (evictionPolicyListener != null)
{
@@ -356,20 +352,20 @@
private void restoreInvocationContext()
{
- treeCache.getInvocationContext().setState(tempCtx);
+ cache.getInvocationContext().setState(tempCtx);
}
private void resetInvocationContext()
{
try
{
- tempCtx = treeCache.getInvocationContext().clone();
+ tempCtx = cache.getInvocationContext().clone();
}
catch (CloneNotSupportedException e)
{
- log.warn("Unable to clone Invocation Context " + treeCache.getInvocationContext(), e);
+ log.warn("Unable to clone Invocation Context " + cache.getInvocationContext(), e);
}
- treeCache.getInvocationContext().reset();
+ cache.getInvocationContext().reset();
}
/**
More information about the jboss-cvs-commits
mailing list