00001
00002
00003
00004
00005 #include "tao/ORB_Core_TSS_Resources.h"
00006 #include "tao/ORB_Table.h"
00007
00008 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00009
00010 ACE_INLINE ACE_Service_Gestalt*
00011 TAO_ORB_Core::configuration (void) const
00012 {
00013 return this->config_.get ();
00014 }
00015
00016 ACE_INLINE unsigned long
00017 TAO_ORB_Core::_incr_refcnt (void)
00018 {
00019 return this->refcount_++;
00020 }
00021
00022 ACE_INLINE unsigned long
00023 TAO_ORB_Core::_refcnt (void) const
00024 {
00025 return this->refcount_.value ();
00026 }
00027
00028 ACE_INLINE unsigned long
00029 TAO_ORB_Core::_decr_refcnt (void)
00030 {
00031 unsigned long const count = --this->refcount_;
00032 if (count != 0)
00033 return count;
00034
00035 this->fini ();
00036 return 0;
00037 }
00038
00039 ACE_INLINE ACE_Lock *
00040 TAO_ORB_Core::locking_strategy (void)
00041 {
00042 if (this->resource_factory ()->use_locked_data_blocks ())
00043 return &this->data_block_lock_;
00044
00045 return 0;
00046 }
00047
00048 ACE_INLINE CORBA::Boolean
00049 TAO_ORB_Core::bidir_giop_policy (void)
00050 {
00051 return this->bidir_giop_policy_;
00052 }
00053
00054 ACE_INLINE void
00055 TAO_ORB_Core::bidir_giop_policy (CORBA::Boolean val)
00056 {
00057 this->bidir_giop_policy_ = val;
00058 }
00059
00060 ACE_INLINE TAO_Object_Ref_Table &
00061 TAO_ORB_Core::object_ref_table (void)
00062 {
00063 return this->object_ref_table_;
00064 }
00065
00066 ACE_INLINE TAO::ObjectKey_Table &
00067 TAO_ORB_Core::object_key_table (void)
00068 {
00069 return this->object_key_table_;
00070 }
00071
00072 ACE_INLINE TAO_Flushing_Strategy *
00073 TAO_ORB_Core::flushing_strategy (void)
00074 {
00075 return this->flushing_strategy_;
00076 }
00077
00078 ACE_INLINE TAO_Protocols_Hooks *
00079 TAO_ORB_Core::get_protocols_hooks (void)
00080 {
00081 return this->protocols_hooks_;
00082 }
00083
00084 ACE_INLINE TAO_Network_Priority_Protocols_Hooks *
00085 TAO_ORB_Core::get_network_priority_protocols_hooks (void)
00086 {
00087 return this->network_priority_protocols_hooks_;
00088 }
00089
00090 ACE_INLINE CORBA::Boolean
00091 TAO_ORB_Core::service_profile_selection (const TAO_MProfile &mprofile,
00092 TAO_Profile *&profile)
00093 {
00094 CORBA::Boolean retval = false;
00095
00096
00097
00098 if (this->ft_service_.service_callback ())
00099 {
00100 retval =
00101 this->ft_service_.service_callback ()->select_profile (mprofile,
00102 profile);
00103 }
00104 return retval;
00105 }
00106
00107 ACE_INLINE CORBA::Boolean
00108 TAO_ORB_Core::object_is_nil (CORBA::Object_ptr obj)
00109 {
00110 CORBA::Boolean retval = false;
00111 if (this->ft_service_.service_callback ())
00112 {
00113 retval = this->ft_service_.service_callback ()->object_is_nil (obj);
00114 }
00115 return retval;
00116 }
00117
00118
00119 ACE_INLINE TAO_Service_Callbacks::Profile_Equivalence
00120 TAO_ORB_Core::is_profile_equivalent (const TAO_Profile *this_p,
00121 const TAO_Profile *that_p)
00122 {
00123 TAO_Service_Callbacks::Profile_Equivalence retval
00124 = TAO_Service_Callbacks::DONT_KNOW;
00125
00126 if (this->ft_service_.service_callback ())
00127 {
00128 retval =
00129 this->ft_service_.service_callback ()->is_profile_equivalent (this_p,
00130 that_p);
00131 }
00132
00133 return retval;
00134 }
00135
00136 ACE_INLINE CORBA::ULong
00137 TAO_ORB_Core::hash_service (TAO_Profile *p, CORBA::ULong m)
00138 {
00139 if (this->ft_service_.service_callback ())
00140 {
00141 return this->ft_service_.service_callback ()->hash_ft (p, m);
00142 }
00143
00144 return 0;
00145 }
00146
00147 ACE_INLINE TAO_Fault_Tolerance_Service &
00148 TAO_ORB_Core::fault_tolerance_service (void)
00149 {
00150 return this->ft_service_;
00151 }
00152
00153 ACE_INLINE CORBA::Boolean
00154 TAO_ORB_Core::ft_send_extended_sc (void)
00155 {
00156 return this->ft_send_extended_sc_;
00157 }
00158
00159 ACE_INLINE ACE_Thread_Manager *
00160 TAO_ORB_Core::thr_mgr (void)
00161 {
00162 return &this->tm_;
00163 }
00164
00165 ACE_INLINE CORBA::ORB_ptr
00166 TAO_ORB_Core::orb (void)
00167 {
00168 return this->orb_;
00169 }
00170
00171 ACE_INLINE TAO_Adapter_Registry &
00172 TAO_ORB_Core::adapter_registry (void)
00173 {
00174 return this->adapter_registry_;
00175 }
00176
00177 ACE_INLINE TAO_Request_Dispatcher *
00178 TAO_ORB_Core::request_dispatcher (void)
00179 {
00180 return this->request_dispatcher_;
00181 }
00182
00183 ACE_INLINE TAO_ORB_Core::InitRefMap *
00184 TAO_ORB_Core::init_ref_map (void)
00185 {
00186 return &this->init_ref_map_;
00187 }
00188
00189 ACE_INLINE void
00190 TAO_ORB_Core::set_default (const char * orb_id)
00191 {
00192 TAO::ORB_Table * const table = TAO::ORB_Table::instance ();
00193 table->set_default (orb_id);
00194 }
00195
00196 ACE_INLINE void
00197 TAO_ORB_Core::not_default (const char * orb_id)
00198 {
00199 TAO::ORB_Table * const table = TAO::ORB_Table::instance ();
00200 table->not_default (orb_id);
00201 }
00202
00203 ACE_INLINE void
00204 TAO_ORB_Core::optimize_collocation_objects (CORBA::Boolean opt)
00205 {
00206 this->opt_for_collocation_ = opt;
00207 }
00208
00209 ACE_INLINE CORBA::Boolean
00210 TAO_ORB_Core::optimize_collocation_objects (void) const
00211 {
00212 return this->opt_for_collocation_;
00213 }
00214
00215 ACE_INLINE void
00216 TAO_ORB_Core::use_global_collocation (CORBA::Boolean opt)
00217 {
00218 this->use_global_collocation_ = opt;
00219 }
00220
00221 ACE_INLINE CORBA::Boolean
00222 TAO_ORB_Core::use_global_collocation (void) const
00223 {
00224 return this->use_global_collocation_;
00225 }
00226
00227 ACE_INLINE CORBA::ULong
00228 TAO_ORB_Core::get_collocation_strategy (void) const
00229 {
00230 return this->collocation_strategy_;
00231 }
00232
00233 ACE_INLINE TAO_ORB_Parameters *
00234 TAO_ORB_Core::orb_params(void)
00235 {
00236 return &(this->orb_params_);
00237 }
00238
00239 #define TAO_OC_RETRIEVE(member) \
00240 ((this->member##_ == 0) \
00241 ? (this->member##_ = this->resource_factory ()->get_##member ()) \
00242 : (this->member##_))
00243
00244 ACE_INLINE TAO_ProtocolFactorySet *
00245 TAO_ORB_Core::protocol_factories (void)
00246 {
00247 return TAO_OC_RETRIEVE (protocol_factories);
00248 }
00249
00250 ACE_INLINE TAO_Parser_Registry *
00251 TAO_ORB_Core::parser_registry (void)
00252 {
00253 return &this->parser_registry_;
00254 }
00255
00256 #undef TAO_OC_RETRIEVE
00257
00258 #if (TAO_HAS_CORBA_MESSAGING == 1)
00259
00260 ACE_INLINE TAO_Policy_Manager *
00261 TAO_ORB_Core::policy_manager (void)
00262 {
00263 return this->policy_manager_;
00264 }
00265
00266 #endif
00267
00268 ACE_INLINE TAO_ORB_Core_TSS_Resources*
00269 TAO_ORB_Core::get_tss_resources (void)
00270 {
00271 return ACE_TSS_GET (&this->tss_resources_,TAO_ORB_Core_TSS_Resources);
00272 }
00273
00274 ACE_INLINE void *
00275 TAO_ORB_Core::get_tss_resource (size_t slot_id)
00276 {
00277 TAO_ORB_Core_TSS_Resources *tss_resources =
00278 this->get_tss_resources ();
00279
00280 if (slot_id >= tss_resources->ts_objects_.size ())
00281 return 0;
00282
00283 return tss_resources->ts_objects_[slot_id];
00284 }
00285
00286 ACE_INLINE int
00287 TAO_ORB_Core::set_tss_resource (size_t slot_id, void *ts_object)
00288 {
00289 TAO_ORB_Core_TSS_Resources *tss_resources =
00290 this->get_tss_resources ();
00291
00292
00293
00294
00295 if (slot_id >= this->tss_cleanup_funcs_.size ())
00296 {
00297 errno = EINVAL;
00298 return -1;
00299 }
00300
00301
00302
00303
00304 const size_t old_size = tss_resources->ts_objects_.size ();
00305 const size_t new_size = slot_id + 1;
00306 if (slot_id >= old_size
00307 && tss_resources->ts_objects_.size (new_size) != 0)
00308 return -1;
00309
00310
00311
00312
00313
00314 for (size_t i = old_size; i < slot_id; ++i)
00315 tss_resources->ts_objects_[i] = 0;
00316
00317 tss_resources->ts_objects_[slot_id] = ts_object;
00318
00319
00320
00321
00322 tss_resources->orb_core_ = this;
00323
00324 return 0;
00325 }
00326
00327 ACE_INLINE void
00328 TAO_ORB_Core::tss_cleanup (ACE_Array_Base<void *> &ts_objects)
00329 {
00330 this->tss_cleanup_funcs_.cleanup (ts_objects);
00331 }
00332
00333 ACE_INLINE bool
00334 TAO_ORB_Core::has_shutdown (void) const
00335 {
00336 return this->has_shutdown_;
00337 }
00338
00339 ACE_INLINE int
00340 TAO_ORB_Core::thread_per_connection_timeout (ACE_Time_Value &timeout) const
00341 {
00342 timeout = this->thread_per_connection_timeout_;
00343 return this->thread_per_connection_use_timeout_;
00344 }
00345
00346 ACE_INLINE const char *
00347 TAO_ORB_Core::orbid (void) const
00348 {
00349 return this->orbid_;
00350 }
00351
00352 ACE_INLINE void
00353 TAO_ORB_Core::implrepo_service (const CORBA::Object_ptr ir)
00354 {
00355 this->implrepo_service_ = ir;
00356 }
00357
00358 ACE_INLINE CORBA::Boolean
00359 TAO_ORB_Core::use_implrepo (void)
00360 {
00361 return use_implrepo_;
00362 }
00363
00364 ACE_INLINE CORBA::Boolean
00365 TAO_ORB_Core::imr_endpoints_in_ior (void)
00366 {
00367 return imr_endpoints_in_ior_;
00368 }
00369
00370 ACE_INLINE CORBA::Object_ptr
00371 TAO_ORB_Core::resolve_typecodefactory (void)
00372 {
00373 ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, mon, this->lock_,
00374 CORBA::Object::_nil ());
00375 if (CORBA::is_nil (this->typecode_factory_))
00376 {
00377 this->resolve_typecodefactory_i ();
00378 }
00379 return CORBA::Object::_duplicate (this->typecode_factory_);
00380 }
00381
00382 #if TAO_HAS_INTERCEPTORS == 1
00383
00384 ACE_INLINE CORBA::Object_ptr
00385 TAO_ORB_Core::resolve_picurrent (void)
00386 {
00387 ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, mon, this->lock_,
00388 CORBA::Object::_nil ());
00389 if (CORBA::is_nil (this->pi_current_))
00390 {
00391 this->resolve_picurrent_i ();
00392 }
00393 return CORBA::Object::_duplicate (this->pi_current_);
00394 }
00395
00396 #endif
00397
00398 ACE_INLINE CORBA::Object_ptr
00399 TAO_ORB_Core::resolve_codecfactory (void)
00400 {
00401 ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, mon, this->lock_,
00402 CORBA::Object::_nil ());
00403 if (CORBA::is_nil (this->codec_factory_))
00404 {
00405 this->resolve_codecfactory_i ();
00406 }
00407 return CORBA::Object::_duplicate (this->codec_factory_);
00408 }
00409
00410 ACE_INLINE CORBA::Object_ptr
00411 TAO_ORB_Core::resolve_compression_manager (void)
00412 {
00413 ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, mon, this->lock_,
00414 CORBA::Object::_nil ());
00415 if (CORBA::is_nil (this->compression_manager_))
00416 {
00417 this->resolve_compression_manager_i ();
00418 }
00419 return CORBA::Object::_duplicate (this->compression_manager_);
00420 }
00421
00422 ACE_INLINE const char *
00423 TAO_ORB_Core::server_id (void) const
00424 {
00425 return this->server_id_.c_str();
00426 }
00427
00428 ACE_INLINE TAO_Codeset_Manager *
00429 TAO_ORB_Core::codeset_manager()
00430 {
00431 if (this->orb_params()->negotiate_codesets() == 0)
00432 return 0;
00433 if (this->codeset_manager_ == 0)
00434 {
00435
00436
00437 this->codeset_manager_ =
00438 this->resource_factory()->codeset_manager();
00439 if (this->codeset_manager_ == 0)
00440 this->orb_params()->negotiate_codesets(false);
00441 }
00442 return this->codeset_manager_;
00443 }
00444
00445 ACE_INLINE TAO_ZIOP_Adapter *
00446 TAO_ORB_Core::ziop_adapter () const
00447 {
00448 return this->ziop_adapter_;
00449 }
00450
00451 ACE_INLINE void
00452 TAO_ORB_Core::ziop_adapter (TAO_ZIOP_Adapter *adapter)
00453 {
00454 this->ziop_adapter_ = adapter;
00455 }
00456
00457 ACE_INLINE TAO::ORBInitializer_Registry_Adapter *
00458 TAO_ORB_Core::orbinitializer_registry ()
00459 {
00460 ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, mon, this->lock_,
00461 0);
00462 if (orbinitializer_registry_ == 0)
00463 {
00464 return this->orbinitializer_registry_i ();
00465 }
00466 return this->orbinitializer_registry_;
00467 }
00468
00469 ACE_INLINE TAO_Service_Context_Registry &
00470 TAO_ORB_Core::service_context_registry (void)
00471 {
00472 return this->service_context_registry_;
00473 }
00474
00475 ACE_INLINE TAO::PolicyFactory_Registry_Adapter *
00476 TAO_ORB_Core::policy_factory_registry ()
00477 {
00478 ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, mon, this->lock_,
00479 0);
00480 if (policy_factory_registry_ == 0)
00481 {
00482 return this->policy_factory_registry_i ();
00483 }
00484 return this->policy_factory_registry_;
00485 }
00486
00487 ACE_INLINE CORBA::Object_ptr
00488 TAO_ORB_Core::resolve_dynanyfactory (void)
00489 {
00490 ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, mon, this->lock_,
00491 CORBA::Object::_nil ());
00492 if (CORBA::is_nil (this->dynany_factory_))
00493 {
00494 this->resolve_dynanyfactory_i ();
00495 }
00496 return CORBA::Object::_duplicate (this->dynany_factory_);
00497 }
00498
00499 ACE_INLINE CORBA::Object_ptr
00500 TAO_ORB_Core::resolve_ior_manipulation (void)
00501 {
00502 ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, mon, this->lock_,
00503 CORBA::Object::_nil ());
00504 if (CORBA::is_nil (this->ior_manip_factory_))
00505 {
00506 this->resolve_iormanipulation_i ();
00507 }
00508 return CORBA::Object::_duplicate (this->ior_manip_factory_);
00509 }
00510
00511 ACE_INLINE CORBA::Object_ptr
00512 TAO_ORB_Core::resolve_ior_table (void)
00513 {
00514 ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, mon, this->lock_,
00515 CORBA::Object::_nil ());
00516 if (CORBA::is_nil (this->ior_table_))
00517 {
00518 this->resolve_ior_table_i ();
00519 }
00520 return CORBA::Object::_duplicate (this->ior_table_);
00521 }
00522
00523 ACE_INLINE CORBA::Object_ptr
00524 TAO_ORB_Core::resolve_monitor (void)
00525 {
00526 ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, mon, this->lock_,
00527 CORBA::Object::_nil ());
00528 if (CORBA::is_nil (this->monitor_))
00529 {
00530 this->resolve_monitor_i ();
00531 }
00532 return CORBA::Object::_duplicate (this->monitor_);
00533 }
00534
00535
00536
00537 #if (TAO_HAS_CORBA_MESSAGING == 1)
00538
00539 ACE_INLINE TAO_Policy_Current &
00540 TAO_ORB_Core::policy_current (void)
00541 {
00542 return *this->policy_current_;
00543 }
00544
00545 #endif
00546
00547 ACE_INLINE CORBA::Object_ptr
00548 TAO_ORB_Core::resolve_poa_current (void)
00549 {
00550 ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, mon, this->lock_,
00551 CORBA::Object::_nil ());
00552 if (CORBA::is_nil (this->poa_current_.in ()))
00553 {
00554 this->resolve_poa_current_i ();
00555 }
00556 return CORBA::Object::_duplicate (this->poa_current_.in ());
00557 }
00558
00559 #if (TAO_HAS_CORBA_MESSAGING == 1)
00560
00561 ACE_INLINE TAO_Policy_Set *
00562 TAO_ORB_Core::get_default_policies (void)
00563 {
00564 return this->default_policies_;
00565 }
00566
00567 #endif
00568
00569 #if defined (TAO_HAS_CORBA_MESSAGING) && TAO_HAS_CORBA_MESSAGING != 0
00570 ACE_INLINE CORBA::Object_ptr
00571 TAO_ORB_Core::resolve_rt_orb (void)
00572 {
00573 if (CORBA::is_nil (this->rt_orb_.in ()))
00574 {
00575 ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, mon, this->lock_,
00576 CORBA::Object::_nil ());
00577 if (CORBA::is_nil (this->rt_orb_.in ()))
00578 {
00579
00580 this->rt_orb_ =
00581 this->object_ref_table ().resolve_initial_reference (
00582 TAO_OBJID_RTORB);
00583 }
00584 }
00585
00586 return CORBA::Object::_duplicate (this->rt_orb_.in ());
00587 }
00588 #endif
00589
00590 #if (TAO_HAS_INTERCEPTORS == 1)
00591 ACE_INLINE CORBA::Object_ptr
00592 TAO_ORB_Core::pi_current (void)
00593 {
00594
00595
00596
00597
00598 return this->pi_current_;
00599 }
00600
00601 ACE_INLINE void
00602 TAO_ORB_Core::pi_current (CORBA::Object_ptr current)
00603 {
00604
00605
00606 this->pi_current_ = current;
00607 }
00608
00609 ACE_INLINE TAO::ClientRequestInterceptor_Adapter *
00610 TAO_ORB_Core::clientrequestinterceptor_adapter (void)
00611 {
00612 return this->client_request_interceptor_adapter_;
00613 }
00614
00615 ACE_INLINE TAO::ServerRequestInterceptor_Adapter *
00616 TAO_ORB_Core::serverrequestinterceptor_adapter (void)
00617 {
00618 return this->server_request_interceptor_adapter_;
00619 }
00620
00621 #endif
00622
00623
00624
00625 ACE_INLINE CORBA::Boolean
00626 TAO_ORB_Core::is_permanent_forward_condition
00627 (const CORBA::Object_ptr obj,
00628 const TAO_Service_Context &service_context)
00629 {
00630 const TAO_Service_Callbacks *service_callback =
00631 this->fault_tolerance_service ().service_callback ();
00632
00633
00634 CORBA::Boolean const permanent_forward_condition =
00635 service_callback && obj &&
00636 service_callback->is_permanent_forward_condition (obj,
00637 service_context);
00638
00639 return permanent_forward_condition;
00640 }
00641
00642 ACE_INLINE
00643 void
00644 TAO_ORB_Core::set_sync_scope_hook (Sync_Scope_Hook hook)
00645 {
00646 this->sync_scope_hook_ = hook;
00647 }
00648
00649 ACE_INLINE
00650 void
00651 TAO_ORB_Core::set_timeout_hook (Timeout_Hook hook)
00652 {
00653
00654 this->timeout_hook_ = hook;
00655 }
00656
00657 #if (TAO_HAS_BUFFERING_CONSTRAINT_POLICY == 1)
00658
00659 ACE_INLINE
00660 void
00661 TAO_ORB_Core::set_eager_transport_queueing_strategy (
00662 TAO::Transport_Queueing_Strategy* strategy)
00663 {
00664 this->eager_transport_queueing_strategy_ = strategy;
00665 }
00666
00667 ACE_INLINE
00668 void
00669 TAO_ORB_Core::set_delayed_transport_queueing_strategy (
00670 TAO::Transport_Queueing_Strategy* strategy)
00671 {
00672 this->delayed_transport_queueing_strategy_ = strategy;
00673 }
00674
00675 #endif
00676
00677 TAO_END_VERSIONED_NAMESPACE_DECL