KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > roller > model > ThreadManager


1 package org.roller.model;
2
3 import java.util.TimerTask JavaDoc;
4 import java.sql.Date JavaDoc;
5
6 /**
7  * Thread management for executing scheduled and asynchronous tasks.
8  */

9 public interface ThreadManager
10 {
11     public static final long MIN_RATE_INTERVAL_MINS = 1;
12
13     /**
14      * Execute runnable in background (asynchronously).
15      * @param runnable
16      * @throws java.lang.InterruptedException
17      */

18     public void executeInBackground(Runnable JavaDoc runnable)
19             throws InterruptedException JavaDoc;
20
21     /**
22      * Execute runnable in foreground (synchronously).
23      */

24     public void executeInForeground(Runnable JavaDoc runnable)
25             throws InterruptedException JavaDoc;
26
27     /**
28      * Schedule task to run once a day.
29      */

30     public void scheduleDailyTimerTask(TimerTask JavaDoc task);
31
32     /**
33      * Schedule task to run once per hour.
34      */

35     public void scheduleHourlyTimerTask(TimerTask JavaDoc task);
36
37     /**
38      * Schedule task to run at fixed rate.
39      */

40     public void scheduleFixedRateTimerTask(TimerTask JavaDoc task, long delayMins, long periodMins);
41
42     /**
43      * Shutdown
44      */

45     public void shutdown();
46
47     /**
48      * Release all resources associated with Roller session.
49      */

50     public void release();
51 }
Popular Tags