Class ComponentActionList


  • public class ComponentActionList
    extends java.lang.Object
    The list of scheduled component actions and convenience methods for executing selected actions. This implementation is not thread-safe, i.e. methods should only be called from threads that are already synchronized with the environment space monitor.
    • Constructor Detail

      • ComponentActionList

        public ComponentActionList​(IEnvironmentSpace space)
        Create a new action list.
    • Method Detail

      • scheduleComponentAction

        public int scheduleComponentAction​(ISpaceAction action,
                                           java.util.Map parameters,
                                           IResultListener listener)
        Schedules an component action.
        Parameters:
        action - The action.
        parameters - parameters for the action (may be null)
        listener - the result listener
      • cancelComponentAction

        public void cancelComponentAction​(int id)
        Cancels a component action.
      • addComponentAction

        public void addComponentAction​(ComponentActionList.ActionEntry entry)
        Add an component action.
        Parameters:
        entry - The action entry.
      • removeComponentAction

        public void removeComponentAction​(ComponentActionList.ActionEntry entry)
        Remove an component action.
        Parameters:
        entry - The action entry.
      • setOrdering

        public void setOrdering​(java.util.Comparator comp)
        Set an ordering used for executing actions.
        Parameters:
        comp - The comparator representing the ordering.
      • executeActions

        public void executeActions​(IFilter filter,
                                   boolean wakeup)
        Should be called on environment thread only.
        Parameters:
        filter - A filter to select only a subset of actions (or null for all actions).
        wakeup - Immediately wake up each calling component after its action has been executed (otherwise wakeupComponents() has to be called separately).
      • wakeupComponents

        public void wakeupComponents​(IFilter filter)
        Should be called on environment thread only.
        Parameters:
        filter - A filter to select only a subset of actions (or null for all actions). (otherwise wakeupComponents() has to be called separately).
      • setScheduleCommand

        public void setScheduleCommand​(ICommand cmd)
        Set the schedule command to be invoked, when an action should be scheduled. Per default, an action is added to the list, but custom commands might decide to execute action immediately or alter the list in arbitrary ways. The command parameter is of type ActionEntry.