Please report new issues athttps://github.com/DOCGroup
Hi, I would appreciatte if you can help me clarifying some doubts about facet objects behavior. The get_facet_name in the component executor returns to the container an facet executor. If in my component executor I have a method implemented like that: ::App::CCM_IFooFacet_ptr Foo_exec_i::get_foo_facet () { // Your code here. return ( new IFooFacet_exec_i () ); } And If I have two receptacles connected to the same component facet by DAnCE using the following deployment content: <connection> <name>foo_client1</name> <internalEndpoint> <portName>foo_facet</portName> <kind>Facet</kind> <instance>Foo-idd</instance> </internalEndpoint> <internalEndpoint> <portName>foo_rec</portName> <kind>SimplexReceptacle</kind> <instance>Client1-idd</instance> </internalEndpoint> </connection> <connection> <name>foo_client2</name> <internalEndpoint> <portName>foo_facet</portName> <kind>Facet</kind> <instance>Foo-idd</instance> </internalEndpoint> <internalEndpoint> <portName>foo_rec</portName> <kind>SimplexReceptacle</kind> <instance>Client2-idd</instance> </internalEndpoint> </connection> Will I have two diferent servants for the same facet? Will the reference received by the Client1 receptacle point to a different object than that received by Client2? Will it be created one IfooFacet_exec_i executor for each connection? Thank you very much. Santos
Santos, I don't know 100% the answer to your question. But I think every time the container get a request to obtain an object reference to the facet, it will call into your get_foo_facet () method. Personally speaking, I think you're just asking for trouble here. I usually instantiate the facet into a CCM_IFooFacet_var type (say my_foo_var), and do the following in the get_foo_facet() method ::App::CCM_IFooFacet_ptr Foo_exec_i::get_foo_facet () { // Your code here. return ::App::CCM_IFooFacet::_duplicate(my_foo_var.in()); } That way, everything is clear and safe. There will be one instantiation for the Foo Facet. Thanks, Abdul
Right now, the servant code caches the first result of get_foo_facet, so each connection will be served by a common facet executor. hth, /-Will
Hmmm, that seems counter intuitive to me. Is this spec compliant or CIAO-specific behavior? Thanks, Abdul
Insofar as I know, it is an implementation decision - I don't think the spec says one way or the other. It would be a relatively simple matter to patch this into CIDLC, if someone were so inclined. Thanks, /-Will
Hi Abdul - To follow up, I found the following nugget on page 14 of 06-04-01 > In general, a component instance shall be prepared to return object references for facets throughout the instance’s life > cycle. A component implementation may, as part of its advertised behavior, return a nil object reference as the result of > a provide_<name> operation. This certainly suggests that the intuitive behavior (ie, servant queries the executor each time) is the behavior mandated by the spec. hth, /-Will
clear target mileston
updated version
Will, what is the status of this?
reassign
It looks we are still only caching, is this something we want to change now?
Yes, we still cache. I think we should update this behavior as part of the servant code rework.
I will create some devportal tasks for this