org.openide.util
Class RequestProcessor.Task

java.lang.Object
  |
  +--org.openide.util.Task
        |
        +--org.openide.util.RequestProcessor.Task
All Implemented Interfaces:
Runnable
Enclosing class:
RequestProcessor

public final class RequestProcessor.Task
extends Task

The task describing the request task send to the processor.


Fields inherited from class org.openide.util.Task
EMPTY
 
Method Summary
 boolean cancel()
          Removes the task from the queue.
 int getDelay()
          Getter for amount of millis till this task is started.
 int getPriority()
          Current priority of the task.
 void schedule(int delay)
          (Re-)schedules a task to run in the future.
 void setPriority(int priority)
          Changes priority to new one.
 String toString()
           
 void waitFinished()
          This method is an implementation of the waitFinished method in the RequestProcessor.Task.
 
Methods inherited from class org.openide.util.Task
addTaskListener, isFinished, notifyFinished, notifyRunning, removeTaskListener, run
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getDelay

public int getDelay()
Getter for amount of millis till this task is started.
Returns:
amount of millis

schedule

public void schedule(int delay)
(Re-)schedules a task to run in the future. If the task has not been run yet, it is postponed to the new time. If it has already run and finished, it is scheduled to be started again. If it is currently running, it is nevertheless left to finish, and also scheduled to run again.
Parameters:
delay - time in milliseconds to wait (starting from now)

cancel

public boolean cancel()
Removes the task from the queue.
Returns:
true if the task has been removed from the queue, false it the task has already been processed

getPriority

public int getPriority()
Current priority of the task.

setPriority

public void setPriority(int priority)
Changes priority to new one. If the task has been already run, do not plan it again.

waitFinished

public void waitFinished()
This method is an implementation of the waitFinished method in the RequestProcessor.Task. It check the current thread if it is request processor thread and in such case runs the task immediatelly to prevent deadlocks.
Overrides:
waitFinished in class Task

toString

public String toString()
Overrides:
toString in class Task


Built on December 12 2001.  |  Portions Copyright 1997-2001 Sun Microsystems, Inc. All rights reserved.