Package com.ms.util Previous
Previous
Contents
Contents
Index
Index
Next
Next

Class Task

Methods

public class Task {
  // Methods
  public static int schedule(Runnable runnable)
  public static int schedule(Runnable runnable, long when)
  public static int schedule(Runnable runnable, long when, boolean lightweight)
  public static boolean cancel(int id)
}

Class for scheduling and managing the execution of runnable objects in the global task manager.


Methods


cancel

public static boolean cancel(int id)

Cancels a pending runnable object.

Return Value:

Returns a boolean indicating whether the runnable was successfully cancelled. This value is false if the task was already run or had never been scheduled.

ParameterDescription
id An integer identifying the task.


schedule

public static int schedule(Runnable runnable)

Schedules a runnable object to be run in the global task manager at the specified time.

Return Value:

Returns a non-zero integer identifying the task.

ParameterDescription
runnable The object to run.


schedule

public static int schedule(Runnable runnable, long when)

Schedules a runnable object to be run in the global task manager at the specified time.

Return Value:

Returns a non-zero integer identifying the task.

ParameterDescription
runnable The object to run.
when The time to run the object.


schedule

public static int schedule(Runnable runnable, long when, boolean lightweight)

Schedules a runnable object to be run in the global task manager at the specified time.

Return Value:

Returns a non-zero integer identifying the task.

ParameterDescription
runnable The object to run.
when The time to run the object.
lightweight Whether to run the task as a lightweight task.



Top© 1997 Microsoft Corporation. All rights reserved. Legal Notices.