|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.lang.Thread
com.agentfactory.cldc.scheduler.Scheduler
public class Scheduler
The scheduler schedules tasks to be executed at periodic intervals.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.lang.Thread |
|---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
| Field Summary |
|---|
| Fields inherited from class java.lang.Thread |
|---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
|---|---|
Scheduler(int numThreads)
Creates a new instance of Scheduler. |
|
| Method Summary | |
|---|---|
void |
destroy()
Destroys the scheduler. |
void |
pause()
Pauses the scheduler. |
void |
remove(java.lang.Object key)
Removes the task represented by the key from the scheduler. |
void |
reschedule(java.lang.Object key,
int period)
Reschedules the task identified by the specified key to execute at period value. |
void |
run()
Executes the main control loop of the scheduler. |
void |
schedule(java.lang.Object key,
java.lang.Runnable task,
int period)
Schedules the task identified by the key to be executed periodically. |
void |
schedule(java.lang.Runnable task)
Schedules a task to be executed on a once off basis. |
void |
writeAgent(java.lang.Object key,
java.io.DataOutputStream dos)
Writes the state of the task represented by the key to the data output stream. |
void |
writeOut(java.lang.Object key,
java.io.DataOutputStream dos)
This method writes the state of the execution time associated with the task that is represented by the specified key. |
| Methods inherited from class java.lang.Thread |
|---|
activeCount, checkAccess, countStackFrames, currentThread, 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 |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Scheduler(int numThreads)
numThreads - the number of worker threads to be created.| Method Detail |
|---|
public void schedule(java.lang.Object key,
java.lang.Runnable task,
int period)
key - the identifier for the task.task - the task to be executed.period - the period at which the task should be executed.
public void reschedule(java.lang.Object key,
int period)
key - the identifier for the task to be rescheduled.period - the period at which the task should execute.public void schedule(java.lang.Runnable task)
task - the task to be executed.public void remove(java.lang.Object key)
key - the identifer of the task to be removed.
public void writeAgent(java.lang.Object key,
java.io.DataOutputStream dos)
throws java.io.IOException
key - the identifier for the agent task.dos - the stream to write the state of the agent to.
java.io.IOException - if there is an I/O error.
public void writeOut(java.lang.Object key,
java.io.DataOutputStream dos)
throws java.io.IOException
key - the identifier of the task.dos - the stream that the state is written to.
java.io.IOException - if there is an I/O error.public void pause()
public void destroy()
destroy in class java.lang.Thread
public void run()
throws MalformedLogicException
run in interface java.lang.Runnablerun in class java.lang.ThreadMalformedLogicException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||