Package jadex.execution
Interface IExecutionFeature
- All Known Implementing Classes:
ExecutionFeature
public interface IExecutionFeature
The execution feature controls how and when components execute their steps,
e.g., single-threaded vs parallel steps, real-time vs. simulation time.
-
Method Summary
Modifier and TypeMethodDescriptionstatic IExecutionFeatureget()Get the feature instance of the currently running component.jadex.core.IComponentGet the component to which this feature belongs.longgetTime()Get the current time.static booleanTest if currently running inside a component.booleanTest if the current thread is used for current component execution.voidscheduleStep(jadex.core.IThrowingConsumer<jadex.core.IComponent> step) Schedule a step that provides a result.<T> jadex.future.IFuture<T> scheduleStep(jadex.core.IThrowingFunction<jadex.core.IComponent, T> step) Schedule a step that provides a result.voidscheduleStep(Runnable step) Schedule a step to be run on the component.<T> jadex.future.IFuture<T> scheduleStep(Callable<T> step) Schedule a step that provides a result.jadex.future.ITerminableFuture<Void> waitForDelay(long millis) Wait a specific amount.
-
Method Details
-
get
Get the feature instance of the currently running component. -
isAnyComponentThread
static boolean isAnyComponentThread()Test if currently running inside a component. -
scheduleStep
Schedule a step to be run on the component.- Parameters:
step- A step that is executed via theRunnable.run()method.
-
scheduleStep
Schedule a step that provides a result.- Parameters:
step- A step that is executed via theSupplier.get()method.- Returns:
- A future that provides access to the step result, once it is available.
-
scheduleStep
void scheduleStep(jadex.core.IThrowingConsumer<jadex.core.IComponent> step) Schedule a step that provides a result.- Parameters:
step- A step that is executed via themethod.invalid reference
IThrowingConsumer#accept()
-
scheduleStep
<T> jadex.future.IFuture<T> scheduleStep(jadex.core.IThrowingFunction<jadex.core.IComponent, T> step) Schedule a step that provides a result.- Parameters:
step- A step that is executed via themethod.invalid reference
IThrowingFunction#apply()- Returns:
- A future that provides access to the step result, once it is available.
-
isComponentThread
boolean isComponentThread()Test if the current thread is used for current component execution.- Returns:
- True, if it is the currently executing component thread.
-
waitForDelay
Wait a specific amount.- Parameters:
millis- The time to wait (in milliseconds).- Returns:
- A future that is finished when the time has passed.
-
getComponent
jadex.core.IComponent getComponent()Get the component to which this feature belongs. -
getTime
long getTime()Get the current time.- Returns:
- The time in milliseconds.
-