[jboss-cvs] JBossCache/src/org/jboss/cache/notifications ...
Manik Surtani
msurtani at jboss.com
Wed Jan 3 12:50:31 EST 2007
User: msurtani
Date: 07/01/03 12:50:31
Modified: src/org/jboss/cache/notifications Notifier.java
Log:
added more rich nodeModified callback
Revision Changes Path
1.16 +7 -6 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.15
retrieving revision 1.16
diff -u -b -r1.15 -r1.16
--- Notifier.java 3 Jan 2007 16:43:52 -0000 1.15
+++ Notifier.java 3 Jan 2007 17:50:31 -0000 1.16
@@ -43,7 +43,7 @@
// and there are less frequently other listeners so optimization is justified
private CacheListener evictionPolicyListener;
- private Set<CacheListener> listeners = new CopyOnWriteArraySet();
+ private final Set<CacheListener> listeners = new CopyOnWriteArraySet<CacheListener>();
private CacheImpl cache;
private InvocationContext tempCtx;
private static final Log log = LogFactory.getLog(Notifier.class);
@@ -56,7 +56,7 @@
try
{
nodeCreated = CacheListener.class.getMethod("nodeCreated", Fqn.class, boolean.class, boolean.class);
- nodeModified = CacheListener.class.getMethod("nodeModified", Fqn.class, boolean.class, boolean.class, Map.class);
+ nodeModified = CacheListener.class.getMethod("nodeModified", Fqn.class, boolean.class, boolean.class, CacheListener.ModificationType.class, Map.class);
nodeRemoved = CacheListener.class.getMethod("nodeRemoved", Fqn.class, boolean.class, boolean.class, Map.class);
nodeVisited = CacheListener.class.getMethod("nodeVisited", Fqn.class, boolean.class);
nodeEvicted = CacheListener.class.getMethod("nodeEvicted", Fqn.class, boolean.class, boolean.class);
@@ -176,10 +176,11 @@
*
* @param fqn
* @param pre
+ * @param modificationType
* @param data
* @param sendImmediately
*/
- public synchronized void notifyNodeModified(Fqn fqn, boolean pre, Map<Object, Object> data, boolean sendImmediately)
+ public synchronized void notifyNodeModified(Fqn fqn, boolean pre, CacheListener.ModificationType modificationType, Map<Object, Object> data, boolean sendImmediately)
{
boolean originLocal = cache.getInvocationContext().isOriginLocal();
Map dataCopy = copy(data);
@@ -188,20 +189,20 @@
resetInvocationContext();
if (evictionPolicyListener != null)
{
- evictionPolicyListener.nodeModified(fqn, pre, originLocal, dataCopy);
+ evictionPolicyListener.nodeModified(fqn, pre, originLocal, modificationType, dataCopy);
}
if (hasListeners)
{
for (CacheListener listener : listeners)
{
- listener.nodeModified(fqn, pre, originLocal, dataCopy);
+ listener.nodeModified(fqn, pre, originLocal, modificationType, dataCopy);
}
}
restoreInvocationContext();
}
else
{
- MethodCall call = new MethodCall(nodeModified, new Object[]{fqn, pre, originLocal, dataCopy});
+ MethodCall call = new MethodCall(nodeModified, new Object[]{fqn, pre, originLocal, modificationType, dataCopy});
cache.getInvocationContext().addCacheListenerEvent(call);
}
}
More information about the jboss-cvs-commits
mailing list