[jboss-cvs] JBossCache/src/org/jboss/cache/eviction ...
Manik Surtani
msurtani at jboss.com
Thu Nov 16 13:15:26 EST 2006
User: msurtani
Date: 06/11/16 13:15:26
Modified: src/org/jboss/cache/eviction NodeEventType.java
EvictionTimerTask.java
Log:
some eviction stuff
Revision Changes Path
1.2 +4 -4 JBossCache/src/org/jboss/cache/eviction/NodeEventType.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: NodeEventType.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/eviction/NodeEventType.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- NodeEventType.java 12 Oct 2006 03:36:46 -0000 1.1
+++ NodeEventType.java 16 Nov 2006 18:15:26 -0000 1.2
@@ -23,10 +23,10 @@
/**
* Enumeration of the valid event types used to create an
- * {@link EvictionEventNode}.
+ * {@link org.jboss.cache.eviction.EvictedEventNode}.
*
* @author <a href="brian.stansberry at jboss.com">Brian Stansberry</a>
- * @version $Revision: 1.1 $
+ * @version $Revision: 1.2 $
*/
public enum NodeEventType
{
1.9 +11 -10 JBossCache/src/org/jboss/cache/eviction/EvictionTimerTask.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: EvictionTimerTask.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/eviction/EvictionTimerTask.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9
--- EvictionTimerTask.java 15 Nov 2006 17:01:29 -0000 1.8
+++ EvictionTimerTask.java 16 Nov 2006 18:15:26 -0000 1.9
@@ -26,7 +26,7 @@
*
* @author Ben Wang 2-2004
* @author Daniel Huang (dhuang at jboss.org)
- * @version $Revision: 1.8 $
+ * @version $Revision: 1.9 $
*/
public class EvictionTimerTask extends TimerTask
{
@@ -46,7 +46,8 @@
public void init(int wakeupIntervalSeconds, Notifier notifier)
{
this.wakeupIntervalSeconds = wakeupIntervalSeconds;
- if (log.isTraceEnabled()) log.trace("Creating a new eviction listener with wakeupIntervalSeconds set at " + wakeupIntervalSeconds);
+ if (log.isTraceEnabled())
+ log.trace("Creating a new eviction listener with wakeupIntervalSeconds set at " + wakeupIntervalSeconds);
EvictionListener l = new EvictionListener();
notifier.setEvictionPolicyListener(l);
}
@@ -115,22 +116,22 @@
{
private Log log = LogFactory.getLog(EvictionListener.class);
private Timer evictionThread;
+ private final Object lock = new Object();
public void cacheStarted(CacheSPI cache)
{
- log.debug("Starting eviction timer");
- if (evictionThread != null) evictionThread.cancel();
evictionThread = new Timer();
- evictionThread.schedule(EvictionTimerTask.this,
- wakeupIntervalSeconds * 1000,
- wakeupIntervalSeconds * 1000);
+ evictionThread.schedule(EvictionTimerTask.this, wakeupIntervalSeconds * 1000, wakeupIntervalSeconds * 1000);
}
public void cacheStopped(CacheSPI cache)
{
- log.debug("Stopping eviction timer ... ");
+ log.debug("Stopping eviction timer");
+
if (evictionThread != null)
+ {
evictionThread.cancel();
+ }
evictionThread = null;
}
}
More information about the jboss-cvs-commits
mailing list