3 //=============================================================================
5 * @file Thread_Lane_Resources.h
7 * @author Irfan Pyarali
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)
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
29 ACE_END_VERSIONED_NAMESPACE_DECL
31 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
34 class TAO_Acceptor_Registry
;
35 class TAO_Leader_Follower
;
37 class TAO_New_Leader_Generator
;
38 class TAO_Connector_Registry
;
39 class TAO_Resource_Factory
;
42 * @class TAO_Thread_Lane_Resources
44 * @brief Class representing a thread lane's resources.
49 class TAO_Export TAO_Thread_Lane_Resources
53 TAO_Thread_Lane_Resources (
54 TAO_ORB_Core
&orb_core
,
55 TAO_New_Leader_Generator
*new_leader_generator
= 0);
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
,
67 /// Finalize resources.
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 ();
79 TAO_Acceptor_Registry
&acceptor_registry ();
82 * @note Returning a pointer helps to return 0 in case of
85 TAO_Connector_Registry
*connector_registry ();
87 /// Get the transport cache
88 TAO::Transport_Cache_Manager
&transport_cache ();
90 TAO_Leader_Follower
&leader_follower ();
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 ();
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
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 ();
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 ();
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
165 TAO_Connector_Registry
*connector_registry_
;
168 TAO::Transport_Cache_Manager
*transport_cache_
;
170 /// The leader/followers management class for this lane.
171 TAO_Leader_Follower
*leader_follower_
;
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.
181 ACE_Allocator
*input_cdr_dblock_allocator_
;
182 ACE_Allocator
*input_cdr_buffer_allocator_
;
183 ACE_Allocator
*input_cdr_msgblock_allocator_
;
186 /// @name The allocators for the buffering messages in the transport.
188 ACE_Allocator
*transport_message_buffer_allocator_
;
191 /// @name The allocators for the output CDR streams.
193 ACE_Allocator
*output_cdr_dblock_allocator_
;
194 ACE_Allocator
*output_cdr_buffer_allocator_
;
195 ACE_Allocator
*output_cdr_msgblock_allocator_
;
198 /// @name The allocators for AMH.
200 ACE_Allocator
*amh_response_handler_allocator_
;
203 /// @name The allocators for AMI.
205 ACE_Allocator
*ami_response_handler_allocator_
;
209 TAO_END_VERSIONED_NAMESPACE_DECL
211 #include /**/ "ace/post.h"
213 #endif /* TAO_THREAD_LANE_RESOURCES_H */