Merge pull request #2309 from mitza-oci/warnings
[ACE_TAO.git] / TAO / tao / DiffServPolicy / DiffServPolicy.cpp
blobd669b6ee3edf1588a13dc83f45f01c02d0d5adfe
1 // -*- C++ -*-
2 #include "tao/DiffServPolicy/DiffServPolicy.h"
3 #include "tao/DiffServPolicy/DiffServPolicy_ORBInitializer.h"
4 #include "tao/DiffServPolicy/DiffServ_Protocols_Hooks.h"
5 #include "tao/ORB_Core.h"
6 #include "tao/ORBInitializer_Registry.h"
7 #include "tao/PI/PI.h"
9 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
11 int
12 TAO_DiffServPolicy_Initializer::static_init ()
14 TAO_ORB_Core::set_network_priority_protocols_hooks (
15 "DS_Network_Priority_Protocols_Hooks");
16 ACE_Service_Config::process_directive (
17 ace_svc_desc_TAO_DS_Network_Priority_Protocols_Hooks);
18 ACE_Service_Config::process_directive (
19 ace_svc_desc_TAO_DiffServPolicy_Initializer);
20 return 0;
23 int
24 TAO_DiffServPolicy_Initializer::init (int, ACE_TCHAR* [])
26 PortableInterceptor::ORBInitializer_var orb_initializer;
28 try
30 PortableInterceptor::ORBInitializer_ptr temp_orb_initializer =
31 PortableInterceptor::ORBInitializer::_nil ();
32 /// Register the EndpointPolicy ORBInitializer.
33 ACE_NEW_THROW_EX (temp_orb_initializer,
34 TAO_DiffServPolicy_ORBInitializer,
35 CORBA::NO_MEMORY (
36 CORBA::SystemException::_tao_minor_code (
37 TAO::VMCID,
38 ENOMEM),
39 CORBA::COMPLETED_NO));
41 orb_initializer = temp_orb_initializer;
43 PortableInterceptor::register_orb_initializer (orb_initializer.in ());
45 catch (const ::CORBA::Exception& ex)
47 if (TAO_debug_level > 0)
49 ex._tao_print_exception ("Caught exception:");
51 return -1;
54 return 0;
58 /////////////////////////////////////////////////////////////////////
60 ACE_FACTORY_DEFINE (TAO_DiffServPolicy, TAO_DiffServPolicy_Initializer)
61 ACE_STATIC_SVC_DEFINE (TAO_DiffServPolicy_Initializer,
62 ACE_TEXT ("DiffservPolicy_Initializer"),
63 ACE_SVC_OBJ_T,
64 &ACE_SVC_NAME (TAO_DiffServPolicy_Initializer),
65 ACE_Service_Type::DELETE_THIS
66 | ACE_Service_Type::DELETE_OBJ,
68 TAO_END_VERSIONED_NAMESPACE_DECL