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