Merge pull request #2216 from jwillemsen/jwi-cxxversionchecks
[ACE_TAO.git] / TAO / tao / RTPortableServer / RT_Object_Adapter_Factory.cpp
blob6f63f05e2364128f8cbd9dd3fb489075a0b1320f
1 #include "tao/RTPortableServer/RT_Object_Adapter_Factory.h"
3 #if defined (TAO_HAS_CORBA_MESSAGING) && TAO_HAS_CORBA_MESSAGING != 0
5 #include "tao/PortableServer/Object_Adapter.h"
6 #include "tao/ORB_Core.h"
7 #include "tao/RTPortableServer/RT_Servant_Dispatcher.h"
8 #include "tao/RTPortableServer/RT_Policy_Validator.h"
9 #include "tao/RTPortableServer/RT_Collocation_Resolver.h"
11 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
13 TAO_Adapter*
14 TAO_RT_Object_Adapter_Factory::create (TAO_ORB_Core *orb_core)
16 if (!orb_core->orb_params ()->disable_rt_collocation_resolver ())
18 // Set the name of the collocation resolver to be RT_Collocation_Resolver.
19 orb_core->orb_params ()->collocation_resolver_name ("RT_Collocation_Resolver");
20 ACE_Service_Config::process_directive (
21 ace_svc_desc_TAO_RT_Collocation_Resolver);
24 TAO_Object_Adapter *object_adapter = 0;
25 ACE_NEW_RETURN (object_adapter,
26 TAO_Object_Adapter (orb_core->server_factory ()->
27 active_object_map_creation_parameters (),
28 *orb_core),
29 0);
31 // Create and register the RT servant dispatcher.
32 TAO_RT_Servant_Dispatcher *rt_servant_dispatcher = 0;
33 ACE_NEW_RETURN (rt_servant_dispatcher,
34 TAO_RT_Servant_Dispatcher,
35 0);
36 object_adapter->servant_dispatcher (rt_servant_dispatcher);
38 // Create and add the RT policy validator.
39 TAO_POA_RT_Policy_Validator *rt_validator = 0;
40 ACE_NEW_RETURN (rt_validator,
41 TAO_POA_RT_Policy_Validator (*orb_core),
42 0);
43 object_adapter->validator ().add_validator (rt_validator);
45 return object_adapter;
49 ACE_FACTORY_DEFINE (TAO_RTPortableServer, TAO_RT_Object_Adapter_Factory)
50 ACE_STATIC_SVC_DEFINE (TAO_RT_Object_Adapter_Factory,
51 ACE_TEXT ("TAO_RT_Object_Adapter_Factory"),
52 ACE_SVC_OBJ_T,
53 &ACE_SVC_NAME (TAO_RT_Object_Adapter_Factory),
54 ACE_Service_Type::DELETE_THIS | ACE_Service_Type::DELETE_OBJ,
57 TAO_END_VERSIONED_NAMESPACE_DECL
59 #endif /* TAO_HAS_CORBA_MESSAGING && TAO_HAS_CORBA_MESSAGING != 0 */