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