Microsoft SDK for Java

schedule

The schedule method of the Task Class contains the following signatures:

schedule(Runnable runnable)
schedule(Runnable runnable, long when)
schedule(Runnable runnable, long when boolean lightweight)

schedule(Runnable runnable)

Schedules a runnable object to run immediately in the global task manager as a lightweight task.

Syntax

public static int schedule(Runnable runnable);

Return Value

Returns a non-zero integer that identifies the task.

Parameters

runnable The object scheduled to run.

schedule(Runnable runnable, long when)

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

Syntax

public static int schedule(Runnable runnable, long when);

Return Value

Returns a non-zero integer that identifies the task.

Parameters

runnable The object that is run.
when The time at which the object is run.

schedule(Runnable runnable, long when, boolean lightweight)

Schedules a runnable object to run in the global task manager at the specified time, and optionally as a lightweight task or not.

Syntax

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

Return Value

Returns a non-zero integer that identifies the task.

Parameters

runnable The object that runs.
when The time at which the object runs.
lightweight Set to true to run the task as a lightweight task; false, otherwise.

© 1999 Microsoft Corporation. All rights reserved. Terms of use.