Merge pull request #2309 from mitza-oci/warnings
[ACE_TAO.git] / TAO / tao / Dynamic_TP / DTP_Thread_Lane_Resources_Manager.cpp
blob500efca43f43c33694c16bd68b772f282e559031
1 #include "tao/Dynamic_TP/DTP_Thread_Lane_Resources_Manager.h"
3 #if defined (TAO_HAS_CORBA_MESSAGING) && TAO_HAS_CORBA_MESSAGING != 0
5 #include "tao/ORB_Core.h"
6 #include "tao/ORB_Core_TSS_Resources.h"
7 #include "tao/Acceptor_Registry.h"
8 #include "tao/Thread_Lane_Resources.h"
9 #include "tao/Dynamic_TP/DTP_Thread_Pool.h"
10 #include "tao/LF_Follower.h"
11 #include "tao/Leader_Follower.h"
13 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
15 TAO_DTP_Thread_Lane_Resources_Manager::TAO_DTP_Thread_Lane_Resources_Manager
16 (TAO_ORB_Core &orb_core)
17 : TAO_Thread_Lane_Resources_Manager (orb_core),
18 default_lane_resources_ (0),
19 tp_manager_ (0)
21 // Create the default resources.
22 ACE_NEW (this->default_lane_resources_,
23 TAO_Thread_Lane_Resources (orb_core));
25 // Create the thread-pool manager.
26 ACE_NEW (this->tp_manager_,
27 TAO_DTP_Thread_Pool_Manager (orb_core));
30 TAO_DTP_Thread_Lane_Resources_Manager::~TAO_DTP_Thread_Lane_Resources_Manager ()
32 // Delete the default resources.
33 delete this->default_lane_resources_;
35 // Delete the thread-pool manager.
36 delete this->tp_manager_;
39 int
40 TAO_DTP_Thread_Lane_Resources_Manager::open_default_resources ()
42 TAO_ORB_Parameters *params =
43 this->orb_core_->orb_params ();
45 TAO_EndpointSet endpoint_set;
47 params->get_endpoint_set (TAO_DEFAULT_LANE, endpoint_set);
49 bool ignore_address = false;
51 int const result =
52 this->default_lane_resources_->open_acceptor_registry (endpoint_set,
53 ignore_address);
55 return result;
58 void
59 TAO_DTP_Thread_Lane_Resources_Manager::finalize ()
61 // Finalize default resources.
62 this->default_lane_resources_->finalize ();
65 void
66 TAO_DTP_Thread_Lane_Resources_Manager::shutdown_reactor ()
68 // Shutdown default reactors.
69 this->default_lane_resources_->shutdown_reactor ();
70 // This is the only reactor in use with this thread pool
73 void
74 TAO_DTP_Thread_Lane_Resources_Manager::close_all_transports ()
76 // Shutdown default reactors.
77 this->default_lane_resources_->close_all_transports ();
80 int
81 TAO_DTP_Thread_Lane_Resources_Manager::is_collocated (const TAO_MProfile &mprofile)
83 return this->default_lane_resources_->is_collocated (mprofile);
86 TAO_Thread_Lane_Resources &
87 TAO_DTP_Thread_Lane_Resources_Manager::lane_resources ()
89 return *this->default_lane_resources_;
92 TAO_Thread_Lane_Resources &
93 TAO_DTP_Thread_Lane_Resources_Manager::default_lane_resources ()
95 return *this->default_lane_resources_;
98 TAO_DTP_Thread_Pool_Manager &
99 TAO_DTP_Thread_Lane_Resources_Manager::tp_manager ()
101 return *this->tp_manager_;
104 TAO_Thread_Lane_Resources_Manager *
105 TAO_DTP_Thread_Lane_Resources_Manager_Factory::create_thread_lane_resources_manager (
106 TAO_ORB_Core &core)
108 TAO_Thread_Lane_Resources_Manager *manager = 0;
110 /// Create the RT Thread Lane Resources Manager.
111 ACE_NEW_RETURN (manager,
112 TAO_DTP_Thread_Lane_Resources_Manager (core),
115 return manager;
118 ACE_STATIC_SVC_DEFINE (TAO_DTP_Thread_Lane_Resources_Manager_Factory,
119 ACE_TEXT ("DTP_Thread_Lane_Resources_Manager_Factory"),
120 ACE_SVC_OBJ_T,
121 &ACE_SVC_NAME (TAO_DTP_Thread_Lane_Resources_Manager_Factory),
122 ACE_Service_Type::DELETE_THIS | ACE_Service_Type::DELETE_OBJ,
124 ACE_FACTORY_DEFINE (TAO_Dynamic_TP, TAO_DTP_Thread_Lane_Resources_Manager_Factory)
126 TAO_END_VERSIONED_NAMESPACE_DECL
128 #endif /* TAO_HAS_CORBA_MESSAGING && TAO_HAS_CORBA_MESSAGING != 0 */