Extension SDK 10.1.2

oracle.javatools.parser.util
Class AsyncScheduler

java.lang.Object
  extended byoracle.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.
 
Method Summary
 void cancelTask(AsyncTask task)
          Cancel a pending task.
 void scheduleTask(AsyncTask task)
          Schedule a new task.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

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
Method Detail

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

Extension SDK

 

Copyright © 1997, 2004, Oracle. All rights reserved.