#include <ORB.h>
Collaboration diagram for CORBA::ORB:
The "ORB" pseudo-object is used in bootstrapping, such as to create object references from strings. This class is intended to be inherited by others, which will provide some more of the CORBA support. Implementations of this "CORBA::ORB" class must know how to create stringify/destringify their objrefs, as well as how to marshal and unmarshal them.
Definition at line 162 of file ORB.h.
typedef ORB_out CORBA::ORB::_out_type |
typedef ORB_ptr CORBA::ORB::_ptr_type |
typedef ORB_var CORBA::ORB::_var_type |
typedef char* CORBA::ORB::ObjectId |
typedef CORBA::ORB_ObjectIdList CORBA::ORB::ObjectIdList |
typedef CORBA::ORB_ObjectIdList* CORBA::ORB::ObjectIdList_ptr |
CORBA::ORB::ORB | ( | TAO_ORB_Core * | orb_core | ) | [protected] |
CORBA::ORB::~ORB | ( | void | ) | [protected] |
CORBA::ORB::ORB | ( | const ORB & | ) | [private] |
CORBA::Policy_ptr CORBA::ORB::_create_policy | ( | CORBA::PolicyType | type | ) |
Create an empty policy, usually to be filled in later by demarshaling.
Definition at line 1548 of file ORB.cpp.
References check_shutdown(), orb_core_, and TAO_ORB_Core::policy_factory_registry().
01549 { 01550 this->check_shutdown (); 01551 01552 TAO::PolicyFactory_Registry_Adapter *adapter = 01553 this->orb_core_->policy_factory_registry (); 01554 01555 if (adapter == 0) 01556 { 01557 throw ::CORBA::INTERNAL (); 01558 } 01559 01560 // Attempt to obtain the policy from the policy factory registry. 01561 return adapter->_create_policy (type); 01562 }
ACE_INLINE unsigned long CORBA::ORB::_decr_refcnt | ( | void | ) |
ACE_INLINE CORBA::ORB_ptr CORBA::ORB::_duplicate | ( | CORBA::ORB_ptr | orb | ) | [static] |
Return a duplicate of orb
.
When work with this duplicate is complete, it should be freed up using CORBA::release().
Definition at line 44 of file ORB.inl.
References _incr_refcnt().
Referenced by CORBA::Object::_get_orb(), CORBA::ORB_init(), TAO_Stub::servant_orb(), TAO_Stub::servant_orb_ptr(), and TAO_Stub::TAO_Stub().
ACE_INLINE unsigned long CORBA::ORB::_incr_refcnt | ( | void | ) |
Definition at line 24 of file ORB.inl.
References refcount_.
Referenced by _duplicate().
00025 { 00026 return ++this->refcount_; 00027 }
ACE_INLINE CORBA::ORB_ptr CORBA::ORB::_nil | ( | void | ) | [static] |
Returns a pointer to a nil ORB, i.e., an non-existent ORB. This can be used for initialization or in comparisons.
Definition at line 57 of file ORB.inl.
Referenced by _tao_make_ORB(), CORBA::is_nil(), and CORBA::ORB_init().
CORBA::ORB_ptr CORBA::ORB::_tao_make_ORB | ( | TAO_ORB_Core * | orb_core | ) | [static] |
Factory method that creates an ORB.
Definition at line 1054 of file ORB.cpp.
References _nil(), ACE_NEW_RETURN, and orb_core().
Referenced by TAO_ORB_Core::init().
01055 { 01056 CORBA::ORB_ptr orb = CORBA::ORB_ptr (); 01057 01058 ACE_NEW_RETURN (orb, 01059 CORBA::ORB (orb_core), 01060 CORBA::ORB::_nil ()); 01061 01062 return orb; 01063 }
ACE_INLINE CORBA::Boolean CORBA::ORB::_use_omg_ior_format | ( | void | ) |
Get the IOR flag.
Definition at line 69 of file ORB.inl.
References use_omg_ior_format_.
00070 { 00071 return this->use_omg_ior_format_; 00072 }
ACE_INLINE void CORBA::ORB::_use_omg_ior_format | ( | CORBA::Boolean | ior | ) |
Set the IOR flag.
Definition at line 63 of file ORB.inl.
References use_omg_ior_format_.
Referenced by TAO_ORB_Core::init(), and TAO_Profile::verify_orb_configuration().
00064 { 00065 this->use_omg_ior_format_ = ior; 00066 }
void CORBA::ORB::check_shutdown | ( | void | ) | [private] |
Check if ORB has shutdown. If it has, throw the appropriate exception.
Definition at line 1033 of file ORB.cpp.
References CORBA::COMPLETED_NO.
Referenced by _create_policy(), create_policy(), list_initial_services(), object_to_string(), perform_work(), resolve_initial_references(), run(), shutdown(), string_to_object(), and work_pending().
01034 { 01035 if (this->orb_core () != 0) 01036 { 01037 this->orb_core ()->check_shutdown (); 01038 } 01039 else 01040 { 01041 // If the ORB_Core pointer is zero, assume that the ORB_Core has 01042 // been destroyed. 01043 01044 // As defined by the CORBA 2.3 specification, throw a 01045 // CORBA::OBJECT_NOT_EXIST exception if the ORB has been 01046 // destroyed by the time an ORB function is called. 01047 01048 throw ::CORBA::OBJECT_NOT_EXIST (0, CORBA::COMPLETED_NO); 01049 } 01050 }
CORBA::TypeCode_ptr CORBA::ORB::create_abstract_interface_tc | ( | const char * | id, | |
const char * | name | |||
) |
Definition at line 672 of file ORB.cpp.
References TAO_TypeCodeFactory_Adapter::create_abstract_interface_tc(), ACE_Dynamic_Service< TYPE >::instance(), and TAO_ORB_Core::typecodefactory_adapter_name().
00673 { 00674 TAO_TypeCodeFactory_Adapter *adapter = 00675 ACE_Dynamic_Service<TAO_TypeCodeFactory_Adapter>::instance ( 00676 TAO_ORB_Core::typecodefactory_adapter_name ()); 00677 00678 if (adapter == 0) 00679 { 00680 throw ::CORBA::INTERNAL (); 00681 } 00682 00683 return adapter->create_abstract_interface_tc (id, name); 00684 }
CORBA::TypeCode_ptr CORBA::ORB::create_alias_tc | ( | const char * | id, | |
const char * | name, | |||
CORBA::TypeCode_ptr | original_type | |||
) |
Definition at line 465 of file ORB.cpp.
References TAO_TypeCodeFactory_Adapter::create_alias_tc(), ACE_Dynamic_Service< TYPE >::instance(), and TAO_ORB_Core::typecodefactory_adapter_name().
00469 { 00470 TAO_TypeCodeFactory_Adapter *adapter = 00471 ACE_Dynamic_Service<TAO_TypeCodeFactory_Adapter>::instance ( 00472 TAO_ORB_Core::typecodefactory_adapter_name ()); 00473 00474 if (adapter == 0) 00475 { 00476 throw ::CORBA::INTERNAL (); 00477 } 00478 00479 return adapter->create_alias_tc (id, name, original_type); 00480 }
CORBA::TypeCode_ptr CORBA::ORB::create_array_tc | ( | CORBA::ULong | length, | |
CORBA::TypeCode_ptr | element_type | |||
) |
Definition at line 584 of file ORB.cpp.
References TAO_TypeCodeFactory_Adapter::create_array_tc(), ACE_Dynamic_Service< TYPE >::instance(), and TAO_ORB_Core::typecodefactory_adapter_name().
00587 { 00588 TAO_TypeCodeFactory_Adapter *adapter = 00589 ACE_Dynamic_Service<TAO_TypeCodeFactory_Adapter>::instance ( 00590 TAO_ORB_Core::typecodefactory_adapter_name ()); 00591 00592 if (adapter == 0) 00593 { 00594 throw ::CORBA::INTERNAL (); 00595 } 00596 00597 return adapter->create_array_tc (length, element_type); 00598 }
CORBA::TypeCode_ptr CORBA::ORB::create_component_tc | ( | const char * | id, | |
const char * | name | |||
) |
Definition at line 702 of file ORB.cpp.
References TAO_TypeCodeFactory_Adapter::create_component_tc(), ACE_Dynamic_Service< TYPE >::instance(), and TAO_ORB_Core::typecodefactory_adapter_name().
00703 { 00704 TAO_TypeCodeFactory_Adapter *adapter = 00705 ACE_Dynamic_Service<TAO_TypeCodeFactory_Adapter>::instance ( 00706 TAO_ORB_Core::typecodefactory_adapter_name ()); 00707 00708 if (adapter == 0) 00709 { 00710 throw ::CORBA::INTERNAL (); 00711 } 00712 00713 return adapter->create_component_tc (id, name); 00714 }
void CORBA::ORB::create_context_list | ( | CORBA::ContextList_ptr & | ctxtlist | ) |
Definition at line 345 of file ORB.cpp.
References CORBA::SystemException::_tao_minor_code(), CORBA::COMPLETED_NO, and ENOTSUP.
00346 { 00347 throw ::CORBA::NO_IMPLEMENT ( 00348 CORBA::SystemException::_tao_minor_code ( 00349 0, 00350 ENOTSUP), 00351 CORBA::COMPLETED_NO); 00352 }
CORBA::TypeCode_ptr CORBA::ORB::create_enum_tc | ( | const char * | id, | |
const char * | name, | |||
const CORBA::EnumMemberSeq & | members | |||
) |
Definition at line 447 of file ORB.cpp.
References TAO_TypeCodeFactory_Adapter::create_enum_tc(), ACE_Dynamic_Service< TYPE >::instance(), and TAO_ORB_Core::typecodefactory_adapter_name().
00451 { 00452 TAO_TypeCodeFactory_Adapter *adapter = 00453 ACE_Dynamic_Service<TAO_TypeCodeFactory_Adapter>::instance ( 00454 TAO_ORB_Core::typecodefactory_adapter_name ()); 00455 00456 if (adapter == 0) 00457 { 00458 throw ::CORBA::INTERNAL (); 00459 } 00460 00461 return adapter->create_enum_tc (id, name, members); 00462 }
void CORBA::ORB::create_environment | ( | CORBA::Environment_ptr & | new_env | ) |
Definition at line 298 of file ORB.cpp.
References CORBA::SystemException::_tao_minor_code(), ACE_NEW_THROW_EX, and CORBA::COMPLETED_NO.
00299 { 00300 ACE_NEW_THROW_EX (environment, 00301 CORBA::Environment (), 00302 CORBA::NO_MEMORY ( 00303 CORBA::SystemException::_tao_minor_code ( 00304 0, 00305 ENOMEM), 00306 CORBA::COMPLETED_NO)); 00307 }
CORBA::TypeCode_ptr CORBA::ORB::create_event_tc | ( | const char * | id, | |
const char * | name, | |||
CORBA::ValueModifier | type_modifier, | |||
CORBA::TypeCode_ptr | concrete_base, | |||
const CORBA::ValueMemberSeq & | members | |||
) |
Definition at line 732 of file ORB.cpp.
References TAO_TypeCodeFactory_Adapter::create_event_tc(), ACE_Dynamic_Service< TYPE >::instance(), and TAO_ORB_Core::typecodefactory_adapter_name().
00738 { 00739 TAO_TypeCodeFactory_Adapter *adapter = 00740 ACE_Dynamic_Service<TAO_TypeCodeFactory_Adapter>::instance ( 00741 TAO_ORB_Core::typecodefactory_adapter_name ()); 00742 00743 if (adapter == 0) 00744 { 00745 throw ::CORBA::INTERNAL (); 00746 } 00747 00748 return adapter->create_event_tc (id, 00749 name, 00750 type_modifier, 00751 concrete_base, 00752 members); 00753 }
void CORBA::ORB::create_exception_list | ( | CORBA::ExceptionList_ptr & | exclist | ) |
Definition at line 271 of file ORB.cpp.
References TAO_Dynamic_Adapter::create_exception_list(), TAO_ORB_Core::dynamic_adapter_name(), and ACE_Dynamic_Service< TYPE >::instance().
00272 { 00273 TAO_Dynamic_Adapter *dynamic_adapter = 00274 ACE_Dynamic_Service<TAO_Dynamic_Adapter>::instance ( 00275 TAO_ORB_Core::dynamic_adapter_name ()); 00276 00277 dynamic_adapter->create_exception_list (list); 00278 }
CORBA::TypeCode_ptr CORBA::ORB::create_exception_tc | ( | const char * | id, | |
const char * | name, | |||
const CORBA::StructMemberSeq & | members | |||
) |
Definition at line 483 of file ORB.cpp.
References TAO_TypeCodeFactory_Adapter::create_exception_tc(), ACE_Dynamic_Service< TYPE >::instance(), and TAO_ORB_Core::typecodefactory_adapter_name().
00487 { 00488 TAO_TypeCodeFactory_Adapter *adapter = 00489 ACE_Dynamic_Service<TAO_TypeCodeFactory_Adapter>::instance ( 00490 TAO_ORB_Core::typecodefactory_adapter_name ()); 00491 00492 if (adapter == 0) 00493 { 00494 throw ::CORBA::INTERNAL (); 00495 } 00496 00497 return adapter->create_exception_tc (id, name, members); 00498 }
CORBA::TypeCode_ptr CORBA::ORB::create_fixed_tc | ( | CORBA::UShort | digits, | |
CORBA::UShort | scale | |||
) |
Definition at line 550 of file ORB.cpp.
References TAO_TypeCodeFactory_Adapter::create_fixed_tc(), ACE_Dynamic_Service< TYPE >::instance(), and TAO_ORB_Core::typecodefactory_adapter_name().
00553 { 00554 TAO_TypeCodeFactory_Adapter *adapter = 00555 ACE_Dynamic_Service<TAO_TypeCodeFactory_Adapter>::instance ( 00556 TAO_ORB_Core::typecodefactory_adapter_name ()); 00557 00558 if (adapter == 0) 00559 { 00560 throw ::CORBA::INTERNAL (); 00561 } 00562 00563 return adapter->create_fixed_tc (digits, scale); 00564 }
CORBA::TypeCode_ptr CORBA::ORB::create_home_tc | ( | const char * | id, | |
const char * | name | |||
) |
Definition at line 717 of file ORB.cpp.
References TAO_TypeCodeFactory_Adapter::create_home_tc(), ACE_Dynamic_Service< TYPE >::instance(), and TAO_ORB_Core::typecodefactory_adapter_name().
00718 { 00719 TAO_TypeCodeFactory_Adapter *adapter = 00720 ACE_Dynamic_Service<TAO_TypeCodeFactory_Adapter>::instance ( 00721 TAO_ORB_Core::typecodefactory_adapter_name ()); 00722 00723 if (adapter == 0) 00724 { 00725 throw ::CORBA::INTERNAL (); 00726 } 00727 00728 return adapter->create_home_tc (id, name); 00729 }
CORBA::TypeCode_ptr CORBA::ORB::create_interface_tc | ( | const char * | id, | |
const char * | name | |||
) |
Definition at line 501 of file ORB.cpp.
References TAO_TypeCodeFactory_Adapter::create_interface_tc(), ACE_Dynamic_Service< TYPE >::instance(), and TAO_ORB_Core::typecodefactory_adapter_name().
00504 { 00505 TAO_TypeCodeFactory_Adapter *adapter = 00506 ACE_Dynamic_Service<TAO_TypeCodeFactory_Adapter>::instance ( 00507 TAO_ORB_Core::typecodefactory_adapter_name ()); 00508 00509 if (adapter == 0) 00510 { 00511 throw ::CORBA::INTERNAL (); 00512 } 00513 00514 return adapter->create_interface_tc (id, name); 00515 }
void CORBA::ORB::create_list | ( | CORBA::Long | count, | |
CORBA::NVList_ptr & | new_list | |||
) |
Definition at line 253 of file ORB.cpp.
References ACE_ERROR, ACE_TEXT, TAO_NVList_Adapter::create_list(), ACE_Dynamic_Service< TYPE >::instance(), and LM_ERROR.
00254 { 00255 TAO_NVList_Adapter *adapter = 00256 ACE_Dynamic_Service<TAO_NVList_Adapter>::instance ("TAO_NVList_Adapter"); 00257 00258 if (adapter == 0) 00259 { 00260 ACE_ERROR ((LM_ERROR, 00261 ACE_TEXT ("(%P|%t) %p\n"), 00262 ACE_TEXT ("ORB unable to find the ") 00263 ACE_TEXT ("NVList Adapter instance"))); 00264 throw ::CORBA::INTERNAL (); 00265 } 00266 00267 adapter->create_list (count, new_list); 00268 }
CORBA::TypeCode_ptr CORBA::ORB::create_local_interface_tc | ( | const char * | id, | |
const char * | name | |||
) |
Definition at line 687 of file ORB.cpp.
References TAO_TypeCodeFactory_Adapter::create_local_interface_tc(), ACE_Dynamic_Service< TYPE >::instance(), and TAO_ORB_Core::typecodefactory_adapter_name().
00688 { 00689 TAO_TypeCodeFactory_Adapter *adapter = 00690 ACE_Dynamic_Service<TAO_TypeCodeFactory_Adapter>::instance ( 00691 TAO_ORB_Core::typecodefactory_adapter_name ()); 00692 00693 if (adapter == 0) 00694 { 00695 throw ::CORBA::INTERNAL (); 00696 } 00697 00698 return adapter->create_local_interface_tc (id, name); 00699 }
void CORBA::ORB::create_named_value | ( | CORBA::NamedValue_ptr & | nmval | ) |
Definition at line 310 of file ORB.cpp.
References ACE_ERROR, ACE_TEXT, TAO_NVList_Adapter::create_named_value(), ACE_Dynamic_Service< TYPE >::instance(), and LM_ERROR.
00311 { 00312 TAO_NVList_Adapter *adapter = 00313 ACE_Dynamic_Service<TAO_NVList_Adapter>::instance ( 00314 "TAO_NVList_Adapter"); 00315 00316 if (adapter == 0) 00317 { 00318 ACE_ERROR ((LM_ERROR, 00319 ACE_TEXT ("(%P|%t) %p\n"), 00320 ACE_TEXT ("ORB unable to find the ") 00321 ACE_TEXT ("NVList Adapter instance"))); 00322 00323 throw ::CORBA::INTERNAL (); 00324 } 00325 00326 adapter->create_named_value (nv); 00327 }
CORBA::TypeCode_ptr CORBA::ORB::create_native_tc | ( | const char * | id, | |
const char * | name | |||
) |
Definition at line 642 of file ORB.cpp.
References TAO_TypeCodeFactory_Adapter::create_native_tc(), ACE_Dynamic_Service< TYPE >::instance(), and TAO_ORB_Core::typecodefactory_adapter_name().
00643 { 00644 TAO_TypeCodeFactory_Adapter *adapter = 00645 ACE_Dynamic_Service<TAO_TypeCodeFactory_Adapter>::instance ( 00646 TAO_ORB_Core::typecodefactory_adapter_name ()); 00647 00648 if (adapter == 0) 00649 { 00650 throw ::CORBA::INTERNAL (); 00651 } 00652 00653 return adapter->create_native_tc (id, name); 00654 }
void CORBA::ORB::create_operation_list | ( | CORBA::OperationDef_ptr | opDef, | |
CORBA::NVList_ptr & | result | |||
) |
Definition at line 281 of file ORB.cpp.
References TAO_IFR_Client_Adapter::create_operation_list(), TAO_ORB_Core::ifr_client_adapter_name(), and ACE_Dynamic_Service< TYPE >::instance().
00283 { 00284 TAO_IFR_Client_Adapter *adapter = 00285 ACE_Dynamic_Service<TAO_IFR_Client_Adapter>::instance ( 00286 TAO_ORB_Core::ifr_client_adapter_name ()); 00287 00288 if (adapter == 0) 00289 { 00290 throw ::CORBA::INTF_REPOS (); 00291 } 00292 00293 adapter->create_operation_list (this, opDef, result); 00294 }
CORBA::Policy_ptr CORBA::ORB::create_policy | ( | CORBA::PolicyType | type, | |
const CORBA::Any & | val | |||
) |
Definition at line 1529 of file ORB.cpp.
References check_shutdown(), orb_core_, and TAO_ORB_Core::policy_factory_registry().
01530 { 01531 this->check_shutdown (); 01532 01533 TAO::PolicyFactory_Registry_Adapter *adapter = 01534 this->orb_core_->policy_factory_registry (); 01535 01536 if (adapter == 0) 01537 { 01538 throw ::CORBA::INTERNAL (); 01539 } 01540 01541 // Attempt to obtain the policy from the policy factory registry. 01542 return adapter->create_policy (type, val); 01543 }
CORBA::TypeCode_ptr CORBA::ORB::create_recursive_tc | ( | const char * | id | ) |
Definition at line 657 of file ORB.cpp.
References TAO_TypeCodeFactory_Adapter::create_recursive_tc(), ACE_Dynamic_Service< TYPE >::instance(), and TAO_ORB_Core::typecodefactory_adapter_name().
00658 { 00659 TAO_TypeCodeFactory_Adapter *adapter = 00660 ACE_Dynamic_Service<TAO_TypeCodeFactory_Adapter>::instance ( 00661 TAO_ORB_Core::typecodefactory_adapter_name ()); 00662 00663 if (adapter == 0) 00664 { 00665 throw ::CORBA::INTERNAL (); 00666 } 00667 00668 return adapter->create_recursive_tc (id); 00669 }
CORBA::TypeCode_ptr CORBA::ORB::create_sequence_tc | ( | CORBA::ULong | bound, | |
CORBA::TypeCode_ptr | element_type | |||
) |
Definition at line 567 of file ORB.cpp.
References TAO_TypeCodeFactory_Adapter::create_sequence_tc(), ACE_Dynamic_Service< TYPE >::instance(), and TAO_ORB_Core::typecodefactory_adapter_name().
00570 { 00571 TAO_TypeCodeFactory_Adapter *adapter = 00572 ACE_Dynamic_Service<TAO_TypeCodeFactory_Adapter>::instance ( 00573 TAO_ORB_Core::typecodefactory_adapter_name ()); 00574 00575 if (adapter == 0) 00576 { 00577 throw ::CORBA::INTERNAL (); 00578 } 00579 00580 return adapter->create_sequence_tc (bound, element_type); 00581 }
CORBA::TypeCode_ptr CORBA::ORB::create_string_tc | ( | CORBA::ULong | bound | ) |
Definition at line 518 of file ORB.cpp.
References TAO_TypeCodeFactory_Adapter::create_string_tc(), ACE_Dynamic_Service< TYPE >::instance(), and TAO_ORB_Core::typecodefactory_adapter_name().
00520 { 00521 TAO_TypeCodeFactory_Adapter *adapter = 00522 ACE_Dynamic_Service<TAO_TypeCodeFactory_Adapter>::instance ( 00523 TAO_ORB_Core::typecodefactory_adapter_name ()); 00524 00525 if (adapter == 0) 00526 { 00527 throw ::CORBA::INTERNAL (); 00528 } 00529 00530 return adapter->create_string_tc (bound); 00531 }
CORBA::TypeCode_ptr CORBA::ORB::create_struct_tc | ( | const char * | id, | |
const char * | name, | |||
const CORBA::StructMemberSeq & | members | |||
) |
The ORB TypeCode creation functions.
Definition at line 407 of file ORB.cpp.
References TAO_TypeCodeFactory_Adapter::create_struct_tc(), ACE_Dynamic_Service< TYPE >::instance(), and TAO_ORB_Core::typecodefactory_adapter_name().
00411 { 00412 TAO_TypeCodeFactory_Adapter *adapter = 00413 ACE_Dynamic_Service<TAO_TypeCodeFactory_Adapter>::instance ( 00414 TAO_ORB_Core::typecodefactory_adapter_name ()); 00415 00416 if (adapter == 0) 00417 { 00418 throw ::CORBA::INTERNAL (); 00419 } 00420 00421 return adapter->create_struct_tc (id, name, members); 00422 }
CORBA::TypeCode_ptr CORBA::ORB::create_union_tc | ( | const char * | id, | |
const char * | name, | |||
CORBA::TypeCode_ptr | discriminator_type, | |||
const CORBA::UnionMemberSeq & | members | |||
) |
Definition at line 425 of file ORB.cpp.
References TAO_TypeCodeFactory_Adapter::create_union_tc(), ACE_Dynamic_Service< TYPE >::instance(), and TAO_ORB_Core::typecodefactory_adapter_name().
00430 { 00431 TAO_TypeCodeFactory_Adapter *adapter = 00432 ACE_Dynamic_Service<TAO_TypeCodeFactory_Adapter>::instance ( 00433 TAO_ORB_Core::typecodefactory_adapter_name ()); 00434 00435 if (adapter == 0) 00436 { 00437 throw ::CORBA::INTERNAL (); 00438 } 00439 00440 return adapter->create_union_tc (id, 00441 name, 00442 discriminator_type, 00443 members); 00444 }
CORBA::TypeCode_ptr CORBA::ORB::create_value_box_tc | ( | const char * | id, | |
const char * | name, | |||
CORBA::TypeCode_ptr | boxed_type | |||
) |
Definition at line 624 of file ORB.cpp.
References TAO_TypeCodeFactory_Adapter::create_value_box_tc(), ACE_Dynamic_Service< TYPE >::instance(), and TAO_ORB_Core::typecodefactory_adapter_name().
00628 { 00629 TAO_TypeCodeFactory_Adapter *adapter = 00630 ACE_Dynamic_Service<TAO_TypeCodeFactory_Adapter>::instance ( 00631 TAO_ORB_Core::typecodefactory_adapter_name ()); 00632 00633 if (adapter == 0) 00634 { 00635 throw ::CORBA::INTERNAL (); 00636 } 00637 00638 return adapter->create_value_box_tc (id, name, boxed_type); 00639 }
CORBA::TypeCode_ptr CORBA::ORB::create_value_tc | ( | const char * | id, | |
const char * | name, | |||
CORBA::ValueModifier | type_modifier, | |||
CORBA::TypeCode_ptr | concrete_base, | |||
const CORBA::ValueMemberSeq & | members | |||
) |
Definition at line 601 of file ORB.cpp.
References TAO_TypeCodeFactory_Adapter::create_value_tc(), ACE_Dynamic_Service< TYPE >::instance(), and TAO_ORB_Core::typecodefactory_adapter_name().
00607 { 00608 TAO_TypeCodeFactory_Adapter *adapter = 00609 ACE_Dynamic_Service<TAO_TypeCodeFactory_Adapter>::instance ( 00610 TAO_ORB_Core::typecodefactory_adapter_name ()); 00611 00612 if (adapter == 0) 00613 { 00614 throw ::CORBA::INTERNAL (); 00615 } 00616 00617 return adapter->create_value_tc (id, name, 00618 type_modifier, 00619 concrete_base, 00620 members); 00621 }
CORBA::TypeCode_ptr CORBA::ORB::create_wstring_tc | ( | CORBA::ULong | bound | ) |
Definition at line 534 of file ORB.cpp.
References TAO_TypeCodeFactory_Adapter::create_wstring_tc(), ACE_Dynamic_Service< TYPE >::instance(), and TAO_ORB_Core::typecodefactory_adapter_name().
00536 { 00537 TAO_TypeCodeFactory_Adapter *adapter = 00538 ACE_Dynamic_Service<TAO_TypeCodeFactory_Adapter>::instance ( 00539 TAO_ORB_Core::typecodefactory_adapter_name ()); 00540 00541 if (adapter == 0) 00542 { 00543 throw ::CORBA::INTERNAL (); 00544 } 00545 00546 return adapter->create_wstring_tc (bound); 00547 }
void CORBA::ORB::destroy | ( | void | ) |
Explicitly destroy the ORB, releasing any resources. Note that TAO *cannot* implicitly release the resources even if you have destroyed all the references to a particular ORB since CORBA::ORB_init() is required to return the same pointer if called with the same ORBid, only after ORB::destroy() is called it may return a new one.
The results of multi-threaded applications, trying to destroy () the ORB in one thread and trying to service a request in another thread are not well defined. TAO does not support such cases.
Definition at line 149 of file ORB.cpp.
References ACE_DEBUG, ACE_TEXT, ACE_TEXT_CHAR_TO_TCHAR, CORBA::COMPLETED_NO, TAO_ORB_Core::destroy(), LM_DEBUG, orb_core(), orb_core_, and TAO_debug_level.
00150 { 00151 if (this->orb_core () == 0) 00152 { 00153 // If the ORB_Core pointer is zero, assume that the ORB_Core has 00154 // been destroyed. 00155 00156 // As defined by the CORBA 2.3 specification, throw a 00157 // CORBA::OBJECT_NOT_EXIST exception if the ORB has been 00158 // destroyed by the time an ORB function is called. 00159 00160 throw ::CORBA::OBJECT_NOT_EXIST (0, CORBA::COMPLETED_NO); 00161 } 00162 00163 if (TAO_debug_level > 2) 00164 { 00165 ACE_DEBUG ((LM_DEBUG, 00166 ACE_TEXT ("CORBA::ORB::destroy() called on ORB <%s>.\n"), 00167 ACE_TEXT_CHAR_TO_TCHAR (this->orb_core ()->orbid ()))); 00168 } 00169 00170 this->orb_core ()->destroy (); 00171 00172 // Now invalidate the pointer to the ORB_Core that created this 00173 // ORB. 00174 this->orb_core_ = 0; 00175 }
void CORBA::ORB::get_default_context | ( | CORBA::Context_ptr & | ctx | ) |
Definition at line 355 of file ORB.cpp.
References CORBA::SystemException::_tao_minor_code(), CORBA::COMPLETED_NO, and ENOTSUP.
00356 { 00357 throw ::CORBA::NO_IMPLEMENT ( 00358 CORBA::SystemException::_tao_minor_code ( 00359 0, 00360 ENOTSUP), 00361 CORBA::COMPLETED_NO); 00362 }
void CORBA::ORB::get_next_response | ( | CORBA::Request_ptr & | req | ) |
Definition at line 385 of file ORB.cpp.
References CORBA::SystemException::_tao_minor_code(), CORBA::COMPLETED_NO, and ENOTSUP.
00386 { 00387 throw ::CORBA::NO_IMPLEMENT ( 00388 CORBA::SystemException::_tao_minor_code ( 00389 0, 00390 ENOTSUP), 00391 CORBA::COMPLETED_NO); 00392 }
CORBA::Boolean CORBA::ORB::get_service_information | ( | CORBA::ServiceType | service_type, | |
CORBA::ServiceInformation_out | service_information | |||
) |
Definition at line 333 of file ORB.cpp.
References CORBA::SystemException::_tao_minor_code(), CORBA::COMPLETED_NO, and ENOTSUP.
00336 { 00337 throw ::CORBA::NO_IMPLEMENT ( 00338 CORBA::SystemException::_tao_minor_code ( 00339 0, 00340 ENOTSUP), 00341 CORBA::COMPLETED_NO); 00342 }
TAO_BEGIN_VERSIONED_NAMESPACE_DECL ACE_INLINE ACE_Time_Value * CORBA::ORB::get_timeout | ( | void | ) |
char * CORBA::ORB::id | ( | void | ) |
Return this ORB's ORBid.
Definition at line 1520 of file ORB.cpp.
References CORBA::string_dup().
01521 { 01522 return CORBA::string_dup (this->orb_core_->orbid ()); 01523 }
CORBA::Object_ptr CORBA::ORB::ior_string_to_object | ( | const char * | ior | ) | [private] |
Convert an OMG IOR into an object reference.
Definition at line 1571 of file ORB.cpp.
References CORBA::Object::_nil(), ACE_OS::ace_isspace(), ACE_OS::ace_isxdigit(), ACE::hex2byte(), ACE_CDR::MAX_ALIGNMENT, ACE_CDR::mb_align(), ACE_Message_Block::rd_ptr(), ACE_OS::strlen(), TAO_DEF_GIOP_MAJOR, TAO_DEF_GIOP_MINOR, and ACE_Message_Block::wr_ptr().
Referenced by string_to_object().
01572 { 01573 // Unhex the bytes, and make a CDR deencapsulation stream from the 01574 // resulting data. 01575 ACE_Message_Block mb (ACE_OS::strlen (str) / 2 + 1 01576 + ACE_CDR::MAX_ALIGNMENT + 1); 01577 01578 ACE_CDR::mb_align (&mb); 01579 01580 char *buffer = mb.rd_ptr (); 01581 const char *tmp = str; 01582 size_t len = 0; 01583 01584 while (tmp [0] && tmp [1]) 01585 { 01586 // Some platforms define 'byte' as a macro, solve the problem 01587 // here. 01588 #undef byte 01589 unsigned char byte; 01590 01591 if (!(ACE_OS::ace_isxdigit (tmp [0]) && ACE_OS::ace_isxdigit (tmp [1]))) 01592 break; 01593 01594 byte = (u_char) (ACE::hex2byte (tmp [0]) << 4); 01595 byte |= ACE::hex2byte (tmp [1]); 01596 01597 buffer [len++] = byte; 01598 tmp += 2; 01599 } 01600 01601 if (tmp [0] && !ACE_OS::ace_isspace (tmp [0])) 01602 { 01603 throw ::CORBA::BAD_PARAM (); 01604 } 01605 01606 // Create deencapsulation stream ... then unmarshal objref from that 01607 // stream. 01608 01609 int byte_order = *(mb.rd_ptr ()); 01610 mb.rd_ptr (1); 01611 mb.wr_ptr (len); 01612 TAO_InputCDR stream (&mb, 01613 byte_order, 01614 TAO_DEF_GIOP_MAJOR, 01615 TAO_DEF_GIOP_MINOR, 01616 this->orb_core_); 01617 01618 CORBA::Object_ptr objref = CORBA::Object::_nil (); 01619 stream >> objref; 01620 return objref; 01621 }
CORBA::ORB::ObjectIdList_ptr CORBA::ORB::list_initial_services | ( | void | ) |
Returns a sequence of ObjectIds that lists which objects have references available via the initial references mechanism.
Definition at line 1024 of file ORB.cpp.
References check_shutdown(), TAO_ORB_Core::list_initial_references(), and orb_core().
01025 { 01026 this->check_shutdown (); 01027 01028 return 01029 this->orb_core ()->list_initial_references (); 01030 }
CORBA::ValueFactory CORBA::ORB::lookup_value_factory | ( | const char * | repository_id | ) |
Definition at line 1715 of file ORB.cpp.
References orb_core(), TAO_ORB_Core::valuetype_adapter(), and TAO_Valuetype_Adapter::vf_map_find().
01716 { 01717 TAO_Valuetype_Adapter *vta = this->orb_core ()->valuetype_adapter (); 01718 01719 if (vta) 01720 { 01721 return vta->vf_map_find (repository_id); 01722 } 01723 01724 return 0; 01725 }
char * CORBA::ORB::object_to_string | ( | CORBA::Object_ptr | obj | ) |
Turn an object reference into a string. Each type of ORB, e.g. an IIOP ORB, must implement this. This can be used by servers to publish their whereabouts to clients. The output of this is typically eventually given to string_to_object()
as an argument.
Definition at line 1348 of file ORB.cpp.
References CORBA::SystemException::_tao_minor_code(), ACE_ALLOCATOR_RETURN, ACE_ERROR, ACE_TEXT, ACE_OutputCDR::begin(), TAO_ORB_Parameters::cdr_memcpy_tradeoff(), check_shutdown(), CORBA::COMPLETED_NO, ACE_Message_Block::cont(), ACE_CDR::DEFAULT_BUFSIZE, TAO_MProfile::get_profile(), CORBA::is_nil(), LM_ERROR, ACE_OS::memset(), ACE::nibble2hex(), CORBA::OMGVMCID, orb_core_, TAO_ORB_Core::orb_params(), TAO_ORB_Core::output_cdr_dblock_allocator(), TAO_ORB_Core::output_cdr_msgblock_allocator(), TAO_MProfile::profile_count(), ACE_OS::strcpy(), CORBA::string_alloc(), TAO_debug_level, TAO_DEF_GIOP_MAJOR, TAO_DEF_GIOP_MINOR, TAO_ENCAP_BYTE_ORDER, TAO_Profile::to_string(), ACE_OutputCDR::total_length(), use_omg_ior_format_, and ACE_OutputCDR::write_octet().
01349 { 01350 // This method should not be called if the ORB has been shutdown. 01351 this->check_shutdown (); 01352 01353 if (!CORBA::is_nil (obj)) 01354 { 01355 if (!obj->can_convert_to_ior ()) 01356 throw ::CORBA::MARSHAL (CORBA::OMGVMCID | 4, CORBA::COMPLETED_NO); 01357 01358 // Allow a user to provide custom object stringification 01359 char* user_string = 01360 obj->convert_to_ior (this->use_omg_ior_format_, ior_prefix); 01361 01362 if (user_string != 0) 01363 return user_string; 01364 } 01365 01366 // Application writer controls what kind of objref strings they get, 01367 // maybe along with other things, by how they initialize the ORB. 01368 01369 if (use_omg_ior_format_) 01370 { 01371 // By default, orbs use IOR strings; these are ugly (and error 01372 // prone) but specified by CORBA. 01373 // 01374 // XXX there should be a simple way to reuse this code in other 01375 // ORB implementations ... 01376 01377 #if defined (ACE_INITIALIZE_MEMORY_BEFORE_USE) 01378 char buf [ACE_CDR::DEFAULT_BUFSIZE] = { 0 }; 01379 #else 01380 // Avoid the initialization overhead if not compiling with 01381 // support for a memory profiler. There is no need to actually perform 01382 // initialization otherwise. 01383 char buf [ACE_CDR::DEFAULT_BUFSIZE]; 01384 #endif /* ACE_INITIALIZE_MEMORY_BEFORE_USE */ 01385 01386 TAO_OutputCDR cdr (buf, sizeof buf, 01387 TAO_ENCAP_BYTE_ORDER, 01388 this->orb_core_->output_cdr_buffer_allocator (), 01389 this->orb_core_->output_cdr_dblock_allocator (), 01390 this->orb_core_->output_cdr_msgblock_allocator (), 01391 this->orb_core_->orb_params ()->cdr_memcpy_tradeoff (), 01392 TAO_DEF_GIOP_MAJOR, 01393 TAO_DEF_GIOP_MINOR); 01394 01395 // There is no translator currently available for stringifying an object 01396 // reference, since there is no transport with which to choose an NCS/TCS 01397 // pair. 01398 01399 // support limited oref ACE_OS::strcmp. 01400 (void) ACE_OS::memset (buf, 0, sizeof (buf)); 01401 01402 // Marshal the objref into an encapsulation bytestream. 01403 (void) cdr.write_octet (TAO_ENCAP_BYTE_ORDER); 01404 if (!(cdr << obj)) 01405 throw ::CORBA::MARSHAL (); 01406 01407 // Now hexify the encapsulated CDR data into a string, and 01408 // return that string. 01409 01410 size_t const total_len = cdr.total_length (); 01411 01412 char *cp = 0; 01413 ACE_ALLOCATOR_RETURN (cp, 01414 CORBA::string_alloc ( 01415 sizeof ior_prefix 01416 + 2 01417 * static_cast<CORBA::ULong> (total_len)), 01418 0); 01419 01420 CORBA::String_var string = cp; 01421 01422 ACE_OS::strcpy (cp, ior_prefix); 01423 cp += sizeof (ior_prefix) - 1; 01424 01425 for (const ACE_Message_Block *i = cdr.begin (); i != 0; i = i->cont ()) 01426 { 01427 const char *bytes = i->rd_ptr (); 01428 size_t len = i->length (); 01429 01430 while (len--) 01431 { 01432 *cp++ = static_cast<char> (ACE::nibble2hex ((*bytes) >> 4)); 01433 *cp++ = static_cast<char> (ACE::nibble2hex (*bytes)); 01434 ++bytes; 01435 } 01436 } 01437 // Null terminate the string.. 01438 *cp = 0; 01439 01440 return string._retn (); 01441 } 01442 else 01443 { 01444 // It is perfectly valid to marshal a nil object reference. 01445 // However, it is not possible to convert a nil object reference 01446 // to a URL IOR, so throw an exception. 01447 if (CORBA::is_nil (obj) || obj->_stubobj () == 0) 01448 { 01449 if (TAO_debug_level > 0) 01450 ACE_ERROR ((LM_ERROR, 01451 ACE_TEXT ("Nil object reference or TAO_Stub ") 01452 ACE_TEXT ("pointer is zero when converting\n") 01453 ACE_TEXT ("object reference to URL IOR.\n"))); 01454 01455 throw ::CORBA::MARSHAL ( 01456 CORBA::SystemException::_tao_minor_code ( 01457 0, 01458 EINVAL), 01459 CORBA::COMPLETED_NO); 01460 } 01461 01462 TAO_MProfile &mp = obj->_stubobj ()->base_profiles (); 01463 01464 if (mp.profile_count () == 0) 01465 { 01466 if (TAO_debug_level > 0) 01467 ACE_ERROR ((LM_ERROR, 01468 ACE_TEXT ("(%P|%t) Cannot stringify given ") 01469 ACE_TEXT ("object. No profiles.\n"))); 01470 01471 01472 throw ::CORBA::MARSHAL ( 01473 CORBA::SystemException::_tao_minor_code ( 01474 0, 01475 EINVAL), 01476 CORBA::COMPLETED_NO); 01477 } 01478 01479 // For now we just use the first profile. 01480 TAO_Profile *profile = mp.get_profile (0); 01481 01482 return profile->to_string (); 01483 } 01484 }
ACE_INLINE TAO_ORB_Core * CORBA::ORB::orb_core | ( | void | ) | const |
Get the ORB core.
Definition at line 75 of file ORB.inl.
References orb_core_.
Referenced by _tao_make_ORB(), destroy(), list_initial_services(), lookup_value_factory(), TAO_CORBALOC_Parser::make_stub_from_mprofile(), TAO_DLL_Parser::parse_string(), TAO_CORBALOC_Parser::parse_string(), perform_work(), register_value_factory(), resolve_initial_references(), run(), shutdown(), and unregister_value_factory().
00076 { 00077 return this->orb_core_; 00078 }
void CORBA::ORB::perform_work | ( | ACE_Time_Value * | tv | ) |
Definition at line 210 of file ORB.cpp.
References check_shutdown(), orb_core(), and TAO_ORB_Core::run().
00211 { 00212 // This method should not be called if the ORB has been shutdown. 00213 this->check_shutdown (); 00214 00215 this->orb_core ()->run (tv, 1); 00216 }
void CORBA::ORB::perform_work | ( | ACE_Time_Value & | tv | ) |
Definition at line 204 of file ORB.cpp.
References perform_work().
00205 { 00206 this->perform_work (&tv); 00207 }
void CORBA::ORB::perform_work | ( | void | ) |
This operation performs an implementation-defined unit of work. Note that the default behavior is to block if the unit of work is not present; this behavior can be modified by passing an appropriate ACE_Time_Value
as described in run().
Definition at line 198 of file ORB.cpp.
Referenced by perform_work().
00199 { 00200 this->perform_work (0); 00201 }
CORBA::Boolean CORBA::ORB::poll_next_response | ( | void | ) |
Definition at line 395 of file ORB.cpp.
References CORBA::SystemException::_tao_minor_code(), CORBA::COMPLETED_NO, and ENOTSUP.
00396 { 00397 throw ::CORBA::NO_IMPLEMENT ( 00398 CORBA::SystemException::_tao_minor_code ( 00399 0, 00400 ENOTSUP), 00401 CORBA::COMPLETED_NO); 00402 }
void CORBA::ORB::register_initial_reference | ( | const char * | id, | |
CORBA::Object_ptr | obj | |||
) |
Register an object reference with the ORB.
Definition at line 1008 of file ORB.cpp.
References CORBA::COMPLETED_NO, CORBA::is_nil(), TAO_ORB_Core::object_ref_table(), CORBA::OMGVMCID, orb_core_, TAO_Object_Ref_Table::register_initial_reference(), and ACE_OS::strlen().
01009 { 01010 if (id == 0 || ACE_OS::strlen (id) == 0) 01011 throw ::CORBA::ORB::InvalidName (); 01012 01013 if (CORBA::is_nil (obj)) 01014 throw ::CORBA::BAD_PARAM (CORBA::OMGVMCID | 27, CORBA::COMPLETED_NO); 01015 01016 TAO_Object_Ref_Table &table = this->orb_core_->object_ref_table (); 01017 01018 if (table.register_initial_reference (id, obj) == -1) 01019 throw ::CORBA::ORB::InvalidName (); 01020 }
CORBA::ValueFactory CORBA::ORB::register_value_factory | ( | const char * | repository_id, | |
CORBA::ValueFactory | factory | |||
) |
Definition at line 1674 of file ORB.cpp.
References orb_core(), TAO_ORB_Core::valuetype_adapter(), and TAO_Valuetype_Adapter::vf_map_rebind().
01676 { 01677 TAO_Valuetype_Adapter *vta = this->orb_core ()->valuetype_adapter (); 01678 01679 if (vta) 01680 { 01681 int const result = vta->vf_map_rebind (repository_id, factory); 01682 01683 if (result == 0) // No previous factory found 01684 { 01685 return 0; 01686 } 01687 01688 if (result == -1) 01689 { 01690 // Error on bind. 01691 throw ::CORBA::MARSHAL (); 01692 } 01693 } 01694 01695 return factory; // previous factory was found 01696 }
CORBA::Object_ptr CORBA::ORB::resolve_initial_references | ( | const char * | name, | |
ACE_Time_Value * | timeout = 0 | |||
) |
This method acts as a mini-bootstrapping Naming Service, which is provided by the ORB for certain well-known object references. TAO supports the "NameService", "TradingService", "RootPOA", "ImplRepo", and "POACurrent" via this method. The timeout
value bounds the amount of time the ORB blocks waiting to resolve the service. This is most useful for bootstrapping remote services, such as the "NameService" or "TradingService", that are commonly resolved via multicast. By default, the value is 0, which means "use the TAO_DEFAULT_SERVICE_RESOLUTION_TIMEOUT
timeout period".
timeout
parameter, TAO will remains compliant with the CORBA resolve_initial_references() specification. Definition at line 864 of file ORB.cpp.
References TAO_Pseudo_Var_T< T >::_retn(), check_shutdown(), ACE_OS::getenv(), TAO_Pseudo_Var_T< T >::in(), TAO_ORB_Core::init_ref_map(), CORBA::is_nil(), TAO::MCAST_IMPLREPOSERVICE, TAO::MCAST_INTERFACEREPOSERVICE, TAO::MCAST_NAMESERVICE, TAO::MCAST_TRADINGSERVICE, TAO_ORB_Core::object_ref_table(), orb_core(), orb_core_, TAO_ORB_Core::resolve_codecfactory(), TAO_ORB_Core::resolve_compression_manager(), TAO_ORB_Core::resolve_dynanyfactory(), TAO_Object_Ref_Table::resolve_initial_reference(), TAO_ORB_Core::resolve_ior_manipulation(), TAO_ORB_Core::resolve_ior_table(), TAO_ORB_Core::resolve_monitor(), TAO_ORB_Core::resolve_picurrent(), TAO_ORB_Core::resolve_poa_current(), resolve_policy_current(), resolve_policy_manager(), TAO_ORB_Core::resolve_rir(), resolve_service(), TAO_ORB_Core::resolve_typecodefactory(), TAO_ORB_Core::root_poa(), set_timeout(), ACE_OS::strcat(), ACE_OS::strcmp(), ACE_OS::strcpy(), CORBA::string_alloc(), string_to_object(), ACE_OS::strlen(), TAO_OBJID_CODECFACTORY, TAO_OBJID_COMPRESSIONMANAGER, TAO_OBJID_DYNANYFACTORY, TAO_OBJID_IMPLREPOSERVICE, TAO_OBJID_INTERFACEREP, TAO_OBJID_IORMANIPULATION, TAO_OBJID_IORTABLE, TAO_OBJID_MONITOR, TAO_OBJID_NAMESERVICE, TAO_OBJID_PICurrent, TAO_OBJID_POACURRENT, TAO_OBJID_POLICYCURRENT, TAO_OBJID_POLICYMANAGER, TAO_OBJID_ROOTPOA, TAO_OBJID_TRADINGSERVICE, and TAO_OBJID_TYPECODEFACTORY.
Referenced by TAO_ORB_Core::implrepo_service(), and TAO_CORBALOC_Parser::parse_string_rir_helper().
00866 { 00867 // This method should not be called if the ORB has been shutdown. 00868 this->check_shutdown (); 00869 00870 CORBA::Object_var result; 00871 00872 if (ACE_OS::strcmp (name, TAO_OBJID_ROOTPOA) == 0) 00873 { 00874 result = this->orb_core ()->root_poa (); 00875 } 00876 else if (ACE_OS::strcmp (name, TAO_OBJID_POACURRENT) == 0) 00877 { 00878 result = this->orb_core ()->resolve_poa_current (); 00879 } 00880 else if (ACE_OS::strcmp (name, TAO_OBJID_POLICYMANAGER) == 0) 00881 { 00882 result = this->resolve_policy_manager (); 00883 } 00884 else if (ACE_OS::strcmp (name, TAO_OBJID_POLICYCURRENT) == 0) 00885 { 00886 result = this->resolve_policy_current (); 00887 } 00888 else if (ACE_OS::strcmp (name, TAO_OBJID_IORMANIPULATION) == 0) 00889 { 00890 result = this->orb_core ()->resolve_ior_manipulation (); 00891 } 00892 else if (ACE_OS::strcmp (name, TAO_OBJID_IORTABLE) == 0) 00893 { 00894 result = this->orb_core ()->resolve_ior_table (); 00895 } 00896 else if (ACE_OS::strcmp (name, TAO_OBJID_DYNANYFACTORY) == 0) 00897 { 00898 result = this->orb_core ()->resolve_dynanyfactory (); 00899 } 00900 else if (ACE_OS::strcmp (name, TAO_OBJID_TYPECODEFACTORY) == 0) 00901 { 00902 result = this->orb_core ()->resolve_typecodefactory (); 00903 } 00904 else if (ACE_OS::strcmp (name, TAO_OBJID_CODECFACTORY) == 0) 00905 { 00906 result = this->orb_core ()->resolve_codecfactory (); 00907 } 00908 else if (ACE_OS::strcmp (name, TAO_OBJID_COMPRESSIONMANAGER) == 0) 00909 { 00910 result = this->orb_core ()->resolve_compression_manager (); 00911 } 00912 else if (ACE_OS::strcmp (name, TAO_OBJID_MONITOR) == 0) 00913 { 00914 result = this->orb_core ()->resolve_monitor (); 00915 } 00916 #if TAO_HAS_INTERCEPTORS == 1 00917 else if (ACE_OS::strcmp (name, TAO_OBJID_PICurrent) == 0) 00918 { 00919 result = this->orb_core ()->resolve_picurrent (); 00920 } 00921 #endif 00922 00923 // ----------------------------------------------------------------- 00924 00925 if (CORBA::is_nil (result.in ())) 00926 { 00927 // Search the object reference table. This search must occur before 00928 // the InitRef table search, since it may contain local objects. 00929 result = 00930 this->orb_core ()->object_ref_table ().resolve_initial_reference ( 00931 name); 00932 } 00933 00934 if (!CORBA::is_nil (result.in ())) 00935 return result._retn (); 00936 00937 // ----------------------------------------------------------------- 00938 00939 // Check ORBInitRef options. 00940 00941 // @@ There appears to be long standing (i.e. back when the map was 00942 // an ACE_Hash_Map_Manager) race condition here since the map 00943 // access is not synchronized. 00944 00945 // Is the service name in the IOR Table. 00946 TAO_ORB_Core::InitRefMap::iterator ior = 00947 this->orb_core_->init_ref_map ()->find (ACE_CString (name)); 00948 00949 if (ior != this->orb_core_->init_ref_map ()->end ()) 00950 return this->string_to_object ((*ior).second.c_str ()); 00951 00952 // Look for an environment variable called "<name>IOR". 00953 // 00954 CORBA::String_var ior_env_var_name = 00955 CORBA::string_alloc (static_cast<CORBA::ULong> (ACE_OS::strlen (name) + 3)); 00956 00957 ACE_OS::strcpy (ior_env_var_name.inout (), name); 00958 00959 ACE_OS::strcat (ior_env_var_name.inout (), "IOR"); 00960 00961 ACE_CString service_ior = ACE_OS::getenv (ior_env_var_name.in ()); 00962 00963 if (ACE_OS::strcmp (service_ior.c_str (), "") != 0) 00964 { 00965 result = this->string_to_object (service_ior.c_str()); 00966 00967 return result._retn (); 00968 } 00969 00970 // May be trying the explicitly specified services and the well 00971 // known services should be tried first before falling on to default 00972 // services. 00973 00974 // Set the timeout value. 00975 this->set_timeout (timeout); 00976 00977 if (ACE_OS::strcmp (name, TAO_OBJID_NAMESERVICE) == 0) 00978 { 00979 this->resolve_service (TAO::MCAST_NAMESERVICE); 00980 } 00981 else if (ACE_OS::strcmp (name, TAO_OBJID_TRADINGSERVICE) == 0) 00982 { 00983 this->resolve_service (TAO::MCAST_TRADINGSERVICE); 00984 } 00985 else if (ACE_OS::strcmp (name, TAO_OBJID_IMPLREPOSERVICE) == 0) 00986 { 00987 this->resolve_service (TAO::MCAST_IMPLREPOSERVICE); 00988 } 00989 else if (ACE_OS::strcmp (name, TAO_OBJID_INTERFACEREP) == 0) 00990 { 00991 this->resolve_service (TAO::MCAST_INTERFACEREPOSERVICE); 00992 } 00993 00994 // Is not one of the well known services, try to find it in the 00995 // InitRef table....check the defaultinitref values also. 00996 00997 result = this->orb_core ()->resolve_rir (name); 00998 00999 if (!CORBA::is_nil (result.in ())) 01000 return result._retn (); 01001 // ----------------------------------------------------------------- 01002 01003 throw ::CORBA::ORB::InvalidName (); 01004 }
CORBA::Object_ptr CORBA::ORB::resolve_policy_current | ( | void | ) | [protected] |
Resolve the Policy Current for this thread.
Definition at line 781 of file ORB.cpp.
References CORBA::Object::_duplicate(), CORBA::Object::_nil(), orb_core_, and TAO_ORB_Core::policy_current().
Referenced by resolve_initial_references().
00782 { 00783 #if (TAO_HAS_CORBA_MESSAGING == 1) 00784 00785 TAO_Policy_Current &policy_current = this->orb_core_->policy_current (); 00786 return CORBA::Object::_duplicate (&policy_current); 00787 00788 #else 00789 00790 return CORBA::Object::_nil (); 00791 00792 #endif /* TAO_HAS_CORBA_MESSAGING == 1 */ 00793 }
CORBA::Object_ptr CORBA::ORB::resolve_policy_manager | ( | void | ) | [protected] |
Resolve the Policy Manager for this ORB.
Definition at line 760 of file ORB.cpp.
References CORBA::Object::_duplicate(), CORBA::Object::_nil(), orb_core_, and TAO_ORB_Core::policy_manager().
Referenced by resolve_initial_references().
00761 { 00762 #if (TAO_HAS_CORBA_MESSAGING == 1) 00763 00764 TAO_Policy_Manager *policy_manager = this->orb_core_->policy_manager (); 00765 00766 if (policy_manager == 0) 00767 { 00768 return CORBA::Object::_nil (); 00769 } 00770 00771 return CORBA::Object::_duplicate (policy_manager); 00772 00773 #else 00774 00775 return CORBA::Object::_nil (); 00776 00777 #endif /* TAO_HAS_CORBA_MESSAGING == 1 */ 00778 }
void CORBA::ORB::resolve_service | ( | TAO::MCAST_SERVICEID | service_id | ) | [private] |
Resolve the given service based on the service ID.
"@c resolve_service" is a legacy name. This method now simply sets up a default initial reference that will be subsequently used in resolve_initial_references().
Definition at line 796 of file ORB.cpp.
References ACE_OS::atoi(), TAO_ORB_Parameters::default_init_ref(), ACE_OS::getenv(), orb_core_, TAO_ORB_Core::orb_params(), TAO_ORB_Parameters::service_port(), ACE_OS::snprintf(), ACE_OS::strncmp(), TAO_DEFAULT_IMPLREPO_SERVER_REQUEST_PORT, TAO_DEFAULT_INTERFACEREPO_SERVER_REQUEST_PORT, TAO_DEFAULT_NAME_SERVER_REQUEST_PORT, and TAO_DEFAULT_TRADING_SERVER_REQUEST_PORT.
Referenced by resolve_initial_references().
00797 { 00798 #if defined ACE_HAS_IP_MULTICAST 00799 static char const * const env_service_port[] = 00800 { 00801 "NameServicePort", 00802 "TradingServicePort", 00803 "ImplRepoServicePort", 00804 "InterfaceRepoServicePort" 00805 }; 00806 00807 static unsigned short const default_service_port[] = 00808 { 00809 TAO_DEFAULT_NAME_SERVER_REQUEST_PORT, 00810 TAO_DEFAULT_TRADING_SERVER_REQUEST_PORT, 00811 TAO_DEFAULT_IMPLREPO_SERVER_REQUEST_PORT, 00812 TAO_DEFAULT_INTERFACEREPO_SERVER_REQUEST_PORT 00813 }; 00814 00815 // By now, the table filled in with -ORBInitRef arguments has been 00816 // checked. We only get here if the table didn't contain an initial 00817 // reference for the requested Service. 00818 00819 CORBA::String_var default_init_ref = 00820 this->orb_core_->orb_params ()->default_init_ref (); 00821 00822 static char const mcast_prefix[] = "mcast://:::"; 00823 00824 if ((ACE_OS::strncmp (default_init_ref.in (), 00825 mcast_prefix, 00826 sizeof (mcast_prefix) - 1) == 0)) 00827 { 00828 // First, determine if the port was supplied on the command line 00829 unsigned short port = 00830 this->orb_core_->orb_params ()->service_port (mcast_service_id); 00831 00832 if (port == 0) 00833 { 00834 // Look for the port among our environment variables. 00835 char const * const port_number = 00836 ACE_OS::getenv (env_service_port[mcast_service_id]); 00837 00838 if (port_number != 0) 00839 port = static_cast<unsigned short> (ACE_OS::atoi (port_number)); 00840 else 00841 port = default_service_port[mcast_service_id]; 00842 } 00843 00844 // Set the port value in ORB_Params: modify the default mcast 00845 // value. 00846 static char const mcast_fmt[] = "mcast://:%d::"; 00847 static size_t const PORT_BUF_SIZE = 256; 00848 00849 char def_init_ref[PORT_BUF_SIZE] = { 0 }; 00850 00851 ACE_OS::snprintf (def_init_ref, 00852 PORT_BUF_SIZE, 00853 mcast_fmt, 00854 port); 00855 00856 this->orb_core_->orb_params ()->default_init_ref (def_init_ref); 00857 } 00858 #else 00859 ACE_UNUSED_ARG (mcast_service_id); 00860 #endif /* ACE_HAS_IP_MULTICAST */ 00861 }
void CORBA::ORB::run | ( | ACE_Time_Value * | tv | ) |
Instructs the ORB to initialize itself and run its event loop in the current thread, not returning until the ORB has shut down or the time value specified through tv has expired. If an error occurs during initialization or at runtime, a CORBA system exception will be thrown. tv is reduced by the amount of time spent in this call. If tv is 0, it means that the timeout is infinite. If tv is ACE_Time_Value::zero
, it specifies to poll and does not block.
If this function is called with tv value, client threads making invocations will continue their operations. When the operation times out and returns, any invocations showing up on the server will be buffered by TCP.
Definition at line 190 of file ORB.cpp.
References check_shutdown(), orb_core(), and TAO_ORB_Core::run().
00191 { 00192 this->check_shutdown (); 00193 00194 this->orb_core ()->run (tv, 0); 00195 }
void CORBA::ORB::run | ( | ACE_Time_Value & | tv | ) |
Instructs the ORB to initialize itself and run its event loop in the current thread, not returning until the ORB has shut down or the time value specified through tv has expired. If an error occurs during initialization or at runtime, a CORBA system exception will be thrown. tv is reduced by the amount of time spent in this call.
If this function is called with a @ tv value, client threads making invocations will continue their operations. When the operation timesout and returns, any invocations showing up on the server will be buffered by TCP.
Definition at line 184 of file ORB.cpp.
References run().
00185 { 00186 this->run (&tv); 00187 }
void CORBA::ORB::run | ( | void | ) |
Instructs the ORB to initialize itself and run its event loop in the current thread, not returning until the ORB has shut down. If an error occurs during initialization or at runtime, a CORBA system exception will be thrown.
Definition at line 178 of file ORB.cpp.
Referenced by run().
00179 { 00180 this->run (0); 00181 }
void CORBA::ORB::send_multiple_requests_deferred | ( | const CORBA::RequestSeq & | req | ) |
Definition at line 375 of file ORB.cpp.
References CORBA::SystemException::_tao_minor_code(), CORBA::COMPLETED_NO, and ENOTSUP.
00376 { 00377 throw ::CORBA::NO_IMPLEMENT ( 00378 CORBA::SystemException::_tao_minor_code ( 00379 0, 00380 ENOTSUP), 00381 CORBA::COMPLETED_NO); 00382 }
void CORBA::ORB::send_multiple_requests_oneway | ( | const CORBA::RequestSeq & | req | ) |
Definition at line 365 of file ORB.cpp.
References CORBA::SystemException::_tao_minor_code(), CORBA::COMPLETED_NO, and ENOTSUP.
00366 { 00367 throw ::CORBA::NO_IMPLEMENT ( 00368 CORBA::SystemException::_tao_minor_code ( 00369 0, 00370 ENOTSUP), 00371 CORBA::COMPLETED_NO); 00372 }
ACE_INLINE void CORBA::ORB::set_timeout | ( | ACE_Time_Value * | timeout | ) | [private] |
Set the timeout value.
Definition at line 18 of file ORB.inl.
References timeout_.
Referenced by resolve_initial_references().
00019 { 00020 this->timeout_ = timeout; 00021 }
void CORBA::ORB::shutdown | ( | CORBA::Boolean | wait_for_completion = false |
) |
This operation instructs the ORB to shut down. Shutting down the ORB causes all Object Adapters to be shut down. If wait_for_completion
parameter is TRUE, this operation blocks until all ORB processing (including request processing and object deactivation or other operations associated with object adapters) has completed.
Definition at line 138 of file ORB.cpp.
References check_shutdown(), orb_core(), and TAO_ORB_Core::shutdown().
00139 { 00140 // We cannot lock the exceptions here. We need to propogate 00141 // BAD_INV_ORDER exceptions if needed to the caller. Locking 00142 // exceptions down would render us non-compliant with the spec. 00143 this->check_shutdown (); 00144 00145 this->orb_core ()->shutdown (wait_for_completion); 00146 }
CORBA::Object_ptr CORBA::ORB::string_to_object | ( | const char * | str | ) |
Turn a string-ified object reference back into an object pointer. Typically these strings are created using object_to_string(), but not necessarily locally.
Definition at line 1490 of file ORB.cpp.
References CORBA::SystemException::_tao_minor_code(), check_shutdown(), CORBA::COMPLETED_NO, ior_string_to_object(), TAO_Parser_Registry::match_parser(), orb_core_, TAO_IOR_Parser::parse_string(), TAO_ORB_Core::parser_registry(), ACE_OS::strncmp(), and url_ior_string_to_object().
Referenced by TAO_HTTP_Parser::parse_string(), TAO_FILE_Parser::parse_string(), TAO_CORBANAME_Parser::parse_string(), resolve_initial_references(), and TAO_ORB_Core::resolve_rir().
01491 { 01492 // This method should not be called if the ORB has been shutdown. 01493 this->check_shutdown (); 01494 01495 // Check for NULL pointer 01496 if (str == 0) 01497 throw ::CORBA::INV_OBJREF ( 01498 CORBA::SystemException::_tao_minor_code ( 01499 0, 01500 EINVAL), 01501 CORBA::COMPLETED_NO); 01502 01503 TAO_IOR_Parser *ior_parser = 01504 this->orb_core_->parser_registry ()->match_parser (str); 01505 01506 if (ior_parser != 0) 01507 { 01508 return ior_parser->parse_string (str, this); 01509 } 01510 01511 if (ACE_OS::strncmp (str, ior_prefix, sizeof ior_prefix - 1) == 0) 01512 return this->ior_string_to_object (str + sizeof ior_prefix - 1); 01513 else 01514 return this->url_ior_string_to_object (str); 01515 }
void CORBA::ORB::unregister_value_factory | ( | const char * | repository_id | ) |
Definition at line 1701 of file ORB.cpp.
References orb_core(), TAO_ORB_Core::valuetype_adapter(), and TAO_Valuetype_Adapter::vf_map_unbind().
01702 { 01703 TAO_Valuetype_Adapter *vta = this->orb_core ()->valuetype_adapter (); 01704 01705 if (vta) 01706 { 01707 // Dont care whther it was successful or not! 01708 (void) vta->vf_map_unbind (repository_id); 01709 } 01710 }
CORBA::Object_ptr CORBA::ORB::url_ior_string_to_object | ( | const char * | ior | ) | [private] |
Convert an URL style IOR into an object reference.
Definition at line 1628 of file ORB.cpp.
References CORBA::Object::_nil(), CORBA::SystemException::_tao_minor_code(), CORBA::COMPLETED_NO, TAO_ORB_Core::connector_registry(), TAO_ORB_Core::create_object(), TAO_ORB_Core::create_stub(), TAO_Stub_Auto_Ptr::get(), CORBA::is_nil(), TAO_Connector_Registry::make_mprofile(), orb_core_, and TAO_Stub_Auto_Ptr::release().
Referenced by string_to_object().
01629 { 01630 TAO_MProfile mprofile; 01631 // It is safe to declare this on the stack since the contents of 01632 // mprofile get copied. No memory is allocated for profile storage 01633 // here. The Connector Registry will determine the exact number 01634 // of profiles and tell the MProfile object to allocate enough memory 01635 // to hold them all. 01636 01637 TAO_Connector_Registry *conn_reg = this->orb_core_->connector_registry (); 01638 01639 int const retv = conn_reg->make_mprofile (str, mprofile); 01640 // Return nil. 01641 01642 if (retv != 0) 01643 { 01644 throw ::CORBA::INV_OBJREF ( 01645 CORBA::SystemException::_tao_minor_code ( 01646 0, 01647 EINVAL), 01648 CORBA::COMPLETED_NO); 01649 } 01650 01651 // Now make the TAO_Stub. 01652 TAO_Stub *data = this->orb_core_->create_stub ((char *) 0, mprofile); 01653 01654 TAO_Stub_Auto_Ptr safe_objdata (data); 01655 01656 // Figure out if the servant is collocated. 01657 CORBA::Object_ptr obj = this->orb_core_->create_object (safe_objdata.get ()); 01658 01659 if (CORBA::is_nil (obj)) 01660 return CORBA::Object::_nil (); 01661 01662 // Transfer ownership to the CORBA::Object 01663 (void) safe_objdata.release (); 01664 01665 return obj; 01666 }
CORBA::Boolean CORBA::ORB::work_pending | ( | ACE_Time_Value & | tv | ) |
Definition at line 219 of file ORB.cpp.
References check_shutdown(), orb_core_, TAO_ORB_Core::reactor(), and ACE_Reactor::work_pending().
00220 { 00221 // This method should not be called if the ORB has been shutdown. 00222 this->check_shutdown (); 00223 00224 int const result = this->orb_core_->reactor ()->work_pending (tv); 00225 if (result == 0 || (result == -1 && errno == ETIME)) 00226 return false; 00227 00228 if (result == -1) 00229 throw ::CORBA::INTERNAL (); 00230 00231 return true; 00232 }
CORBA::Boolean CORBA::ORB::work_pending | ( | void | ) |
Returns an indication of whether the ORB needs to perform some work.
Definition at line 235 of file ORB.cpp.
References check_shutdown(), orb_core_, TAO_ORB_Core::reactor(), and ACE_Reactor::work_pending().
00236 { 00237 // This method should not be called if the ORB has been shutdown. 00238 this->check_shutdown (); 00239 00240 const int result = this->orb_core_->reactor ()->work_pending (); 00241 if (result == 0) 00242 return false; 00243 00244 if (result == -1) 00245 throw ::CORBA::INTERNAL (); 00246 00247 return true; 00248 }
CORBA::TypeCode_ptr const CORBA::ORB::_tc_ObjectId [static] |
CORBA::TypeCode_ptr const CORBA::ORB::_tc_ObjectIdList [static] |
TAO_ORB_Core* CORBA::ORB::orb_core_ [private] |
The ORB_Core that created us....
Definition at line 567 of file ORB.h.
Referenced by _create_policy(), create_policy(), destroy(), object_to_string(), orb_core(), register_initial_reference(), resolve_initial_references(), resolve_policy_current(), resolve_policy_manager(), resolve_service(), string_to_object(), url_ior_string_to_object(), and work_pending().
ACE_Atomic_Op<TAO_SYNCH_MUTEX, unsigned long> CORBA::ORB::refcount_ [private] |
Maintains a reference count of number of instantiations of the ORB.
Definition at line 564 of file ORB.h.
Referenced by _decr_refcnt(), and _incr_refcnt().
ACE_Time_Value* CORBA::ORB::timeout_ [private] |
Timeout value.
Definition at line 577 of file ORB.h.
Referenced by get_timeout(), and set_timeout().
Decides whether to use the URL notation or to use IOR notation.
Definition at line 570 of file ORB.h.
Referenced by _use_omg_ior_format(), and object_to_string().