1 #include "tao/CORBANAME_Parser.h"
2 #include "tao/CORBALOC_Parser.h"
3 #include "tao/Protocol_Factory.h"
4 #include "ace/Dynamic_Service.h"
5 #include "ace/Intrusive_Auto_Ptr.h"
7 #include "Service_Configuration_Per_ORB.h"
10 // @brief Dynamic services loading
13 ACE_TMAIN (int, ACE_TCHAR
*[])
15 ACE_Intrusive_Auto_Ptr
<ACE_Service_Gestalt
> one (new ACE_Service_Gestalt());
17 one
->process_directive (ace_svc_desc_TAO_CORBANAME_Parser
);
18 one
->process_directive (ace_svc_desc_TAO_CORBALOC_Parser
);
20 TAO_Protocol_Factory
* p1
= ACE_Dynamic_Service
<TAO_Protocol_Factory
>::instance (one
.get (), "IIOP_Factory");
23 ACE_ERROR_RETURN ((LM_DEBUG
, ACE_TEXT("Unexpected to find IIOP_Factory\n")), -1);
25 ACE_Service_Object
* p2
= ACE_Dynamic_Service
<ACE_Service_Object
>::instance (one
.get (), "CORBANAME_Parser");
28 ACE_ERROR_RETURN ((LM_DEBUG
, ACE_TEXT("Expected to find CORBANAME_Parser\n")), -1);
30 ACE_Service_Object
* p3
= ACE_Dynamic_Service
<ACE_Service_Object
>::instance (one
.get (), "CORBALOC_Parser");
33 ACE_ERROR_RETURN ((LM_DEBUG
, ACE_TEXT("Expected to find CORBALOC_Parser\n")), -1);