Revert "Minor modernization of DynamicAny code"
[ACE_TAO.git] / TAO / tao / CSD_Framework / CSD_Object_Adapter_Factory.cpp
blob440758c11c35b9b8fbc799a09ed339c7c2be3c8c
1 // -*- C++ -*-
2 #include "tao/CSD_Framework/CSD_Object_Adapter_Factory.h"
3 #include "tao/CSD_Framework/CSD_Strategy_Repository.h"
4 #include "tao/CSD_Framework/CSD_Object_Adapter.h"
5 #include "tao/CSD_Framework/CSD_Default_Servant_Dispatcher.h"
6 #include "tao/ORB_Core.h"
7 #include "tao/ORBInitializer_Registry.h"
8 #include "ace/Dynamic_Service.h"
10 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
12 TAO_CSD_Object_Adapter_Factory::TAO_CSD_Object_Adapter_Factory ()
16 TAO_Adapter*
17 TAO_CSD_Object_Adapter_Factory::create (TAO_ORB_Core *oc)
19 // Create the CSD object adapter.
20 TAO_CSD_Object_Adapter *object_adapter = 0;
21 ACE_NEW_RETURN (object_adapter,
22 TAO_CSD_Object_Adapter (oc->server_factory ()->
23 active_object_map_creation_parameters (),
24 *oc),
25 0);
27 // Create and register the CSD servant dispatcher.
28 TAO_CSD_Default_Servant_Dispatcher * csd_servant_dispatcher = 0;
29 ACE_NEW_RETURN (csd_servant_dispatcher,
30 TAO_CSD_Default_Servant_Dispatcher,
31 0);
32 object_adapter->servant_dispatcher (csd_servant_dispatcher);
34 return object_adapter;
37 int
38 TAO_CSD_Object_Adapter_Factory::init (int /* argc */, ACE_TCHAR* /* argv */ [])
40 TAO_CSD_Strategy_Repository *repo =
41 ACE_Dynamic_Service<TAO_CSD_Strategy_Repository>::instance ("TAO_CSD_Strategy_Repository");
43 if (repo != 0)
44 repo->init(0,0);
46 return 0;
50 ACE_FACTORY_DEFINE (TAO_CSD_FW, TAO_CSD_Object_Adapter_Factory)
51 ACE_STATIC_SVC_DEFINE (TAO_CSD_Object_Adapter_Factory,
52 ACE_TEXT ("TAO_CSD_Object_Adapter_Factory"),
53 ACE_SVC_OBJ_T,
54 &ACE_SVC_NAME (TAO_CSD_Object_Adapter_Factory),
55 ACE_Service_Type::DELETE_THIS | ACE_Service_Type::DELETE_OBJ,
57 TAO_END_VERSIONED_NAMESPACE_DECL