|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--java.lang.Thread
|
+--com.adventnet.utilities.scheduler.Scheduler
A scheduler for running tasks in a Java VM. This class can be used to schedule a particular task at a specified time. This is basically to control effectively a number of tasks using a limited number of threads
| Field Summary | |
(package private) int |
MAX_THREADS
The maximum numer of threads to be used in executing tasks for this scheduler |
(package private) int |
NUM_THREADS_STOPPED
|
(package private) java.util.Vector |
ready_tasks
|
(package private) java.util.Vector |
runnables
|
(package private) static boolean |
STOP_ALL
|
(package private) boolean |
STOP_THIS
|
(package private) static int |
STOP_TIME_OUT
|
(package private) java.util.Vector |
times
|
(package private) static int |
TOTAL_THREADS
|
(package private) java.util.Vector |
workers
|
| Fields inherited from class java.lang.Thread |
MAX_PRIORITY,
MIN_PRIORITY,
NORM_PRIORITY,
values |
| Method Summary | |
boolean |
cleanUp()
|
static Scheduler |
createScheduler(java.lang.String nam)
|
static Scheduler |
createScheduler(java.lang.String nam,
int maxThreadNumber)
|
void |
deregisterThisScheduler(java.lang.String nam)
|
static java.lang.String |
getConfFile()
|
static int |
getDefaultMaxThreads()
|
int |
getMaxThreads()
|
(package private) java.lang.Runnable |
getNextTask()
get the next task ready to run |
static Scheduler |
getScheduler(java.lang.String nam)
|
(package private) java.lang.Runnable |
getTheWork()
something to let this thread rest when nothing to do |
static int |
getTotalThreads()
|
void |
killScheduler()
Stops and destroys the schduler and its worker threads Cannot reuse scheduler when this method is called |
void |
removeTask(java.lang.Runnable task)
This methood is used to remove a task from being scheduled. |
boolean |
resumeAll()
|
void |
run()
The main thread which kicks off the task execution |
void |
scheduleTask(java.lang.Runnable task,
java.util.Date when)
This methood schedules a one-time task at the specified time |
static void |
setConfFile(java.lang.String s)
|
static void |
setDefaultMaxThreads(int i)
|
boolean |
setMaxThreads(int i)
|
void |
setStopTimeout(int timeout)
|
(package private) void |
startTask(java.lang.Runnable task)
start the task |
(package private) void |
startWorkers()
start the workers |
static boolean |
stopAll()
|
boolean |
stopThis()
|
(package private) void |
waitSchedule()
|
| Methods inherited from class java.lang.Thread |
|
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
| Field Detail |
int MAX_THREADS
static int TOTAL_THREADS
static boolean STOP_ALL
boolean STOP_THIS
int NUM_THREADS_STOPPED
java.util.Vector runnables
java.util.Vector times
java.util.Vector workers
java.util.Vector ready_tasks
static int STOP_TIME_OUT
| Method Detail |
public int getMaxThreads()
public static int getDefaultMaxThreads()
public static void setDefaultMaxThreads(int i)
public boolean setMaxThreads(int i)
public static int getTotalThreads()
public static java.lang.String getConfFile()
public static void setConfFile(java.lang.String s)
public static Scheduler createScheduler(java.lang.String nam)
public static Scheduler createScheduler(java.lang.String nam,
int maxThreadNumber)
public static Scheduler getScheduler(java.lang.String nam)
public void scheduleTask(java.lang.Runnable task,
java.util.Date when)
public void removeTask(java.lang.Runnable task)
public boolean resumeAll()
public void killScheduler()
public static boolean stopAll()
public boolean stopThis()
public boolean cleanUp()
public void setStopTimeout(int timeout)
java.lang.Runnable getTheWork()
public void run()
void waitSchedule()
throws java.lang.InterruptedException
void startTask(java.lang.Runnable task)
java.lang.Runnable getNextTask()
void startWorkers()
public void deregisterThisScheduler(java.lang.String nam)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||