Issue 10496: ExecutionContextAdmin should receive RTObject not ComponentProfile (rtc-ftf) Source: AIST (Dr. Noriaki Ando, n-ando@aist.go.jp) Nature: Uncategorized Issue Severity: Summary: Source: AIST (Noriaki Ando, [[MailTo(n-ando AT SPAMFREE aist DOT go DOT jp)]]) Severity: Minor Disposition: Resolution Proposed Summary ExecutionContextAdmin has no way to know RTObject itself. ExecutionContextAdmin is defined as follows, interface ExecutionContextAdmin : ExecutionContext, Service { ExecutionContextProfile get_profile(); ReturnCode_t add(in ComponentProfile comp_profile, in long index); ReturnCode_t remove(in ComponentProfile comp_profile); }; ComponentProfile does not include RTObject's reference (or pointer or object reference). Therefore ExecutionContextAdmin cannot call RTObject (or related classed for example ComponentAction, etc..) -- Noriaki Ando, 2006/12/4 Discussion Resolution The definition of the ExecutionContextAdmin should be as follows, interface ExecutionContextAdmin : ExecutionContext, Service { ExecutionContextProfile get_profile(); ReturnCode_t add(in RTObject comp, in long index); ReturnCode_t remove(in RTObject comp); }; Since RTObject has get_component_profile operation, ExecutionContextAdmin can access the component profile. -- Noriaki Ando, 2006/12/4 Revised Text Resolution: The add and remove operations are generally useful, not only for introspective RTCs but for all RTCs, because they effectively define an interface between a component and its hosting middleware (which will likely provide the execution context). Therefore, move the add and remove operations from ExecutionContextAdmin to ExecutionContextOperations and change the argument type from ComponentProfile to LightweightRTObject. These add and remove operations should be complemented by attach/detach operations on the RTC itself to inform it of its participation in the context and to associate the context with an identifier ("ExecutionContextHandle_t") relative to that component (see issue 10495). To make callback operations less expensive in distributed environments, all callback operations should be passed these identifiers instead of ExecutionContext references. Revised Text: · Add the add_component/remove_component operations to ExecutionContextOperations. (The "index" parameter to ExecutionContextAdmin::add is omitted, because the ordering of periodic components is already defined in section 7.3.1.1.1, Execution Sorting.) · Add the following operations to the depiction of ExecutionContextOperations in Figure 7.2, Lightweight RTC Package, in section 7.2.2, Components: + add_component(LightweightRTObject) : ReturnCode_t + remove_component(LightweightRTObject) : ReturnCode_t · The ExecutionContextOperations interface is not a member of the Introspection package, so its members need not be displayed in diagrams of that package. Remove all operations from the depiction of ExecutionContextOperations in Figure 7.16, Introspection interfaces, in section 7.4.2, Stereotypes and Interfaces. · Add the following rows to the operations table in the ExecutionContextOperations section (introduced by the resolution to issue 10601). The new rows should be inserted immediately before activate_component. add_component ReturnCode_t comp LightweightRTComponent remove_component ReturnCode_t comp LightweightRTComponent · Add the following sections immediately before section 7.2.2.6.6, activate_component: 7.2.2.6.6 add_componentDescriptionThe operation causes the given RTC to begin participating in the execution context.SemanticsThe newly added RTC will receive a call to LightweightRTComponent::attach_context (see Section <cross reference>) and then enter the Inactive state. Figure <number> - ExecutionContextOperations::add_componentConstraints· If the ExecutionKind of this context is PERIODIC, the RTC must be a data flow participant (see Section 7.3.1.2). Otherwise, this operation shall fail with PRECONDITION_NOT_MET.· If the ExecutionKind of this context is EVENT_DRIVEN, the RTC must be an FSM participant (see Section 7.3.2.2). Otherwise, this operation shall fail with PRECONDITION_NOT_MET.7.2.2.6.7 remove_componentDescriptionThis operation causes a participant RTC to stop participating in the execution context.SemanticsThe newly added RTC will receive a call to LightweightRTComponent::detach_context (see Section <cross reference>). Figure <number> - ExecutionContextOperations::remove_componentConstraints· If the given RTC is not currently participating in the execution context, this operation shall fail with BAD_PARAMETER.· An RTC must be deactivated before it can be removed from an execution context. If the given RTC is participating in the execution context but is still in the Active state, this operation shall fail with PRECONDITION_NOT_MET. · Add the following operations to the IDL in RTC.idl and Annex A: interface ExecutionContext { // … ReturnCode_t add_component(in LightweightRTObject comp); ReturnCode_t remove_component(in LightweightRTObject comp); // … activate_component and other operations }; · Remove the operations ExecutionContextAdmin::add and ExecutionContextAdmin::remove. · Remove the operations from the depiction of ExecutionContextAdmin in Figure 7.16, Introspection interfaces, in section 7.4.2, Stereotypes and Interfaces. · Remove the corresponding rows from the Operations table in section 7.4.2.4, ExecutionContextAdmin. · Remove sections 7.4.2.4.2, add, and 7.4.2.4.3, remove. · Rename ExecutionContextAdmin to ExecutionContextService. (Without add/remove operations, it no longer has an "administrator" role greater than that of ExecutionContext itself.) · In Figure 7.14, Introspection overview, in section 7.4, Introspection, remove the depiction of the operation RTObject::get_execution_context_admins and replace it with the following: + get_execution_context_services() : ExecutionContextService[] · In Figure 7.16, Introspection interfaces, in section 7.4.2, Stereotypes and Interfaces, remove the depiction of the operation RTObject::get_execution_context_admins and replace it with the following: + get_execution_context_services() : ExecutionContextService[] · In Figure 7.16, Introspection interfaces, in section 7.4.2, Stereotypes and Interfaces, rename the depiction of ExecutionContextAdmin to "ExecutionContextService". · In the Operations table in section 7.4.2.2, RTObject, rename get_execution_context_admins to "get_execution_context_services". · Rename section 7.4.2.2.3, get_execution_context_admins, to "get_execution_context_services". In the first sentence of the Description in that section, replace "an ExecutionContextAdmin" with "an ExecutionContextService". · Rename section 7.4.2.4, ExecutionContextAdmin, to "ExecutionContextService". Make the same replacement under Description, under Semantics, and in the title of the Operations table in the same numbered section. · In RTC.idl and in Annex A, rename the IDL definition of ExecutionContextAdmin to "ExecutionContextService". · In RTC.idl and in Annex A, remove the definition ExecutionContextAdminList and replace it with the following: typedef sequence<ExecutionContextService> ExecutionContextServiceList; · Add attach/detach operations to LightweightRTObject. · Add the following to the end of section 7.2.2.2, LightweightRTObject: OperationsLightweightRTObject no attributes operations attach_context ExecutionContextHandle_t exec_context ExecutionContext detach_context ReturnCode_t exec_handle ExecutionContextHandle_t get_context ExecutionContext exec_handle ExecutionContextHandle_t 7.2.2.2.1 attach_contextDescriptionInform this RTC that it is participating in the given execution context. Return a handle that represents the association of this RTC with the context.SemanticsThis operation is intended to be invoked by ExecutionContextOperations::add_component (see Section <cross reference>. It is not intended for use by other clients.7.2.2.2.2 detach_contextDescriptionInform this RTC that it is no longer participating in the given execution context.SemanticsThis operation is intended to be invoked by ExecutionContextOperations::remove_component (see Section <cross reference>. It is not intended for use by other clients.Constraints· This operation may not be invoked if this RTC is not already participating in the execution context. Such a call shall fail with ReturnCode_t::PRECONDITION_NOT_MET.· This operation may not be invoked if this RTC is Active in the indicated execution context. Otherwise, it shall fail with ReturnCode_t::PRECONDITION_NOT_MET.7.2.2.2.3 get_contextDescriptionObtain a reference to the execution context represented by the given handle.SemanticsThe mapping from handle to context is specific to a particular RTC instance. The given handle must have been obtained by a previous call to attach_context on this RTC. · Add the following operations to the depiction of LightweightRTObject in Figure 7.2, Lightweight RTC package, in section 7.2.2: + attach_context(ExecutionContext) : ExecutionContextHandle_t + detach_context(ExecutionContextHandle_t) : ReturnCode_t + get_context(ExecutionContextHandle_t) : ExecutionContext · Add the following operations to the definition of LightweightRTObject in RTC.idl and Annex A: ExecutionContextHandle_t attach_context( in ExecutionContext exec_context); ReturnCode_t detach_context( in ExecutionContextHandle_t exec_handle); ExecutionContext get_context( in ExecutionContextHandle_t exec_handle); · Add a definition of the ExecutionContextHandle_t type. · Add the following section immediately following section 7.2.2.7, ExecutionKind. 7.2.2.8 ExecutionContextHandle_tDescriptionThis data type represents the association between an RTC and an ExecutionContext in which it participates.SemanticsThis is an opaque DataType. It has no attributes or operations. · Add the following statements to RTC.idl and Annex A: #define EXECUTION_HANDLE_TYPE_NATIVE long module RTC { typedef EXECUTION_HANDLE_TYPE_NATIVE ExecutionContextHandle_t; // ... }; · Change the types of the parameters to the callback operations. · In Figure 7.2, Lightweight RTC Package, in section 7.2.2, Components, replace the ExecutionContext parameters to the ComponentAction operations with ExecutionContextHandle_t. · In the operations table in section 7.2.2.5, ComponentAction, change the parameter types from ExecutionContext to ExecutionContextHandle_t. · In Figure 7.6, Data Flow Types, in section 7.3.1, Periodic Samples Data Processing, replace the ExecutionContext parameters to the DataFlowComponentAction operations with ExecutionContextHandle_t. · In Figure 7.7, Data Flow Example, in section 7.3.1, Periodic Samples Data Processing, replace the ExecutionContext parameters to the DataFlowComponentAction operations with ExecutionContextHandle_t. · In the operations table in section 7.3.1.3, DataFlowComponentAction, change the parameter types from ExecutionContext to ExecutionContextHandle_t. · In Figure 7.9, Stimulus Response Execution, in section 7.3.2, Stimulus Response Execution, replace the ExecutionContext parameter to FsmComponentAction::on_transition with ExecutionContextHandle_t. · In Figure 7.10, FSM UML Example, in section 7.3.2, Stimulus Response Execution, replace the ExecutionContext parameter to FsmComponentAction::on_transition with ExecutionContextHandle_t. · In the operations table in section 7.3.2.3, FsmComponentAction, change the on_transition parameter type from ExecutionContext to ExecutionContextHandle_t. · In Figure 7.12, Modes of Operation, in section 7.3.3, Modes of operation, replace the ExecutionContext parameter to MultiModeComponentAction::on_mode_changed with ExecutionContextHandle_t. · In the operations table in section 7.3.3.4, MultiModeComponentAction, change the on_mode_changed parameter type from ExecutionContext to ExecutionContextHandle_t. · In RTC.idl and Annex A, replace ExecutionContext with ExecutionContextHandle_t in the definitions of ComponentAction, DataFlowComponentAction, FsmComponentAction, and MultiModeComponentAction. Actions taken: December 5, 2006: received issue January 15, 2008: closed issue Discussion: End of Annotations:===== MG issue 10496: ExecutionContextAdmin should receive RTObject not ComponentProfile Source: AIST (Noriaki Ando, [[MailTo(n-ando AT SPAMFREE aist DOT go DOT jp)]]) Severity: Minor Disposition: Resolution Proposed Summary ExecutionContextAdmin has no way to know RTObject itself. ExecutionContextAdmin is defined as follows, interface ExecutionContextAdmin : ExecutionContext, Service { ExecutionContextProfile get_profile(); ReturnCode_t add(in ComponentProfile comp_profile, in long index); ReturnCode_t remove(in ComponentProfile comp_profile); }; ComponentProfile does not include RTObject's reference (or pointer or object reference). Therefore ExecutionContextAdmin cannot call RTObject (or related classed for example ComponentAction, etc..) -- Noriaki Ando, 2006/12/4 Discussion Resolution The definition of the ExecutionContextAdmin should be as follows, interface ExecutionContextAdmin : ExecutionContext, Service { ExecutionContextProfile get_profile(); ReturnCode_t add(in RTObject comp, in long index); ReturnCode_t remove(in RTObject comp); }; Since RTObject has get_component_profile operation, ExecutionContextAdmin can access the component profile. -- Noriaki Ando, 2006/12/4 Revised Text Date: Wed, 01 Aug 2007 14:23:22 -0700 From: Rick Warren Reply-To: rick.warren@rti.com Organization: RTI User-Agent: Thunderbird 2.0.0.5 (Windows/20070716) To: Ando Noriaki Cc: "rtc-ftf@omg.org" Subject: Re: Preparation for RTC FTF votes Ando Noriaki wrote: I would like to propose the following timeline: 1) Aug. 10th (8/10) : Finish review about open issues on wiki. If you have any opinions or comments, please write up wiki and send notification e-mail about it to this mailinglist. I noticed that in issue 10496, we removed ExecutionContextService::add() and remove() from the PIM. However, we neglected to remove them from the IDL. Since 10492 also mentions ExecutionContextService, I think we can put this fix in with that issue. I added the following bullet on the wiki: * Remove ExecutionContextService::add() and remove() from Annex A and from RTC.idl. (These operations were removed from the PIM by issue 10496, but were accidentally not removed from the PSM.) -- Rick Warren Lead Software Engineer Real-Time Innovations (RTI) 3975 Freedom Circle Santa Clara, CA 95054 +1 (408) 200-4755 rick.warren@rti.com www.rti.com