Package com.ms.util |
![]() Previous |
![]() Contents |
![]() Index |
![]() Next |
public class TaskManager extends ThreadGroup implements Runnable { // Constructors public TaskManager() public TaskManager(boolean runTasksAsDaemons) public TaskManager(String name) public TaskManager(String name, boolean runTasksAsDaemons) public TaskManager(ThreadGroup parent) public TaskManager(ThreadGroup parent, boolean runTasksAsDaemons) public TaskManager(ThreadGroup parent, String name) public TaskManager(ThreadGroup parent, String name, boolean runTasksAsDaemons) // Methods public static TaskManager global() public int schedule(Runnable runnable) public int schedule(Runnable runnable, long when) public synchronized int schedule(Runnable runnable, long when, boolean lightweight) public synchronized boolean cancel(int id) public void run() }
This class is for scheduling or managing the execution of runnable objects.
public TaskManager()Constructs a new TaskManager in the current thread's thread group.
public TaskManager(boolean runTasksAsDaemons)Constructs a new TaskManager in the current thread's thread group.
Parameter Description runTasksAsDaemons Indicates whether the tasks in this task manager are run on daemon threads.
public TaskManager(String name)Constructs a new TaskManager in the current thread's thread group.
Parameter Description name The name of the task manager.
public TaskManager(String name, boolean runTasksAsDaemons)Constructs a new TaskManager in the current thread's thread group.
Parameter Description name The name of the task manager. runTasksAsDaemons Set to true if the tasks in this task manager are to run on daemon threads; otherwise set to false.
public TaskManager(ThreadGroup parent)Constructs a new TaskManager.
Parameter Description parent The parent thread group for this task manager.
public TaskManager(ThreadGroup parent, boolean runTasksAsDaemons)Constructs a new TaskManager.
Parameter Description parent The parent thread group for this task manager. runTasksAsDaemons Set to true if the tasks in this task manager are to run on daemon threads; otherwise set to false.
public TaskManager(ThreadGroup parent, String name)Constructs a new TaskManager
Parameter Description parent The parent thread group for this task manager. name The name of the task manager.
public TaskManager(ThreadGroup parent, String name, boolean runTasksAsDaemons)Constructs a new TaskManager
Parameter Description parent The parent thread group for this task manager name the name of the task manager runTasksAsDaemons Set to true if the tasks in this task manager are to run on daemon threads; otherwise set to false.
public synchronized 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; otherwise it is true.
Parameter Description id An integer identifying the task.
public static TaskManager global()Returns the global task manager.
Return Value:
Returns the global task manager object.
public void run()
public int schedule(Runnable runnable)Schedules a runnable object to be run immediately.
Return Value:
Returns a non-zero integer identifying the task.
Parameter Description runnable The object to run.
public int schedule(Runnable runnable, long when)Schedules a runnable object to be run at the specified time.
Return Value:
Returns a non-zero integer identifying the task.
Parameter Description runnable The object to run.
public synchronized int schedule(Runnable runnable, long when, boolean lightweight)Schedules a runnable object to be run at the specified time.
Return Value:
Returns a non-zero integer identifying the task.
Parameter Description runnable The object to run. when The time to run the object. lightweight Whether to run the task as a lightweight task.
© 1997 Microsoft Corporation. All rights reserved. Legal Notices.