Interface ScheduleAware
-
public interface ScheduleAwareDefinition of an interface to be implemented by
Commandobjects 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 theCommandobject 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
Commandimplementation 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 voidcommandScheduled(CommandQueue queue)Notifies this object that it was passed to aCommandQueuefor execution.
-
-
-
Method Detail
-
commandScheduled
void commandScheduled(CommandQueue queue)
Notifies this object that it was passed to aCommandQueuefor execution. This method is invoked by theCommandQueue.execute(Command)method (in the current thread).- Parameters:
queue- theCommandQueueto which this object was passed
-
-