Interface ScheduleAware
-
public interface ScheduleAware
Definition of an interface to be implemented by
Command
objects that are interested in the point of time they are passed to aCommandQueue
.This interface is evaluated by implementations of the
CommandQueue.execute(Command)
method. If theCommand
object to be executed implements this interface, theonSchedule()
method is invoked. Invocation of this method happens in the same thread that has called theexecute()
method. This is usually the event dispatch thread in typical GUI applications, when a user triggered an action, which causes the execution of a command.The idea behind this interface is that often some initialization has to be performed before the actual execution of a command in a background thread. An example of such an initialization is changing the status of UI controls affected by the current command. This has typically to be done in the event dispatch thread, immediately after the invocation of the action that caused the execution of this command. By implementing this interface this initialization logic can be placed in the
Command
implementation itself and need not to be implemented somewhere else.- Version:
- $Id: ScheduleAware.java 205 2012-01-29 18:29:57Z oheger $
- Author:
- Oliver Heger
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
commandScheduled(CommandQueue queue)
Notifies this object that it was passed to aCommandQueue
for execution.
-
-
-
Method Detail
-
commandScheduled
void commandScheduled(CommandQueue queue)
Notifies this object that it was passed to aCommandQueue
for execution. This method is invoked by theCommandQueue.execute(Command)
method (in the current thread).- Parameters:
queue
- theCommandQueue
to which this object was passed
-
-