[jboss-cvs] JBossCache/src/org/jboss/cache/aop ...
Manik Surtani
msurtani at jboss.com
Tue Jul 18 06:50:45 EDT 2006
User: msurtani
Date: 06/07/18 06:50:45
Modified: src/org/jboss/cache/aop MarshalledTreeCache.java
PojoCacheMBean.java TreeCacheAopView.java
Log:
Checked in new Habanero interfaces
Updated codebase to deal with new interfaces
Revision Changes Path
1.12 +49 -46 JBossCache/src/org/jboss/cache/aop/MarshalledTreeCache.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: MarshalledTreeCache.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/aop/MarshalledTreeCache.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -b -r1.11 -r1.12
--- MarshalledTreeCache.java 25 Apr 2006 19:26:07 -0000 1.11
+++ MarshalledTreeCache.java 18 Jul 2006 10:50:45 -0000 1.12
@@ -9,7 +9,8 @@
import org.jboss.cache.TreeCache;
import org.jboss.cache.Fqn;
import org.jboss.cache.CacheException;
-import org.jboss.cache.TreeCacheListener;
+import org.jboss.cache.CacheListener;
+import org.jboss.cache.CacheSPI;
import org.jboss.cache.lock.IsolationLevel;
import org.jboss.invocation.MarshalledValue;
import org.jgroups.JChannel;
@@ -32,7 +33,7 @@
* the marshalled value in the cache store.</p>
* @author Ben Wang
*/
-public class MarshalledTreeCache extends TreeCache implements TreeCacheListener {
+public class MarshalledTreeCache extends TreeCache implements CacheListener {
// Store the in-memory copy of the treecache (key, value) pair.
// This is used for performance reason so there is no need to un-marshall every single operation.
// In addition, it will support an invalidation mechanism.
@@ -290,49 +291,51 @@
}
}
- public void nodeCreated(Fqn fqn)
+ public void nodeCreated(Fqn fqn, boolean pre, boolean isLocal)
{
- // no-op
}
- public void nodeRemoved(Fqn fqn)
+ public void nodeModified(Fqn fqn, boolean pre, boolean isLocal, Map data)
{
- invalidate(fqn);
+ if (!pre) invalidate(fqn);
}
- public void nodeLoaded(Fqn fqn)
+ public void nodeRemoved(Fqn fqn, boolean pre, boolean isLocal, Map data)
{
- // no-op
+ if (!pre) invalidate(fqn);
}
- public void nodeEvicted(Fqn fqn)
+ public void nodeVisited(Fqn fqn, boolean pre)
{
- invalidate(fqn);
}
- public void nodeModified(Fqn fqn)
+ public void nodeEvicted(Fqn fqn, boolean pre, boolean isLocal)
{
- invalidate(fqn);
+ if (!pre) invalidate(fqn);
}
- public void nodeVisited(Fqn fqn)
+ public void nodeLoaded(Fqn fqn, boolean pre, Map data)
{
- // no-op
}
- public void cacheStarted(TreeCache cache)
+ public void nodeActivated(Fqn fqn, boolean pre)
{
- // no-op
}
- public void cacheStopped(TreeCache cache)
+ public void nodePassivated(Fqn fqn, boolean pre)
+ {
+ }
+
+ public void cacheStarted(CacheSPI cache)
+ {
+ }
+
+ public void cacheStopped(CacheSPI cache)
{
- // no-op
}
public void viewChange(View new_view)
{
- // no-op
}
protected void checkValue(Object value)
1.3 +0 -3 JBossCache/src/org/jboss/cache/aop/PojoCacheMBean.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: PojoCacheMBean.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/aop/PojoCacheMBean.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- PojoCacheMBean.java 12 Apr 2006 09:59:18 -0000 1.2
+++ PojoCacheMBean.java 18 Jul 2006 10:50:45 -0000 1.3
@@ -7,11 +7,8 @@
package org.jboss.cache.aop;
import org.jboss.cache.CacheException;
-import org.jboss.cache.Fqn;
import org.w3c.dom.Element;
-import java.util.Map;
-
/**
* MBean interface for PojoCache. Note that it also inherits from {@link org.jboss.cache.TreeCacheMBean}.
* @author Ben Wang
1.12 +69 -66 JBossCache/src/org/jboss/cache/aop/TreeCacheAopView.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: TreeCacheAopView.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/aop/TreeCacheAopView.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -b -r1.11 -r1.12
--- TreeCacheAopView.java 13 Apr 2006 00:19:31 -0000 1.11
+++ TreeCacheAopView.java 18 Jul 2006 10:50:45 -0000 1.12
@@ -8,7 +8,28 @@
package org.jboss.cache.aop;
-import java.awt.BorderLayout;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.jboss.cache.CacheListener;
+import org.jboss.cache.CacheSPI;
+import org.jboss.cache.Fqn;
+import org.jboss.cache.PropertyConfigurator;
+import org.jboss.cache.TreeCacheView;
+import org.jgroups.View;
+
+import javax.swing.*;
+import javax.swing.event.TableModelEvent;
+import javax.swing.event.TableModelListener;
+import javax.swing.event.TreeSelectionEvent;
+import javax.swing.event.TreeSelectionListener;
+import javax.swing.table.DefaultTableModel;
+import javax.swing.table.TableColumn;
+import javax.swing.tree.DefaultMutableTreeNode;
+import javax.swing.tree.DefaultTreeModel;
+import javax.swing.tree.TreeNode;
+import javax.swing.tree.TreePath;
+import javax.swing.tree.TreeSelectionModel;
+import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
@@ -23,38 +44,6 @@
import java.util.StringTokenizer;
import java.util.Vector;
-import javax.swing.AbstractAction;
-import javax.swing.JFrame;
-import javax.swing.JMenu;
-import javax.swing.JMenuBar;
-import javax.swing.JOptionPane;
-import javax.swing.JPanel;
-import javax.swing.JPopupMenu;
-import javax.swing.JScrollPane;
-import javax.swing.JTable;
-import javax.swing.JTextField;
-import javax.swing.JTree;
-import javax.swing.event.TableModelEvent;
-import javax.swing.event.TableModelListener;
-import javax.swing.event.TreeSelectionEvent;
-import javax.swing.event.TreeSelectionListener;
-import javax.swing.table.DefaultTableModel;
-import javax.swing.table.TableColumn;
-import javax.swing.tree.DefaultMutableTreeNode;
-import javax.swing.tree.DefaultTreeModel;
-import javax.swing.tree.TreeNode;
-import javax.swing.tree.TreePath;
-import javax.swing.tree.TreeSelectionModel;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.jboss.cache.Fqn;
-import org.jboss.cache.PropertyConfigurator;
-import org.jboss.cache.TreeCache;
-import org.jboss.cache.TreeCacheListener;
-import org.jboss.cache.TreeCacheView;
-import org.jgroups.View;
-
//import java.util.List;
/**
@@ -67,7 +56,7 @@
*
* @author Ben Wang
* @deprecated Not used now. Use TreeCacheView2 directly.
- * @version $Revision: 1.11 $
+ * @version $Revision: 1.12 $
*/
public class TreeCacheAopView
{
@@ -189,7 +178,7 @@
}
-class TreeCacheAopGui extends JFrame implements WindowListener, TreeCacheListener,
+class TreeCacheAopGui extends JFrame implements WindowListener, CacheListener,
TreeSelectionListener, TableModelListener
{
private static final long serialVersionUID = -7044654602510185865L;
@@ -382,7 +371,9 @@
/* ------------------ ReplicatedTree.ReplicatedTreeListener interface ------------ */
- public void nodeCreated(Fqn fqn)
+ public void nodeCreated(Fqn fqn, boolean pre, boolean isLocal)
+ {
+ if (!pre)
{
MyNode n, p;
@@ -393,8 +384,11 @@
jtree.scrollPathToVisible(new TreePath(n.getPath()));
}
}
+ }
- public void nodeRemoved(Fqn fqn)
+ public void nodeRemoved(Fqn fqn, boolean pre, boolean isLocal, Map data)
+ {
+ if (!pre)
{
MyNode n;
TreeNode par;
@@ -407,16 +401,27 @@
tree_model.reload(par);
}
}
+ }
+
+ public void nodeLoaded(Fqn fqn, boolean pre, Map data) {
+ nodeCreated(fqn, pre, true);
+ }
+
+ public void nodeActivated(Fqn fqn, boolean pre)
+ {
+ }
- public void nodeLoaded(Fqn fqn) {
- nodeCreated(fqn);
+ public void nodePassivated(Fqn fqn, boolean pre)
+ {
}
- public void nodeEvicted(Fqn fqn) {
- nodeRemoved(fqn);
+ public void nodeEvicted(Fqn fqn, boolean pre, boolean isLocal) {
+ nodeRemoved(fqn, pre, isLocal, null);
}
- public void nodeModified(final Fqn fqn)
+ public void nodeModified(final Fqn fqn, boolean pre, boolean isLocal, Map d)
+ {
+ if (!pre)
{
// needs to be in a separate thread because Swing thread is different from callback thread,
// resulting in a lock until lock timeout kicks in
@@ -433,20 +438,18 @@
poulateTable is the current table being shown is the info of the node. that is modified.
*/
}
+ }
- public void nodeVisited(Fqn fqn)
+ public void nodeVisited(Fqn fqn, boolean pre)
{
- //To change body of implemented methods use File | Settings | File Templates.
}
- public void cacheStarted(TreeCache cache)
+ public void cacheStarted(CacheSPI cache)
{
- //To change body of implemented methods use File | Settings | File Templates.
}
- public void cacheStopped(TreeCache cache)
+ public void cacheStopped(CacheSPI cache)
{
- //To change body of implemented methods use File | Settings | File Templates.
}
public void viewChange(final View new_view)
More information about the jboss-cvs-commits
mailing list