org.apache.openjpa.datacache
Class DataCacheScheduler

java.lang.Object
  extended by org.apache.openjpa.datacache.DataCacheScheduler
All Implemented Interfaces:
Runnable

public class DataCacheScheduler
extends Object
implements Runnable

Cron-style cache eviction. Understands schedules based on cron format: minute hour mday month wday For example: 15,30 6,19 2,10 1 2 Would run at 15 and 30 past the 6AM and 7PM, on the 2nd and 10th of January when its a Monday.

Author:
Steve Kim

Constructor Summary
DataCacheScheduler(OpenJPAConfiguration conf)
           
 
Method Summary
protected  void evict(DataCache cache)
           
 int getInterval()
          The interval time in minutes between cache checks.
 void removeFromSchedule(DataCache cache)
          Remove the given cache from scheduling.
 void run()
           
 void scheduleEviction(DataCache cache, String times)
          Schedule the given cache for eviction.
 void setInterval(int interval)
          The interval time in minutes between cache checks.
 void stop()
          Stop the associated thread if there and stop the current runnable.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataCacheScheduler

public DataCacheScheduler(OpenJPAConfiguration conf)
Method Detail

getInterval

public int getInterval()
The interval time in minutes between cache checks. Defaults to 2.


setInterval

public void setInterval(int interval)
The interval time in minutes between cache checks. Defaults to 2.


stop

public void stop()
Stop the associated thread if there and stop the current runnable.


scheduleEviction

public void scheduleEviction(DataCache cache,
                             String times)
Schedule the given cache for eviction. Starts the scheduling thread if not started.


removeFromSchedule

public void removeFromSchedule(DataCache cache)
Remove the given cache from scheduling.


run

public void run()
Specified by:
run in interface Runnable

evict

protected void evict(DataCache cache)


Copyright © 2006 Apache Software Foundation. All Rights Reserved.