public class KScheduler
extends java.lang.Thread
KSchedulerClient
. The scheduler must be explicitly started.Constructor and Description |
---|
KScheduler()
Deprecated.
KScheduler should be used as a Singleton. Use getInstance
instead to obtain the unique instance of KScheduler.
|
Modifier and Type | Method and Description |
---|---|
void |
addJob(KSchedulerClient client,
int jobId,
long delay,
boolean recurrent)
Adds a new job in the scheduler.
|
void |
callMeEveryNSeconds(KSchedulerClient client,
int jobId,
long delay)
Deprecated.
Use addJob method instead.
|
void |
callMeNow(KSchedulerClient client,
int jobId)
Deprecated.
Use addJob method instead.
|
static void |
close()
Closes the scheduler.
|
static KScheduler |
getInstance()
Retrieves the unique instance (singleton) of KScheduler.
|
void |
removeJob(KSchedulerClient client,
int jobId)
Removes a job for the specified client with the specified job id.
|
void |
run()
Overrides the run method
|
void |
stopCallingMe(KSchedulerClient client,
int jobId)
Deprecated.
Use removeJob method instead.
|
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
@Deprecated public KScheduler()
public static KScheduler getInstance()
public void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread
public void addJob(KSchedulerClient client, int jobId, long delay, boolean recurrent)
client
- the client to notifyjobId
- a number assigned to the job. Must be unique for a given client.delay
- number of milliseconds to wait until the client is notified by the schedulerrecurrent
- if true, the client will be notified recurrently, once every delay millisecondes.
Otherwise, the client will be notified only once.@Deprecated public void callMeEveryNSeconds(KSchedulerClient client, int jobId, long delay)
client
- the client to notifyjobId
- the id of the jobdelay
- the number of seconds between each notification@Deprecated public void callMeNow(KSchedulerClient client, int jobId)
client
- the client to notifyjobId
- the id of the jobpublic void removeJob(KSchedulerClient client, int jobId)
client
- the client associated with the jobjobId
- the id of the job to remove@Deprecated public void stopCallingMe(KSchedulerClient client, int jobId)
client
- the client associated with the jobjobId
- the id of the job to removepublic static void close()