Class ComponentActionList
- java.lang.Object
- 
- jadex.extension.envsupport.environment.ComponentActionList
 
- 
 public class ComponentActionList extends java.lang.ObjectThe 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.
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classComponentActionList.ActionEntryEntry for a scheduled action.
 - 
Field SummaryFields Modifier and Type Field Description protected java.util.Set<ComponentActionList.ActionEntry>actionsThe scheduled actions.protected ICommandcmdThe schedule command.protected java.util.Collection<ComponentActionList.ActionEntry>executedThe executed actions where actors still need to be woken up.protected IEnvironmentSpacespaceThe environment space.
 - 
Constructor SummaryConstructors Constructor Description ComponentActionList(IEnvironmentSpace space)Create a new action list.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddComponentAction(ComponentActionList.ActionEntry entry)Add an component action.voidcancelComponentAction(int id)Cancels a component action.voidexecuteActions(IFilter filter, boolean wakeup)Should be called on environment thread only.ComponentActionList.ActionEntry[]getActionEntries()Get the queued entries, which have not yet been executed.voidremoveComponentAction(ComponentActionList.ActionEntry entry)Remove an component action.intscheduleComponentAction(ISpaceAction action, java.util.Map parameters, IResultListener listener)Schedules an component action.voidsetOrdering(java.util.Comparator comp)Set an ordering used for executing actions.voidsetScheduleCommand(ICommand cmd)Set the schedule command to be invoked, when an action should be scheduled.voidwakeupComponents(IFilter filter)Should be called on environment thread only.
 
- 
- 
- 
Field Detail- 
spaceprotected IEnvironmentSpace space The environment space.
 - 
actionsprotected java.util.Set<ComponentActionList.ActionEntry> actions The scheduled actions.
 - 
executedprotected java.util.Collection<ComponentActionList.ActionEntry> executed The executed actions where actors still need to be woken up.
 - 
cmdprotected ICommand cmd The schedule command.
 
- 
 - 
Constructor Detail- 
ComponentActionListpublic ComponentActionList(IEnvironmentSpace space) Create a new action list.
 
- 
 - 
Method Detail- 
scheduleComponentActionpublic 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
 
 - 
cancelComponentActionpublic void cancelComponentAction(int id) Cancels a component action.
 - 
addComponentActionpublic void addComponentAction(ComponentActionList.ActionEntry entry) Add an component action.- Parameters:
- entry- The action entry.
 
 - 
removeComponentActionpublic void removeComponentAction(ComponentActionList.ActionEntry entry) Remove an component action.- Parameters:
- entry- The action entry.
 
 - 
getActionEntriespublic ComponentActionList.ActionEntry[] getActionEntries() Get the queued entries, which have not yet been executed.
 - 
setOrderingpublic void setOrdering(java.util.Comparator comp) Set an ordering used for executing actions.- Parameters:
- comp- The comparator representing the ordering.
 
 - 
executeActionspublic 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).
 
 - 
wakeupComponentspublic 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).
 
 - 
setScheduleCommandpublic 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.
 
- 
 
-