[jboss-cvs] JBossCache/src/org/jboss/cache/eviction ...
Elias Ross
genman at noderunner.net
Fri Dec 8 13:49:17 EST 2006
User: genman
Date: 06/12/08 13:49:17
Modified: src/org/jboss/cache/eviction BaseEvictionAlgorithm.java
Log:
JBCACHE-892 Use JDK1.5 concurrent classes
Revision Changes Path
1.17 +6 -5 JBossCache/src/org/jboss/cache/eviction/BaseEvictionAlgorithm.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: BaseEvictionAlgorithm.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/eviction/BaseEvictionAlgorithm.java,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -b -r1.16 -r1.17
--- BaseEvictionAlgorithm.java 27 Nov 2006 04:49:46 -0000 1.16
+++ BaseEvictionAlgorithm.java 8 Dec 2006 18:49:17 -0000 1.17
@@ -6,12 +6,13 @@
*/
package org.jboss.cache.eviction;
-import EDU.oswego.cs.dl.util.concurrent.BoundedBuffer;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.jboss.cache.Fqn;
import org.jboss.cache.Region;
import org.jboss.cache.lock.TimeoutException;
+import java.util.concurrent.BlockingQueue;
+import java.util.concurrent.LinkedBlockingQueue;
/**
* Abstract Event Processing Eviction Algorithm.
@@ -20,7 +21,7 @@
* abstract methods and a policy.
*
* @author Daniel Huang - dhuang at jboss.org 10/2005
- * @version $Revision: 1.16 $
+ * @version $Revision: 1.17 $
*/
public abstract class BaseEvictionAlgorithm implements EvictionAlgorithm
{
@@ -34,7 +35,7 @@
/**
* Contains Fqn instances.
*/
- protected BoundedBuffer recycleQueue;
+ protected BlockingQueue recycleQueue;
/**
* Contains NodeEntry instances.
@@ -61,7 +62,7 @@
protected BaseEvictionAlgorithm()
{
- recycleQueue = new BoundedBuffer();
+ recycleQueue = new LinkedBlockingQueue();
}
protected void initialize(Region region) throws EvictionException
@@ -438,7 +439,7 @@
try
{
- fqn = (Fqn) recycleQueue.poll(0);
+ fqn = (Fqn) recycleQueue.take();
}
catch (InterruptedException e)
{
More information about the jboss-cvs-commits
mailing list