org.fuin.apps4swing
Class ControllerTaskExecutor<CONTROLLER>

java.lang.Object
  extended by org.fuin.apps4swing.ControllerTaskExecutor<CONTROLLER>
Type Parameters:
CONTROLLER - Type of controller the task executor acts on.
All Implemented Interfaces:
Runnable

public final class ControllerTaskExecutor<CONTROLLER>
extends Object
implements Runnable

Executes tasks submitted for a controller in sequential order. During the execution the view of the controller will be blocked.


Constructor Summary
ControllerTaskExecutor()
          Default constructor.
 
Method Summary
 void cancel()
          Cancel the task.
 void execute(Runnable event)
          Executes the task.
 boolean isCanceled()
          Returns if the execution has been canceled.
 void run()
          
 void setEvents(ArrayBlockingQueue<Runnable> events)
          Set an event queue.
 void setExecutorService(ExecutorService executor)
          Set an executor service.
 void setView(org.fuin.apps4j.base.View<CONTROLLER> view)
          Set the view to block during task execution.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ControllerTaskExecutor

public ControllerTaskExecutor()
Default constructor.

Method Detail

isCanceled

public final boolean isCanceled()
Returns if the execution has been canceled.

Returns:
If the task has been canceled true else false.

cancel

public final void cancel()
Cancel the task.


execute

public final void execute(Runnable event)
Executes the task.

Parameters:
event - Event to handle.

run

public final void run()

Specified by:
run in interface Runnable

setEvents

public final void setEvents(ArrayBlockingQueue<Runnable> events)
Set an event queue.

Parameters:
events - Event queue to use.

setExecutorService

public final void setExecutorService(ExecutorService executor)
Set an executor service.

Parameters:
executor - Executor to use.

setView

public final void setView(org.fuin.apps4j.base.View<CONTROLLER> view)
Set the view to block during task execution.

Parameters:
view - View


Copyright © 2011 Future Invent Informationsmanagement GmbH. All Rights Reserved.