Author: manik.surtani(a)jboss.com
Date: 2008-06-04 14:11:48 -0400 (Wed, 04 Jun 2008)
New Revision: 5956
Modified:
demos/core-demo-gui/trunk/pom.xml
demos/core-demo-gui/trunk/src/main/java/org/jboss/cache/demo/JBossCacheDemo.java
Log:
Updated to JBC 2.2.0.CR2
Updated to deal with refreshing display for DEAD backup subtrees
Modified: demos/core-demo-gui/trunk/pom.xml
===================================================================
--- demos/core-demo-gui/trunk/pom.xml 2008-06-04 17:10:42 UTC (rev 5955)
+++ demos/core-demo-gui/trunk/pom.xml 2008-06-04 18:11:48 UTC (rev 5956)
@@ -18,7 +18,7 @@
<dependency>
<groupId>org.jboss.cache</groupId>
<artifactId>jbosscache-core</artifactId>
- <version>2.1.0.GA</version>
+ <version>2.2.0.CR2</version>
</dependency>
<dependency>
<groupId>jgoodies</groupId>
Modified:
demos/core-demo-gui/trunk/src/main/java/org/jboss/cache/demo/JBossCacheDemo.java
===================================================================
---
demos/core-demo-gui/trunk/src/main/java/org/jboss/cache/demo/JBossCacheDemo.java 2008-06-04
17:10:42 UTC (rev 5955)
+++
demos/core-demo-gui/trunk/src/main/java/org/jboss/cache/demo/JBossCacheDemo.java 2008-06-04
18:11:48 UTC (rev 5956)
@@ -9,17 +9,20 @@
import org.jboss.cache.DefaultCacheFactory;
import org.jboss.cache.Fqn;
import org.jboss.cache.Node;
-import org.jboss.cache.util.CachePrinter;
+import org.jboss.cache.NodeSPI;
import org.jboss.cache.notifications.annotation.BuddyGroupChanged;
import org.jboss.cache.notifications.annotation.NodeCreated;
import org.jboss.cache.notifications.annotation.NodeModified;
+import org.jboss.cache.notifications.annotation.NodeMoved;
import org.jboss.cache.notifications.annotation.NodeRemoved;
import org.jboss.cache.notifications.annotation.ViewChanged;
import org.jboss.cache.notifications.event.BuddyGroupChangedEvent;
import org.jboss.cache.notifications.event.NodeCreatedEvent;
import org.jboss.cache.notifications.event.NodeModifiedEvent;
+import org.jboss.cache.notifications.event.NodeMovedEvent;
import org.jboss.cache.notifications.event.NodeRemovedEvent;
import org.jboss.cache.notifications.event.ViewChangedEvent;
+import org.jboss.cache.util.CachePrinter;
import org.jgroups.Address;
import javax.swing.*;
@@ -49,9 +52,6 @@
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.ThreadPoolExecutor;
-import java.util.concurrent.AbstractExecutorService;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.LinkedBlockingQueue;
/**
* @author Manik Surtani (<a
href="mailto:manik@jboss.org">manik@jboss.org</a>)
@@ -592,6 +592,7 @@
public void buddyGroupChanged(BuddyGroupChangedEvent e)
{
clusterDataModel.setBuddies();
+ treeRefresher.repaint();
}
@NodeModified
@@ -625,6 +626,36 @@
}
}
+ @NodeMoved
+ public void nodeMoved(NodeMovedEvent e)
+ {
+ if (!e.isPre())
+ {
+ final Fqn fqn = e.getTargetFqn();
+ asyncExecutor.execute(new Runnable()
+ {
+ public void run()
+ {
+
+ // get all kids and add to the tree as well.
+ CacheSPI<String, String> spi = (CacheSPI) cache;
+ recursivelyAddNode(spi.peek(fqn, false));
+ // only refresh if there are no more tasks queued up
+ if (asyncTaskQueue.isEmpty()) treeRefresher.repaint();
+ }
+
+ private void recursivelyAddNode(NodeSPI<String, String> n)
+ {
+ treeRefresher.addNode(n.getFqn());
+ for (Node<String, String> child : n.getChildrenDirect())
+ recursivelyAddNode((NodeSPI<String, String>) child);
+ }
+
+ });
+ }
+ }
+
+
@NodeRemoved
public void nodeRemoved(NodeRemovedEvent e)
{
Show replies by date