00001 // -*- C++ -*- 00002 00003 // =================================================================== 00004 /** 00005 * @file ORB_Core.h 00006 * 00007 * ORB_Core.h,v 1.306 2006/06/05 15:36:26 mesnier_p Exp 00008 * 00009 * @author DOC Center - Washington University at St. Louis 00010 * @author DOC Laboratory - University of California at Irvine 00011 */ 00012 // =================================================================== 00013 00014 #ifndef TAO_ORB_CORE_H 00015 #define TAO_ORB_CORE_H 00016 00017 #include /**/ "ace/pre.h" 00018 00019 #include "tao/Resource_Factory.h" 00020 00021 #if !defined (ACE_LACKS_PRAGMA_ONCE) 00022 # pragma once 00023 #endif /* ACE_LACKS_PRAGMA_ONCE */ 00024 00025 #include "tao/Collocation_Strategy.h" 00026 #include "tao/params.h" 00027 #include "tao/ORB_Constants.h" 00028 #include "tao/Parser_Registry.h" 00029 #include "tao/Service_Callbacks.h" 00030 #include "tao/Fault_Tolerance_Service.h" 00031 #include "tao/Cleanup_Func_Registry.h" 00032 #include "tao/Object_Ref_Table.h" 00033 #include "tao/ObjectKey_Table.h" 00034 #include "tao/Messaging_SyncScopeC.h" 00035 #include "tao/Object.h" 00036 #include "tao/Invocation_Utils.h" 00037 #include "tao/Adapter_Registry.h" 00038 #include "tao/ORB_Core_TSS_Resources.h" 00039 #include "ace/Array_Map.h" 00040 00041 #include "ace/Thread_Manager.h" 00042 #include "ace/Lock_Adapter_T.h" 00043 #include "ace/TSS_T.h" 00044 00045 #include "ace/Service_Object.h" 00046 00047 ACE_BEGIN_VERSIONED_NAMESPACE_DECL 00048 class ACE_Data_Block; 00049 ACE_END_VERSIONED_NAMESPACE_DECL 00050 00051 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00052 00053 #if TAO_HAS_INTERCEPTORS == 1 00054 00055 namespace TAO 00056 { 00057 class ClientRequestInterceptor_Adapter; 00058 class ServerRequestInterceptor_Adapter; 00059 } 00060 00061 #endif /* TAO_HAS_INTERCEPTORS == 1 */ 00062 00063 class TAO_Adapter; 00064 class TAO_Acceptor; 00065 class TAO_Connector; 00066 class TAO_Connector_Registry; 00067 00068 class TAO_Resource_Factory; 00069 class TAO_Client_Strategy_Factory; 00070 class TAO_Server_Strategy_Factory; 00071 00072 class TAO_TSS_Resources; 00073 class TAO_Leader_Follower; 00074 class TAO_LF_Strategy; 00075 class TAO_RT_ORB; 00076 class TAO_RT_Current; 00077 class TAO_MProfile; 00078 class TAO_Profile; 00079 00080 class TAO_Endpoint_Selector_Factory; 00081 class TAO_Message_State_Factory; 00082 class TAO_Protocols_Hooks; 00083 class TAO_BiDir_Adapter; 00084 00085 class TAO_Flushing_Strategy; 00086 00087 class TAO_Thread_Lane_Resources_Manager; 00088 class TAO_Collocation_Resolver; 00089 class TAO_Thread_Lane_Resources; 00090 class TAO_Stub_Factory; 00091 class TAO_Endpoint_Selector_Factory; 00092 class TAO_Service_Context; 00093 class TAO_Request_Dispatcher; 00094 class TAO_Policy_Set; 00095 class TAO_Policy_Manager; 00096 class TAO_Policy_Current; 00097 00098 class TAO_Codeset_Manager; 00099 class TAO_IORInterceptor_Adapter; 00100 class TAO_Valuetype_Adapter; 00101 00102 class TAO_Policy_Validator; 00103 00104 namespace TAO 00105 { 00106 class GUIResource_Factory; 00107 class PolicyFactory_Registry_Adapter; 00108 class ORBInitializer_Registry_Adapter; 00109 class Transport_Queueing_Strategy; 00110 } 00111 00112 namespace CORBA 00113 { 00114 class ORB_ObjectIdList; // CORBA::ORB::ObjectIdList 00115 class ORB; 00116 typedef ORB *ORB_ptr; 00117 00118 class PolicyList; 00119 } 00120 00121 namespace IOP 00122 { 00123 class ServiceContextList; 00124 } 00125 00126 namespace PortableInterceptor 00127 { 00128 class IORInterceptor; 00129 typedef IORInterceptor *IORInterceptor_ptr; 00130 00131 #if TAO_HAS_INTERCEPTORS == 1 00132 00133 class ClientRequestInterceptor; 00134 typedef ClientRequestInterceptor *ClientRequestInterceptor_ptr; 00135 00136 class ServerRequestInterceptor; 00137 typedef ServerRequestInterceptor *ServerRequestInterceptor_ptr; 00138 00139 #endif /* TAO_HAS_INTERCEPTORS == 1 */ 00140 } 00141 00142 // **************************************************************** 00143 /** 00144 * @class TAO_ORB_Core 00145 * 00146 * @brief Encapsulates the state of an ORB. 00147 * 00148 * This is the implementation class for the CORBA::ORB interface. The 00149 * class also encapsulates the access to the ORB resources and its 00150 * state. 00151 * @par 00152 * Some resources can be TSS or global, those resources are always 00153 * accessed through a TSS interface, but are allocated using the 00154 * Resource_Factory. If the resource is really global the 00155 * Resource_Factory will simply return a pointer to the global 00156 * instance. 00157 */ 00158 class TAO_Export TAO_ORB_Core 00159 { 00160 friend class TAO_ORB_Core_Auto_Ptr; 00161 friend CORBA::ORB_ptr CORBA::ORB_init (int &, 00162 char *argv[], 00163 const char *, 00164 CORBA::Environment &); 00165 public: 00166 00167 /// Constructor. 00168 TAO_ORB_Core (const char* id); 00169 00170 /// Accessor for the ORB parameters. 00171 TAO_ORB_Parameters *orb_params (void); 00172 00173 /** 00174 * @todo 00175 * In the future this hook should change, instead of hardcoding the 00176 * object we should add a "Resolver" to the ORB, so the "POACurrent" 00177 * object returns a per-ORB object. 00178 * @par 00179 * Similarly, each ORB should implement the TSS pattern to put the 00180 * POA_Current_Impl in a void* slot. The current approach *does* 00181 * decouple the POA from the ORB, but it cannot add new adapters or 00182 * other components transparently. 00183 */ 00184 /// Accessor to the POA current. 00185 //@{ 00186 CORBA::Object_ptr poa_current(void); 00187 //@} 00188 00189 /// Get the connector registry 00190 TAO_Connector_Registry *connector_registry (ACE_ENV_SINGLE_ARG_DECL); 00191 00192 /// Get the IOR parser registry 00193 TAO_Parser_Registry *parser_registry (void); 00194 00195 /// Return pointer to the policy factory registry associated with 00196 /// this ORB core. 00197 TAO::PolicyFactory_Registry_Adapter *policy_factory_registry (void); 00198 00199 /// Return pointer to the orb initializer registry associated with 00200 /// this ORB core. Tries to load the PI library if it is not loaded 00201 /// yet 00202 TAO::ORBInitializer_Registry_Adapter *orbinitializer_registry (void); 00203 00204 /// Get the protocol factories 00205 TAO_ProtocolFactorySet *protocol_factories (void); 00206 00207 /// Get pointer to the ORB. 00208 CORBA::ORB_ptr orb (void); 00209 00210 /// Wrappers that forward the request to the concurrency strategy. 00211 ACE_Reactor *reactor (void); 00212 00213 /// Get the ACE_Thread_Manager 00214 ACE_Thread_Manager *thr_mgr (void); 00215 00216 /// Return the RootPOA, or try to load it if not initialized already. 00217 CORBA::Object_ptr root_poa (ACE_ENV_SINGLE_ARG_DECL); 00218 00219 /// Get the adapter registry 00220 TAO_Adapter_Registry *adapter_registry (void); 00221 00222 /// @name Collocation Strategies 00223 //@{ 00224 enum 00225 { 00226 /// Indicate object should refer to ORB for either one of the 00227 /// following strategies. 00228 ORB_CONTROL, 00229 00230 /// Collocated calls will go thru POA. 00231 THRU_POA, 00232 00233 /// Collocated calls invoke operation on Servant directly. 00234 DIRECT 00235 }; 00236 00237 /** 00238 * This method returns the right collocation strategy, if any, 00239 * to be used to perform a method invocation on the given object. 00240 * 00241 * @note 00242 * No-Collocation is a special case of collocation. 00243 */ 00244 static 00245 TAO::Collocation_Strategy collocation_strategy (CORBA::Object_ptr object 00246 ACE_ENV_ARG_DECL); 00247 //@} 00248 00249 /// Set/get the collocation flags 00250 //@{ 00251 void optimize_collocation_objects (CORBA::Boolean opt); 00252 CORBA::Boolean optimize_collocation_objects (void) const; 00253 00254 void use_global_collocation (CORBA::Boolean opt); 00255 CORBA::Boolean use_global_collocation (void) const; 00256 00257 CORBA::ULong get_collocation_strategy (void) const; 00258 //@} 00259 00260 /// Get the adapter named "RootPOA" and cache the result, this is an 00261 /// optimization for the POA. 00262 TAO_Adapter *poa_adapter (void); 00263 00264 /** 00265 * @name Access to Factories 00266 * 00267 * These factories are not thread-specific, and are presented here 00268 * in order to have one place to get useful information. Often, the 00269 * instances to which the return pointers are stored in the Service 00270 * Repository. 00271 */ 00272 //@{ 00273 /// Returns pointer to the resource factory. 00274 TAO_Resource_Factory *resource_factory (void); 00275 00276 /// Returns pointer to the factory for creating gui resources 00277 TAO::GUIResource_Factory *gui_resource_factory (void); 00278 00279 /// Returns pointer to the client factory. 00280 TAO_Client_Strategy_Factory *client_factory (void); 00281 00282 /// Returns pointer to the server factory. 00283 TAO_Server_Strategy_Factory *server_factory (void); 00284 00285 /// Returns pointer to the Protocols_Hooks. 00286 TAO_Protocols_Hooks *protocols_hooks (void); 00287 00288 /// Returns a pointer to the Thread Lane Resources Manager. 00289 TAO_Thread_Lane_Resources_Manager &thread_lane_resources_manager (void); 00290 00291 /// Returns a pointer to the Collocation Resolver. 00292 TAO_Collocation_Resolver &collocation_resolver (void); 00293 00294 /// Returns a pointer to the Stub factory. 00295 TAO_Stub_Factory *stub_factory (void); 00296 00297 /// Returns a pointer to the endpoint selector factory. 00298 TAO_Endpoint_Selector_Factory *endpoint_selector_factory (void); 00299 00300 //@} 00301 00302 /// Sets the value of 00303 /// TAO_ORB_Core::thread_lane_resources_manager_factory_name_ 00304 static void set_thread_lane_resources_manager_factory (const char * 00305 thread_lane_resources_manager_factory_name); 00306 00307 /// Sets the value of TAO_ORB_Core::collocation_resolver_name_ 00308 static void set_collocation_resolver (const char *collocation_resolver_name); 00309 00310 /// Sets the value of TAO_ORB_Core::stub_factory_name_ 00311 static void set_stub_factory (const char *stub_factory_name); 00312 00313 /// Sets the value of TAO_ORB_Core::resource_factory_ 00314 static void set_resource_factory (const char *resource_factory_name); 00315 00316 /** Sets the value of TAO_ORB_Core::gui_resource_factory_. 00317 * 00318 * Sets the value of gui_resource_factory in TSS. ORB_Core is responsible 00319 * for releasing this factory if needed. 00320 */ 00321 static void set_gui_resource_factory (TAO::GUIResource_Factory *gui_factory); 00322 00323 /// Sets the value of TAO_ORB_Core::protocols_hooks_ 00324 static void set_protocols_hooks (const char *protocols_hooks_name); 00325 00326 /// Sets the value of TAO_ORB_Core::endpoint_selector_factory_ 00327 static void set_endpoint_selector_factory ( 00328 const char *endpoint_selector_factory_name); 00329 00330 /// Sets the name of the POA factory and the dynamic service 00331 /// configurator directive to load it if needed. 00332 static void set_poa_factory (const char *poa_factory_name, 00333 const char *poa_factory_directive); 00334 00335 /// Access the POA factory name. 00336 static const ACE_CString &poa_factory_name (void); 00337 00338 /// Gets the value of TAO_ORB_Core::protocols_hooks__ 00339 TAO_Protocols_Hooks * get_protocols_hooks (void); 00340 00341 /// Sets the value of TAO_ORB_Core::dynamic_adapter_name_. 00342 static void dynamic_adapter_name (const char *name); 00343 00344 /// Gets the value of TAO_ORB_Core::dynamic_adapter_name_. 00345 static const char *dynamic_adapter_name (void); 00346 00347 /// Sets the value of TAO_ORB_Core::ifr_client_adapter_name_. 00348 static void ifr_client_adapter_name (const char *name); 00349 00350 /// Gets the value of TAO_ORB_Core::ifr_client_adapter_name_. 00351 static const char *ifr_client_adapter_name (void); 00352 00353 /// Sets the value of TAO_ORB_Core::typecodefactory_adapter_name_. 00354 static void typecodefactory_adapter_name (const char *name); 00355 00356 /// Gets the value of TAO_ORB_Core::typecodefactory_adapter_name_. 00357 static const char *typecodefactory_adapter_name (void); 00358 00359 /// Sets the value of TAO_ORB_Core::iorinterceptor_adapter_factory_name_. 00360 static void iorinterceptor_adapter_factory_name (const char *name); 00361 00362 /// Gets the value of TAO_ORB_Core::iorinterceptor_adapter_factory_name_. 00363 static const char *iorinterceptor_adapter_factory_name (void); 00364 00365 /// Sets the value of TAO_ORB_Core::valuetype_adapter_factory_name. 00366 static void valuetype_adapter_factory_name (const char *name); 00367 00368 /// Gets the value of TAO_ORB_Core::valuetype_adapter_factory_name. 00369 static const char *valuetype_adapter_factory_name (void); 00370 00371 00372 /// See if we have a collocated address, if yes, return the POA 00373 /// associated with the address. 00374 int is_collocated (const TAO_MProfile& mprofile); 00375 00376 /// This allocator is always TSS and has no locks. It is intended 00377 /// for allocating the ACE_Data_Blocks used in *outgoing* CDR 00378 /// streams. 00379 ACE_Allocator *output_cdr_dblock_allocator (void); 00380 00381 /// This allocator is always TSS and has no locks. It is intended 00382 /// for allocating the buffers used in *outgoing* CDR streams. 00383 ACE_Allocator *output_cdr_buffer_allocator (void); 00384 00385 /// This allocator is always TSS and has no locks. It is intended 00386 /// for allocating the ACE_Data_Blocks used in *outgoing* CDR 00387 /// streams. 00388 ACE_Allocator *output_cdr_msgblock_allocator (void); 00389 00390 /// This allocator is global, may or may not have locks. It is 00391 /// intended for allocating the ACE_Data_Blocks used in *incoming* 00392 /// CDR streams. 00393 ACE_Allocator *input_cdr_dblock_allocator (void); 00394 00395 /// This allocator is always global and has no locks. It is intended 00396 /// for allocating the buffers used in *incoming* CDR streams. 00397 ACE_Allocator *input_cdr_buffer_allocator (void); 00398 00399 /// This allocator is always global and has no locks. It is intended 00400 /// for allocating the buffers used in *incoming* CDR streams. 00401 ACE_Allocator *input_cdr_msgblock_allocator (void); 00402 00403 /// This allocator is always global and has no locks. It is intended 00404 /// for allocating the buffers used to queue messages in 00405 /// transports. 00406 ACE_Allocator *transport_message_buffer_allocator (void); 00407 00408 /// The Message Blocks used for input CDRs must have appropiate 00409 /// locking strategies. 00410 ACE_Data_Block *create_input_cdr_data_block (size_t size); 00411 00412 /// Return the locking strategy used for the data blocks. 00413 ACE_Lock *locking_strategy (void); 00414 00415 #if (TAO_HAS_CORBA_MESSAGING == 1) 00416 00417 /// Accessor method for the default_policies_ 00418 TAO_Policy_Set *get_default_policies (void); 00419 00420 /// Get a policy. First, check the ORB-level Policy Manager, then 00421 /// check the ORB defaults. 00422 CORBA::Policy_ptr get_policy (CORBA::PolicyType type 00423 ACE_ENV_ARG_DECL); 00424 00425 /// Get a policy. First, check the thread current, then check the 00426 /// ORB-level Policy Manager, then check the ORB defaults. 00427 CORBA::Policy_ptr get_policy_including_current (CORBA::PolicyType type 00428 ACE_ENV_ARG_DECL); 00429 00430 /// Get a cached policy. First, check the ORB-level Policy Manager, 00431 /// then check the ORB defaults. 00432 CORBA::Policy_ptr get_cached_policy (TAO_Cached_Policy_Type type 00433 ACE_ENV_ARG_DECL); 00434 00435 /// Get a cached policy. First, check the thread current, then 00436 /// check the ORB-level Policy Manager, then check the ORB defaults. 00437 CORBA::Policy_ptr get_cached_policy_including_current ( 00438 TAO_Cached_Policy_Type type 00439 ACE_ENV_ARG_DECL); 00440 00441 #endif /* TAO_HAS_CORBA_MESSAGING == 1 */ 00442 00443 /** 00444 * The thread has a default environment to simplify porting between 00445 * platforms that support native C++ exceptions and those that 00446 * don't. This is a TSS resource (always), but with a twist: if the 00447 * user creates a new environment the old one is "pushed" (actually 00448 * the new one remembers it), eventually the new environment 00449 * destructor pops itself from the stack and we recover the old 00450 * environment. 00451 * @par 00452 * This means that if the user create a new environment and somebody 00453 * calls a function using the default one the exception will still 00454 * be received in the environment created by the user. 00455 * The only drawback is that environments life time must nest 00456 * properly, this shouldn't be a problem because environments are 00457 * usually created on the stack, but, the spec allows their creation 00458 * on the heap and/or as class members; we need to investigate the 00459 * tradeoffs and take a decision. 00460 */ 00461 //@{ 00462 CORBA::Environment *default_environment (void) const; 00463 void default_environment (CORBA::Environment*); 00464 //@} 00465 00466 #if (TAO_HAS_CORBA_MESSAGING == 1) 00467 00468 /// Return the Policy_Manager for this ORB. 00469 TAO_Policy_Manager *policy_manager (void); 00470 00471 /// Accesors to the policy current, this object should be kept in 00472 /// TSS storage. The POA has to reset the policy current object on 00473 /// every upcall. 00474 TAO_Policy_Current &policy_current (void); 00475 00476 #endif /* TAO_HAS_CORBA_MESSAGING == 1 */ 00477 00478 /// Invoke the timeout hook if present. 00479 /** 00480 * The timeout hook is used to determine if the timeout policy is 00481 * set and with what value. If the ORB is compiled without support 00482 * for Messaging this feature does not take effect 00483 * \param has_timeout returns 0 if there is no timeout policy set. 00484 * \param time_value returns the timeout value in effect for the object, 00485 * thread and current ORB. 00486 */ 00487 void call_timeout_hook (TAO_Stub *stub, 00488 bool &has_timeout, 00489 ACE_Time_Value &time_value); 00490 00491 /// Define the Timeout_Hook signature 00492 typedef void (*Timeout_Hook) (TAO_ORB_Core *, 00493 TAO_Stub *, 00494 bool&, 00495 ACE_Time_Value&); 00496 00497 static void set_timeout_hook (Timeout_Hook hook); 00498 00499 /// Invoke the timeout hook if present. 00500 /** 00501 * The timeout hook is used to determine if the timeout policy is 00502 * set and with what value. If the ORB is compiled without support 00503 * for Messaging this feature does not take effect 00504 * \param has_timeout returns 0 if there is no timeout policy set. 00505 * \param time_value returns the timeout value in effect for the object, 00506 * thread and current ORB. 00507 */ 00508 void connection_timeout (TAO_Stub *stub, 00509 bool &has_timeout, 00510 ACE_Time_Value &time_value); 00511 00512 /// Define the Timeout_Hook signature 00513 /** 00514 * The connection timeout hook was originally defined to allow the 00515 * TAO Messaging code to be factored out of the core TAO library and 00516 * placed in to an optional library. Since then, a new invocation 00517 * endpoint selector, the optimised connection endpoint selector 00518 * (see Strategies/OC_Endpoint_Selector.h) reused this connection 00519 * timeout hook. However, this set up a problem when both the 00520 * Messaging library and OCES are being used in the same 00521 * application. 00522 * 00523 * The solution was to add a new connection timeout hook attribute 00524 * (see alt_connection_timeout_hook_ below). This method now checks 00525 * to see if the connection timeout hook is already set, and if so 00526 * assigns the supplied hook value to the alternate connection 00527 * timeout hook. This functionality has a side-effect of assuming 00528 * that hooks are NEVER unloaded or actively replaced. IOW, no one 00529 * will call this method with a 0 or some other pointer value to 00530 * replace an existing hook. 00531 * 00532 * If such functionality as unloading a hook pointer is required, 00533 * then this method must be extended to give some kind of identity 00534 * for the hook. Additional changes to the definition of the hook 00535 * will also be necessary to support such identity and manipulation. 00536 */ 00537 static void connection_timeout_hook (Timeout_Hook hook); 00538 00539 void call_sync_scope_hook (TAO_Stub *stub, 00540 bool &has_synchronization, 00541 Messaging::SyncScope &scope); 00542 00543 #if (TAO_HAS_BUFFERING_CONSTRAINT_POLICY == 1) 00544 00545 TAO::Transport_Queueing_Strategy &get_transport_queueing_strategy ( 00546 TAO_Stub *stub, 00547 Messaging::SyncScope &scope); 00548 00549 #endif /* TAO_HAS_BUFFERING_CONSTRAINT_POLICY == 1 */ 00550 00551 typedef void (*Sync_Scope_Hook) (TAO_ORB_Core *, 00552 TAO_Stub *, 00553 bool &, 00554 Messaging::SyncScope &); 00555 00556 static void set_sync_scope_hook (Sync_Scope_Hook hook); 00557 00558 /// Handle to the factory for protocols_hooks_.. 00559 TAO_Protocols_Hooks *protocols_hooks_; 00560 00561 /// Obtain the TSS resources of this orb. 00562 TAO_ORB_Core_TSS_Resources* get_tss_resources (void); 00563 00564 /// Obtain the TSS resource in the given slot. 00565 void* get_tss_resource (size_t slot_id); 00566 00567 /// Set the TSS resource at the given slot. 00568 /// Returns 0 on success, and -1 on failure. 00569 int set_tss_resource (size_t slot_id, void *); 00570 00571 /// Register a TSS cleanup function. The slot ID for the 00572 /// corresponding ORB core TSS resource is returned by the reference 00573 /// argument. This method return 0 on success, and -1 on failure. 00574 int add_tss_cleanup_func (ACE_CLEANUP_FUNC cleanup, 00575 size_t &slot_id); 00576 00577 /// Return the underlying TSS cleanup function registry. 00578 TAO_Cleanup_Func_Registry *tss_cleanup_funcs (void); 00579 00580 /// Get access to the leader_follower class. 00581 TAO_Leader_Follower &leader_follower (void); 00582 00583 /// Get access to the leader follower strategy. 00584 TAO_LF_Strategy &lf_strategy (void); 00585 00586 /// Get access to the thread lane resources. 00587 TAO_Thread_Lane_Resources &lane_resources (void); 00588 00589 /// Run the event loop. 00590 int run (ACE_Time_Value *tv, 00591 int perform_work 00592 ACE_ENV_ARG_DECL); 00593 00594 /// End the event loop 00595 void shutdown (CORBA::Boolean wait_for_completion 00596 ACE_ENV_ARG_DECL); 00597 00598 /// Get the shutdown flag value 00599 int has_shutdown (void); 00600 00601 /// Shutdown the ORB and free resources 00602 void destroy (ACE_ENV_SINGLE_ARG_DECL); 00603 00604 /// Check if ORB has shutdown. If it has, throw an exception. 00605 void check_shutdown (ACE_ENV_SINGLE_ARG_DECL); 00606 00607 /// Returns the <timeout> value used by the server threads to poll 00608 /// the shutdown flag. If the return value is zero then the server 00609 /// threads block forever. 00610 int thread_per_connection_timeout (ACE_Time_Value &timeout) const; 00611 00612 /// Makes sure that the ORB is open and then creates a TAO_Stub 00613 /// based on the endpoint. 00614 TAO_Stub *create_stub_object (TAO_MProfile &mprofile, 00615 const char *type_id, 00616 CORBA::PolicyList *policy_list 00617 ACE_ENV_ARG_DECL); 00618 00619 /// Factory method that create the "right" Stub depending on 00620 /// wheather RTCORBA is loaded or not. The factory used to create 00621 /// the stub, is loaded at ORB initialization, and its type depends 00622 /// on the fact that RTCORBA is being used or not. 00623 TAO_Stub *create_stub (const char *repository_id, 00624 const TAO_MProfile &profiles 00625 ACE_ENV_ARG_DECL); 00626 00627 /// Create a new object, use the adapter registry to create a 00628 /// collocated object, if not possible then create a regular 00629 /// object. 00630 CORBA::Object_ptr create_object (TAO_Stub *the_stub); 00631 00632 /// Initialize a new object, use the adapter registry to initialize a 00633 /// collocated object, if not possible then initialize a regular 00634 /// object. 00635 /// NOTE: Why would this method be required? The answer is if the 00636 /// user decides to use lazy initialization of CORBA object, then 00637 /// this is the route that we have to take to do the 00638 /// initialization. 00639 CORBA::Long initialize_object (TAO_Stub *the_stub, 00640 CORBA::Object_ptr obj); 00641 00642 /// Reinitialise a stub after the effective profile has changed. 00643 /// This will happen after a location forward has been received 00644 /// or if a location forward supplied new target subsequently fails. 00645 CORBA::Long reinitialize_object (TAO_Stub *stub); 00646 00647 /// Return ORBid string. 00648 const char *orbid (void) const; 00649 00650 /// Set/Get the IOR of the Implementation Repository service. 00651 //@{ 00652 CORBA::Object_ptr implrepo_service (void); 00653 void implrepo_service (const CORBA::Object_ptr ir); 00654 //@} 00655 00656 /// Do we attempt to register with the Implementation Repository 00657 CORBA::Boolean use_implrepo (void); 00658 00659 /// Do we put the ImR's endpoints into persistent object references we create 00660 CORBA::Boolean imr_endpoints_in_ior (void); 00661 00662 /// Resolve the TypeCodeFactory DLL. 00663 CORBA::Object_ptr resolve_typecodefactory (ACE_ENV_SINGLE_ARG_DECL); 00664 00665 #if TAO_HAS_INTERCEPTORS == 1 00666 /// Resolve the PICurrent. 00667 CORBA::Object_ptr resolve_picurrent (ACE_ENV_SINGLE_ARG_DECL); 00668 #endif /* TAO_HAS_INTERCEPTORS == 1 */ 00669 00670 /// Resolve POA Current. 00671 CORBA::Object_ptr resolve_poa_current (ACE_ENV_SINGLE_ARG_DECL); 00672 00673 /// Resolve the CodecFactory DLL. 00674 CORBA::Object_ptr resolve_codecfactory (ACE_ENV_SINGLE_ARG_DECL); 00675 00676 /// Resolve the Dynamic Any Factory 00677 CORBA::Object_ptr resolve_dynanyfactory (ACE_ENV_SINGLE_ARG_DECL); 00678 00679 /// Resolve the IOR Manipulation reference for this ORB. 00680 CORBA::Object_ptr resolve_ior_manipulation (ACE_ENV_SINGLE_ARG_DECL); 00681 00682 /// Resolve the IOR Table reference for this ORB. 00683 CORBA::Object_ptr resolve_ior_table (ACE_ENV_SINGLE_ARG_DECL); 00684 00685 /// Resolve an initial reference via the -ORBInitRef and 00686 // -ORBDefaultInitRef options. 00687 CORBA::Object_ptr resolve_rir (const char *name 00688 ACE_ENV_ARG_DECL); 00689 00690 /// Resolve the RT ORB reference for this ORB. 00691 CORBA::Object_ptr resolve_rt_orb (void); 00692 00693 /// Resolve the RT Current flyweight for this ORB. 00694 /// Return server_id string. 00695 const char *server_id (void) const; 00696 00697 /// List all the service known by the ORB 00698 CORBA::ORB_ObjectIdList *list_initial_references ( 00699 ACE_ENV_SINGLE_ARG_DECL_NOT_USED 00700 ); 00701 00702 /// Reference counting... 00703 CORBA::ULong _incr_refcnt (void); 00704 CORBA::ULong _decr_refcnt (void); 00705 00706 /// Register the handle of an open connection with the ORB Core 00707 /// handle set. This handle set will be used to explicitly remove 00708 /// corresponding event handlers from the reactor. 00709 int register_handle (ACE_HANDLE handle); 00710 00711 /// Remove <handle> from the ORB Core's handle set so that it 00712 /// isn't included in the set that is passed to the reactor upon ORB 00713 /// destruction. 00714 int remove_handle (ACE_HANDLE handle); 00715 00716 /** 00717 * @name ORB Core Service Hooks 00718 * 00719 * These methods would represent the hooks in the ORB Core. These 00720 * hooks would be used to call back on the services or other 00721 * features that are dynamically loaded. 00722 */ 00723 //@{ 00724 /** 00725 * The loaded service in the ORB_Core would determine if the profile 00726 * selection is going to be made by the services or not. If the 00727 * services do make the selection they would return the selected 00728 * profile through <profile>. 00729 */ 00730 CORBA::Boolean service_profile_selection (TAO_MProfile &mprofile, 00731 TAO_Profile *&profile); 00732 00733 /** 00734 * The loaded service in the ORB_Core would determine if the profile 00735 * reselection is going to be made by the services or not. If the 00736 * services do make the reselection they would return the selected 00737 * profile through <profile>. The reselction is for the 00738 * multi-profile IORS. 00739 */ 00740 CORBA::Boolean service_profile_reselection (TAO_Stub *stub, 00741 TAO_Profile *&profile); 00742 00743 /// Reset the flags in the loaded services. 00744 void reset_service_profile_flags (void); 00745 00746 /** 00747 * The loaded service would determine if the CORBA::Object_ptr is 00748 * actually nil or not. This would be useful to accomodate new 00749 * enhanced definitions as defined by the service specification. 00750 */ 00751 CORBA::Boolean object_is_nil (CORBA::Object_ptr object); 00752 00753 /// Hook for the services to determine whether the profiles are 00754 /// equivalent or not. 00755 /** 00756 * For details on how this is used please see the FT service 00757 */ 00758 TAO_Service_Callbacks::Profile_Equivalence is_profile_equivalent ( 00759 const TAO_Profile *this_p, 00760 const TAO_Profile *that_p); 00761 00762 /// Hook for the services to determine the <hash> value of a 00763 /// profile. 00764 /** 00765 * For details on how this is used please see the FT service 00766 */ 00767 CORBA::ULong hash_service (TAO_Profile *this_p, 00768 CORBA::ULong max); 00769 00770 /// Call the service layers with the Service Context to check 00771 /// whether they would like to add something to the list. 00772 void service_context_list (TAO_Stub *stub, 00773 TAO_Service_Context &service_context, 00774 CORBA::Boolean retstart 00775 ACE_ENV_ARG_DECL); 00776 00777 /// Return a reference to the Fault Tolerant service object. 00778 TAO_Fault_Tolerance_Service &fault_tolerance_service (void); 00779 00780 /// Raise a comm failure exception if a service is not loaded, else 00781 /// delegate to the service to see what the service has to do for 00782 /// this case. 00783 TAO::Invocation_Status service_raise_comm_failure ( 00784 IOP::ServiceContextList &clist, 00785 TAO_Profile *profile 00786 ACE_ENV_ARG_DECL); 00787 00788 /// Raise a transient failure exception if a service is not loaded, 00789 /// else delegate to the service to see what the service has to do 00790 /// for this case. 00791 TAO::Invocation_Status service_raise_transient_failure ( 00792 IOP::ServiceContextList &clist, 00793 TAO_Profile *profile 00794 ACE_ENV_ARG_DECL); 00795 00796 //@} 00797 00798 /** 00799 * @name Portable Interceptor Related Methods 00800 * 00801 * These are support methods for interceptor registration and 00802 * interceptor set (an array) access, in addition to PICurrent 00803 * access. 00804 */ 00805 //@{ 00806 #if TAO_HAS_INTERCEPTORS == 1 00807 00808 /// Return a pointer to the cached TAO::PICurrent object. 00809 CORBA::Object_ptr pi_current (void); 00810 00811 /// Set the pointer to the cached TAO::PICurrent object. 00812 void pi_current (CORBA::Object_ptr current); 00813 00814 /// Register a client request interceptor. 00815 void add_interceptor ( 00816 PortableInterceptor::ClientRequestInterceptor_ptr interceptor 00817 ACE_ENV_ARG_DECL); 00818 00819 /// Register a server request interceptor. 00820 void add_interceptor ( 00821 PortableInterceptor::ServerRequestInterceptor_ptr interceptor 00822 ACE_ENV_ARG_DECL); 00823 00824 /// Register a client request interceptor with policies. 00825 void add_interceptor ( 00826 PortableInterceptor::ClientRequestInterceptor_ptr interceptor, 00827 const CORBA::PolicyList& policies 00828 ACE_ENV_ARG_DECL); 00829 00830 /// Register a server request interceptor with policies. 00831 void add_interceptor ( 00832 PortableInterceptor::ServerRequestInterceptor_ptr interceptor, 00833 const CORBA::PolicyList& policies 00834 ACE_ENV_ARG_DECL); 00835 00836 /// Get the Client Request Interceptor adapter. 00837 /// Will not create a new one if not available yet. 00838 TAO::ClientRequestInterceptor_Adapter *clientrequestinterceptor_adapter (void); 00839 00840 /// Get the Server Request Interceptor adapter. 00841 /// Will not create a new one if not available yet. 00842 TAO::ServerRequestInterceptor_Adapter *serverrequestinterceptor_adapter (void); 00843 00844 #endif /* TAO_HAS_INTERCEPTORS */ 00845 00846 /// Register an IOR interceptor. 00847 void add_interceptor ( 00848 PortableInterceptor::IORInterceptor_ptr interceptor 00849 ACE_ENV_ARG_DECL); 00850 //@} 00851 00852 /// Return the valuetype adapter 00853 TAO_Valuetype_Adapter *valuetype_adapter (void); 00854 00855 /// Get the IOR Interceptor adapter. If not created, this method will try 00856 /// to create one. 00857 TAO_IORInterceptor_Adapter *ior_interceptor_adapter (void); 00858 00859 /// Set and Get methods to indicate whether a BiDir IIOP policy has 00860 /// been set in the POA. 00861 /// @note At present, the value will be true even if one of the POA's 00862 /// is set with the Bi Dir GIOP policy. 00863 CORBA::Boolean bidir_giop_policy (void); 00864 void bidir_giop_policy (CORBA::Boolean); 00865 00866 /// Return the table that maps object key/name to de-stringified 00867 /// object reference. It is needed for supporting local objects in 00868 /// the resolve_initial_references() mechanism. 00869 TAO_Object_Ref_Table &object_ref_table (void); 00870 00871 /// Acceessor to the table that stores the object_keys. 00872 TAO::ObjectKey_Table &object_key_table (void); 00873 00874 /// Return the current request dispatcher strategy. 00875 TAO_Request_Dispatcher *request_dispatcher (void); 00876 00877 /// Set a new request dispatcher. The ORB Core retains ownership 00878 /// of the request dispatcher once it gets it. Currently, this only 00879 /// gets called at initialization. 00880 void request_dispatcher (TAO_Request_Dispatcher *rd); 00881 00882 /// Call the libraries to handover the validators if they havent 00883 /// registered yet with the list of validators. 00884 void load_policy_validators (TAO_Policy_Validator &validator 00885 ACE_ENV_ARG_DECL); 00886 00887 /// Return the flushing strategy 00888 /** 00889 * The flushing strategy is created by the resource factory, and it 00890 * is used by the ORB to control the mechanism used to flush the 00891 * outgoing data queues. 00892 * The flushing strategies are stateless, therefore, there is only 00893 * one per ORB. 00894 */ 00895 TAO_Flushing_Strategy *flushing_strategy (void); 00896 00897 /// Get Code Set Manager 00898 TAO_Codeset_Manager *codeset_manager (void); 00899 00900 typedef ACE_Array_Map<ACE_CString, ACE_CString> InitRefMap; 00901 00902 /// Return a pointer to the -ORBInitRef map. 00903 InitRefMap * init_ref_map (void); 00904 00905 /// Set the ORB related to the orb_id as the default ORB and not the 00906 /// ORB that is first binded in the ORB Table 00907 void set_default (const char * orb_id); 00908 00909 /// Choose to be not a default ORB when there is more than one ORB. 00910 void not_default (const char * orb_id); 00911 00912 /// This strategy is the default, no explicit queueing and no explicit 00913 /// flush 00914 TAO::Transport_Queueing_Strategy &default_transport_queueing_strategy (void); 00915 00916 /// Verify condition for permanent forward is given, 00917 /// both parameters must provide group attributes. 00918 CORBA::Boolean is_permanent_forward_condition 00919 (const CORBA::Object_ptr obj, 00920 const TAO_Service_Context &service_context); 00921 00922 /// Configuration accessor method 00923 ACE_Service_Gestalt* configuration () const; 00924 00925 /// Get outgoing fragmentation strategy. 00926 auto_ptr<TAO_GIOP_Fragmentation_Strategy> 00927 fragmentation_strategy (TAO_Transport * transport); 00928 00929 protected: 00930 00931 /// Destructor is protected since the ORB Core is a reference 00932 /// counted object. 00933 ~TAO_ORB_Core (void); 00934 00935 /// Initialize the guts of the ORB Core. It is intended that this be 00936 /// called by <CORBA::ORB_init>. 00937 int init (int &argc, char **argv ACE_ENV_ARG_DECL); 00938 00939 /// Final termination hook, typically called by CORBA::ORB's 00940 /// destructor. 00941 int fini (void); 00942 00943 /// Routine that creates a ACE_Data_Block given the lock and allocators. 00944 ACE_Data_Block *create_data_block_i (size_t size, 00945 ACE_Allocator *buffer_allocator, 00946 ACE_Allocator *dblock_allocator, 00947 ACE_Lock *lock); 00948 00949 /// Obtain and cache the typecode factory object reference. 00950 void resolve_typecodefactory_i (ACE_ENV_SINGLE_ARG_DECL); 00951 00952 /// Obtain and cache the poa current. 00953 void resolve_poa_current_i (ACE_ENV_SINGLE_ARG_DECL); 00954 00955 #if TAO_HAS_INTERCEPTORS == 1 00956 /// Obtain and cache the picurrent factory object reference. 00957 void resolve_picurrent_i (ACE_ENV_SINGLE_ARG_DECL); 00958 00959 /// Get the Client Request Interceptor adapter. 00960 /// If not created, this method will try to create one if needed. 00961 TAO::ClientRequestInterceptor_Adapter *clientrequestinterceptor_adapter_i (void); 00962 00963 /// Get the Server Request Interceptor adapter. 00964 /// If not created, this method will try to create one if needed. 00965 TAO::ServerRequestInterceptor_Adapter *serverrequestinterceptor_adapter_i (void); 00966 00967 #endif /* TAO_HAS_INTERCEPTORS */ 00968 00969 /// Obtain and cache the codec factory object reference. 00970 void resolve_codecfactory_i (ACE_ENV_SINGLE_ARG_DECL); 00971 00972 /// Obtain and cache the dynamic any factory object reference. 00973 void resolve_dynanyfactory_i (ACE_ENV_SINGLE_ARG_DECL); 00974 00975 /// Obtain and cache the IORManipulation factory object reference. 00976 void resolve_iormanipulation_i (ACE_ENV_SINGLE_ARG_DECL); 00977 00978 /// Search the Dynamic service list for well known services that has 00979 /// callbacks which can be dynamically loaded. 00980 void services_callbacks_init (void); 00981 00982 /// Helper method that invokes Interceptor::destroy() on all 00983 /// registered interceptors when ORB::destroy() is called. Prevents 00984 /// exceptions from propagating up the call chain. 00985 void destroy_interceptors (ACE_ENV_SINGLE_ARG_DECL); 00986 00987 /// Pointer to the list of protocol loaded into this ORB instance. 00988 /// Helper method to hold the common code part for -ORBEndpoint and 00989 /// -ORBListenEndpoint options. 00990 int set_endpoint_helper (const ACE_CString &lane, 00991 const ACE_CString &endpoints 00992 ACE_ENV_ARG_DECL); 00993 00994 /// Return pointer to the policy factory registry associated with 00995 /// this ORB core. 00996 TAO::PolicyFactory_Registry_Adapter *policy_factory_registry_i (void); 00997 00998 /// Return pointer to the orb initializer registry associated with 00999 /// this ORB core. 01000 TAO::ORBInitializer_Registry_Adapter *orbinitializer_registry_i (void); 01001 01002 /// Common code from ::initialize_object and ::reinitialize_object 01003 CORBA::Long initialize_object_i (TAO_Stub *the_stub, 01004 const TAO_MProfile& mprofile); 01005 01006 private: 01007 01008 /// The ORB Core should not be copied. 01009 //@{ 01010 TAO_ORB_Core(const TAO_ORB_Core&); 01011 void operator=(const TAO_ORB_Core&); 01012 //@} 01013 01014 /// Obtain and cache the dynamic any factory object reference. 01015 void resolve_ior_table_i (ACE_ENV_SINGLE_ARG_DECL); 01016 01017 /// Checks to see whether collocation optimizations have to be 01018 /// applied on objects in the @a other_orb 01019 CORBA::Boolean is_collocation_enabled (TAO_ORB_Core *other_orb, 01020 const TAO_MProfile &mp); 01021 01022 #if (TAO_HAS_BUFFERING_CONSTRAINT_POLICY == 1) 01023 01024 /// This strategy will buffer messages. 01025 //@{ 01026 TAO::Transport_Queueing_Strategy &eager_transport_queueing_strategy (void); 01027 TAO::Transport_Queueing_Strategy &delayed_transport_queueing_strategy (void); 01028 TAO::Transport_Queueing_Strategy &flush_transport_queueing_strategy (void); 01029 //@} 01030 01031 #endif /* TAO_HAS_BUFFERING_CONSTRAINT_POLICY == 1 */ 01032 01033 bool use_local_memory_pool_; 01034 01035 protected: 01036 01037 /// Synchronize internal state... 01038 TAO_SYNCH_MUTEX lock_; 01039 01040 TAO_Thread_Lane_Resources_Manager *thread_lane_resources_manager_; 01041 01042 TAO_Collocation_Resolver *collocation_resolver_; 01043 01044 TAO_Stub_Factory *stub_factory_; 01045 01046 TAO_ProtocolFactorySet *protocol_factories_; 01047 01048 /// The cached IOR for the Implementation Repository. 01049 // @@ If this is a _var, where should it get deleted? (brunsch) 01050 CORBA::Object_ptr implrepo_service_; 01051 01052 /// Flag for whether the implrepo support is enabled or not. 01053 int use_implrepo_; 01054 01055 /// Flag for whether to put the ImR endpoints into our object refs. 01056 int imr_endpoints_in_ior_; 01057 01058 /// The cached IOR for the TypeCodeFactory DLL. 01059 CORBA::Object_ptr typecode_factory_; 01060 01061 /// The cached IOR for the CodecFactory DLL. 01062 CORBA::Object_ptr codec_factory_; 01063 01064 /// The cached object reference for the DynAnyFactory. 01065 CORBA::Object_ptr dynany_factory_; 01066 01067 /// The cached object reference for the IORManipulataion. 01068 CORBA::Object_ptr ior_manip_factory_; 01069 01070 /// The cached object reference for the IORTable. 01071 CORBA::Object_ptr ior_table_; 01072 01073 /// The cached object reference for the RTCORBA::RTORB. 01074 CORBA::Object_var rt_orb_; 01075 01076 /// The cached object reference for the RTCORBA::Current interface. 01077 CORBA::Object_var rt_current_; 01078 01079 /** 01080 * @note 01081 * Should we keep a single ORB pointer? This is good because 01082 * multiple calls to ORB_init() with the same ORBid can use the same 01083 * object, but maybe don't want so much coupling. 01084 * 01085 * Pointer to the ORB. 01086 */ 01087 CORBA::ORB_ptr orb_; 01088 01089 /// Object reference to the root POA. It will eventually be the 01090 /// object reference returned by calls to 01091 /// CORBA::ORB::resolve_initial_references ("RootPOA"). 01092 CORBA::Object_var root_poa_; 01093 01094 /// Parameters used by the ORB. 01095 TAO_ORB_Parameters orb_params_; 01096 01097 /// Return InitRefMap to find if a particular object id is present. 01098 InitRefMap init_ref_map_; 01099 01100 /// Table that maps object key/name to (de-stringified) object 01101 /// reference. It is needed for supporting local objects in the 01102 /// resolve_initial_references() mechanism. 01103 TAO_Object_Ref_Table object_ref_table_; 01104 01105 /// Table that stores the object key instead of caching one per-profile. 01106 TAO::ObjectKey_Table object_key_table_; 01107 01108 /// The ORBid for this ORB. 01109 char *orbid_; 01110 01111 /// Handle to the factory for resource information.. 01112 TAO_Resource_Factory *resource_factory_; 01113 01114 /// The server_id_ that was passed via -ORBServerId option 01115 ACE_CString server_id_; 01116 01117 /// Handle to the factory for Client-side strategies. 01118 TAO_Client_Strategy_Factory *client_factory_; 01119 01120 /// Handle to the factory for Server-side strategies. 01121 TAO_Server_Strategy_Factory *server_factory_; 01122 01123 /** 01124 * @name Service Level Hooks 01125 */ 01126 //@{ 01127 01128 /// Fault Tolerant service hook. 01129 TAO_Fault_Tolerance_Service ft_service_; 01130 01131 //@} 01132 01133 /// TRUE if we want to take advantage of collocation optimization in 01134 /// this ORB. 01135 CORBA::Boolean opt_for_collocation_; 01136 01137 /// TRUE if we want to consider all ORBs in this address space 01138 /// collocated. 01139 CORBA::Boolean use_global_collocation_; 01140 01141 /// Default collocation policy. This should never be ORB_CONTROL. 01142 CORBA::ULong collocation_strategy_; 01143 01144 01145 #if (TAO_HAS_CORBA_MESSAGING == 1) 01146 01147 /// The Policy_Manager for this ORB. 01148 TAO_Policy_Manager *policy_manager_; 01149 01150 /// The default policies. 01151 TAO_Policy_Set *default_policies_; 01152 01153 /// Policy current. 01154 TAO_Policy_Current *policy_current_; 01155 01156 #endif /* TAO_HAS_CORBA_MESSAGING == 1 */ 01157 01158 /// The request dispatching strategy. 01159 TAO_Request_Dispatcher *request_dispatcher_; 01160 01161 /** 01162 * POA current. 01163 */ 01164 CORBA::Object_var poa_current_; 01165 01166 /// The list of Adapters used in this ORB. 01167 TAO_Adapter_Registry adapter_registry_; 01168 01169 /// An optimization for the POA. 01170 TAO_Adapter *poa_adapter_; 01171 01172 /// The Thread Manager 01173 ACE_Thread_Manager tm_; 01174 01175 /// The data block reference counts are locked using this mutex 01176 ACE_Lock_Adapter<TAO_SYNCH_MUTEX> data_block_lock_; 01177 01178 /// TSS Object cleanup functions. These correspond to the TSS 01179 /// objects stored in TAO's TSS resources. 01180 TAO_Cleanup_Func_Registry tss_cleanup_funcs_; 01181 01182 /// This is where the tss resources for this ORB are stored. 01183 ACE_TSS_TYPE (TAO_ORB_Core_TSS_Resources) tss_resources_; 01184 01185 /// Flag which denotes that the ORB has been shutdown. 01186 int has_shutdown_; 01187 01188 /// The value of the timeout if the flag above is not zero. 01189 //@{ 01190 int thread_per_connection_use_timeout_; 01191 ACE_Time_Value thread_per_connection_timeout_; 01192 //@} 01193 01194 /// Mutual exclusion for calling open. 01195 TAO_SYNCH_MUTEX open_lock_; 01196 01197 /// Flag which denotes that the open method was called. 01198 int open_called_; 01199 01200 TAO_Endpoint_Selector_Factory *endpoint_selector_factory_; 01201 01202 #if (TAO_HAS_BUFFERING_CONSTRAINT_POLICY == 1) 01203 01204 /// This strategy will buffer messages. 01205 TAO::Transport_Queueing_Strategy *eager_transport_queueing_strategy_; 01206 01207 /// This strategy will buffer messages. 01208 TAO::Transport_Queueing_Strategy *delayed_transport_queueing_strategy_; 01209 01210 /// This strategy will not queue by default, but will flush the queue 01211 /// each time 01212 TAO::Transport_Queueing_Strategy *flush_transport_queueing_strategy_; 01213 01214 #endif /* TAO_HAS_BUFFERING_CONSTRAINT_POLICY == 1 */ 01215 01216 /// This strategy will not queue by default and not flush 01217 TAO::Transport_Queueing_Strategy *default_transport_queueing_strategy_; 01218 01219 /// Number of outstanding references to this object. 01220 CORBA::ULong refcount_; 01221 01222 /// Registry containing all registered policy factories. 01223 TAO::PolicyFactory_Registry_Adapter *policy_factory_registry_; 01224 01225 /// Registry containing all orb initializers 01226 TAO::ORBInitializer_Registry_Adapter *orbinitializer_registry_; 01227 01228 #if (TAO_HAS_INTERCEPTORS == 1) 01229 /// Cached pointer/reference to the PICurrent object. 01230 /** 01231 * A pointer/reference to the PICurrent object is cached in the ORB 01232 * Core since it is accessed in the critical path (i.e. the request 01233 * invocation path). Caching it prevents additional overhead to due 01234 * object resolution from occurring. 01235 */ 01236 CORBA::Object_ptr pi_current_; 01237 01238 /// The adapter for handling client request interceptors 01239 TAO::ClientRequestInterceptor_Adapter *client_request_interceptor_adapter_; 01240 01241 /// The adapter for handling server request interceptors 01242 TAO::ServerRequestInterceptor_Adapter *server_request_interceptor_adapter_; 01243 01244 #endif /* TAO_HAS_INTERCEPTORS */ 01245 01246 /// IORInterceptor adapter. 01247 TAO_IORInterceptor_Adapter *ior_interceptor_adapter_; 01248 01249 /// Pointer to the valuetype adapter. 01250 TAO_Valuetype_Adapter *valuetype_adapter_; 01251 01252 /// The IOR parser registry. 01253 TAO_Parser_Registry parser_registry_; 01254 01255 /// BiDirectional GIOP factory 01256 TAO_BiDir_Adapter *bidir_adapter_; 01257 01258 /// Bir Dir GIOP policy value 01259 CORBA::Boolean bidir_giop_policy_; 01260 01261 /// Hold the flushing strategy 01262 TAO_Flushing_Strategy *flushing_strategy_; 01263 01264 /// Code Set Manager - points to service object in the service repo 01265 TAO_Codeset_Manager *codeset_manager_; 01266 01267 /// ORB's service configuration 01268 ACE_Service_Gestalt *config_; 01269 }; 01270 01271 // **************************************************************** 01272 01273 /** 01274 * @class TAO_ORB_Core_Static_Resources 01275 * 01276 * @brief The static (global) resoures of all ORB cores. 01277 * 01278 * This class is used by the ORB_Core to store the resources global to 01279 * all ORB_Cores. All instance variables that would have been 01280 * declared "static" in TAO_ORB_Core, should be declared in this class 01281 * to avoid the "static initialization order fiasco" as described in 01282 * http://www.parashift.com/c++-faq-lite/ctors.html#faq-10.11. 01283 * Briefly, this is the problem that occurs if any static initializers 01284 * in any other code call into set static members of TAO_ORB_Core. 01285 * Since the order in which these initializers execute is unspecified, 01286 * uninitialized members can be accessed. 01287 */ 01288 class TAO_Export TAO_ORB_Core_Static_Resources : public ACE_Service_Object 01289 { 01290 public: 01291 01292 /// Return the context-specific singleton instance. 01293 static TAO_ORB_Core_Static_Resources* instance (void); 01294 01295 public: 01296 // The hook to be set for the SyncScopePolicy 01297 TAO_ORB_Core::Sync_Scope_Hook sync_scope_hook_; 01298 01299 /** 01300 * Name of the protocols_hooks that needs to be instantiated. 01301 * The default value is "Protocols_Hooks". If RTCORBA option is 01302 * set, its value will be set to be "RT_Protocols_Hooks". 01303 */ 01304 ACE_CString protocols_hooks_name_; 01305 01306 /// The hook to be set for the RelativeRoundtripTimeoutPolicy. 01307 TAO_ORB_Core::Timeout_Hook timeout_hook_; 01308 01309 /// The hook to be set for the ConnectionTimeoutPolicy 01310 TAO_ORB_Core::Timeout_Hook connection_timeout_hook_; 01311 01312 /** 01313 * Name of the endpoint selector factory that needs to be instantiated. 01314 * The default value is "Default_Endpoint_Selector_Factory". If 01315 * TAO_RTCORBA is linked, the set_endpoint_selector_factory will be 01316 * called to set the value to be "RT_Endpoint_Selector_Factory". 01317 */ 01318 ACE_CString endpoint_selector_factory_name_; 01319 01320 /** 01321 * Name of the thread lane resources manager that needs to be 01322 * instantiated. The default value is 01323 * "Default_Thread_Lane_Resources_Manager_Factory". If TAO_RTCORBA 01324 * is linked, the set_thread_lane_resources_manager will be called 01325 * to set the value to be 01326 * "RT_Thread_Lane_Resources_Manager_Factory". 01327 */ 01328 ACE_CString thread_lane_resources_manager_factory_name_; 01329 01330 /** 01331 * Name of the collocation resolver that needs to be instantiated. 01332 * The default value is "Default_Collocation_Resolver". If 01333 * TAO_RTCORBA is linked, the set_collocation_resolver will be 01334 * called to set the value to be "RT_Collocation_Resolver". 01335 */ 01336 ACE_CString collocation_resolver_name_; 01337 01338 /** 01339 * Name of the stub factory that needs to be instantiated. 01340 * The default value is "Default_Stub_Factory". If TAO_RTCORBA is 01341 * linked, the set_stub_factory will be called to set the value 01342 * to be "RT_Stub_Factory". 01343 */ 01344 ACE_CString stub_factory_name_; 01345 01346 /** 01347 * Name of the resource factory that needs to be instantiated. 01348 * The default value is "Resource_Factory". If TAO_Strategies is 01349 * linked, the set_resource_factory will be called to set the value 01350 * to be "Advanced_Resource_Factory". 01351 */ 01352 ACE_CString resource_factory_name_; 01353 01354 /** 01355 * Name of the service object for DII request creation that needs 01356 * to be instantiated. The default value is "Dynamic_Adaper". If 01357 * TAO_DynamicInterface is linked, dynamic_adapter_name() will be 01358 * called to set the value to "Concrete_Dynamic_Adapter". 01359 */ 01360 ACE_CString dynamic_adapter_name_; 01361 01362 /** 01363 * Name of the service object for functions that make calls on 01364 * the Interface Repository. The default value is "IFR_Client_Adaper". 01365 * If TAO_IFR_CLient is linked, ifr_client_adapter_name() will be 01366 * called to set the value to "Concrete_IFR_Client_Adapter". 01367 */ 01368 ACE_CString ifr_client_adapter_name_; 01369 01370 /** 01371 * Name of the service object used by the ORB create_*_tc functions. 01372 * The default value is "TypeCodeFactory_Adapter". If the 01373 * TypeCodeFactory library is linked, the corresponding accessor 01374 * function typecodefactory_adapter_name() will be called to set 01375 * the value to "Concrete_TypeCodeFactory_Adapter". 01376 */ 01377 ACE_CString typecodefactory_adapter_name_; 01378 01379 /** 01380 * Name of the factory object used to adapt function calls on 01381 * the PortableInterceptor interfaces IORInfo and IORInterceptor. 01382 * The default value is "IORInterceptor_Adapter_Factory". If the 01383 * IORInterceptor library is linked, the corresponding accessor 01384 * function iorinterceptor_adapter_factory_name() will be called to set 01385 * the value to "Concrete_IORInterceptor_Adapter_Factory". 01386 */ 01387 ACE_CString iorinterceptor_adapter_factory_name_; 01388 01389 /** 01390 * Name of the factory object used to adapt function calls on 01391 * the valuetype-related interfaces. 01392 * The default value is "Valuetype_Adapter_Factory". If the 01393 * Valuetype library is linked, the corresponding accessor 01394 * function valuetype_adapter_factory_name() will be called to set 01395 * the value to "Concrete_Valuetype_Adapter_Factory". 01396 */ 01397 ACE_CString valuetype_adapter_factory_name_; 01398 01399 /** 01400 * Name of the service object used to create the RootPOA. The 01401 * default value is "TAO_POA". If TAO_RTCORBA is loaded, this 01402 * will be changed to TAO_RT_POA so that a POA equipped with 01403 * realtime extensions will be returned. 01404 */ 01405 ACE_CString poa_factory_name_; 01406 01407 /** 01408 * The service configurator directive used to load 01409 * poa_factory_name_ dynamically. 01410 */ 01411 ACE_CString poa_factory_directive_; 01412 01413 /// An alternative hook to be set for the ConnectionTimeoutPolicy 01414 TAO_ORB_Core::Timeout_Hook alt_connection_timeout_hook_; 01415 01416 //private: 01417 01418 /// Constructor. 01419 TAO_ORB_Core_Static_Resources (void); 01420 TAO_ORB_Core_Static_Resources& operator= 01421 (const TAO_ORB_Core_Static_Resources&); 01422 01423 private: 01424 01425 /// The singleton instance. 01426 // static TAO_ORB_Core_Static_Resources* instance_; 01427 01428 /// Mostly unused variable whose sole purpose is to enforce 01429 /// the instantiation of a TAO_ORB_Core_Static_Resources instance 01430 /// at initialization time. 01431 static TAO_ORB_Core_Static_Resources* initialization_reference_; 01432 }; 01433 01434 // **************************************************************** 01435 01436 /// Obtain an instance of the first ORB core registered in the ORB 01437 /// table. 01438 TAO_Export TAO_ORB_Core * TAO_ORB_Core_instance (void); 01439 01440 // **************************************************************** 01441 01442 TAO_END_VERSIONED_NAMESPACE_DECL 01443 01444 ACE_STATIC_SVC_DECLARE_EXPORT (TAO, TAO_ORB_Core_Static_Resources) 01445 ACE_FACTORY_DECLARE (TAO, TAO_ORB_Core_Static_Resources) 01446 01447 #if defined (__ACE_INLINE__) 01448 # include "tao/ORB_Core.i" 01449 #endif /* __ACE_INLINE__ */ 01450 01451 #include /**/ "ace/post.h" 01452 #endif /* TAO_ORB_CORE_H */