Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.1.0)

E17493-02

oracle.jdevimpl.audit.util
Class SwingExecutor

java.lang.Object
  extended by oracle.jdevimpl.audit.util.SwingExecutor
All Implemented Interfaces:
java.lang.Runnable

public class SwingExecutor
extends java.lang.Object
implements java.lang.Runnable

A simple task executor. Tasks are executed sequentially in a single background thread and are committed in the event dispatch thread. Tasks can be scheduled to execute after a delay, and scheduled or executing tasks can be rescheduled or cancelled.


Constructor Summary
SwingExecutor()
          Creates an executor.
 
Method Summary
 void cancel(Task task)
          Cancels a scheduled or executing task.
 void cancelIfExecuting(Task task)
          Cancels an executing task.
 void close(Task task)
          Closes a task.
 void run()
          Runs the execution thread.
 void schedule(Task task, java.lang.Object input)
          Schedules a task to run immediately.
 void schedule(Task task, java.lang.Object input, long delay)
          Schedules a task to run after a delay.
 void start()
          Starts this executor, if it has not already been started.
 void stop()
          Stops this executor and cancels all its tasks.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SwingExecutor

public SwingExecutor()
Creates an executor. Tasks may be scheduled, but none will be executed until start()

Method Detail

start

public void start()
Starts this executor, if it has not already been started. Any tasks that are ready will be executed.


stop

public void stop()
Stops this executor and cancels all its tasks.


schedule

public void schedule(Task task,
                     java.lang.Object input)
Schedules a task to run immediately. Cancels the current execution of the task, if any.

Parameters:
task - The task to schedule.
input - Input data for the task.

schedule

public void schedule(Task task,
                     java.lang.Object input,
                     long delay)
Schedules a task to run after a delay. Cancels the current execution of the task, if any.

Parameters:
task - The task to run.
input - Input data for the task.
delay - The number of milliseconds after which to schedule the task.

cancel

public void cancel(Task task)
Cancels a scheduled or executing task.

Parameters:
task - The task to cancel.

cancelIfExecuting

public void cancelIfExecuting(Task task)
Cancels an executing task.

Parameters:
task - The task to cancel.

close

public void close(Task task)
Closes a task. Cancels the task if scheduled or executing and invokes its close method.

Parameters:
task -

run

public void run()
Runs the execution thread.

Specified by:
run in interface java.lang.Runnable

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.1.0)

E17493-02

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