Package jadex.bridge.component.impl
Interface IInternalExecutionFeature
-
- All Known Implementing Classes:
ExecutionComponentFeature
public interface IInternalExecutionFeature
The execution feature allows to schedule steps to be synchronously executed on the component.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.ThreadLocal<IInternalAccess>
LOCAL
The currently executing component (if any).
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addSubcomponent(IInternalExecutionFeature sub)
Add a synchronous subcomponent that will run on its parent's thread.void
block(java.lang.Object monitor, long timeout, boolean realtime)
Block the current thread and allow execution on other threads.void
childTerminated(IComponentDescription desc, java.lang.Exception ex)
Called when a child was terminated.jadex.commons.future.IFuture<java.lang.Void>
doStep(java.lang.String stepinfo)
Do a step of a suspended component.boolean
execute()
Execute the executable.int
getEndstateStart()
Get the step number when endstate began.void
removeSubcomponent(IInternalExecutionFeature sub)
Remove a synchronous subcomponent.void
setManual(boolean manual)
Set manual execution mode, e.g.void
unblock(java.lang.Object monitor, java.lang.Throwable exception)
Unblock the thread waiting for the given monitor and cease execution on the current thread.void
wakeup()
Trigger component execution.
-
-
-
Field Detail
-
LOCAL
static final java.lang.ThreadLocal<IInternalAccess> LOCAL
The currently executing component (if any).
-
-
Method Detail
-
wakeup
void wakeup()
Trigger component execution.
-
doStep
jadex.commons.future.IFuture<java.lang.Void> doStep(java.lang.String stepinfo)
Do a step of a suspended component.
-
block
void block(java.lang.Object monitor, long timeout, boolean realtime)
Block the current thread and allow execution on other threads.- Parameters:
monitor
- The monitor to wait for.realtime
- Flag if timeout is realtime (in contrast to simulation time).
-
unblock
void unblock(java.lang.Object monitor, java.lang.Throwable exception)
Unblock the thread waiting for the given monitor and cease execution on the current thread.- Parameters:
monitor
- The monitor to notify.
-
execute
boolean execute()
Execute the executable.- Returns:
- True, if the object wants to be executed again.
-
addSubcomponent
void addSubcomponent(IInternalExecutionFeature sub)
Add a synchronous subcomponent that will run on its parent's thread.- Parameters:
sub
- The subcomponent.
-
removeSubcomponent
void removeSubcomponent(IInternalExecutionFeature sub)
Remove a synchronous subcomponent.- Parameters:
sub
- The subcomponent.
-
getEndstateStart
int getEndstateStart()
Get the step number when endstate began.- Returns:
- The step cnt.
-
childTerminated
void childTerminated(IComponentDescription desc, java.lang.Exception ex)
Called when a child was terminated.
-
setManual
void setManual(boolean manual)
Set manual execution mode, e.g. for bootstrapping at platform startup/shutdown.- Parameters:
manual
- Ignore wake up calls, if true.
-
-