oracle.javatools.parser.util
Class AsyncScheduler
java.lang.Object
oracle.javatools.parser.util.AsyncScheduler
- public class AsyncScheduler
- extends java.lang.Object
The AsyncScheduler
is a part of a basic API to allow scheduling asynchronous tasks that support cancelling while the task is running. It is recommended that JSR 166 be used when it becomes available as part of the JDK later.
This scheduler schedules background threads to complete queued tasks. If there are no tasks queued, the background threads will exit.
Constructor Summary |
AsyncScheduler(java.lang.String runnerPrefix, int idleTimeout)
Construct a new AsyncScheduler . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AsyncScheduler
public AsyncScheduler(java.lang.String runnerPrefix,
int idleTimeout)
- Construct a new
AsyncScheduler
.
- Parameters:
runnerPrefix
- the prefix name for the runner threads
idleTimeout
- the idle timeout that an idle thread waits before exiting
scheduleTask
public void scheduleTask(AsyncTask task)
- Schedule a new task.
-
- Parameters:
task
- the task to schedule
cancelTask
public void cancelTask(AsyncTask task)
- Cancel a pending task.
-
- Parameters:
task
- the task to cancel
Copyright © 1997, 2004, Oracle. All rights reserved.