Package org.apache.openjpa.datacache
Class ClearableScheduler
- java.lang.Object
-
- org.apache.openjpa.datacache.ClearableScheduler
-
- All Implemented Interfaces:
java.lang.Runnable
public class ClearableScheduler extends java.lang.Object implements java.lang.Runnable
Cron-style clearable eviction. Understands schedules based on cron format:minute hour mday month wday
For example:+minute
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.
-
-
Constructor Summary
Constructors Constructor Description ClearableScheduler(OpenJPAConfiguration conf)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
evict(Clearable cache)
int
getInterval()
The interval time in minutes between scheduler checks.void
removeFromSchedule(Clearable clearable)
Remove the given Clearable from scheduling.void
run()
void
scheduleEviction(Clearable clearable, java.lang.String times)
Schedule the given Clearable for clear to be called.void
setInterval(int interval)
The interval time in minutes between scheduler checks.void
stop()
Stop the associated thread if there and stop the current runnable.
-
-
-
Constructor Detail
-
ClearableScheduler
public ClearableScheduler(OpenJPAConfiguration conf)
-
-
Method Detail
-
getInterval
public int getInterval()
The interval time in minutes between scheduler checks. Defaults to 1.
-
setInterval
public void setInterval(int interval)
The interval time in minutes between scheduler checks. Defaults to 1.
-
stop
public void stop()
Stop the associated thread if there and stop the current runnable.
-
scheduleEviction
public void scheduleEviction(Clearable clearable, java.lang.String times)
Schedule the given Clearable for clear to be called. Starts the scheduling thread if not started.
-
removeFromSchedule
public void removeFromSchedule(Clearable clearable)
Remove the given Clearable from scheduling.
-
run
public void run()
- Specified by:
run
in interfacejava.lang.Runnable
-
evict
protected void evict(Clearable cache)
-
-