Product: OpenFusion TAO
Version: ALL
Description:
How to create a server with two endpoints manually?
Resolution:
You can strategise how an endpoint is selected for a particular orb instance by calling the static method
TAO_ORB_Core::set_endpoint_selector_factory
supplying the name of a TAO_Endpoint_Selector_Factory implementation.
See
TAO/tao/Endpoint_Selector_Factory.h
which is loaded and registered against a name using the ACE service configurator framework. This factory should instantiate a custom implementation of TAO_Invocation_Endpoint_Selector.
See
TAO/tao/Invocation_Endpoint_Selectors.h
which can be used to control which profiles are selected from an IOR according to the strategy of your choice.
See
TAO/tao/Strategies/OC_Endpoint_Selector_Factory[.h|.cpp];
TAO/tao/Strategies/Optimized_Connection_Endpoint_Selector.[h|.cpp].
See also
TAO/tests/AlternateIIOP
for how such a strategy is loaded and used. This particular strategy may prove a close enough approximation to what is required. This strategy will check all profiles in an IOR for an existing matching cached connection before falling back try and connect to the first profile in the IOR.
So on the first access to an object from a particular server the behaviour will match the normal behaviour (all addresses tried in order), but subsequent access to objects from the same server will be optimised in that the client will reuse the successfully opened connection even though it may not be for the first profile in the IOR.
#KnowledgeDocs
#OpenFusion