Author: manik.surtani(a)jboss.com
Date: 2007-11-15 11:19:11 -0500 (Thu, 15 Nov 2007)
New Revision: 4760
Modified:
core/trunk/src/main/java/org/jboss/cache/statetransfer/DefaultStateTransferIntegrator.java
Log:
Notify eviction of added nodes
Modified:
core/trunk/src/main/java/org/jboss/cache/statetransfer/DefaultStateTransferIntegrator.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/statetransfer/DefaultStateTransferIntegrator.java 2007-11-15
16:18:44 UTC (rev 4759)
+++
core/trunk/src/main/java/org/jboss/cache/statetransfer/DefaultStateTransferIntegrator.java 2007-11-15
16:19:11 UTC (rev 4760)
@@ -16,6 +16,7 @@
import org.jboss.cache.NodeFactory;
import org.jboss.cache.NodeSPI;
import org.jboss.cache.Region;
+import org.jboss.cache.RegionManager;
import org.jboss.cache.buddyreplication.BuddyManager;
import org.jboss.cache.eviction.EvictedEventNode;
import org.jboss.cache.eviction.NodeEventType;
@@ -208,6 +209,13 @@
getCache().getNotifier().notifyNodeModified(curr.getFqn(), false,
NodeModifiedEvent.ModificationType.PUT_MAP, curr.getDataDirect(), ctx);
}
ctx.setOriginLocal(true);
+
+ // Make sure any eviction policy is aware of this node
+ RegionManager rm = cache.getRegionManager();
+ Region region = null;
+ region = rm.getRegion(curr.getFqn(), Region.Type.EVICTION, false);
+ if (region != null) region.putNodeEvent(new EvictedEventNode(curr.getFqn(),
NodeEventType.ADD_NODE_EVENT, curr.getKeysDirect().size()));
+
// AND notify that they have been modified!!
Set<NodeSPI> children = curr.getChildrenDirect();
for (NodeSPI n : children)
Show replies by date