Revert "Minor modernization of DynamicAny code"
[ACE_TAO.git] / TAO / tao / Thread_Lane_Resources.h
blob86a789e535b8d7422036637d84f6d349d843df7c
1 // -*- C++ -*-
3 //=============================================================================
4 /**
5 * @file Thread_Lane_Resources.h
7 * @author Irfan Pyarali
8 */
9 // ===================================================================
11 #ifndef TAO_THREAD_LANE_RESOURCES_H
12 #define TAO_THREAD_LANE_RESOURCES_H
14 #include /**/ "ace/pre.h"
16 #include "tao/orbconf.h"
18 #if !defined (ACE_LACKS_PRAGMA_ONCE)
19 # pragma once
20 #endif /* ACE_LACKS_PRAGMA_ONCE */
22 #include "ace/Thread_Mutex.h"
23 #include /**/ "tao/TAO_Export.h"
24 #include "tao/params.h"
25 #include "tao/Transport_Cache_Manager.h"
27 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
28 class ACE_Allocator;
29 ACE_END_VERSIONED_NAMESPACE_DECL
31 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
33 class TAO_ORB_Core;
34 class TAO_Acceptor_Registry;
35 class TAO_Leader_Follower;
36 class TAO_MProfile;
37 class TAO_New_Leader_Generator;
38 class TAO_Connector_Registry;
39 class TAO_Resource_Factory;
41 /**
42 * @class TAO_Thread_Lane_Resources
44 * @brief Class representing a thread lane's resources.
46 * \nosubgrouping
48 **/
49 class TAO_Export TAO_Thread_Lane_Resources
51 public:
52 /// Constructor.
53 TAO_Thread_Lane_Resources (
54 TAO_ORB_Core &orb_core,
55 TAO_New_Leader_Generator *new_leader_generator = 0);
57 /// Destructor.
58 ~TAO_Thread_Lane_Resources ();
60 /// Does @a mprofile belong to us?
61 int is_collocated (const TAO_MProfile &mprofile);
63 /// Open the acceptor registry.
64 int open_acceptor_registry (const TAO_EndpointSet &endpoint_set,
65 bool ignore_address);
67 /// Finalize resources.
68 void finalize ();
70 /// Shutdown the reactor.
71 void shutdown_reactor ();
73 /// Certain ORB policies such as dropping replies on shutdown
74 /// would need cleanup of transports to wake threads up.
75 void close_all_transports ();
77 /// @name Accessors
78 //@{
79 TAO_Acceptor_Registry &acceptor_registry ();
81 /**
82 * @note Returning a pointer helps to return 0 in case of
83 * exceptions.
85 TAO_Connector_Registry *connector_registry ();
87 /// Get the transport cache
88 TAO::Transport_Cache_Manager &transport_cache ();
90 TAO_Leader_Follower &leader_follower ();
92 /**
93 * Allocator is intended for allocating the ACE_Data_Blocks used in
94 * incoming CDR streams. This allocator has locks.
96 ACE_Allocator *input_cdr_dblock_allocator ();
98 /**
99 * Allocator is intended for allocating the buffers in the incoming
100 * CDR streams. This allocator has locks.
102 ACE_Allocator *input_cdr_buffer_allocator ();
105 * Allocator is intended for allocating the ACE_Message_Blocks used
106 * in incoming CDR streams. This allocator is global, and has locks.
108 ACE_Allocator *input_cdr_msgblock_allocator ();
111 * Allocator is intended for allocating the buffers used in the
112 * Transport object. This allocator has locks.
114 ACE_Allocator *transport_message_buffer_allocator ();
117 * Allocator is intended for allocating the ACE_Data_Blocks used in
118 * outgoing CDR streams. This allocator has locks.
120 ACE_Allocator *output_cdr_dblock_allocator ();
123 * Allocator is intended for allocating the buffers in the outgoing
124 * CDR streams. This allocator has locks.
126 ACE_Allocator *output_cdr_buffer_allocator ();
129 * Allocator is intended for allocating the ACE_Message_Blocks used
130 * in the outgoing CDR streams. This allocator is global, and has
131 * locks.
133 ACE_Allocator *output_cdr_msgblock_allocator ();
136 * Allocator is intended for allocating the AMH response handlers
137 * This allocator is global.
139 ACE_Allocator *amh_response_handler_allocator ();
142 * Allocator is intended for allocating the AMI response handlers
143 * This allocator is global.
145 ACE_Allocator *ami_response_handler_allocator ();
146 //@}
148 private:
149 /// Checks if the acceptor registry has been created.
150 int has_acceptor_registry_been_created () const;
152 /// Helper to get the resource factory in the ORB_Core
153 TAO_Resource_Factory *resource_factory ();
155 private:
156 /// ORB_Core related to this thread lane.
157 TAO_ORB_Core &orb_core_;
159 /// The registry which maintains a list of acceptor factories for
160 /// each loaded protocol.
161 TAO_Acceptor_Registry *acceptor_registry_;
163 /// The connector registry which all active connectors must register
164 /// themselves with.
165 TAO_Connector_Registry *connector_registry_;
167 /// Transport cache.
168 TAO::Transport_Cache_Manager *transport_cache_;
170 /// The leader/followers management class for this lane.
171 TAO_Leader_Follower *leader_follower_;
173 /// Synchronization.
174 TAO_SYNCH_MUTEX lock_;
176 /// Generator of new leader threads.
177 TAO_New_Leader_Generator *new_leader_generator_;
179 /// @name The allocators for the input CDR streams.
180 //@{
181 ACE_Allocator *input_cdr_dblock_allocator_;
182 ACE_Allocator *input_cdr_buffer_allocator_;
183 ACE_Allocator *input_cdr_msgblock_allocator_;
184 //@}
186 /// @name The allocators for the buffering messages in the transport.
187 //@{
188 ACE_Allocator *transport_message_buffer_allocator_;
189 //@}
191 /// @name The allocators for the output CDR streams.
192 //@{
193 ACE_Allocator *output_cdr_dblock_allocator_;
194 ACE_Allocator *output_cdr_buffer_allocator_;
195 ACE_Allocator *output_cdr_msgblock_allocator_;
196 //@}
198 /// @name The allocators for AMH.
199 //@{
200 ACE_Allocator *amh_response_handler_allocator_;
201 //@}
203 /// @name The allocators for AMI.
204 //@{
205 ACE_Allocator *ami_response_handler_allocator_;
206 //@}
209 TAO_END_VERSIONED_NAMESPACE_DECL
211 #include /**/ "ace/post.h"
213 #endif /* TAO_THREAD_LANE_RESOURCES_H */