public interface JavaScriptJobManager extends Serializable
JavaScriptJob
s.Modifier and Type | Interface and Description |
---|---|
static interface |
JavaScriptJobManager.JavaScriptJobFilter
Simple filter interface.
|
Modifier and Type | Method and Description |
---|---|
int |
addJob(JavaScriptJob job,
Page page)
Adds the specified job to this job manager, assigning it an ID.
|
JavaScriptJob |
getEarliestJob()
Gets the earliest job for this manager.
|
JavaScriptJob |
getEarliestJob(JavaScriptJobManager.JavaScriptJobFilter filter)
Gets the earliest job for this manager.
|
int |
getJobCount()
Returns the number of active jobs, including jobs that are currently executing and jobs that are
waiting to execute.
|
int |
getJobCount(JavaScriptJobManager.JavaScriptJobFilter filter)
Returns the number of active jobs, including jobs that are currently executing and jobs that are
waiting to execute.
|
String |
jobStatusDump(JavaScriptJobManager.JavaScriptJobFilter filter)
INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
Utility method to report the current job status. |
void |
removeAllJobs()
Removes all jobs from the execution queue.
|
void |
removeJob(int id)
Removes the specified job from the execution queue.
|
boolean |
runSingleJob(JavaScriptJob job)
Runs the provided job if it is the right time for it.
|
void |
shutdown()
Shuts down this job manager and stops all of its jobs.
|
void |
stopJob(int id)
Stops the specified job and removes it from the execution queue, not even allowing the job to finish if it is
currently executing.
|
int |
waitForJobs(long timeoutMillis)
Blocks until all active jobs have finished executing.
|
int |
waitForJobsStartingBefore(long delayMillis)
Blocks until all jobs scheduled to start executing before (now + delayMillis) have finished executing.
|
int |
waitForJobsStartingBefore(long delayMillis,
JavaScriptJobManager.JavaScriptJobFilter filter)
Blocks until all jobs scheduled to start executing before (now + delayMillis) have finished executing.
|
int getJobCount()
int getJobCount(JavaScriptJobManager.JavaScriptJobFilter filter)
filter
- the JavaScriptJobFilterint addJob(JavaScriptJob job, Page page)
job
- the job to add to the job managerpage
- the page which is trying to add the jobvoid removeJob(int id)
id
- the ID of the job to be removed from the execution queuevoid removeAllJobs()
void stopJob(int id)
id
- the ID of the job to be stoppedint waitForJobs(long timeoutMillis)
false
.timeoutMillis
- the maximum amount of time to wait (in milliseconds); may be negative, in which
case this method returns immediatelyint waitForJobsStartingBefore(long delayMillis)
delayMillis
- the delay which determines the background tasks to wait for (in milliseconds);
may be negative, as it is relative to the current timeint waitForJobsStartingBefore(long delayMillis, JavaScriptJobManager.JavaScriptJobFilter filter)
delayMillis
- the delay which determines the background tasks to wait for (in milliseconds);
may be negative, as it is relative to the current timefilter
- the JavaScriptJobFiltervoid shutdown()
JavaScriptJob getEarliestJob()
null
if noneJavaScriptJob getEarliestJob(JavaScriptJobManager.JavaScriptJobFilter filter)
filter
- the JavaScriptJobFilternull
if noneboolean runSingleJob(JavaScriptJob job)
job
- the job to runString jobStatusDump(JavaScriptJobManager.JavaScriptJobFilter filter)
filter
- the JavaScriptJobFilterCopyright © 2002–2021 Gargoyle Software Inc.. All rights reserved.