public class ExecutionContextWorker
extends java.lang.Object
Periodic Sampled Data Processing (for the execution cycles) ExecutionContext class
Modifier and Type | Field and Description |
---|---|
protected java.util.ArrayList<RTObjectStateMachine> |
m_addedComps |
protected java.lang.String |
m_addedMutex |
protected java.util.ArrayList<RTObjectStateMachine> |
m_comps
List of the participating component
|
protected java.lang.String |
m_mutex |
protected ExecutionContextService |
m_ref |
protected java.util.ArrayList<RTObjectStateMachine> |
m_removedComps |
protected java.lang.String |
m_removedMutex |
protected boolean |
m_running
The running state of ExecutionContext
true: running, false: stopped
|
protected Logbuf |
rtcout
Logger stream
|
protected boolean |
running_ |
protected boolean |
ticked_ |
Constructor and Description |
---|
ExecutionContextWorker()
Default Constructor
|
protected Logbuf rtcout
protected ExecutionContextService m_ref
protected boolean m_running
protected boolean ticked_
protected boolean running_
protected java.util.ArrayList<RTObjectStateMachine> m_comps
protected java.lang.String m_mutex
protected java.util.ArrayList<RTObjectStateMachine> m_addedComps
protected java.lang.String m_addedMutex
protected java.util.ArrayList<RTObjectStateMachine> m_removedComps
protected java.lang.String m_removedMutex
public ExecutionContextWorker()
Default Constructor Set the following items to profile. - kind : PERIODIC - rate : 0.0
public void setECRef(ExecutionContextService ref)
public ExecutionContextService getECRef()
public boolean isRunning()
This operation shall return true if the context is in the Running state. While the context is Running, all Active RTCs participating in the context shall be executed according to the context’s execution kind.
public ReturnCode_t start()
Request that the context enter the Running state. Once the state transition occurs, the ComponentAction::on_startup operation will be invoked. An execution context may not be started until the RT-Components that participate in it have been initialized. An execution context may be started and stopped multiple times.
public ReturnCode_t stop()
Request that the context enter the Stopped state. Once the transition occurs, the ComponentAction::on_shutdown operation will be invoked. An execution context must be stopped before the RT components that participate in it are finalized. An execution context may be started and stopped multiple times.
public ReturnCode_t rateChanged()
public ReturnCode_t activateComponent(LightweightRTObject comp, RTObjectStateMachineHolder rtobjhldr)
The given participant RTC is Inactive and is therefore not being invoked according to the execution context’s execution kind. This operation shall cause the RTC to transition to the Active state such that it may subsequently be invoked in this execution context. The callback on_activate shall be called as a result of calling this operation. This operation shall not return until the callback has returned, and shall result in an error if the callback does.
comp
-
The target RT-Component holder for activationpublic ReturnCode_t waitActivateComplete(RTObjectStateMachine rtobj, TimeValue timeout, long cycle)
public ReturnCode_t waitActivateComplete(RTObjectStateMachine rtobj)
public ReturnCode_t waitActivateComplete(RTObjectStateMachine rtobj, TimeValue timeout)
public ReturnCode_t waitActivateComplete(RTObjectStateMachine rtobj, long cycle)
public ReturnCode_t deactivateComponent(LightweightRTObject comp, RTObjectStateMachineHolder rtobjhldr)
The given RTC is Active in the execution context. Cause it to transition to the Inactive state such that it will not be subsequently invoked from the context unless and until it is activated again. The callback on_deactivate shall be called as a result of calling this operation. This operation shall not return until the callback has returned, and shall result in an error if the callback does.
comp
-
The target RT-Component holder for deactivatepublic ReturnCode_t waitDeactivateComplete(RTObjectStateMachine rtobj, TimeValue timeout, long cycle)
public ReturnCode_t waitDeactivateComplete(RTObjectStateMachine rtobj, TimeValue timeout)
public ReturnCode_t waitDeactivateComplete(RTObjectStateMachine rtobj, long cycle)
public ReturnCode_t waitDeactivateComplete(RTObjectStateMachine rtobj)
public ReturnCode_t resetComponent(LightweightRTObject comp, RTObjectStateMachineHolder rtobjhldr)
Attempt to recover the RTC when it is in Error. The ComponentAction::on_reset callback shall be invoked. This operation shall not return until the callback has returned, and shall result in an error if the callback does. If possible, the RTC developer should implement that callback such that the RTC may be returned to a valid state.
comp
-
The target RT-Component holder for resetpublic ReturnCode_t waitResetComplete(RTObjectStateMachine rtobj, TimeValue timeout, long cycle)
public ReturnCode_t waitResetComplete(RTObjectStateMachine rtobj, TimeValue timeout)
public ReturnCode_t waitResetComplete(RTObjectStateMachine rtobj, long cycle)
public ReturnCode_t waitResetComplete(RTObjectStateMachine rtobj)
public LifeCycleState getComponentState(LightweightRTObject comp)
This operation shall report the LifeCycleState of the given participant RTC. UNKNOWN_STATE will be returned, if the given RT-Component is not inclued in the participant list.
comp
-
The target RT-Component to get the statepublic final java.lang.String getStateString(LifeCycleState state)
public ReturnCode_t addComponent(LightweightRTObject comp)
The operation causes the given RTC to begin participating in the execution context. The newly added RTC will receive a call to LightweightRTComponent::attach_context and then enter the Inactive state. BAD_PARAMETER will be invoked, if the given RT-Component is null or if the given RT-Component is other than DataFlowComponent.
comp
-
The target RT-Component for addpublic ReturnCode_t bindComponent(RTObject_impl rtc)
Bind the component.
rtc
-
RT-Component's instancespublic ReturnCode_t removeComponent(LightweightRTObject comp)
This operation causes a participant RTC to stop participating in the execution context. The removed RTC will receive a call to LightweightRTComponent::detach_context. BAD_PARAMETER will be returned, if the given RT-Component is not participating in the participant list.
comp
-
The target RT-Component for deletepublic RTObjectStateMachine findComponent(LightweightRTObject comp)
public boolean isAllCurrentState(LifeCycleState state)
public boolean isAllNextState(LifeCycleState state)
public boolean isOneOfCurrentState(LifeCycleState state)
public boolean isOneOfNextState(LifeCycleState state)
public void invokeWorker()
public void invokeWorkerPreDo()
public void invokeWorkerDo()
public void invokeWorkerPostDo()
public void updateComponentList()