ORB.cpp

Go to the documentation of this file.
00001 // "ORB.cpp,v 1.515 2006/06/20 06:32:59 jwillemsen Exp"
00002 
00003 #include "tao/ORB.h"
00004 
00005 ACE_RCSID (tao,
00006            ORB,
00007            "ORB.cpp,v 1.515 2006/06/20 06:32:59 jwillemsen Exp")
00008 
00009 #include "tao/ORB_Table.h"
00010 #include "tao/Connector_Registry.h"
00011 #include "tao/IOR_Parser.h"
00012 #include "tao/Stub.h"
00013 #include "tao/ORB_Core.h"
00014 #include "tao/ORB_Core_TSS_Resources.h"
00015 #include "tao/TAO_Internal.h"
00016 #include "tao/Dynamic_Adapter.h"
00017 #include "tao/Profile.h"
00018 #include "tao/default_ports.h"
00019 #include "tao/ORBInitializer_Registry_Adapter.h"
00020 #include "tao/PolicyFactory_Registry_Adapter.h"
00021 #include "tao/NVList_Adapter.h"
00022 #include "tao/TAO_Singleton_Manager.h"
00023 #include "tao/Policy_Current.h"
00024 #include "tao/Policy_Manager.h"
00025 #include "tao/Valuetype_Adapter.h"
00026 #include "tao/IFR_Client_Adapter.h"
00027 #include "tao/TypeCodeFactory_Adapter.h"
00028 #include "tao/debug.h"
00029 #include "tao/CDR.h"
00030 #include "tao/SystemException.h"
00031 #include "tao/default_environment.h"
00032 #include "tao/ObjectIdListC.h"
00033 
00034 #if !defined (__ACE_INLINE__)
00035 # include "tao/ORB.i"
00036 #endif /* ! __ACE_INLINE__ */
00037 
00038 #include "ace/Dynamic_Service.h"
00039 #include "ace/Service_Config.h"
00040 #include "ace/Arg_Shifter.h"
00041 #include "ace/Reactor.h"
00042 #include "ace/Argv_Type_Converter.h"
00043 #include "ace/ACE.h"
00044 #include "ace/Static_Object_Lock.h"
00045 #include "ace/OS_NS_strings.h"
00046 #include "ace/OS_NS_string.h"
00047 #include "ace/os_include/os_ctype.h"
00048 
00049 #if defined (ACE_HAS_EXCEPTIONS)
00050 void TAO_unexpected_exception_handler (void)
00051 {
00052   throw CORBA::UNKNOWN ();
00053 }
00054 #endif  /* ACE_HAS_EXCEPTIONS */
00055 
00056 static const char ior_prefix[] = "IOR:";
00057 
00058 // = Static initialization.
00059 
00060 namespace
00061 {
00062   // Count of the number of ORBs.
00063   int orb_init_count = 0;
00064 }
00065 
00066 // ****************************************************************
00067 
00068 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00069 
00070 CORBA::ORB::InvalidName::InvalidName (void)
00071   : CORBA::UserException ("IDL:omg.org/CORBA/ORB/InvalidName:1.0",
00072                           "InvalidName")
00073 {
00074 }
00075 
00076 // Destructor - all members are of self managing types.
00077 CORBA::ORB::InvalidName::~InvalidName (void)
00078 {
00079 }
00080 
00081 // Copy constructor.
00082 CORBA::ORB::InvalidName::InvalidName (const CORBA::ORB::InvalidName &exc)
00083   : CORBA::UserException (exc._rep_id (),
00084                           exc._name ())
00085 {
00086 }
00087 
00088 // Assignment operator.
00089 CORBA::ORB::InvalidName&
00090 CORBA::ORB::InvalidName::operator= (const ::CORBA::ORB::InvalidName &_tao_excp)
00091 {
00092   this->UserException::operator= (_tao_excp);
00093   return *this;
00094 }
00095 
00096 CORBA::ORB::InvalidName *
00097 CORBA::ORB::InvalidName::_downcast (CORBA::Exception *exc)
00098 {
00099   return dynamic_cast<InvalidName *> (exc);
00100 }
00101 
00102 CORBA::Exception *CORBA::ORB::InvalidName::_alloc (void)
00103 {
00104   CORBA::Exception *retval = 0;
00105   ACE_NEW_RETURN (retval, ::CORBA::ORB::InvalidName, 0);
00106   return retval;
00107 }
00108 
00109 CORBA::Exception *
00110 CORBA::ORB::InvalidName::_tao_duplicate (void) const
00111 {
00112   CORBA::Exception *result = 0;
00113   ACE_NEW_RETURN (
00114       result,
00115       ::CORBA::ORB::InvalidName (*this),
00116       0
00117     );
00118   return result;
00119 }
00120 
00121 void CORBA::ORB::InvalidName::_raise (void) const
00122 {
00123   TAO_RAISE (*this);
00124 }
00125 
00126 void CORBA::ORB::InvalidName::_tao_encode (
00127     TAO_OutputCDR &
00128     ACE_ENV_ARG_DECL
00129   ) const
00130 {
00131   ACE_THROW (CORBA::MARSHAL ());
00132 }
00133 
00134 void CORBA::ORB::InvalidName::_tao_decode (
00135     TAO_InputCDR &
00136     ACE_ENV_ARG_DECL
00137   )
00138 {
00139   ACE_THROW (CORBA::MARSHAL ());
00140 }
00141 
00142 // ****************************************************************
00143 
00144 CORBA::ORB::ORB (TAO_ORB_Core *orb_core)
00145   : lock_ ()
00146   , refcount_ (1)
00147   , orb_core_ (orb_core)
00148   , use_omg_ior_format_ (1)
00149   , timeout_ (0)
00150 {
00151 }
00152 
00153 CORBA::ORB::~ORB (void)
00154 {
00155   // This destructor is only invoked when the last ORB reference (not
00156   // instance) is being destroyed.
00157 }
00158 
00159 void
00160 CORBA::ORB::shutdown (CORBA::Boolean wait_for_completion
00161                      ACE_ENV_ARG_DECL)
00162 {
00163   // We cannot lock the exceptions here. We need to propogate
00164   // BAD_INV_ORDER  exceptions if needed to the caller. Locking
00165   // exceptions down would render us non-compliant with the spec.
00166   this->check_shutdown (ACE_ENV_SINGLE_ARG_PARAMETER);
00167   ACE_CHECK;
00168 
00169   this->orb_core ()->shutdown (wait_for_completion
00170                                ACE_ENV_ARG_PARAMETER);
00171 }
00172 
00173 void
00174 CORBA::ORB::destroy (ACE_ENV_SINGLE_ARG_DECL)
00175 {
00176   if (this->orb_core () == 0)
00177     {
00178       // If the ORB_Core pointer is zero, assume that the ORB_Core has
00179       // been destroyed.
00180 
00181       // As defined by the CORBA 2.3 specification, throw a
00182       // CORBA::OBJECT_NOT_EXIST exception if the ORB has been
00183       // destroyed by the time an ORB function is called.
00184 
00185       ACE_THROW (CORBA::OBJECT_NOT_EXIST (0,
00186                                           CORBA::COMPLETED_NO));
00187     }
00188 
00189   if (TAO_debug_level > 2)
00190     {
00191       ACE_DEBUG ((LM_DEBUG,
00192                   ACE_TEXT ("CORBA::ORB::destroy() called on ORB <%s>.\n"),
00193                   ACE_TEXT_CHAR_TO_TCHAR (this->orb_core ()->orbid ())));
00194     }
00195 
00196   this->orb_core ()->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
00197   ACE_CHECK;
00198 
00199   // Now invalidate the pointer to the ORB_Core that created this
00200   // ORB.
00201   this->orb_core_ = 0;
00202 }
00203 
00204 void
00205 CORBA::ORB::run (ACE_ENV_SINGLE_ARG_DECL)
00206 {
00207   this->run (0 ACE_ENV_ARG_PARAMETER);
00208 }
00209 
00210 void
00211 CORBA::ORB::run (ACE_Time_Value &tv ACE_ENV_ARG_DECL)
00212 {
00213   this->run (&tv ACE_ENV_ARG_PARAMETER);
00214 }
00215 
00216 void
00217 CORBA::ORB::run (ACE_Time_Value *tv
00218                  ACE_ENV_ARG_DECL)
00219 {
00220   this->check_shutdown (ACE_ENV_SINGLE_ARG_PARAMETER);
00221   ACE_CHECK;
00222 
00223   this->orb_core ()->run (tv, 0 ACE_ENV_ARG_PARAMETER);
00224 }
00225 
00226 void
00227 CORBA::ORB::perform_work (ACE_ENV_SINGLE_ARG_DECL)
00228 {
00229   this->perform_work (0 ACE_ENV_ARG_PARAMETER);
00230 }
00231 
00232 void
00233 CORBA::ORB::perform_work (ACE_Time_Value &tv ACE_ENV_ARG_DECL)
00234 {
00235   this->perform_work (&tv ACE_ENV_ARG_PARAMETER);
00236 }
00237 
00238 void
00239 CORBA::ORB::perform_work (ACE_Time_Value *tv
00240                          ACE_ENV_ARG_DECL)
00241 {
00242   // This method should not be called if the ORB has been shutdown.
00243   this->check_shutdown (ACE_ENV_SINGLE_ARG_PARAMETER);
00244   ACE_CHECK;
00245 
00246   this->orb_core ()->run (tv, 1 ACE_ENV_ARG_PARAMETER);
00247 }
00248 
00249 CORBA::Boolean
00250 CORBA::ORB::work_pending (ACE_Time_Value &tv ACE_ENV_ARG_DECL)
00251 {
00252   // This method should not be called if the ORB has been shutdown.
00253   this->check_shutdown (ACE_ENV_SINGLE_ARG_PARAMETER);
00254   ACE_CHECK_RETURN (0);
00255 
00256   int const result = this->orb_core_->reactor ()->work_pending (tv);
00257   if (result == 0 || (result == -1 && errno == ETIME))
00258     return 0;
00259 
00260   if (result == -1)
00261     ACE_THROW_RETURN (CORBA::INTERNAL (), 0);
00262 
00263   return 1;
00264 }
00265 
00266 CORBA::Boolean
00267 CORBA::ORB::work_pending (ACE_ENV_SINGLE_ARG_DECL)
00268 {
00269   // This method should not be called if the ORB has been shutdown.
00270   this->check_shutdown (ACE_ENV_SINGLE_ARG_PARAMETER);
00271   ACE_CHECK_RETURN (0);
00272 
00273   const int result = this->orb_core_->reactor ()->work_pending ();
00274   if (result == 0)
00275     return 0;
00276 
00277   if (result == -1)
00278     ACE_THROW_RETURN (CORBA::INTERNAL (), 0);
00279 
00280   return 1;
00281 }
00282 
00283 #if (TAO_HAS_MINIMUM_CORBA == 0)
00284 
00285 void
00286 CORBA::ORB::create_list (CORBA::Long count,
00287                          CORBA::NVList_ptr &new_list
00288                          ACE_ENV_ARG_DECL)
00289 {
00290   TAO_NVList_Adapter *adapter =
00291     ACE_Dynamic_Service<TAO_NVList_Adapter>::instance (
00292         "TAO_NVList_Adapter"
00293       );
00294 
00295   if (adapter == 0)
00296     {
00297       ACE_ERROR ((LM_ERROR,
00298                   ACE_TEXT ("(%P|%t) %p\n"),
00299                   ACE_TEXT ("ORB unable to find the ")
00300                   ACE_TEXT ("NVList Adapter instance")));
00301       ACE_THROW (CORBA::INTERNAL ());
00302     }
00303 
00304   adapter->create_list (count, new_list ACE_ENV_ARG_PARAMETER);
00305 }
00306 
00307 void
00308 CORBA::ORB::create_exception_list (CORBA::ExceptionList_ptr &list
00309                                    ACE_ENV_ARG_DECL)
00310 {
00311   TAO_Dynamic_Adapter *dynamic_adapter =
00312     ACE_Dynamic_Service<TAO_Dynamic_Adapter>::instance (
00313         TAO_ORB_Core::dynamic_adapter_name ()
00314       );
00315 
00316   dynamic_adapter->create_exception_list (list
00317                                           ACE_ENV_ARG_PARAMETER);
00318 }
00319 
00320 void
00321 CORBA::ORB::create_operation_list (CORBA::OperationDef_ptr opDef,
00322                                    CORBA::NVList_ptr &result
00323                                    ACE_ENV_ARG_DECL)
00324 {
00325   TAO_IFR_Client_Adapter *adapter =
00326     ACE_Dynamic_Service<TAO_IFR_Client_Adapter>::instance (
00327         TAO_ORB_Core::ifr_client_adapter_name ()
00328       );
00329 
00330   if (adapter == 0)
00331     {
00332       ACE_THROW (CORBA::INTF_REPOS ());
00333     }
00334 
00335   adapter->create_operation_list (this,
00336                                   opDef,
00337                                   result
00338                                   ACE_ENV_ARG_PARAMETER);
00339 }
00340 
00341 
00342 void
00343 CORBA::ORB::create_environment (CORBA::Environment_ptr &environment
00344                                 ACE_ENV_ARG_DECL)
00345 {
00346   ACE_NEW_THROW_EX (environment,
00347                     CORBA::Environment (),
00348                     CORBA::NO_MEMORY (
00349                       CORBA::SystemException::_tao_minor_code (
00350                         0,
00351                         ENOMEM),
00352                       CORBA::COMPLETED_NO));
00353 }
00354 
00355 void
00356 CORBA::ORB::create_named_value (CORBA::NamedValue_ptr &nv
00357                                 ACE_ENV_ARG_DECL)
00358 {
00359   TAO_NVList_Adapter *adapter =
00360     ACE_Dynamic_Service<TAO_NVList_Adapter>::instance (
00361         "TAO_NVList_Adapter"
00362       );
00363 
00364   if (adapter == 0)
00365     {
00366       ACE_ERROR ((LM_ERROR,
00367                   ACE_TEXT ("(%P|%t) %p\n"),
00368                   ACE_TEXT ("ORB unable to find the ")
00369                   ACE_TEXT ("NVList Adapter instance")));
00370 
00371       ACE_THROW (CORBA::INTERNAL ());
00372     }
00373 
00374   adapter->create_named_value (nv ACE_ENV_ARG_PARAMETER);
00375 }
00376 
00377 // The following functions are not implemented - they just throw
00378 // CORBA::NO_IMPLEMENT.
00379 
00380 CORBA::Boolean
00381 CORBA::ORB::get_service_information (
00382   CORBA::ServiceType /* service_type */,
00383   CORBA::ServiceInformation_out /* service_information */
00384   ACE_ENV_ARG_DECL)
00385 {
00386   ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (
00387                       CORBA::SystemException::_tao_minor_code (
00388                         0,
00389                         ENOTSUP),
00390                       CORBA::COMPLETED_NO),
00391                     0);
00392 }
00393 
00394 void
00395 CORBA::ORB::create_context_list (CORBA::ContextList_ptr &
00396                                 ACE_ENV_ARG_DECL)
00397 {
00398   ACE_THROW (CORBA::NO_IMPLEMENT (
00399                CORBA::SystemException::_tao_minor_code (
00400                  0,
00401                  ENOTSUP),
00402                CORBA::COMPLETED_NO));
00403 }
00404 
00405 void
00406 CORBA::ORB::get_default_context (CORBA::Context_ptr &
00407                                 ACE_ENV_ARG_DECL)
00408 {
00409   ACE_THROW (CORBA::NO_IMPLEMENT (
00410                CORBA::SystemException::_tao_minor_code (
00411                  0,
00412                  ENOTSUP),
00413                CORBA::COMPLETED_NO));
00414 }
00415 
00416 void
00417 CORBA::ORB::send_multiple_requests_oneway (const CORBA::RequestSeq &
00418                                           ACE_ENV_ARG_DECL)
00419 {
00420   ACE_THROW (CORBA::NO_IMPLEMENT (
00421                CORBA::SystemException::_tao_minor_code (
00422                  0,
00423                  ENOTSUP),
00424                CORBA::COMPLETED_NO));
00425 }
00426 
00427 void
00428 CORBA::ORB::send_multiple_requests_deferred (const CORBA::RequestSeq &
00429                                             ACE_ENV_ARG_DECL)
00430 {
00431   ACE_THROW (CORBA::NO_IMPLEMENT (
00432                CORBA::SystemException::_tao_minor_code (
00433                  0,
00434                  ENOTSUP),
00435                CORBA::COMPLETED_NO));
00436 }
00437 
00438 void
00439 CORBA::ORB::get_next_response (CORBA::Request_ptr &
00440                               ACE_ENV_ARG_DECL)
00441 {
00442   ACE_THROW (CORBA::NO_IMPLEMENT (
00443                CORBA::SystemException::_tao_minor_code (
00444                  0,
00445                  ENOTSUP),
00446                CORBA::COMPLETED_NO));
00447 }
00448 
00449 CORBA::Boolean
00450 CORBA::ORB::poll_next_response (ACE_ENV_SINGLE_ARG_DECL)
00451 {
00452   ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (
00453                       CORBA::SystemException::_tao_minor_code (
00454                         0,
00455                         ENOTSUP),
00456                       CORBA::COMPLETED_NO),
00457                     0);
00458 }
00459 
00460 // ****************************************************************
00461 
00462 CORBA::TypeCode_ptr
00463 CORBA::ORB::create_struct_tc (
00464     const char *id,
00465     const char *name,
00466     const CORBA::StructMemberSeq & members
00467     ACE_ENV_ARG_DECL
00468   )
00469 {
00470   TAO_TypeCodeFactory_Adapter *adapter =
00471     ACE_Dynamic_Service<TAO_TypeCodeFactory_Adapter>::instance (
00472         TAO_ORB_Core::typecodefactory_adapter_name ()
00473       );
00474 
00475   if (adapter == 0)
00476     {
00477       ACE_THROW_RETURN (CORBA::INTERNAL (),
00478                         0);
00479     }
00480 
00481   return adapter->create_struct_tc (id,
00482                                     name,
00483                                     members
00484                                     ACE_ENV_ARG_PARAMETER);
00485 }
00486 
00487 CORBA::TypeCode_ptr
00488 CORBA::ORB::create_union_tc (
00489     const char *id,
00490     const char *name,
00491     CORBA::TypeCode_ptr discriminator_type,
00492     const CORBA::UnionMemberSeq & members
00493     ACE_ENV_ARG_DECL
00494   )
00495 {
00496   TAO_TypeCodeFactory_Adapter *adapter =
00497     ACE_Dynamic_Service<TAO_TypeCodeFactory_Adapter>::instance (
00498         TAO_ORB_Core::typecodefactory_adapter_name ()
00499       );
00500 
00501   if (adapter == 0)
00502     {
00503       ACE_THROW_RETURN (CORBA::INTERNAL (),
00504                         0);
00505     }
00506 
00507   return adapter->create_union_tc (id,
00508                                    name,
00509                                    discriminator_type,
00510                                    members
00511                                    ACE_ENV_ARG_PARAMETER);
00512 }
00513 
00514 CORBA::TypeCode_ptr
00515 CORBA::ORB::create_enum_tc (
00516     const char *id,
00517     const char *name,
00518     const CORBA::EnumMemberSeq & members
00519     ACE_ENV_ARG_DECL
00520   )
00521 {
00522   TAO_TypeCodeFactory_Adapter *adapter =
00523     ACE_Dynamic_Service<TAO_TypeCodeFactory_Adapter>::instance (
00524         TAO_ORB_Core::typecodefactory_adapter_name ()
00525       );
00526 
00527   if (adapter == 0)
00528     {
00529       ACE_THROW_RETURN (CORBA::INTERNAL (),
00530                         0);
00531     }
00532 
00533   return adapter->create_enum_tc (id,
00534                                   name,
00535                                   members
00536                                   ACE_ENV_ARG_PARAMETER);
00537 }
00538 
00539 CORBA::TypeCode_ptr
00540 CORBA::ORB::create_alias_tc (
00541     const char *id,
00542     const char *name,
00543     CORBA::TypeCode_ptr original_type
00544     ACE_ENV_ARG_DECL
00545   )
00546 {
00547   TAO_TypeCodeFactory_Adapter *adapter =
00548     ACE_Dynamic_Service<TAO_TypeCodeFactory_Adapter>::instance (
00549         TAO_ORB_Core::typecodefactory_adapter_name ()
00550       );
00551 
00552   if (adapter == 0)
00553     {
00554       ACE_THROW_RETURN (CORBA::INTERNAL (),
00555                         0);
00556     }
00557 
00558   return adapter->create_alias_tc (id,
00559                                    name,
00560                                    original_type
00561                                    ACE_ENV_ARG_PARAMETER);
00562 }
00563 
00564 CORBA::TypeCode_ptr
00565 CORBA::ORB::create_exception_tc (
00566     const char *id,
00567     const char *name,
00568     const CORBA::StructMemberSeq & members
00569     ACE_ENV_ARG_DECL
00570   )
00571 {
00572   TAO_TypeCodeFactory_Adapter *adapter =
00573     ACE_Dynamic_Service<TAO_TypeCodeFactory_Adapter>::instance (
00574         TAO_ORB_Core::typecodefactory_adapter_name ()
00575       );
00576 
00577   if (adapter == 0)
00578     {
00579       ACE_THROW_RETURN (CORBA::INTERNAL (),
00580                         0);
00581     }
00582 
00583   return adapter->create_exception_tc (id,
00584                                        name,
00585                                        members
00586                                        ACE_ENV_ARG_PARAMETER);
00587 }
00588 
00589 CORBA::TypeCode_ptr
00590 CORBA::ORB::create_interface_tc (
00591     const char *id,
00592     const char *name
00593     ACE_ENV_ARG_DECL
00594   )
00595 {
00596   TAO_TypeCodeFactory_Adapter *adapter =
00597     ACE_Dynamic_Service<TAO_TypeCodeFactory_Adapter>::instance (
00598         TAO_ORB_Core::typecodefactory_adapter_name ()
00599       );
00600 
00601   if (adapter == 0)
00602     {
00603       ACE_THROW_RETURN (CORBA::INTERNAL (),
00604                         0);
00605     }
00606 
00607   return adapter->create_interface_tc (id,
00608                                        name
00609                                        ACE_ENV_ARG_PARAMETER);
00610 }
00611 
00612 CORBA::TypeCode_ptr
00613 CORBA::ORB::create_string_tc (
00614     CORBA::ULong bound
00615     ACE_ENV_ARG_DECL
00616   )
00617 {
00618   TAO_TypeCodeFactory_Adapter *adapter =
00619     ACE_Dynamic_Service<TAO_TypeCodeFactory_Adapter>::instance (
00620         TAO_ORB_Core::typecodefactory_adapter_name ()
00621       );
00622 
00623   if (adapter == 0)
00624     {
00625       ACE_THROW_RETURN (CORBA::INTERNAL (),
00626                         0);
00627     }
00628 
00629   return adapter->create_string_tc (bound
00630                                     ACE_ENV_ARG_PARAMETER);
00631 }
00632 
00633 CORBA::TypeCode_ptr
00634 CORBA::ORB::create_wstring_tc (
00635     CORBA::ULong bound
00636     ACE_ENV_ARG_DECL
00637   )
00638 {
00639   TAO_TypeCodeFactory_Adapter *adapter =
00640     ACE_Dynamic_Service<TAO_TypeCodeFactory_Adapter>::instance (
00641         TAO_ORB_Core::typecodefactory_adapter_name ()
00642       );
00643 
00644   if (adapter == 0)
00645     {
00646       ACE_THROW_RETURN (CORBA::INTERNAL (),
00647                         0);
00648     }
00649 
00650   return adapter->create_wstring_tc (bound
00651                                      ACE_ENV_ARG_PARAMETER);
00652 }
00653 
00654 CORBA::TypeCode_ptr
00655 CORBA::ORB::create_fixed_tc (
00656     CORBA::UShort digits,
00657     CORBA::UShort scale
00658     ACE_ENV_ARG_DECL
00659   )
00660 {
00661   TAO_TypeCodeFactory_Adapter *adapter =
00662     ACE_Dynamic_Service<TAO_TypeCodeFactory_Adapter>::instance (
00663         TAO_ORB_Core::typecodefactory_adapter_name ()
00664       );
00665 
00666   if (adapter == 0)
00667     {
00668       ACE_THROW_RETURN (CORBA::INTERNAL (),
00669                         0);
00670     }
00671 
00672   return adapter->create_fixed_tc (digits,
00673                                    scale
00674                                    ACE_ENV_ARG_PARAMETER);
00675 }
00676 
00677 CORBA::TypeCode_ptr
00678 CORBA::ORB::create_sequence_tc (
00679     CORBA::ULong bound,
00680     CORBA::TypeCode_ptr element_type
00681     ACE_ENV_ARG_DECL
00682   )
00683 {
00684   TAO_TypeCodeFactory_Adapter *adapter =
00685     ACE_Dynamic_Service<TAO_TypeCodeFactory_Adapter>::instance (
00686         TAO_ORB_Core::typecodefactory_adapter_name ()
00687       );
00688 
00689   if (adapter == 0)
00690     {
00691       ACE_THROW_RETURN (CORBA::INTERNAL (),
00692                         0);
00693     }
00694 
00695   return adapter->create_sequence_tc (bound,
00696                                       element_type
00697                                       ACE_ENV_ARG_PARAMETER);
00698 }
00699 
00700 CORBA::TypeCode_ptr
00701 CORBA::ORB::create_array_tc (
00702     CORBA::ULong length,
00703     CORBA::TypeCode_ptr element_type
00704     ACE_ENV_ARG_DECL
00705   )
00706 {
00707   TAO_TypeCodeFactory_Adapter *adapter =
00708     ACE_Dynamic_Service<TAO_TypeCodeFactory_Adapter>::instance (
00709         TAO_ORB_Core::typecodefactory_adapter_name ()
00710       );
00711 
00712   if (adapter == 0)
00713     {
00714       ACE_THROW_RETURN (CORBA::INTERNAL (),
00715                         0);
00716     }
00717 
00718   return adapter->create_array_tc (length,
00719                                    element_type
00720                                    ACE_ENV_ARG_PARAMETER);
00721 }
00722 
00723 CORBA::TypeCode_ptr
00724 CORBA::ORB::create_value_tc (
00725     const char *id,
00726     const char *name,
00727     CORBA::ValueModifier type_modifier,
00728     CORBA::TypeCode_ptr concrete_base,
00729     const CORBA::ValueMemberSeq & members
00730     ACE_ENV_ARG_DECL
00731   )
00732 {
00733   TAO_TypeCodeFactory_Adapter *adapter =
00734     ACE_Dynamic_Service<TAO_TypeCodeFactory_Adapter>::instance (
00735         TAO_ORB_Core::typecodefactory_adapter_name ()
00736       );
00737 
00738   if (adapter == 0)
00739     {
00740       ACE_THROW_RETURN (CORBA::INTERNAL (),
00741                         0);
00742     }
00743 
00744   return adapter->create_value_tc (id,
00745                                    name,
00746                                    type_modifier,
00747                                    concrete_base,
00748                                    members
00749                                    ACE_ENV_ARG_PARAMETER);
00750 }
00751 
00752 CORBA::TypeCode_ptr
00753 CORBA::ORB::create_value_box_tc (
00754     const char *id,
00755     const char *name,
00756     CORBA::TypeCode_ptr boxed_type
00757     ACE_ENV_ARG_DECL
00758   )
00759 {
00760   TAO_TypeCodeFactory_Adapter *adapter =
00761     ACE_Dynamic_Service<TAO_TypeCodeFactory_Adapter>::instance (
00762         TAO_ORB_Core::typecodefactory_adapter_name ()
00763       );
00764 
00765   if (adapter == 0)
00766     {
00767       ACE_THROW_RETURN (CORBA::INTERNAL (),
00768                         0);
00769     }
00770 
00771   return adapter->create_value_box_tc (id,
00772                                        name,
00773                                        boxed_type
00774                                        ACE_ENV_ARG_PARAMETER);
00775 }
00776 
00777 CORBA::TypeCode_ptr
00778 CORBA::ORB::create_native_tc (
00779     const char *id,
00780     const char *name
00781     ACE_ENV_ARG_DECL
00782   )
00783 {
00784   TAO_TypeCodeFactory_Adapter *adapter =
00785     ACE_Dynamic_Service<TAO_TypeCodeFactory_Adapter>::instance (
00786         TAO_ORB_Core::typecodefactory_adapter_name ()
00787       );
00788 
00789   if (adapter == 0)
00790     {
00791       ACE_THROW_RETURN (CORBA::INTERNAL (),
00792                         0);
00793     }
00794 
00795   return adapter->create_native_tc (id,
00796                                     name
00797                                     ACE_ENV_ARG_PARAMETER);
00798 }
00799 
00800 CORBA::TypeCode_ptr
00801 CORBA::ORB::create_recursive_tc (
00802     const char *id
00803     ACE_ENV_ARG_DECL
00804   )
00805 {
00806   TAO_TypeCodeFactory_Adapter *adapter =
00807     ACE_Dynamic_Service<TAO_TypeCodeFactory_Adapter>::instance (
00808         TAO_ORB_Core::typecodefactory_adapter_name ()
00809       );
00810 
00811   if (adapter == 0)
00812     {
00813       ACE_THROW_RETURN (CORBA::INTERNAL (),
00814                         0);
00815     }
00816 
00817   return adapter->create_recursive_tc (id
00818                                        ACE_ENV_ARG_PARAMETER);
00819 }
00820 
00821 CORBA::TypeCode_ptr
00822 CORBA::ORB::create_abstract_interface_tc (
00823     const char *id,
00824     const char *name
00825     ACE_ENV_ARG_DECL
00826   )
00827 {
00828   TAO_TypeCodeFactory_Adapter *adapter =
00829     ACE_Dynamic_Service<TAO_TypeCodeFactory_Adapter>::instance (
00830         TAO_ORB_Core::typecodefactory_adapter_name ()
00831       );
00832 
00833   if (adapter == 0)
00834     {
00835       ACE_THROW_RETURN (CORBA::INTERNAL (),
00836                         0);
00837     }
00838 
00839   return adapter->create_abstract_interface_tc (id,
00840                                                 name
00841                                                 ACE_ENV_ARG_PARAMETER);
00842 }
00843 
00844 CORBA::TypeCode_ptr
00845 CORBA::ORB::create_local_interface_tc (
00846     const char *id,
00847     const char *name
00848     ACE_ENV_ARG_DECL
00849   )
00850 {
00851   TAO_TypeCodeFactory_Adapter *adapter =
00852     ACE_Dynamic_Service<TAO_TypeCodeFactory_Adapter>::instance (
00853         TAO_ORB_Core::typecodefactory_adapter_name ()
00854       );
00855 
00856   if (adapter == 0)
00857     {
00858       ACE_THROW_RETURN (CORBA::INTERNAL (),
00859                         0);
00860     }
00861 
00862   return adapter->create_local_interface_tc (id,
00863                                              name
00864                                              ACE_ENV_ARG_PARAMETER);
00865 }
00866 
00867 CORBA::TypeCode_ptr
00868 CORBA::ORB::create_component_tc (
00869     const char *id,
00870     const char *name
00871     ACE_ENV_ARG_DECL
00872   )
00873 {
00874   TAO_TypeCodeFactory_Adapter *adapter =
00875     ACE_Dynamic_Service<TAO_TypeCodeFactory_Adapter>::instance (
00876         TAO_ORB_Core::typecodefactory_adapter_name ()
00877       );
00878 
00879   if (adapter == 0)
00880     {
00881       ACE_THROW_RETURN (CORBA::INTERNAL (),
00882                         0);
00883     }
00884 
00885   return adapter->create_component_tc (id,
00886                                        name
00887                                        ACE_ENV_ARG_PARAMETER);
00888 }
00889 
00890 CORBA::TypeCode_ptr
00891 CORBA::ORB::create_home_tc (
00892     const char *id,
00893     const char *name
00894     ACE_ENV_ARG_DECL
00895   )
00896 {
00897   TAO_TypeCodeFactory_Adapter *adapter =
00898     ACE_Dynamic_Service<TAO_TypeCodeFactory_Adapter>::instance (
00899         TAO_ORB_Core::typecodefactory_adapter_name ()
00900       );
00901 
00902   if (adapter == 0)
00903     {
00904       ACE_THROW_RETURN (CORBA::INTERNAL (),
00905                         0);
00906     }
00907 
00908   return adapter->create_home_tc (id,
00909                                   name
00910                                   ACE_ENV_ARG_PARAMETER);
00911 }
00912 
00913 CORBA::TypeCode_ptr
00914 CORBA::ORB::create_event_tc (
00915     const char *id,
00916     const char *name,
00917     CORBA::ValueModifier type_modifier,
00918     CORBA::TypeCode_ptr concrete_base,
00919     const CORBA::ValueMemberSeq &members
00920     ACE_ENV_ARG_DECL
00921   )
00922 {
00923   TAO_TypeCodeFactory_Adapter *adapter =
00924     ACE_Dynamic_Service<TAO_TypeCodeFactory_Adapter>::instance (
00925         TAO_ORB_Core::typecodefactory_adapter_name ()
00926       );
00927 
00928   if (adapter == 0)
00929     {
00930       ACE_THROW_RETURN (CORBA::INTERNAL (),
00931                         0);
00932     }
00933 
00934   return adapter->create_event_tc (id,
00935                                    name,
00936                                    type_modifier,
00937                                    concrete_base,
00938                                    members
00939                                    ACE_ENV_ARG_PARAMETER);
00940 }
00941 
00942 // ****************************************************************
00943 
00944 #endif /* TAO_HAS_MINIMUM_CORBA */
00945 
00946 CORBA::Object_ptr
00947 CORBA::ORB::resolve_policy_manager (void)
00948 {
00949 #if (TAO_HAS_CORBA_MESSAGING == 1)
00950 
00951   TAO_Policy_Manager *policy_manager =
00952     this->orb_core_->policy_manager ();
00953 
00954   if (policy_manager == 0)
00955     {
00956       return CORBA::Object::_nil ();
00957     }
00958 
00959   return CORBA::Object::_duplicate (policy_manager);
00960 
00961 #else
00962 
00963   return CORBA::Object::_nil ();
00964 
00965 #endif /* TAO_HAS_CORBA_MESSAGING == 1 */
00966 }
00967 
00968 CORBA::Object_ptr
00969 CORBA::ORB::resolve_policy_current (void)
00970 {
00971 
00972 #if (TAO_HAS_CORBA_MESSAGING == 1)
00973 
00974   TAO_Policy_Current &policy_current = this->orb_core_->policy_current ();
00975   return CORBA::Object::_duplicate (&policy_current);
00976 
00977 #else
00978 
00979   return CORBA::Object::_nil ();
00980 
00981 #endif /* TAO_HAS_CORBA_MESSAGING == 1 */
00982 }
00983 
00984 void
00985 CORBA::ORB::resolve_service (TAO::MCAST_SERVICEID mcast_service_id)
00986 {
00987   static char const * const env_service_port[] =
00988   {
00989     "NameServicePort",
00990     "TradingServicePort",
00991     "ImplRepoServicePort",
00992     "InterfaceRepoServicePort"
00993   };
00994 
00995   static unsigned short const default_service_port[] =
00996   {
00997     TAO_DEFAULT_NAME_SERVER_REQUEST_PORT,
00998     TAO_DEFAULT_TRADING_SERVER_REQUEST_PORT,
00999     TAO_DEFAULT_IMPLREPO_SERVER_REQUEST_PORT,
01000     TAO_DEFAULT_INTERFACEREPO_SERVER_REQUEST_PORT
01001   };
01002 
01003   // By now, the table filled in with -ORBInitRef arguments has been
01004   // checked.  We only get here if the table didn't contain an initial
01005   // reference for the requested Service.
01006 
01007   CORBA::String_var default_init_ref =
01008         this->orb_core_->orb_params ()->default_init_ref ();
01009 
01010   static char const mcast_prefix[] = "mcast://:::";
01011 
01012   if ((ACE_OS::strncmp (default_init_ref.in (),
01013                         mcast_prefix,
01014                         sizeof (mcast_prefix) - 1) == 0))
01015     {
01016       // First, determine if the port was supplied on the command line
01017       unsigned short port =
01018         this->orb_core_->orb_params ()->service_port (mcast_service_id);
01019 
01020       if (port == 0)
01021         {
01022           // Look for the port among our environment variables.
01023           char const * const port_number =
01024             ACE_OS::getenv (env_service_port[mcast_service_id]);
01025 
01026           if (port_number != 0)
01027             port = static_cast<unsigned short> (ACE_OS::atoi (port_number));
01028           else
01029             port = default_service_port[mcast_service_id];
01030         }
01031 
01032       // Set the port value in ORB_Params: modify the default mcast
01033       // value.
01034       static char const mcast_fmt[] = "mcast://:%d::";
01035       static size_t const PORT_BUF_SIZE = 256;
01036 
01037       char def_init_ref[PORT_BUF_SIZE] = { 0 }; // snprintf() doesn't
01038                                                 // null terminate.
01039                                                 // Make sure we do.
01040 
01041       ACE_OS::snprintf (def_init_ref,
01042                         PORT_BUF_SIZE - 1, // Account for null
01043                                            // terminator.
01044                         mcast_fmt,
01045                         port);
01046 
01047       this->orb_core_->orb_params ()->default_init_ref (def_init_ref);
01048     }
01049 }
01050 
01051 CORBA::Object_ptr
01052 CORBA::ORB::resolve_initial_references (const char *name
01053                                         ACE_ENV_ARG_DECL)
01054 {
01055   return this->resolve_initial_references (name,
01056                                            0
01057                                            ACE_ENV_ARG_PARAMETER);
01058 }
01059 
01060 CORBA::Object_ptr
01061 CORBA::ORB::resolve_initial_references (const char *name,
01062                                         ACE_Time_Value *timeout
01063                                         ACE_ENV_ARG_DECL)
01064 {
01065   // This method should not be called if the ORB has been shutdown.
01066   this->check_shutdown (ACE_ENV_SINGLE_ARG_PARAMETER);
01067   ACE_CHECK_RETURN (CORBA::Object::_nil ());
01068 
01069   CORBA::Object_var result;
01070 
01071   if (ACE_OS::strcmp (name, TAO_OBJID_ROOTPOA) == 0)
01072     {
01073       result = this->orb_core ()->root_poa (ACE_ENV_SINGLE_ARG_PARAMETER);
01074       ACE_CHECK_RETURN (CORBA::Object::_nil ());
01075     }
01076   else if (ACE_OS::strcmp (name, TAO_OBJID_POACURRENT) == 0)
01077     {
01078       result = this->orb_core ()->resolve_poa_current
01079         (ACE_ENV_SINGLE_ARG_PARAMETER);
01080       ACE_CHECK_RETURN (CORBA::Object::_nil ());
01081     }
01082   else if (ACE_OS::strcmp (name, TAO_OBJID_POLICYMANAGER) == 0)
01083     {
01084       result = this->resolve_policy_manager ();
01085     }
01086   else if (ACE_OS::strcmp (name, TAO_OBJID_POLICYCURRENT) == 0)
01087     {
01088       result = this->resolve_policy_current ();
01089     }
01090   else if (ACE_OS::strcmp (name, TAO_OBJID_IORMANIPULATION) == 0)
01091     {
01092       result = this->orb_core ()->resolve_ior_manipulation
01093         (ACE_ENV_SINGLE_ARG_PARAMETER);
01094       ACE_CHECK_RETURN (CORBA::Object::_nil ());
01095     }
01096   else if (ACE_OS::strcmp (name, TAO_OBJID_IORTABLE) == 0)
01097     {
01098       result = this->orb_core ()->resolve_ior_table
01099         (ACE_ENV_SINGLE_ARG_PARAMETER);
01100       ACE_CHECK_RETURN (CORBA::Object::_nil ());
01101     }
01102   else if (ACE_OS::strcmp (name, TAO_OBJID_DYNANYFACTORY) == 0)
01103     {
01104       result = this->orb_core ()->resolve_dynanyfactory
01105         (ACE_ENV_SINGLE_ARG_PARAMETER);
01106       ACE_CHECK_RETURN (CORBA::Object::_nil ());
01107     }
01108   else if (ACE_OS::strcmp (name, TAO_OBJID_TYPECODEFACTORY) == 0)
01109     {
01110       result = this->orb_core ()->resolve_typecodefactory
01111         (ACE_ENV_SINGLE_ARG_PARAMETER);
01112       ACE_CHECK_RETURN (CORBA::Object::_nil ());
01113     }
01114   else if (ACE_OS::strcmp (name, TAO_OBJID_CODECFACTORY) == 0)
01115     {
01116       result = this->orb_core ()->resolve_codecfactory
01117         (ACE_ENV_SINGLE_ARG_PARAMETER);
01118       ACE_CHECK_RETURN (CORBA::Object::_nil ());
01119     }
01120 #if TAO_HAS_INTERCEPTORS == 1
01121   else if (ACE_OS::strcmp (name, TAO_OBJID_PICurrent) == 0)
01122     {
01123       result = this->orb_core ()->resolve_picurrent
01124         (ACE_ENV_SINGLE_ARG_PARAMETER);
01125       ACE_CHECK_RETURN (CORBA::Object::_nil ());
01126     }
01127 #endif
01128 
01129   // -----------------------------------------------------------------
01130 
01131   if (CORBA::is_nil (result.in ()))
01132     {
01133       // Search the object reference table.  This search must occur before
01134       // the InitRef table search, since it may contain local objects.
01135       result =
01136         this->orb_core ()->object_ref_table ().resolve_initial_reference (
01137           name);
01138     }
01139 
01140   if (!CORBA::is_nil (result.in ()))
01141     return result._retn ();
01142 
01143   // -----------------------------------------------------------------
01144 
01145   // Check ORBInitRef options.
01146 
01147   // @@ There appears to be long standing (i.e. back when the map was
01148   //    an ACE_Hash_Map_Manager) race condition here since the map
01149   //    access is not synchronized.
01150 
01151   // Is the service name in the IOR Table.
01152   TAO_ORB_Core::InitRefMap::iterator ior =
01153     this->orb_core_->init_ref_map ()->find (ACE_CString (name));
01154 
01155   if (ior != this->orb_core_->init_ref_map ()->end ())
01156     return this->string_to_object ((*ior).second.c_str ()
01157                                    ACE_ENV_ARG_PARAMETER);
01158 
01159   // Look for an environment variable called "<name>IOR".
01160   //
01161   CORBA::String_var ior_env_var_name =
01162     CORBA::string_alloc (static_cast<CORBA::ULong> (ACE_OS::strlen (name) + 3));
01163 
01164   ACE_OS::strcpy (ior_env_var_name.inout (),
01165                   name);
01166 
01167   ACE_OS::strcat (ior_env_var_name.inout (),
01168                   "IOR");
01169 
01170   ACE_CString service_ior = ACE_OS::getenv (ior_env_var_name.in ());
01171 
01172   if (ACE_OS::strcmp (service_ior.c_str (), "") != 0 )
01173     {
01174       result =
01175         this->string_to_object (service_ior.c_str()
01176                                 ACE_ENV_ARG_PARAMETER);
01177       ACE_CHECK_RETURN (CORBA::Object::_nil ());
01178 
01179       return result._retn ();
01180     }
01181 
01182   // May be trying the explicitly specified services and the well
01183   // known services should be tried first before falling on to default
01184   // services.
01185 
01186   // Set the timeout value.
01187   this->set_timeout (timeout);
01188 
01189   if (ACE_OS::strcmp (name, TAO_OBJID_NAMESERVICE) == 0)
01190     {
01191       this->resolve_service (TAO::MCAST_NAMESERVICE);
01192     }
01193   else if (ACE_OS::strcmp (name, TAO_OBJID_TRADINGSERVICE) == 0)
01194     {
01195       this->resolve_service (TAO::MCAST_TRADINGSERVICE);
01196     }
01197   else if (ACE_OS::strcmp (name, TAO_OBJID_IMPLREPOSERVICE) == 0)
01198     {
01199       this->resolve_service (TAO::MCAST_IMPLREPOSERVICE);
01200     }
01201   else if (ACE_OS::strcmp (name, TAO_OBJID_INTERFACEREP) == 0)
01202     {
01203       this->resolve_service (TAO::MCAST_INTERFACEREPOSERVICE);
01204     }
01205 
01206   // Is not one of the well known services, try to find it in the
01207   // InitRef table....check the defaultinitref values also.
01208 
01209   result = this->orb_core ()->resolve_rir (name ACE_ENV_ARG_PARAMETER);
01210   ACE_CHECK_RETURN (CORBA::Object::_nil ());
01211 
01212   if (!CORBA::is_nil (result.in ()))
01213     return result._retn ();
01214   // -----------------------------------------------------------------
01215 
01216   ACE_THROW_RETURN (CORBA::ORB::InvalidName (), CORBA::Object::_nil ());
01217 }
01218 
01219 #if !defined(CORBA_E_MICRO)
01220 void
01221 CORBA::ORB::register_initial_reference (const char * id,
01222                                         CORBA::Object_ptr obj
01223                                         ACE_ENV_ARG_DECL)
01224 {
01225   if (id == 0 || ACE_OS::strlen (id) == 0)
01226     ACE_THROW (CORBA::ORB::InvalidName ());
01227   ACE_CHECK;
01228 
01229   if (CORBA::is_nil (obj))
01230     ACE_THROW (CORBA::BAD_PARAM (CORBA::OMGVMCID | 27,
01231                                  CORBA::COMPLETED_NO));
01232   ACE_CHECK;
01233 
01234   TAO_Object_Ref_Table &table = this->orb_core_->object_ref_table ();
01235 
01236   if (table.register_initial_reference (id, obj) == -1)
01237     ACE_THROW (CORBA::ORB::InvalidName ());
01238 }
01239 #endif
01240 
01241 CORBA::ORB::ObjectIdList_ptr
01242 CORBA::ORB::list_initial_services (ACE_ENV_SINGLE_ARG_DECL)
01243 {
01244   this->check_shutdown (ACE_ENV_SINGLE_ARG_PARAMETER);
01245   ACE_CHECK_RETURN (0);
01246 
01247   return
01248     this->orb_core ()->list_initial_references (ACE_ENV_SINGLE_ARG_PARAMETER);
01249 }
01250 
01251 void
01252 CORBA::ORB::check_shutdown (ACE_ENV_SINGLE_ARG_DECL)
01253 {
01254   if (this->orb_core () != 0)
01255     {
01256       this->orb_core ()->check_shutdown (ACE_ENV_SINGLE_ARG_PARAMETER);
01257       ACE_CHECK;
01258     }
01259   else
01260     {
01261       // If the ORB_Core pointer is zero, assume that the ORB_Core has
01262       // been destroyed.
01263 
01264       // As defined by the CORBA 2.3 specification, throw a
01265       // CORBA::OBJECT_NOT_EXIST exception if the ORB has been
01266       // destroyed by the time an ORB function is called.
01267 
01268       ACE_THROW (CORBA::OBJECT_NOT_EXIST (0,
01269                                           CORBA::COMPLETED_NO));
01270     }
01271 }
01272 
01273 // ****************************************************************
01274 
01275 void
01276 TAO::ORB::init_orb_globals (ACE_ENV_SINGLE_ARG_DECL)
01277 {
01278   // This method should be invoked atomically.  It is the caller's
01279   // responsibility to ensure that this condition is satisfied.
01280 
01281   // Prevent multiple initializations.
01282   if (orb_init_count != 0)
01283     {
01284       return;
01285     }
01286   else
01287     {
01288       ++orb_init_count;
01289     }
01290 
01291   // This must be done after the system TypeCodes and Exceptions have
01292   // been initialized.  An unexpected exception will cause TAO's
01293   // unexpected exception handler to be called.  That handler
01294   // transforms all unexpected exceptions to CORBA::UNKNOWN, which of
01295   // course requires the TypeCode constants and system exceptions to
01296   // have been initialized.
01297   /**
01298    * @note The new TypeCode implementation obviates the above
01299    *       comment.  Standard CORBA exception TypeCodes are now
01300    *       available before CORBA::ORB_init() is ever called.
01301    */
01302   TAO_Singleton_Manager::instance ()->_set_unexpected (
01303     ::TAO_unexpected_exception_handler);
01304 }
01305 
01306 const ACE_CString &
01307 CORBA::ORB::_tao_ft_client_id (void)
01308 {
01309   return this->orb_core ()->fault_tolerance_service ().client_id ();
01310 }
01311 
01312 void
01313 CORBA::ORB::_tao_ft_client_id (const char *id)
01314 {
01315   this->orb_core ()->fault_tolerance_service ().client_id (id);
01316 }
01317 
01318 CORBA::ORB_ptr
01319 CORBA::ORB::_tao_make_ORB (TAO_ORB_Core * orb_core)
01320 {
01321   CORBA::ORB_ptr orb = CORBA::ORB::_nil ();
01322 
01323   ACE_NEW_RETURN (orb,
01324                   CORBA::ORB (orb_core),
01325                   CORBA::ORB::_nil ());
01326 
01327   return orb;
01328 }
01329 
01330 // ****************************************************************
01331 
01332 // ORB initialization, per OMG document 98-12-01.
01333 
01334 CORBA::ORB_ptr
01335 CORBA::ORB_init (int &argc,
01336                  char *argv[],
01337                  const char *orb_name)
01338 {
01339   return CORBA::ORB_init (argc,
01340                           argv,
01341                           orb_name,
01342                           TAO_default_environment ());
01343 }
01344 
01345 CORBA::ORB_ptr
01346 CORBA::ORB_init (int &argc,
01347                  char *argv[],
01348                  const char *orbid,
01349                  CORBA::Environment &ACE_TRY_ENV)
01350 {
01351   // This ugly macro will go away once we've merged the two ORB_init's.
01352   ACE_UNUSED_ARG(ACE_TRY_ENV); // FUZZ: ignore check_for_ace_check
01353 
01354   // Use this string variable to hold the orbid
01355   ACE_CString orbid_string (orbid);
01356 
01357   // Copy command line parameter not to use original.
01358   ACE_Argv_Type_Converter command_line(argc, argv);
01359 
01360   {
01361     // Using ACE_Static_Object_Lock::instance() precludes ORB_init()
01362     // from being called within a static object CTOR.
01363     ACE_MT (ACE_GUARD_RETURN (TAO_SYNCH_RECURSIVE_MUTEX,
01364                               guard,
01365                               *ACE_Static_Object_Lock::instance (),
01366                               CORBA::ORB::_nil ()));
01367 
01368     // Make sure TAO's singleton manager is initialized.
01369     // We need to initialize before TAO_default_environment() is called
01370     // since that call instantiates a TAO_TSS_Singleton.
01371     if (TAO_Singleton_Manager::instance ()->init () == -1)
01372       {
01373         return CORBA::ORB::_nil ();
01374       }
01375 
01376     TAO::ORB::init_orb_globals (ACE_ENV_SINGLE_ARG_PARAMETER);
01377     ACE_CHECK_RETURN (CORBA::ORB::_nil ());
01378   }
01379 
01380   // Make sure the following is done after the global ORB
01381   // initialization since we need to have exceptions initialized.
01382 
01383   // It doesn't make sense for argc to be zero and argv to be
01384   // non-empty/zero, or for argc to be greater than zero and argv be
01385   // zero.
01386   const size_t argv0_len =
01387     (command_line.get_TCHAR_argv ()
01388      ? (*command_line.get_TCHAR_argv ()
01389         ? ACE_OS::strlen (*command_line.get_TCHAR_argv ())
01390         : 0)
01391      : 0);
01392 
01393   if ((command_line.get_argc () == 0 && argv0_len != 0)
01394       || (command_line.get_argc () != 0
01395           && (command_line.get_TCHAR_argv () == 0
01396               || command_line.get_TCHAR_argv ()[0] == 0)))
01397     {
01398       ACE_THROW_RETURN (CORBA::BAD_PARAM (
01399                           CORBA::SystemException::_tao_minor_code (
01400                             0,
01401                             EINVAL),
01402                           CORBA::COMPLETED_NO),
01403                         CORBA::ORB::_nil ());
01404     }
01405 
01406 
01407 
01408   if (orbid_string.length () == 0)
01409     {
01410       ACE_Arg_Shifter arg_shifter (command_line.get_argc (),
01411                                    command_line.get_TCHAR_argv ());
01412 
01413       while (arg_shifter.is_anything_left ())
01414         {
01415           const ACE_TCHAR *current_arg = arg_shifter.get_current ();
01416 
01417           static const ACE_TCHAR orbid_opt[] = ACE_TEXT ("-ORBid");
01418           size_t orbid_len = ACE_OS::strlen (orbid_opt);
01419           if (ACE_OS::strcasecmp (current_arg,
01420                                   orbid_opt) == 0)
01421             {
01422               arg_shifter.consume_arg ();
01423               if (arg_shifter.is_parameter_next ())
01424                 {
01425                   orbid_string =
01426                     ACE_TEXT_ALWAYS_CHAR (arg_shifter.get_current ());
01427                   arg_shifter.consume_arg ();
01428                 }
01429             }
01430           else if (ACE_OS::strncasecmp (current_arg, orbid_opt,
01431                                         orbid_len) == 0)
01432             {
01433               arg_shifter.consume_arg ();
01434               // The rest of the argument is the ORB id...
01435               // but we should skip an optional space...
01436               if (current_arg[orbid_len] == ' ')
01437                 orbid_string =
01438                   ACE_TEXT_ALWAYS_CHAR (current_arg + orbid_len + 1);
01439               else
01440                 orbid_string = ACE_TEXT_ALWAYS_CHAR (current_arg + orbid_len);
01441             }
01442           else
01443             arg_shifter.ignore_arg ();
01444         }
01445     }
01446 
01447   // Get ORB Core
01448   TAO_ORB_Core_Auto_Ptr oc (
01449     TAO::ORB_Table::instance ()->find (orbid_string.c_str ()));
01450 
01451   // The ORB was already initialized.  Just return that one.
01452   if (oc.get () != 0)
01453     {
01454       return CORBA::ORB::_duplicate (oc->orb ());
01455     }
01456   else
01457     {
01458       // An ORB corresponding to the desired ORBid doesn't exist so create
01459       // a new one.
01460       TAO_ORB_Core * tmp = 0;
01461       ACE_NEW_THROW_EX (tmp,
01462                         TAO_ORB_Core (orbid_string.c_str ()),
01463                         CORBA::NO_MEMORY (
01464                           CORBA::SystemException::_tao_minor_code (0,
01465                                                                    ENOMEM),
01466                           CORBA::COMPLETED_NO));
01467       ACE_CHECK_RETURN (CORBA::ORB::_nil ());
01468 
01469       // The ORB table increases the reference count on the ORB Core
01470       // so do not release it here.  Allow the TAO_ORB_Core_Auto_Ptr
01471       // to decrease the reference count on the ORB Core when it goes
01472       // out of scope.
01473       oc.reset (tmp);
01474     }
01475 
01476 
01477   // Having the ORB's default static services be shared among all ORBs
01478   // is tempting from the point of view of reducing the dynamic
01479   // footprint. However, if the ORB in a DLL and the rest of that
01480   // application most likely neither cares, nor wishes to know about
01481   // them. Furthermore, if the ORB DLL gets unloaded, the static
01482   // services it had registered globaly will no longer be accesible,
01483   // which will have disastrous consequences at the process
01484   // shutdown. Hence, the ACE_Service_Config_Guard ensures that for
01485   // the current thread, any references to the global
01486   // ACE_Service_Config will be forwarded to the ORB's.
01487 
01488   // Making sure the initialization process in the current thread uses
01489   // the correct service repository (ours), instead of the global one.
01490   ACE_Service_Config_Guard scg (oc->configuration ());
01491 
01492   /*
01493    * Currently I choose to make the ORB an owner of its configuration,
01494    * which in general is not quite correct because it is very common ORBs to
01495    * need to share the same configuration.
01496    */
01497 
01498   // Initialize the Service Configurator.  This must occur before the
01499   // ORBInitializer::pre_init() method is invoked on each registered
01500   // ORB initializer.
01501   int result = TAO::ORB::open_services (oc->configuration (),
01502                                         command_line.get_argc (),
01503                                         command_line.get_TCHAR_argv ());
01504 
01505   // Check for errors returned from <TAO_Internal::open_services>.
01506   if (result != 0 && errno != ENOENT)
01507     {
01508       ACE_ERROR ((LM_ERROR,
01509                   ACE_TEXT ("(%P|%t) %p\n"),
01510                   ACE_TEXT ("Unable to initialize the ")
01511                   ACE_TEXT ("Service Configurator")));
01512       ACE_THROW_RETURN (CORBA::INITIALIZE (
01513                           CORBA::SystemException::_tao_minor_code (
01514                             TAO_ORB_CORE_INIT_LOCATION_CODE,
01515                             0),
01516                           CORBA::COMPLETED_NO),
01517                         CORBA::ORB::_nil ());
01518     }
01519 
01520   TAO::ORBInitializer_Registry_Adapter * orbinitializer_registry =
01521     oc.get ()->orbinitializer_registry ();
01522 
01523   PortableInterceptor::SlotId slotid = 0;
01524   size_t pre_init_count = 0;
01525 
01526   if (orbinitializer_registry != 0)
01527     {
01528       pre_init_count =
01529         orbinitializer_registry->pre_init (oc.get (),
01530                                            command_line.get_argc(),
01531                                            command_line.get_ASCII_argv(),
01532                                            slotid
01533                                            ACE_ENV_ARG_PARAMETER);
01534       ACE_CHECK_RETURN (CORBA::ORB::_nil ());
01535     }
01536 
01537   // Initialize the ORB Core instance.
01538   result = oc->init (command_line.get_argc(),
01539                      command_line.get_ASCII_argv()
01540                      ACE_ENV_ARG_PARAMETER);
01541   ACE_CHECK_RETURN (CORBA::ORB::_nil ());
01542 
01543   if (orbinitializer_registry != 0)
01544     {
01545 
01546       orbinitializer_registry->post_init (pre_init_count,
01547                                           oc.get (),
01548                                           command_line.get_argc(),
01549                                           command_line.get_ASCII_argv(),
01550                                           slotid
01551                                           ACE_ENV_ARG_PARAMETER);
01552       ACE_CHECK_RETURN (CORBA::ORB::_nil ());
01553     }
01554 
01555   if (TAO_debug_level > 2)
01556     {
01557       ACE_DEBUG ((LM_DEBUG,
01558                   ACE_TEXT("TAO (%P|%t) created new ORB <%s>\n"),
01559                   ACE_TEXT_CHAR_TO_TCHAR (orbid_string.c_str ())));
01560     }
01561 
01562   // Before returning remember to store the ORB into the table...
01563   if (TAO::ORB_Table::instance ()->bind (orbid_string.c_str (),
01564                                          oc.get ()) != 0)
01565     ACE_THROW_RETURN (CORBA::INTERNAL (0,
01566                                        CORBA::COMPLETED_NO),
01567                       CORBA::ORB::_nil ());
01568 
01569   // Return a duplicate since the ORB_Core should release the last
01570   // reference to the ORB.
01571   return CORBA::ORB::_duplicate (oc->orb ());
01572 }
01573 
01574 // ****************************************************************
01575 
01576 // Object reference stringification.
01577 char *
01578 CORBA::ORB::object_to_string (CORBA::Object_ptr obj
01579                               ACE_ENV_ARG_DECL)
01580 {
01581   // This method should not be called if the ORB has been shutdown.
01582   this->check_shutdown (ACE_ENV_SINGLE_ARG_PARAMETER);
01583   ACE_CHECK_RETURN (0);
01584 
01585   if (!CORBA::is_nil (obj) && obj->_is_local ())
01586     ACE_THROW_RETURN (CORBA::MARSHAL (CORBA::OMGVMCID | 4,
01587                                       CORBA::COMPLETED_NO),
01588                       0);
01589 
01590 
01591   // Application writer controls what kind of objref strings they get,
01592   // maybe along with other things, by how they initialize the ORB.
01593 
01594   if (use_omg_ior_format_)
01595     {
01596       // By default, orbs use IOR strings; these are ugly (and error
01597       // prone) but specified by CORBA.
01598       //
01599       // XXX there should be a simple way to reuse this code in other
01600       // ORB implementations ...
01601 
01602 #if defined (ACE_INITIALIZE_MEMORY_BEFORE_USE)
01603       char buf [ACE_CDR::DEFAULT_BUFSIZE] = { 0 };
01604 #else
01605       // Avoid the initialization overhead if not compiling with
01606       // support for a memory profiler.  There is no need to actually perform
01607       // initialization otherwise.
01608       char buf [ACE_CDR::DEFAULT_BUFSIZE];
01609 #endif /* ACE_INITIALIZE_MEMORY_BEFORE_USE */
01610 
01611       TAO_OutputCDR cdr (buf,  sizeof buf,
01612                          TAO_ENCAP_BYTE_ORDER,
01613                          this->orb_core_->output_cdr_buffer_allocator (),
01614                          this->orb_core_->output_cdr_dblock_allocator (),
01615                          this->orb_core_->output_cdr_msgblock_allocator (),
01616                          this->orb_core_->orb_params ()->cdr_memcpy_tradeoff (),
01617                          TAO_DEF_GIOP_MAJOR,
01618                          TAO_DEF_GIOP_MINOR);
01619 
01620       // There is no translator currently available for stringifying an object
01621       // reference, since there is no transport with which to choose an NCS/TCS
01622       // pair.
01623 
01624       // support limited oref ACE_OS::strcmp.
01625       (void) ACE_OS::memset (buf, 0, sizeof (buf));
01626 
01627       // Marshal the objref into an encapsulation bytestream.
01628       (void) cdr.write_octet (TAO_ENCAP_BYTE_ORDER);
01629       if ((cdr << obj) == 0)
01630         ACE_THROW_RETURN (CORBA::MARSHAL (), 0);
01631 
01632       // Now hexify the encapsulated CDR data into a string, and
01633       // return that string.
01634 
01635       const size_t total_len = cdr.total_length ();
01636 
01637       char *cp = 0;
01638       ACE_ALLOCATOR_RETURN (cp,
01639                             CORBA::string_alloc (
01640                               sizeof ior_prefix
01641                               + 2
01642                               * static_cast<CORBA::ULong> (total_len)),
01643                             0);
01644 
01645       CORBA::String_var string = cp;
01646 
01647       ACE_OS::strcpy (cp, ior_prefix);
01648       cp += sizeof (ior_prefix) - 1;
01649 
01650       for (const ACE_Message_Block *i = cdr.begin ();
01651            i != 0;
01652            i = i->cont ())
01653         {
01654           const char *bytes = i->rd_ptr ();
01655           size_t len = i->length ();
01656 
01657           while (len--)
01658             {
01659               *cp++ = ACE::nibble2hex ((*bytes) >> 4);
01660               *cp++ = ACE::nibble2hex (*bytes);
01661               ++bytes;
01662             }
01663         }
01664       // Null terminate the string..
01665       *cp = 0;
01666 
01667       return string._retn ();
01668     }
01669   else
01670     {
01671       // It is perfectly valid to marshal a nil object reference.
01672       // However, it is not possible to convert a nil object reference
01673       // to a URL IOR, so throw an exception.
01674       if (CORBA::is_nil (obj) || obj->_stubobj () == 0)
01675         {
01676           if (TAO_debug_level > 0)
01677             ACE_ERROR ((LM_ERROR,
01678                         ACE_TEXT ("Nil object reference or TAO_Stub ")
01679                         ACE_TEXT ("pointer is zero when converting\n")
01680                         ACE_TEXT ("object reference to URL IOR.\n")));
01681 
01682           ACE_THROW_RETURN (CORBA::MARSHAL (
01683                               CORBA::SystemException::_tao_minor_code (
01684                                 0,
01685                                 EINVAL),
01686                               CORBA::COMPLETED_NO),
01687                             0);
01688         }
01689 
01690       TAO_MProfile &mp = obj->_stubobj ()->base_profiles ();
01691 
01692       if (mp.profile_count () == 0)
01693         {
01694           if (TAO_debug_level > 0)
01695             ACE_ERROR ((LM_ERROR,
01696                         ACE_TEXT ("(%P|%t) Cannot stringify given ")
01697                         ACE_TEXT ("object.  No profiles.\n")));
01698 
01699 
01700           ACE_THROW_RETURN (CORBA::MARSHAL (
01701                               CORBA::SystemException::_tao_minor_code (
01702                                 0,
01703                                 EINVAL),
01704                               CORBA::COMPLETED_NO),
01705                             0);
01706         }
01707 
01708       // For now we just use the first profile.
01709       TAO_Profile *profile = mp.get_profile (0);
01710 
01711       return profile->to_string (ACE_ENV_SINGLE_ARG_PARAMETER);
01712     }
01713 }
01714 
01715 // Destringify arbitrary objrefs.  This method is called from
01716 // <resolve_name_service> with an IOR <multicast_to_service>.
01717 
01718 CORBA::Object_ptr
01719 CORBA::ORB::string_to_object (const char *str
01720                               ACE_ENV_ARG_DECL)
01721 {
01722   // This method should not be called if the ORB has been shutdown.
01723   this->check_shutdown (ACE_ENV_SINGLE_ARG_PARAMETER);
01724   ACE_CHECK_RETURN (CORBA::Object::_nil ());
01725 
01726   // Check for NULL pointer
01727   if (str == 0)
01728     ACE_THROW_RETURN (CORBA::INV_OBJREF (
01729                         CORBA::SystemException::_tao_minor_code (
01730                           0,
01731                           EINVAL),
01732                         CORBA::COMPLETED_NO),
01733                       CORBA::Object::_nil ());
01734 
01735   TAO_IOR_Parser *ior_parser =
01736     this->orb_core_->parser_registry ()->match_parser (str);
01737 
01738   if (ior_parser != 0)
01739     {
01740       return ior_parser->parse_string (str,
01741                                        this
01742                                        ACE_ENV_ARG_PARAMETER);
01743     }
01744 
01745 
01746   if (ACE_OS::strncmp (str,
01747                        ior_prefix,
01748                        sizeof ior_prefix - 1) == 0)
01749     return this->ior_string_to_object (str + sizeof ior_prefix - 1
01750                                        ACE_ENV_ARG_PARAMETER);
01751   else
01752     return this->url_ior_string_to_object (str
01753                                            ACE_ENV_ARG_PARAMETER);
01754 }
01755 
01756 // ****************************************************************
01757 
01758 char *
01759 CORBA::ORB::id (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
01760 {
01761   return CORBA::string_dup (this->orb_core_->orbid ());
01762 }
01763 
01764 // ****************************************************************
01765 
01766 #if !defined(CORBA_E_MICRO)
01767 CORBA::Policy_ptr
01768 CORBA::ORB::create_policy (CORBA::PolicyType type,
01769                            const CORBA::Any& val
01770                            ACE_ENV_ARG_DECL)
01771 {
01772   this->check_shutdown (ACE_ENV_SINGLE_ARG_PARAMETER);
01773   ACE_CHECK_RETURN (CORBA::Policy::_nil ());
01774 
01775   TAO::PolicyFactory_Registry_Adapter *adapter =
01776     this->orb_core_->policy_factory_registry ();
01777 
01778   if (adapter == 0)
01779     {
01780       ACE_THROW_RETURN (CORBA::INTERNAL (),
01781                         CORBA::Policy::_nil ());
01782     }
01783 
01784   // Attempt to obtain the policy from the policy factory registry.
01785   return adapter->create_policy (
01786           type,
01787           val
01788           ACE_ENV_ARG_PARAMETER);
01789 }
01790 #endif
01791 
01792 #if !defined(CORBA_E_MICRO)
01793 CORBA::Policy_ptr
01794 CORBA::ORB::_create_policy (CORBA::PolicyType type
01795                             ACE_ENV_ARG_DECL)
01796 {
01797   this->check_shutdown (ACE_ENV_SINGLE_ARG_PARAMETER);
01798   ACE_CHECK_RETURN (CORBA::Policy::_nil ());
01799 
01800   TAO::PolicyFactory_Registry_Adapter *adapter =
01801     this->orb_core_->policy_factory_registry ();
01802 
01803   if (adapter == 0)
01804     {
01805       ACE_THROW_RETURN (CORBA::INTERNAL (),
01806                         CORBA::Policy::_nil ());
01807     }
01808 
01809   // Attempt to obtain the policy from the policy factory registry.
01810   return adapter->_create_policy (
01811           type
01812           ACE_ENV_ARG_PARAMETER);
01813 }
01814 #endif
01815 
01816 // Destringify OMG-specified "IOR" string.
01817 //
01818 // XXX there should be a simple way to reuse this code in other ORB
01819 // implementations ...
01820 
01821 CORBA::Object_ptr
01822 CORBA::ORB::ior_string_to_object (const char *str
01823                                   ACE_ENV_ARG_DECL)
01824 {
01825   // Unhex the bytes, and make a CDR deencapsulation stream from the
01826   // resulting data.
01827   ACE_Message_Block mb (ACE_OS::strlen (str) / 2 + 1
01828                         + ACE_CDR::MAX_ALIGNMENT + 1);
01829 
01830   ACE_CDR::mb_align (&mb);
01831 
01832   char *buffer = mb.rd_ptr ();
01833   const char *tmp = str;
01834   size_t len = 0;
01835 
01836   while (tmp [0] && tmp [1])
01837     {
01838       // Some platforms define 'byte' as a macro, solve the problem
01839       // here.
01840 #undef byte
01841       unsigned char byte;
01842 
01843       if (!(isxdigit (tmp [0]) && isxdigit (tmp [1])))
01844         break;
01845 
01846       byte = (u_char) (ACE::hex2byte (tmp [0]) << 4);
01847       byte |= ACE::hex2byte (tmp [1]);
01848 
01849       buffer [len++] = byte;
01850       tmp += 2;
01851     }
01852 
01853   if (tmp [0] && !isspace (tmp [0]))
01854     {
01855       ACE_THROW_RETURN (CORBA::BAD_PARAM (),
01856                         CORBA::Object::_nil ());
01857     }
01858 
01859   // Create deencapsulation stream ... then unmarshal objref from that
01860   // stream.
01861 
01862   int byte_order = *(mb.rd_ptr ());
01863   mb.rd_ptr (1);
01864   mb.wr_ptr (len);
01865   TAO_InputCDR stream (&mb,
01866                        byte_order,
01867                        TAO_DEF_GIOP_MAJOR,
01868                        TAO_DEF_GIOP_MINOR,
01869                        this->orb_core_);
01870 
01871   CORBA::Object_ptr objref = CORBA::Object::_nil ();
01872   stream >> objref;
01873   return objref;
01874 }
01875 
01876 // ****************************************************************
01877 
01878 // Convert an URL style IOR in an object
01879 
01880 CORBA::Object_ptr
01881 CORBA::ORB::url_ior_string_to_object (const char* str
01882                                       ACE_ENV_ARG_DECL)
01883 {
01884   TAO_MProfile mprofile;
01885   // It is safe to declare this on the stack since the contents of
01886   // mprofile get copied.  No memory is allocated for profile storage
01887   // here.  The Connector Registry will determine the exact number
01888   // of profiles and tell the MProfile object to allocate enough memory
01889   // to hold them all.
01890 
01891   TAO_Connector_Registry *conn_reg =
01892     this->orb_core_->connector_registry (ACE_ENV_SINGLE_ARG_PARAMETER);
01893   ACE_CHECK_RETURN (0);
01894 
01895   int const retv =
01896     conn_reg->make_mprofile (str,
01897                              mprofile
01898                              ACE_ENV_ARG_PARAMETER);
01899   ACE_CHECK_RETURN (CORBA::Object::_nil ());   // Return nil.
01900 
01901   if (retv != 0)
01902     {
01903       ACE_THROW_RETURN (CORBA::INV_OBJREF (
01904                           CORBA::SystemException::_tao_minor_code (
01905                             0,
01906                             EINVAL),
01907                           CORBA::COMPLETED_NO),
01908                         CORBA::Object::_nil ());
01909     }
01910 
01911   // Now make the TAO_Stub.
01912   TAO_Stub *data = this->orb_core_->create_stub ((char *) 0,
01913                                                  mprofile
01914                                                  ACE_ENV_ARG_PARAMETER);
01915   ACE_CHECK_RETURN (CORBA::Object::_nil ());
01916 
01917   TAO_Stub_Auto_Ptr safe_objdata (data);
01918 
01919   // Figure out if the servant is collocated.
01920   CORBA::Object_ptr obj =
01921     this->orb_core_->create_object (safe_objdata.get ());
01922   if (CORBA::is_nil (obj))
01923     return CORBA::Object::_nil ();
01924 
01925   // Transfer ownership to the CORBA::Object
01926   (void) safe_objdata.release ();
01927 
01928   return obj;
01929 }
01930 
01931 // ****************************************************************
01932 
01933 ACE_Time_Value *
01934 CORBA::ORB::get_timeout (void)
01935 {
01936   return this->timeout_;
01937 }
01938 
01939 void
01940 CORBA::ORB::set_timeout (ACE_Time_Value *timeout)
01941 {
01942   this->timeout_ = timeout;
01943 }
01944 
01945 // *************************************************************
01946 // Valuetype factory operations
01947 // *************************************************************
01948 
01949 #if !defined(CORBA_E_MICRO)
01950 CORBA::ValueFactory
01951 CORBA::ORB::register_value_factory (const char *repository_id,
01952                                     CORBA::ValueFactory factory
01953                                     ACE_ENV_ARG_DECL)
01954 {
01955   TAO_Valuetype_Adapter *vta = this->orb_core ()->valuetype_adapter ();
01956 
01957   if (vta)
01958     {
01959       int const result = vta->vf_map_rebind (repository_id,
01960                                              factory);
01961 
01962       if (result == 0)              // No previous factory found
01963         {
01964           return 0;
01965         }
01966 
01967       if (result == -1)
01968         {
01969           // Error on bind.
01970           ACE_THROW_RETURN (CORBA::MARSHAL (),
01971                             0);
01972         }
01973     }
01974 
01975   return factory;    // previous factory was found
01976 }
01977 #endif
01978 
01979 #if !defined(CORBA_E_MICRO)
01980 void
01981 CORBA::ORB::unregister_value_factory (const char *repository_id
01982                                       ACE_ENV_ARG_DECL_NOT_USED)
01983 {
01984   TAO_Valuetype_Adapter *vta = this->orb_core ()->valuetype_adapter ();
01985 
01986   if (vta)
01987     {
01988       // Dont care whther it was successful or not!
01989       (void) vta->vf_map_unbind (repository_id);
01990     }
01991 }
01992 #endif
01993 
01994 #if !defined(CORBA_E_MICRO)
01995 CORBA::ValueFactory
01996 CORBA::ORB::lookup_value_factory (const char *repository_id
01997                                   ACE_ENV_ARG_DECL)
01998 {
01999   TAO_Valuetype_Adapter *vta = this->orb_core ()->valuetype_adapter ();
02000 
02001   if (vta)
02002     {
02003       return vta->vf_map_find (repository_id);
02004     }
02005 
02006   return 0;
02007 }
02008 #endif
02009 
02010 TAO_END_VERSIONED_NAMESPACE_DECL

Generated on Thu Nov 9 11:54:18 2006 for TAO by doxygen 1.3.6