[jboss-cvs] JBossCache/src/org/jboss/cache/interceptors ...
Manik Surtani
msurtani at jboss.com
Wed Oct 18 07:07:55 EDT 2006
User: msurtani
Date: 06/10/18 07:07:55
Modified: src/org/jboss/cache/interceptors CacheMgmtInterceptor.java
Log:
* added more tests for the move() API
* added a nodeMoved listener event
* moved some methods from CacheSPI to Cache
Revision Changes Path
1.23 +12 -3 JBossCache/src/org/jboss/cache/interceptors/CacheMgmtInterceptor.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: CacheMgmtInterceptor.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/interceptors/CacheMgmtInterceptor.java,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -b -r1.22 -r1.23
--- CacheMgmtInterceptor.java 6 Sep 2006 16:42:58 -0000 1.22
+++ CacheMgmtInterceptor.java 18 Oct 2006 11:07:55 -0000 1.23
@@ -43,7 +43,7 @@
* Captures cache management statistics
*
* @author Jerry Gauthier
- * @version $Id: CacheMgmtInterceptor.java,v 1.22 2006/09/06 16:42:58 msurtani Exp $
+ * @version $Id: CacheMgmtInterceptor.java,v 1.23 2006/10/18 11:07:55 msurtani Exp $
*/
public class CacheMgmtInterceptor extends Interceptor implements CacheMgmtInterceptorMBean, NotificationBroadcaster
{
@@ -54,6 +54,7 @@
NOTIF_NODE_CREATED = "org.jboss.cache.NodeCreated",
NOTIF_NODE_MODIFIED = "org.jboss.cache.NodeModified",
NOTIF_NODE_REMOVED = "org.jboss.cache.NodeRemoved",
+ NOTIF_NODE_MOVED = "org.jboss.cache.NodeMoved",
NOTIF_NODE_VISITED = "org.jboss.cache.NodeVisited",
NOTIF_NODE_EVICTED = "org.jboss.cache.NodeEvicted",
NOTIF_NODE_LOADED = "org.jboss.cache.NodeLoaded",
@@ -67,6 +68,7 @@
private static final String MSG_NODE_CREATED = "Node has been created.";
private static final String MSG_NODE_MODIFIED = "Node has been modifed.";
private static final String MSG_NODE_REMOVED = "Node has been removed.";
+ private static final String MSG_NODE_MOVED = "Node has been moved.";
private static final String MSG_NODE_VISITED = "Node has been visited.";
private static final String MSG_NODE_EVICTED = "Node has been evicted.";
private static final String MSG_NODE_LOADED = "Node has been loaded.";
@@ -107,7 +109,7 @@
public Object invoke(MethodCall m) throws Throwable
{
Map attributes;
- Object[]args = m.getArgs();
+ Object[] args = m.getArgs();
Object retval;
// if statistics not enabled, execute the method and return
@@ -161,7 +163,7 @@
retval = super.invoke(m);
m_evictions++;
break;
- default :
+ default:
retval = super.invoke(m);
break;
}
@@ -394,6 +396,13 @@
m_broadcaster.sendNotification(n);
}
+ public void nodeMoved(Fqn from, Fqn to, boolean pre)
+ {
+ Notification n = new Notification(NOTIF_NODE_MOVED, this, seq(), MSG_NODE_MOVED);
+ n.setUserData(new Object[]{from.toString(), to.toString(), pre});
+ m_broadcaster.sendNotification(n);
+ }
+
public void nodeVisited(Fqn fqn, boolean pre)
{
Notification n = new Notification(NOTIF_NODE_VISITED, this, seq(), MSG_NODE_VISITED);
More information about the jboss-cvs-commits
mailing list