[jboss-cvs] JBossCache/src/org/jboss/cache/eviction ...
Brian Stansberry
brian.stansberry at jboss.com
Wed Oct 11 23:39:59 EDT 2006
User: bstansberry
Date: 06/10/11 23:39:59
Modified: src/org/jboss/cache/eviction BaseEvictionPolicy.java
EvictionPolicy.java
Log:
[JBCACHE-801] Restore EvictionPolicy ability to ignore events based on event type
Revision Changes Path
1.4 +2 -2 JBossCache/src/org/jboss/cache/eviction/BaseEvictionPolicy.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: BaseEvictionPolicy.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/eviction/BaseEvictionPolicy.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- BaseEvictionPolicy.java 12 Jan 2006 04:09:04 -0000 1.3
+++ BaseEvictionPolicy.java 12 Oct 2006 03:39:59 -0000 1.4
@@ -11,7 +11,7 @@
*
* @author Ben Wang 2-2004
* @author Daniel Huang - dhuang at jboss.org
- * @version $Revision: 1.3 $
+ * @version $Revision: 1.4 $
*/
public abstract class BaseEvictionPolicy implements EvictionPolicy
{
@@ -81,7 +81,7 @@
* @see org.jboss.cache.eviction.EvictionPolicy#canIgnoreEvent(org.jboss.cache.Fqn)
*
*/
- public boolean canIgnoreEvent(Fqn fqn) {
+ public boolean canIgnoreEvent(Fqn fqn, NodeEventType eventType) {
return false;
}
}
1.5 +21 -15 JBossCache/src/org/jboss/cache/eviction/EvictionPolicy.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: EvictionPolicy.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/eviction/EvictionPolicy.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- EvictionPolicy.java 12 Jan 2006 04:09:04 -0000 1.4
+++ EvictionPolicy.java 12 Oct 2006 03:39:59 -0000 1.5
@@ -70,26 +70,32 @@
Class getEvictionConfigurationClass();
/**
- * This method will be invoked prior to an event being processed for a node with the
- * specified Fqn. </p>
- *
+ * This method will be invoked prior to an event being processed for a node
+ * with the specified Fqn.
+ * <p>
* This method provides a way to optimize the performance of eviction by
* signalling that the node associated with the specified Fqn should not be
- * subject to normal eviction processing.</p>
-
- * If this method returns false then then event is processed normally
- * and eviction processing for the node continues. As a result,
- * EvictionPolicy.evict() may be invoked at some later point based on the
- * particular algorirthm of the eviction policy.
+ * subject to normal eviction processing. It can also be used to filter
+ * out certain {@link NodeEventType event types} in which the particular
+ * eviction algorithm has no interest.
* </p>
- *
- * If this method returns true, then the event is ignored and eviction
- * processing is bypassed for this node. As a result, EvictionPolicy.evict()
- * will never be invoked for this node.
+ * <p>
+ * If this method returns false then the event is processed normally
+ * and eviction processing for the node continues. As a result, the event
+ * will be added to the {@link Region eviction region's} event queue where
+ * at some later point the particular algorithm of the eviction policy
+ * can use it to decide whether to call {@link #evict(Fqn)}.
+ * </p>
+ * <p>
+ * If this method returns true, then the event is ignored and will not factor
+ * in any subsequent eviction processing.
* </p>
*
* @param fqn The Fqn of the node associated with the event.
- * @return true to ignore events for this Fqn. false to process events normally.
+ * @param eventType the type of the event
+ *
+ * @return <code>true</code> to ignore events of this type for this Fqn,
+ * <code>false</code> to process events normally.
*/
- boolean canIgnoreEvent(Fqn fqn);
+ boolean canIgnoreEvent(Fqn fqn, NodeEventType eventType);
}
More information about the jboss-cvs-commits
mailing list