[jboss-cvs] JBossCache/src/org/jboss/cache/statetransfer ...
Brian Stansberry
brian.stansberry at jboss.com
Thu Dec 21 16:21:05 EST 2006
User: bstansberry
Date: 06/12/21 16:21:05
Modified: src/org/jboss/cache/statetransfer Tag:
Branch_JBossCache_1_4_0
StateTransferIntegrator_140.java
Log:
[JBCACHE-913] Do the TreeCacheListener and eviction region notifications as part of the basic state transfer node creation
Revision Changes Path
No revision
No revision
1.6.2.1 +21 -1 JBossCache/src/org/jboss/cache/statetransfer/Attic/StateTransferIntegrator_140.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: StateTransferIntegrator_140.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/statetransfer/Attic/StateTransferIntegrator_140.java,v
retrieving revision 1.6
retrieving revision 1.6.2.1
diff -u -b -r1.6 -r1.6.2.1
--- StateTransferIntegrator_140.java 27 Apr 2006 07:18:37 -0000 1.6
+++ StateTransferIntegrator_140.java 21 Dec 2006 21:21:05 -0000 1.6.2.1
@@ -23,6 +23,9 @@
import org.jboss.cache.TreeCache;
import org.jboss.cache.aop.InternalDelegate;
import org.jboss.cache.aop.PojoCache;
+import org.jboss.cache.eviction.EvictedEventNode;
+import org.jboss.cache.eviction.Region;
+import org.jboss.cache.eviction.RegionManager;
import org.jboss.cache.factories.NodeFactory;
import org.jboss.cache.loader.CacheLoader;
import org.jboss.cache.loader.ExtendedCacheLoader;
@@ -255,17 +258,34 @@
name = fqn.get(size - 1);
+ Map attrs = nd.getAttributes();
+
// We handle this NodeData. Create a DataNode and
// integrate its data
DataNode target = factory.createDataNode(nodeType,
name,
fqn,
parent,
- nd.getAttributes(),
+ attrs,
true,
cache);
parent.addChild(name, target);
+ // Send out the TreeCacheListener notification
+ cache.notifyNodeCreated(fqn);
+
+ // Make sure any eviction policy is aware of this node
+ RegionManager rm = cache.getEvictionRegionManager();
+ if (rm != null)
+ {
+ Region region = rm.getRegion(fqn);
+ if (region != null)
+ {
+ region.putNodeEvent(new EvictedEventNode(fqn, EvictedEventNode.ADD_NODE_EVENT,
+ attrs == null ? 0 : attrs.size()));
+ }
+ }
+
// Recursively call, which will walk down the tree
// and return the next NodeData that's a child of our parent
nd = integrateStateTransferChildren(target, offset, in);
More information about the jboss-cvs-commits
mailing list