Root_POA.cpp

Go to the documentation of this file.
00001 // $Id: Root_POA.cpp 78630 2007-06-28 10:34:07Z johnnyw $
00002 
00003 #include "tao/PortableServer/Root_POA.h"
00004 #include "tao/PortableServer/Regular_POA.h"
00005 
00006 #include "tao/PortableServer/ThreadPolicy.h"
00007 #include "tao/PortableServer/LifespanPolicy.h"
00008 #include "tao/PortableServer/IdAssignmentPolicy.h"
00009 #include "tao/PortableServer/IdUniquenessPolicy.h"
00010 #include "tao/PortableServer/ImplicitActivationPolicy.h"
00011 #include "tao/PortableServer/RequestProcessingPolicy.h"
00012 #include "tao/PortableServer/ServantRetentionPolicy.h"
00013 #include "tao/PortableServer/Active_Object_Map.h"
00014 #include "tao/PortableServer/Default_Acceptor_Filter.h"
00015 #include "tao/PortableServer/ORT_Adapter.h"
00016 #include "tao/PortableServer/ORT_Adapter_Factory.h"
00017 #include "tao/PortableServer/POA_Current_Impl.h"
00018 #include "tao/PortableServer/Servant_Upcall.h"
00019 #include "tao/PortableServer/AdapterActivatorC.h"
00020 #include "tao/PortableServer/Non_Servant_Upcall.h"
00021 #include "tao/PortableServer/POAManager.h"
00022 #include "tao/PortableServer/POAManagerFactory.h"
00023 #include "tao/PortableServer/ServantManagerC.h"
00024 #include "tao/PortableServer/poa_macros.h"
00025 #include "tao/PortableServer/POA_Guard.h"
00026 #include "tao/PortableServer/Creation_Time.h"
00027 #include "tao/PortableServer/RequestProcessingStrategy.h"
00028 #include "tao/PortableServer/LifespanStrategy.h"
00029 #include "tao/PortableServer/IdUniquenessStrategy.h"
00030 #include "tao/PortableServer/IdAssignmentStrategy.h"
00031 #include "tao/PortableServer/ServantRetentionStrategy.h"
00032 #include "tao/PortableServer/ImplicitActivationStrategy.h"
00033 #include "tao/PortableServer/ThreadStrategy.h"
00034 #include "tao/PortableServer/Acceptor_Filter_Factory.h"
00035 #include "tao/PortableServer/Network_Priority_Hook.h"
00036 
00037 #include "tao/StringSeqC.h"
00038 #include "tao/PortableInterceptorC.h"
00039 #include "tao/PolicyC.h"
00040 #include "tao/ORB_Core.h"
00041 #include "tao/ORB.h"
00042 #include "tao/Server_Strategy_Factory.h"
00043 #include "tao/Acceptor_Registry.h"
00044 #include "tao/Thread_Lane_Resources.h"
00045 #include "tao/Exception.h"
00046 #include "tao/Stub.h"
00047 #include "tao/Profile.h"
00048 #include "tao/TSS_Resources.h"
00049 #include "tao/IORInterceptor_Adapter.h"
00050 #include "tao/debug.h"
00051 
00052 // auto_ptr class
00053 #include "ace/Auto_Ptr.h"
00054 #include "ace/Dynamic_Service.h"
00055 #include "ace/OS_NS_netdb.h"
00056 #include "ace/OS_NS_string.h"
00057 #include "ace/OS_NS_unistd.h"
00058 #include "ace/Log_Msg.h"
00059 
00060 #if !defined (__ACE_INLINE__)
00061 # include "tao/PortableServer/Root_POA.inl"
00062 #endif /* ! __ACE_INLINE__ */
00063 
00064 ACE_RCSID (PortableServer,
00065            Root_POA,
00066            "$Id: Root_POA.cpp 78630 2007-06-28 10:34:07Z johnnyw $")
00067 
00068 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00069 
00070 // This is the TAO_Object_key-prefix that is appended to all TAO Object keys.
00071 // It's an array of octets representing ^t^a^o/0 in octal.
00072 CORBA::Octet const
00073 TAO_Root_POA::objectkey_prefix [TAO_Root_POA::TAO_OBJECTKEY_PREFIX_SIZE] = {
00074   024, // octal for ^t
00075   001, // octal for ^a
00076   017, // octal for ^o
00077   000
00078 };
00079 
00080 #if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO)
00081 
00082 PortableServer::ThreadPolicy_ptr
00083 TAO_Root_POA::create_thread_policy (PortableServer::ThreadPolicyValue value)
00084 {
00085   TAO::Portable_Server::ThreadPolicy *policy = 0;
00086   ACE_NEW_THROW_EX (policy,
00087                     TAO::Portable_Server::ThreadPolicy (value),
00088                     CORBA::NO_MEMORY ());
00089 
00090   return policy;
00091 }
00092 
00093 #endif /* TAO_HAS_MINIMUM_POA == 0 && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) */
00094 
00095 #if !defined (CORBA_E_MICRO)
00096 
00097 PortableServer::LifespanPolicy_ptr
00098 TAO_Root_POA::create_lifespan_policy (PortableServer::LifespanPolicyValue value)
00099 {
00100   TAO::Portable_Server::LifespanPolicy *policy = 0;
00101   ACE_NEW_THROW_EX (policy,
00102                     TAO::Portable_Server::LifespanPolicy (value),
00103                     CORBA::NO_MEMORY ());
00104 
00105   return policy;
00106 }
00107 
00108 #endif
00109 
00110 #if !defined (CORBA_E_MICRO)
00111 PortableServer::IdUniquenessPolicy_ptr
00112 TAO_Root_POA::create_id_uniqueness_policy (PortableServer::IdUniquenessPolicyValue value)
00113 {
00114   TAO::Portable_Server::IdUniquenessPolicy *policy = 0;
00115   ACE_NEW_THROW_EX (policy,
00116                     TAO::Portable_Server::IdUniquenessPolicy (value),
00117                     CORBA::NO_MEMORY ());
00118 
00119   return policy;
00120 }
00121 #endif
00122 
00123 #if !defined (CORBA_E_MICRO)
00124 PortableServer::IdAssignmentPolicy_ptr
00125 TAO_Root_POA::create_id_assignment_policy (PortableServer::IdAssignmentPolicyValue value)
00126 {
00127   TAO::Portable_Server::IdAssignmentPolicy *policy = 0;
00128   ACE_NEW_THROW_EX (policy,
00129                     TAO::Portable_Server::IdAssignmentPolicy (value),
00130                     CORBA::NO_MEMORY ());
00131 
00132   return policy;
00133 }
00134 #endif
00135 
00136 #if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO)
00137 
00138 PortableServer::ImplicitActivationPolicy_ptr
00139 TAO_Root_POA::create_implicit_activation_policy (PortableServer::ImplicitActivationPolicyValue value)
00140 {
00141   TAO::Portable_Server::ImplicitActivationPolicy *policy = 0;
00142   ACE_NEW_THROW_EX (policy,
00143                     TAO::Portable_Server::ImplicitActivationPolicy (value),
00144                     CORBA::NO_MEMORY ());
00145 
00146   return policy;
00147 }
00148 
00149 PortableServer::ServantRetentionPolicy_ptr
00150 TAO_Root_POA::create_servant_retention_policy (PortableServer::ServantRetentionPolicyValue value)
00151 {
00152   TAO::Portable_Server::ServantRetentionPolicy *policy = 0;
00153   ACE_NEW_THROW_EX (policy,
00154                     TAO::Portable_Server::ServantRetentionPolicy (value),
00155                     CORBA::NO_MEMORY ());
00156 
00157   return policy;
00158 }
00159 
00160 PortableServer::RequestProcessingPolicy_ptr
00161 TAO_Root_POA::create_request_processing_policy (PortableServer::RequestProcessingPolicyValue value)
00162 {
00163   TAO::Portable_Server::RequestProcessingPolicy *policy = 0;
00164   ACE_NEW_THROW_EX (policy,
00165                     TAO::Portable_Server::RequestProcessingPolicy (value),
00166                     CORBA::NO_MEMORY ());
00167 
00168   return policy;
00169 }
00170 
00171 #endif /* TAO_HAS_MINIMUM_POA == 0 */
00172 
00173 void
00174 TAO_Root_POA::set_obj_ref_factory (
00175   PortableInterceptor::ObjectReferenceFactory *current_factory)
00176 {
00177   TAO::ORT_Adapter *adapter = this->ORT_adapter ();
00178 
00179   if (adapter)
00180     {
00181       // Activate a different factory
00182       this->ort_adapter_->set_obj_ref_factory (current_factory);
00183     }
00184 }
00185 
00186 TAO_Root_POA::TAO_Root_POA (const TAO_Root_POA::String &name,
00187                             PortableServer::POAManager_ptr poa_manager,
00188                             const TAO_POA_Policy_Set &policies,
00189                             TAO_Root_POA *parent,
00190                             ACE_Lock &lock,
00191                             TAO_SYNCH_MUTEX &thread_lock,
00192                             TAO_ORB_Core &orb_core,
00193                             TAO_Object_Adapter *object_adapter)
00194   : name_ (name),
00195     poa_manager_ (* (dynamic_cast <TAO_POA_Manager*> (poa_manager))),
00196 
00197 #if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO)
00198     poa_manager_factory_ (* (object_adapter->poa_manager_factory_)),
00199 #endif
00200 
00201     tagged_component_ (),
00202     tagged_component_id_ (),
00203     profile_id_array_ (0),
00204     policies_ (policies),
00205     ort_adapter_ (0),
00206     adapter_state_ (PortableInterceptor::HOLDING),
00207     network_priority_hook_ (0),
00208 
00209 #if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO)
00210 
00211     adapter_activator_ (),
00212 
00213 #endif /* TAO_HAS_MINIMUM_POA == 0 */
00214 
00215     children_ (),
00216     lock_ (lock),
00217     orb_core_ (orb_core),
00218     object_adapter_ (object_adapter),
00219     cleanup_in_progress_ (0),
00220     outstanding_requests_ (0),
00221     outstanding_requests_condition_ (thread_lock),
00222     wait_for_completion_pending_ (0),
00223     waiting_destruction_ (0),
00224     servant_deactivation_condition_ (thread_lock),
00225 
00226 #if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO)
00227     filter_factory_ (0),
00228 #endif
00229 
00230     caller_key_to_object_ (0),
00231     servant_for_key_to_object_ (0)
00232 {
00233   // Since we are keeping a reference to a POAManager, we need to
00234   // increment the reference count
00235   this->poa_manager_._add_ref();
00236 
00237   // Parse the policies that are used in the critical path in
00238   // a cache.
00239   this->cached_policies_.update (this->policies_);
00240 
00241   this->network_priority_hook_
00242     = ACE_Dynamic_Service<TAO_Network_Priority_Hook>::instance (
00243         "TAO_Network_Priority_Hook");
00244 
00245   if (this->network_priority_hook_ != 0)
00246     {
00247       this->network_priority_hook_->update_network_priority (
00248         *this, this->policies_);
00249     }
00250 
00251 #if (TAO_HAS_MINIMUM_POA == 1)
00252   // If this is the RootPOA, set the value of the ImplicitActivationPolicy
00253   // to IMPLICIT_ACTIVATION since it is impossible to pass the policy
00254   // as it is not compiled into the library.
00255   //
00256   // If the ImplicitActivationPolicy policy is ever compiled in the
00257   // minimum POA builds, remove this code and remove the guards
00258   // in Object_Adapter.cpp when changing the default policy for the
00259   // RootPOA.
00260   if (ACE_OS::strcmp (this->name_.c_str (),
00261                       TAO_DEFAULT_ROOTPOA_NAME) == 0)
00262     {
00263       this->cached_policies_.implicit_activation
00264         (PortableServer::IMPLICIT_ACTIVATION);
00265     }
00266 #endif /* TAO_HAS_MINIMUM_POA == 1 */
00267 
00268   // Set the active strategies to be used by this POA
00269   this->active_policy_strategies_.update (this->cached_policies_,
00270                                           this);
00271 
00272   // Set the folded name of this POA.
00273   this->set_folded_name (parent);
00274 
00275   // Register self with manager.
00276   int result = this->poa_manager_.register_poa (this);
00277   if (result != 0)
00278     {
00279       throw ::CORBA::OBJ_ADAPTER ();
00280     }
00281 
00282   // Add self to Object Adapter class.
00283   result =
00284     this->object_adapter ().bind_poa (this->folded_name_,
00285                                       this,
00286                                       this->system_name_.out ());
00287   if (result != 0)
00288     {
00289       // Remove from POA Manager in case of errors. No checks of
00290       // further errors...
00291       this->poa_manager_.remove_poa (this);
00292 
00293       throw ::CORBA::OBJ_ADAPTER ();
00294     }
00295 
00296   // Set the id for this POA.
00297   this->set_id (parent);
00298 
00299   // Notify the Lifespan strategy of our startup
00300   try
00301     {
00302       this->active_policy_strategies_.lifespan_strategy()->notify_startup ();
00303     }
00304   catch (const ::CORBA::Exception&)
00305     {
00306       this->poa_manager_.remove_poa (this);
00307       this->object_adapter ().unbind_poa (this,
00308                                           this->folded_name_,
00309                                           this->system_name_.in ());
00310       throw;
00311     }
00312 }
00313 
00314 TAO_Root_POA::~TAO_Root_POA (void)
00315 {
00316   this->poa_manager_._remove_ref();
00317 }
00318 
00319 void
00320 TAO_Root_POA::complete_destruction_i (void)
00321 {
00322   // No longer awaiting destruction.
00323   this->waiting_destruction_ = 0;
00324 
00325   // Remove POA from the POAManager.
00326   int result = this->poa_manager_.remove_poa (this);
00327 
00328   if (result != 0)
00329     throw ::CORBA::OBJ_ADAPTER ();
00330 
00331   // Remove POA from the Object Adapter.
00332   result = this->object_adapter ().unbind_poa (this,
00333                                                this->folded_name_,
00334                                                this->system_name_.in ());
00335   if (result != 0)
00336     throw ::CORBA::OBJ_ADAPTER ();
00337 
00338   // Cleanup all strategies
00339   this->active_policy_strategies_.cleanup ();
00340 
00341   // Forced cleanup.  The new memory management scheme is evil and can
00342   // lead to reference deadlock, i.e., POA holds object A, but POA
00343   // cannot die because object A hold POA.
00344   {
00345     //
00346     // If new things are added to this cleanup code, make sure to move
00347     // the minimum CORBA #define after the declaration of
00348     // <non_servant_upcall>.
00349     //
00350 
00351 #if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO)
00352 
00353     // ATTENTION: Trick locking here, see class header for details
00354     TAO::Portable_Server::Non_Servant_Upcall non_servant_upcall (*this);
00355     ACE_UNUSED_ARG (non_servant_upcall);
00356 
00357     this->adapter_activator_ = PortableServer::AdapterActivator::_nil ();
00358 
00359 #endif /* TAO_HAS_MINIMUM_POA == 0 */
00360 
00361   }
00362 
00363   ::CORBA::release (this);
00364 }
00365 
00366 #if ! defined (CORBA_E_MICRO)
00367 PortableServer::POA_ptr
00368 TAO_Root_POA::create_POA_i (const char *adapter_name,
00369                             PortableServer::POAManager_ptr poa_manager,
00370                             const CORBA::PolicyList &policies)
00371 {
00372   // Initialize a TAO_POA_Policy_Set instance so that it contains the
00373   // default POA policies.
00374   TAO_POA_Policy_Set tao_policies (this->object_adapter ().default_poa_policies ());
00375 
00376   // Merge policies from the ORB level.
00377   this->object_adapter ().validator ().merge_policies (tao_policies.policies ());
00378 
00379   // Merge in any policies that the user may have specified.
00380   tao_policies.merge_policies (policies);
00381 
00382   // If any of the policy objects specified are not valid for the ORB
00383   // implementation, if conflicting policy objects are specified, or
00384   // if any of the specified policy objects require prior
00385   // administrative action that has not been performed, an
00386   // InvalidPolicy exception is raised containing the index in the
00387   // policies parameter value of the first offending policy object.
00388   tao_policies.validate_policies (this->object_adapter ().validator (),
00389                                   this->orb_core_);
00390 
00391   // If the poa_manager parameter is null, a new POAManager object is
00392   // created and associated with the new POA. Otherwise, the specified
00393   // POAManager object is associated with the new POA. The POAManager
00394   // object can be obtained using the attribute name the_POAManager.
00395 
00396   PortableServer::POAManager_var the_poa_manager;
00397 
00398   if (CORBA::is_nil (poa_manager))
00399     {
00400 #if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT)
00401 
00402       PortableServer::POA_var poa = PortableServer::POA::_duplicate (this);
00403       PortableServer::POA_var root_poa;
00404 
00405       // Find the RootPOA by traversing the POA hierarchy until the
00406       // RootPOA is reached.  The RootPOA has no parent.
00407       while (!CORBA::is_nil (poa.in ()))
00408       {
00409         root_poa = poa;
00410         poa = poa->the_parent ();
00411       }
00412 
00413       // Get the POAManagerFactory instance owned by RootPOA.
00414       PortableServer::POAManagerFactory_var tao_poa_manager_factory
00415         = root_poa->the_POAManagerFactory ();
00416 
00417       CORBA::PolicyList empty_policies;
00418 
00419       // The POAManager name will be generated when the POAManager instance
00420       // is created.
00421       the_poa_manager
00422         = tao_poa_manager_factory->create_POAManager (0,
00423                                                       empty_policies);
00424 #else
00425 
00426       PortableServer::POAManager_ptr the_poa_manager_ptr;
00427       ACE_NEW_THROW_EX (the_poa_manager_ptr,
00428                         TAO_POA_Manager (this->object_adapter (), 0),
00429                         CORBA::NO_MEMORY ());
00430       the_poa_manager = the_poa_manager_ptr;
00431 #endif /* TAO_HAS_MINIMUM_POA == 0 && ! CORBA_E_COMPACT) */
00432 
00433     }
00434   else
00435     {
00436       the_poa_manager = PortableServer::POAManager::_duplicate (poa_manager);
00437     }
00438 
00439   PortableServer::POA_var poa = this->create_POA_i (adapter_name,
00440                                                     the_poa_manager.in (),
00441                                                     tao_policies);
00442 
00443   return poa._retn ();
00444 }
00445 #endif /* !CORBA_E_MICRO */
00446 
00447 #if ! defined (CORBA_E_MICRO)
00448 TAO_Root_POA *
00449 TAO_Root_POA::new_POA (const String &name,
00450                        PortableServer::POAManager_ptr poa_manager,
00451                        const TAO_POA_Policy_Set &policies,
00452                        TAO_Root_POA *parent,
00453                        ACE_Lock &lock,
00454                        TAO_SYNCH_MUTEX &thread_lock,
00455                        TAO_ORB_Core &orb_core,
00456                        TAO_Object_Adapter *object_adapter)
00457 {
00458   TAO_Regular_POA *poa = 0;
00459 
00460   ACE_NEW_THROW_EX (poa,
00461                     TAO_Regular_POA (name,
00462                              poa_manager,
00463                              policies,
00464                              parent,
00465                              lock,
00466                              thread_lock,
00467                              orb_core,
00468                              object_adapter),
00469                     CORBA::NO_MEMORY ());
00470 
00471   return poa;
00472 }
00473 
00474 PortableServer::POA_ptr
00475 TAO_Root_POA::create_POA_i (const TAO_Root_POA::String &adapter_name,
00476                             PortableServer::POAManager_ptr poa_manager,
00477                             const TAO_POA_Policy_Set &policies)
00478 {
00479   // This operaton creates a new POA as a child of the target POA. The
00480   // specified name identifies the new POA with respect to other POAs
00481   // with the same parent POA. If the target POA already has a child
00482   // POA with the specified name, the AdapterAlreadyExists exception
00483   // is raised.
00484   // Child was found
00485   if (this->children_.find (adapter_name) != -1)
00486     {
00487       throw PortableServer::POA::AdapterAlreadyExists ();
00488     }
00489 
00490   //
00491   // Child was not found.  Create one.
00492   //
00493 
00494   // The specified policy objects are associated with the POA and used
00495   // to control its behavior. The policy objects are effectively
00496   // copied before this operation returns, so the application is free
00497   // to destroy them while the POA is in use. Policies are not
00498   // inherited from the parent POA.
00499   TAO_Root_POA * poa = this->new_POA (adapter_name,
00500                                       poa_manager,
00501                                       policies,
00502                                       this,
00503                                       this->object_adapter ().lock (),
00504                                       this->object_adapter ().thread_lock (),
00505                                       this->orb_core_,
00506                                       this->object_adapter_);
00507 
00508   // Give ownership of the new map to the POA_var.  Note, that it
00509   // is important for the POA_var to take ownership before
00510   // checking for exception since we may need to delete the new map.
00511   PortableServer::POA_var new_poa = poa;
00512 
00513   // Check for exception in construction of the POA.
00514 
00515   // Add to children map
00516   if (this->children_.bind (adapter_name, poa) != 0)
00517     {
00518       throw ::CORBA::OBJ_ADAPTER ();
00519     }
00520 
00521   // Increment the reference count on the child POA since the children
00522   // map must retain ownership.  Do so immediately before any other
00523   // operations to prevent memory cleanup problems induced from
00524   // errors below.
00525   poa->_add_ref ();
00526 
00527   // Iterate over the registered IOR interceptors so that they may be
00528   // given the opportunity to add tagged components to the profiles
00529   // for this servant.
00530   poa->establish_components ();
00531 
00532   // Note: Creating a POA using a POA manager that is in the active
00533   // state can lead to race conditions if the POA supports preexisting
00534   // objects, because the new POA may receive a request before its
00535   // adapter activator, servant manager, or default servant have been
00536   // initialized. These problems do not occur if the POA is created by
00537   // an adapter activator registered with a parent of the new POA,
00538   // because requests are queued until the adapter activator
00539   // returns. To avoid these problems when a POA must be explicitly
00540   // initialized, the application can initialize the POA by invoking
00541   // find_POA with a TRUE activate parameter.
00542 
00543   // Everything is fine. Don't let the POA_var release the
00544   // implementation.
00545   return new_poa._retn ();
00546 }
00547 #endif
00548 
00549 #if ! defined (CORBA_E_MICRO)
00550 PortableServer::POA_ptr
00551 TAO_Root_POA::find_POA (const char *adapter_name,
00552                         CORBA::Boolean activate_it)
00553 {
00554   // Lock access for the duration of this transaction.
00555   TAO_POA_GUARD_RETURN (0);
00556 
00557   TAO_Root_POA *poa = this->find_POA_i (adapter_name, activate_it);
00558 
00559   return PortableServer::POA::_duplicate (poa);
00560 }
00561 #endif
00562 
00563 #if ! defined (CORBA_E_MICRO)
00564 TAO_Root_POA *
00565 TAO_Root_POA::find_POA_i (const ACE_CString &child_name,
00566                           CORBA::Boolean activate_it)
00567 {
00568   TAO_Root_POA *child = 0;
00569   int result = this->children_.find (child_name, child);
00570 
00571 #if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT)
00572 
00573   if (result != 0)
00574     {
00575       if (activate_it)
00576         {
00577           if (!CORBA::is_nil (this->adapter_activator_.in ()))
00578             {
00579               // Check our state
00580               this->check_state ();
00581 
00582               CORBA::Boolean success = false;
00583               try
00584                 {
00585                   // ATTENTION: Trick locking here, see class header for details
00586                   TAO::Portable_Server::Non_Servant_Upcall non_servant_upcall (
00587                     *this);
00588                   ACE_UNUSED_ARG (non_servant_upcall);
00589 
00590                   // When unknown_adapter gives a system exception, the POA
00591                   // should raise OBJ_ADAPTER with standard minor code 1.
00592                   // See 11.3.9.2 of the Corba spec
00593                   success =
00594                     this->adapter_activator_->unknown_adapter (
00595                       this,
00596                       child_name.c_str ());
00597                 }
00598               catch (const ::CORBA::SystemException&)
00599                 {
00600                   throw ::CORBA::OBJ_ADAPTER (CORBA::OMGVMCID | 1,
00601                                               CORBA::COMPLETED_NO);
00602                 }
00603 
00604               if (success)
00605                 {
00606                   result = this->children_.find (child_name,
00607                                                  child);
00608                 }
00609               else
00610                 {
00611                   result = -1;
00612                 }
00613             }
00614           else
00615             {
00616               result = -1;
00617             }
00618         }
00619       else
00620         {
00621           result = -1;
00622         }
00623     }
00624 #else
00625   ACE_UNUSED_ARG (activate_it);
00626 #endif /* TAO_HAS_MINIMUM_POA == 0 */
00627 
00628   if (result == 0)
00629     {
00630       return child;
00631     }
00632   else
00633     {
00634       // Otherwise, the AdapterNonExistent exception is raised.
00635       throw PortableServer::POA::AdapterNonExistent ();
00636     }
00637 }
00638 #endif
00639 
00640 TAO_POA_Manager &
00641 TAO_Root_POA::tao_poa_manager ()
00642 {
00643   return poa_manager_;
00644 }
00645 
00646 #if ! defined (CORBA_E_MICRO)
00647 PortableServer::POA_ptr
00648 TAO_Root_POA::create_POA (const char *adapter_name,
00649                           PortableServer::POAManager_ptr poa_manager,
00650                           const CORBA::PolicyList &policies)
00651 {
00652   // Lock access for the duration of this transaction.
00653   TAO_POA_GUARD_RETURN (0);
00654 
00655   return this->create_POA_i (adapter_name, poa_manager, policies);
00656 }
00657 #endif
00658 
00659 PortableServer::ObjectId *
00660 TAO_Root_POA::servant_to_id (PortableServer::Servant servant)
00661 {
00662   // If we had upgradeable locks, this would initially be a read lock
00663   //
00664   // Lock access for the duration of this transaction.
00665   TAO_POA_GUARD_RETURN (0);
00666 
00667   return this->servant_to_id_i (servant);
00668 }
00669 
00670 PortableServer::ObjectId *
00671 TAO_Root_POA::servant_to_user_id (PortableServer::Servant servant)
00672 {
00673   return this->active_policy_strategies_.servant_retention_strategy()->
00674     servant_to_user_id (servant);
00675 }
00676 
00677 PortableServer::Servant
00678 TAO_Root_POA::reference_to_servant (CORBA::Object_ptr reference)
00679 {
00680   // Lock access for the duration of this transaction.
00681   TAO_POA_GUARD_RETURN (0);
00682 
00683   return this->reference_to_servant_i (reference);
00684 }
00685 
00686 CORBA::Object_ptr
00687 TAO_Root_POA::servant_to_reference (PortableServer::Servant servant)
00688 {
00689   TAO_POA_GUARD_RETURN (CORBA::Object::_nil ());
00690 
00691   return this->servant_to_reference_i (servant);
00692 }
00693 
00694 PortableServer::POAList *
00695 TAO_Root_POA::the_children (void)
00696 {
00697   // Lock access for the duration of this transaction.
00698   TAO_POA_GUARD_RETURN (0);
00699 
00700   return this->the_children_i ();
00701 }
00702 
00703 
00704 PortableServer::Servant
00705 TAO_Root_POA::id_to_servant (const PortableServer::ObjectId &oid)
00706 {
00707   // Lock access for the duration of this transaction.
00708   TAO_POA_GUARD_RETURN (0);
00709 
00710   return this->id_to_servant_i (oid);
00711 }
00712 
00713 CORBA::Object_ptr
00714 TAO_Root_POA::id_to_reference (const PortableServer::ObjectId &oid)
00715 {
00716   // Lock access for the duration of this transaction.
00717   TAO_POA_GUARD_RETURN (0);
00718 
00719   return this->id_to_reference_i (oid, true);
00720 }
00721 
00722 
00723 CORBA::Object_ptr
00724 TAO_Root_POA::create_reference_with_id (const PortableServer::ObjectId &id,
00725                                         const char *intf)
00726 {
00727   // Lock access for the duration of this transaction.
00728   TAO_POA_GUARD_RETURN (CORBA::Object::_nil ());
00729 
00730   return this->create_reference_with_id_i (id,
00731                                            intf,
00732                                            this->server_priority ());
00733 }
00734 
00735 
00736 void
00737 TAO_Root_POA::destroy (CORBA::Boolean etherealize_objects,
00738                        CORBA::Boolean wait_for_completion)
00739 {
00740   // Lock access for the duration of this transaction.
00741   TAO::Portable_Server::POA_Guard poa_guard (*this , 0);
00742   ACE_UNUSED_ARG (poa_guard);
00743 
00744   this->destroy_i (etherealize_objects,
00745                    wait_for_completion);
00746 }
00747 
00748 void
00749 TAO_Root_POA::remove_from_parent_i (void)
00750 {
00751   // The root poa has no parent, so this is a noop
00752 }
00753 
00754 void
00755 TAO_Root_POA::destroy_i (CORBA::Boolean etherealize_objects,
00756                          CORBA::Boolean wait_for_completion)
00757 {
00758   if (this->cleanup_in_progress_)
00759     return;
00760 
00761   // Is the <wait_for_completion> semantics for this thread correct?
00762   TAO_Root_POA::check_for_valid_wait_for_completions (this->orb_core (),
00763                                                       wait_for_completion);
00764 
00765   this->cleanup_in_progress_ = 1;
00766 
00767   // Inform the custom servant dispatching strategy to stop the working
00768   // threads when the poa is destroyed.
00769   this->poa_deactivated_hook ();
00770 
00771   // This operation destroys the POA and all descendant POAs. The POA
00772   // so destroyed (that is, the POA with its name) may be re-created
00773   // later in the same process. (This differs from the
00774   // POAManager::deactivate operation that does not allow a
00775   // re-creation of its associated POA in the same process.)
00776 
00777   // Remove POA from the parent
00778   this->remove_from_parent_i ();
00779 
00780   TAO::ORT_Array array_obj_ref_template (1);
00781 
00782   CORBA::ULong i = 0;
00783 
00784   // Gather all ObjectReferenceTemplates and change all adapter states
00785   // to INACTIVE.
00786   for (CHILDREN::iterator iterator = this->children_.begin ();
00787        iterator != this->children_.end ();
00788        ++iterator)
00789     {
00790       TAO_Root_POA * const child_poa = (*iterator).int_id_;
00791 
00792       TAO::ORT_Adapter * const adapter = child_poa->ORT_adapter_i ();
00793 
00794       // In case no ORT library is linked we get zero.
00795       if (adapter != 0)
00796         {
00797           // Get the ObjectReferenceTemplate for the child POA.
00798           PortableInterceptor::ObjectReferenceTemplate * const ort =
00799             adapter->get_adapter_template ();
00800 
00801           // Add it to the sequence of object reference templates that
00802           // will be destroyed.
00803           array_obj_ref_template.size (1);
00804 
00805           array_obj_ref_template[0] = ort;
00806         }
00807 
00808       child_poa->adapter_state_ =
00809         PortableInterceptor::INACTIVE;
00810 
00811       // Notify the state changes to the IORInterceptors
00812       this->adapter_state_changed (array_obj_ref_template,
00813                                    PortableInterceptor::INACTIVE);
00814 
00815       if (adapter != 0)
00816         adapter->release (array_obj_ref_template[0]);
00817 
00818       ++i;
00819     }
00820 
00821   // Destroy all child POA's now.
00822   for (CHILDREN::iterator destroy_iterator = this->children_.begin ();
00823        destroy_iterator != this->children_.end ();
00824        ++destroy_iterator)
00825     {
00826       TAO_Root_POA *destroy_child_poa = (*destroy_iterator).int_id_;
00827 
00828       destroy_child_poa->destroy_i (etherealize_objects,
00829                                     wait_for_completion);
00830     }
00831 
00832   // Notify the lifespan strategy of our shutdown
00833   this->active_policy_strategies_.lifespan_strategy()->notify_shutdown ();
00834 
00835 // @todo, is the exception handling above correct, should we just fail when
00836 // the notify above fails
00837 
00838   // When a POA is destroyed, any requests that have started execution
00839   // continue to completion. Any requests that have not started
00840   // execution are processed as if they were newly arrived, that is,
00841   // the POA will attempt to cause recreation of the POA by invoking
00842   // one or more adapter activators as described in Section 3.3.3.
00843   // If the wait_for_completion parameter is TRUE, the destroy
00844   // operation will return only after all requests in process have
00845   // completed and all invocations of etherealize have
00846   // completed. Otherwise, the destroy operation returns after
00847   // destroying the POAs.
00848 
00849   this->deactivate_all_objects_i (etherealize_objects,
00850                                   wait_for_completion);
00851 
00852   // If there are no outstanding requests and that we are not in a
00853   // non-servant upcall or if we are in a non-servant upcall, make
00854   // sure we are the POA related to the non-servant upcall.
00855   TAO::Portable_Server::Non_Servant_Upcall *non_servant_upcall_in_progress =
00856     this->object_adapter ().non_servant_upcall_in_progress ();
00857   if (this->outstanding_requests_ == 0 &&
00858       (non_servant_upcall_in_progress == 0 ||
00859        &non_servant_upcall_in_progress->poa () != this))
00860     {
00861       TAO::ORT_Array my_array_obj_ref_template;
00862 
00863       TAO::ORT_Adapter * const ort_adapter =
00864         this->ORT_adapter_i ();
00865 
00866       // In case no ORT library is linked we get zero.
00867       if (ort_adapter != 0)
00868         {
00869           // Get the ObjectReferenceTemplate.
00870           PortableInterceptor::ObjectReferenceTemplate * const ort =
00871             ort_adapter->get_adapter_template ();
00872 
00873           // Add it to the sequence of object reference templates, we
00874           // just notify for ourselves that we are now non_existent,
00875           // our childs will do it for themselves.
00876           my_array_obj_ref_template.size (1);
00877           my_array_obj_ref_template[0] = ort;
00878         }
00879 
00880       // According to the ORT spec, after a POA is destroyed, its state
00881       // has to be changed to NON_EXISTENT and all the registered
00882       // interceptors are to be informed. Since, the POA is destroyed
00883       // and is released in the complete_destruction_i method, we are
00884       // trying to keep the poa still around by doing a duplicate of
00885       // it. (a hack).
00886       PortableServer::POA_var poa = PortableServer::POA::_duplicate (this);
00887 
00888       this->complete_destruction_i ();
00889 
00890       this->adapter_state_ = PortableInterceptor::NON_EXISTENT;
00891 
00892       this->adapter_state_changed (my_array_obj_ref_template,
00893                                    this->adapter_state_);
00894 
00895       if (ort_adapter != 0)
00896         {
00897           ort_adapter->release (my_array_obj_ref_template[0]);
00898 
00899           TAO::ORT_Adapter_Factory *ort_factory =
00900             this->ORT_adapter_factory ();
00901 
00902           ort_factory->destroy (ort_adapter);
00903 
00904           this->ort_adapter_ = 0;
00905         }
00906     }
00907   else
00908     {
00909       // Mark that we are ready for destruction.
00910       this->waiting_destruction_ = 1;
00911     }
00912 }
00913 
00914 int
00915 TAO_Root_POA::delete_child (const TAO_Root_POA::String &child)
00916 {
00917   int result = 0;
00918 
00919   // If we are not closing down, we must remove this child from our
00920   // collection.
00921   if (!this->cleanup_in_progress_)
00922     result = this->children_.unbind (child);
00923 
00924   // Otherwise, if we are closing down, we are currently iterating
00925   // over our children and there is not need to remove this child from
00926   // our collection.
00927 
00928   return result;
00929 }
00930 
00931 PortableServer::POAList *
00932 TAO_Root_POA::the_children_i (void)
00933 {
00934   PortableServer::POAList_var children;
00935   CORBA::ULong child_current = static_cast <CORBA::ULong>
00936                                            (this->children_.current_size ());
00937   ACE_NEW_THROW_EX (children,
00938                     PortableServer::POAList (child_current),
00939                     CORBA::NO_MEMORY ());
00940 
00941   children->length (child_current);
00942 
00943   CORBA::ULong index = 0;
00944   for (CHILDREN::iterator iterator = this->children_.begin ();
00945        iterator != this->children_.end ();
00946        ++iterator, ++index)
00947     {
00948       TAO_Root_POA *child_poa = (*iterator).int_id_;
00949       children[index] = PortableServer::POA::_duplicate (child_poa);
00950     }
00951 
00952   return children._retn ();
00953 }
00954 
00955 PortableInterceptor::AdapterName *
00956 TAO_Root_POA::adapter_name_i (void)
00957 {
00958   // The adapter name is the sequence of names starting from the
00959   // RootPOA to the one whose name is requested.  The name of the
00960   // RootPOA is "RootPOA".
00961 
00962   PortableServer::POA_var poa = PortableServer::POA::_duplicate (this);
00963 
00964   CORBA::ULong len = 0;
00965 
00966   // Find the length of the adapter name sequence by traversing the
00967   // POA hierarchy until the RootPOA is reached.  The RootPOA has no
00968   // parent.
00969   while (!CORBA::is_nil (poa.in ()))
00970     {
00971       poa = poa->the_parent ();
00972 
00973       ++len;
00974     }
00975 
00976   // Empty adapter name sequence.
00977   PortableInterceptor::AdapterName *names = 0;
00978   ACE_NEW_THROW_EX (names,
00979                     PortableInterceptor::AdapterName (len),
00980                     CORBA::NO_MEMORY (
00981                       CORBA::SystemException::_tao_minor_code (
00982                         TAO::VMCID,
00983                         ENOMEM),
00984                       CORBA::COMPLETED_NO));
00985 
00986   PortableInterceptor::AdapterName_var safe_names (names);
00987 
00988   names->length (len);
00989 
00990   poa = PortableServer::POA::_duplicate (this);
00991 
00992   (*names)[0] = CORBA::string_dup ("RootPOA");
00993 
00994   // Fill in the AdapterName sequence as the POA hierarchy is
00995   // traversed.
00996   CORBA::ULong ilen = len;
00997   for (CORBA::ULong i = 1; i < len; ++i)
00998     {
00999       (*names)[--ilen] = poa->the_name ();
01000 
01001       poa = poa->the_parent ();
01002 
01003       // If this condition asserts, the POA hierarchy was modified
01004       // (i.e. reduced in size) by another thread!
01005       ACE_ASSERT ((ilen > 0 ? !CORBA::is_nil (poa.in ()) : 1));
01006     }
01007 
01008   return safe_names._retn ();
01009 }
01010 
01011 void
01012 TAO_Root_POA::add_ior_component (TAO_MProfile & mprofile,
01013                                  const IOP::TaggedComponent &component)
01014 {
01015   // Add the given tagged component to all profiles.
01016   const CORBA::ULong profile_count = mprofile.profile_count ();
01017 
01018   for (CORBA::ULong i = 0; i < profile_count; ++i)
01019     {
01020       TAO_Profile *profile = mprofile.get_profile (i);
01021 
01022       profile->add_tagged_component (component);
01023     }
01024 }
01025 
01026 void
01027 TAO_Root_POA::add_ior_component_to_profile (
01028     TAO_MProfile & mprofile,
01029     const IOP::TaggedComponent &component,
01030     IOP::ProfileId profile_id)
01031 {
01032   // Add the given tagged component to all profiles matching the given
01033   // ProfileId.
01034   bool found_profile = false;
01035 
01036   CORBA::ULong const profile_count = mprofile.profile_count ();
01037 
01038   for (CORBA::ULong i = 0; i < profile_count; ++i)
01039     {
01040       TAO_Profile *profile = mprofile.get_profile (i);
01041 
01042       if (profile->tag () == profile_id)
01043         {
01044           profile->add_tagged_component (component);
01045 
01046           found_profile = true;
01047         }
01048     }
01049 
01050   // According to the Portable Interceptor specification, we're
01051   // supposed to throw a CORBA::BAD_PARAM exception if no profile
01052   // matched the given ProfileId.
01053   if (found_profile == false)
01054     throw ::CORBA::BAD_PARAM (CORBA::OMGVMCID | 29, CORBA::COMPLETED_NO);
01055 }
01056 
01057 void
01058 TAO_Root_POA::adapter_state_changed (
01059    const TAO::ORT_Array &array_obj_ref_template,
01060    PortableInterceptor::AdapterState state)
01061 {
01062   TAO_IORInterceptor_Adapter *ior_adapter =
01063     this->orb_core_.ior_interceptor_adapter ();
01064 
01065   if (ior_adapter)
01066     {
01067       ior_adapter->adapter_state_changed (array_obj_ref_template, state);
01068     }
01069 }
01070 
01071 PortableServer::ObjectId *
01072 TAO_Root_POA::activate_object_i (PortableServer::Servant servant,
01073                                  CORBA::Short priority,
01074                                  bool &wait_occurred_restart_call)
01075 {
01076   return this->active_policy_strategies_.servant_retention_strategy()->
01077     activate_object (servant,
01078                      priority,
01079                      wait_occurred_restart_call);
01080 }
01081 
01082 PortableServer::ObjectId *
01083 TAO_Root_POA::activate_object (PortableServer::Servant servant)
01084 {
01085   while (1)
01086     {
01087       bool wait_occurred_restart_call = false;
01088 
01089       // Lock access for the duration of this transaction.
01090       TAO_POA_GUARD_RETURN (0);
01091 
01092       PortableServer::ObjectId *result =
01093         this->activate_object_i (servant,
01094                                  this->server_priority (),
01095                                  wait_occurred_restart_call);
01096 
01097       // If we ended up waiting on a condition variable, the POA state
01098       // may have changed while we are waiting.  Therefore, we need to
01099       // restart this call.
01100       if (wait_occurred_restart_call)
01101         continue;
01102       else
01103         return result;
01104     }
01105 }
01106 
01107 #if !defined (CORBA_E_MICRO)
01108 void
01109 TAO_Root_POA::activate_object_with_id (const PortableServer::ObjectId &id,
01110                                        PortableServer::Servant servant)
01111 {
01112   while (1)
01113     {
01114       bool wait_occurred_restart_call = false;
01115 
01116       // Lock access for the duration of this transaction.
01117       TAO_POA_GUARD;
01118 
01119       this->activate_object_with_id_i (id,
01120                                        servant,
01121                                        this->server_priority (),
01122                                        wait_occurred_restart_call);
01123 
01124       // If we ended up waiting on a condition variable, the POA state
01125       // may have changed while we are waiting.  Therefore, we need to
01126       // restart this call.
01127       if (wait_occurred_restart_call)
01128         continue;
01129       else
01130         return;
01131     }
01132 }
01133 #endif
01134 
01135 #if !defined (CORBA_E_MICRO)
01136 void
01137 TAO_Root_POA::activate_object_with_id_i (const PortableServer::ObjectId &id,
01138                                          PortableServer::Servant servant,
01139                                          CORBA::Short priority,
01140                                          bool &wait_occurred_restart_call)
01141 {
01142   this->active_policy_strategies_.servant_retention_strategy()->
01143     activate_object_with_id (id,
01144                              servant,
01145                              priority,
01146                              wait_occurred_restart_call);
01147 }
01148 #endif
01149 
01150 void
01151 TAO_Root_POA::deactivate_all_objects_i (CORBA::Boolean etherealize_objects,
01152                                         CORBA::Boolean wait_for_completion)
01153 {
01154   this->deactivate_all_objects_i (etherealize_objects);
01155 
01156   this->wait_for_completions (wait_for_completion);
01157 }
01158 
01159 void
01160 TAO_Root_POA::wait_for_completions (CORBA::Boolean wait_for_completion)
01161 {
01162   while (this->object_adapter ().enable_locking_ &&
01163          wait_for_completion &&
01164          this->outstanding_requests_ > 0)
01165     {
01166       this->wait_for_completion_pending_ = 1;
01167 
01168       int result = this->outstanding_requests_condition_.wait ();
01169       if (result == -1)
01170         {
01171           throw ::CORBA::OBJ_ADAPTER ();
01172         }
01173     }
01174 }
01175 
01176 /* static */
01177 void
01178 TAO_Root_POA::check_for_valid_wait_for_completions (const TAO_ORB_Core &orb_core,
01179                                                     CORBA::Boolean wait_for_completion)
01180 {
01181   if (wait_for_completion)
01182     {
01183       TAO::Portable_Server::POA_Current_Impl *poa_current_impl =
01184         static_cast <TAO::Portable_Server::POA_Current_Impl *>
01185                     (TAO_TSS_Resources::instance ()->poa_current_impl_);
01186 
01187       while (1)
01188         {
01189           // If wait_for_completion is TRUE and the current thread is
01190           // in an invocation context dispatched from some POA
01191           // belonging to the same ORB as this POA, the BAD_INV_ORDER
01192           // system exception with standard minor code 3 is raised and
01193           // POA destruction does not occur.
01194           if (poa_current_impl != 0)
01195             {
01196               if (&orb_core == &poa_current_impl->orb_core ())
01197                 {
01198                   // CORBA 2.3 specifies which minor code corresponds
01199                   // to this particular problem.
01200                   throw ::CORBA::BAD_INV_ORDER (CORBA::OMGVMCID | 3,
01201                                                    CORBA::COMPLETED_NO);
01202                 }
01203             }
01204           else
01205             break;
01206 
01207           poa_current_impl =
01208             poa_current_impl->previous_current_impl_;
01209         }
01210     }
01211 }
01212 
01213 void
01214 TAO_Root_POA::deactivate_all_objects_i (CORBA::Boolean etherealize_objects)
01215 {
01216   this->active_policy_strategies_.request_processing_strategy ()->
01217     etherealize_objects (etherealize_objects);
01218 
01219   this->active_policy_strategies_.servant_retention_strategy ()->
01220     deactivate_all_objects ();
01221 }
01222 
01223 void
01224 TAO_Root_POA::deactivate_object (const PortableServer::ObjectId &oid)
01225 {
01226   // Lock access for the duration of this transaction.
01227   TAO_POA_GUARD;
01228 
01229   this->deactivate_object_i (oid);
01230 }
01231 
01232 
01233 void
01234 TAO_Root_POA::deactivate_object_i (const PortableServer::ObjectId &id)
01235 {
01236   this->active_policy_strategies_.servant_retention_strategy()->
01237     deactivate_object (id);
01238 }
01239 
01240 CORBA::Boolean
01241 TAO_Root_POA::is_persistent (void) const
01242 {
01243   return active_policy_strategies_.lifespan_strategy()->is_persistent ();
01244 }
01245 
01246 CORBA::Object_ptr
01247 TAO_Root_POA::create_reference (const char *intf)
01248 {
01249   // Lock access for the duration of this transaction.
01250   TAO_POA_GUARD_RETURN (CORBA::Object::_nil ());
01251 
01252   return this->create_reference_i (intf,
01253                                    this->server_priority ());
01254 }
01255 
01256 CORBA::Object_ptr
01257 TAO_Root_POA::create_reference_i (const char *intf,
01258                                   CORBA::Short priority)
01259 {
01260   if (!this->has_system_id ())
01261     {
01262       throw PortableServer::POA::WrongPolicy ();
01263     }
01264 
01265   return this->active_policy_strategies_.servant_retention_strategy()->
01266     create_reference (intf, priority);
01267 }
01268 
01269 CORBA::Object_ptr
01270 TAO_Root_POA::invoke_key_to_object_helper_i (const char * repository_id,
01271                                              const PortableServer::ObjectId & id)
01272 {
01273   const PortableInterceptor::ObjectId &user_oid =
01274     reinterpret_cast <const PortableInterceptor::ObjectId &>(id);
01275 
01276   // Ask the ORT to create the object.
01277   if (this->ORT_adapter_i ())
01278     {
01279       // Ask the ORT to create the object.
01280       return this->ort_adapter_->make_object (repository_id,
01281                                               user_oid);
01282     }
01283   else
01284     {
01285       return this->invoke_key_to_object ();
01286     }
01287 }
01288 
01289 CORBA::Object_ptr
01290 TAO_Root_POA::create_reference_with_id_i (const PortableServer::ObjectId &user_id,
01291                                           const char *intf,
01292                                           CORBA::Short priority)
01293 {
01294   // If the POA has the SYSTEM_ID policy and it detects that the
01295   // Object Id value was not generated by the system or for this POA,
01296   // the create_reference_with_id operation may raise the BAD_PARAM
01297   // system exception. An ORB is not required to detect all such
01298   // invalid Object Id values, but a portable application must not
01299   // invoke this operation on a POA that has the SYSTEM_ID policy with
01300   // an Object Id value that was not previously generated by the
01301   // system for that POA, or, if the POA also has the PERSISTENT
01302   // policy, for a previous instantiation of the same POA.
01303   if (this->has_system_id () &&
01304       !this->is_poa_generated_id (user_id))
01305     {
01306       throw ::CORBA::BAD_PARAM (CORBA::OMGVMCID | 14, CORBA::COMPLETED_NO);
01307     }
01308 
01309   return this->active_policy_strategies_.servant_retention_strategy()->
01310     create_reference_with_id (user_id, intf, priority);
01311 }
01312 
01313 PortableServer::ObjectId *
01314 TAO_Root_POA::servant_to_id_i (PortableServer::Servant servant)
01315 {
01316   return this->active_policy_strategies_.request_processing_strategy()->
01317     servant_to_id (servant);
01318 }
01319 
01320 CORBA::Object_ptr
01321 TAO_Root_POA::servant_to_reference_i (PortableServer::Servant servant)
01322 {
01323   return this->active_policy_strategies_.servant_retention_strategy()->
01324     servant_to_reference (servant);
01325 }
01326 
01327 PortableServer::Servant
01328 TAO_Root_POA::reference_to_servant_i (CORBA::Object_ptr reference)
01329 {
01330   // Make sure that the reference is valid.
01331   if (CORBA::is_nil (reference))
01332     {
01333       throw ::CORBA::BAD_PARAM ();
01334     }
01335 
01336   PortableServer::ObjectId system_id;
01337   bool const is_generated =
01338     this->is_poa_generated (reference, system_id);
01339 
01340   if (!is_generated)
01341     {
01342       // In case this object reference is not generated by this POA throw
01343       // an exception
01344       throw PortableServer::POA::WrongAdapter ();
01345     }
01346 
01347   PortableServer::Servant servant =
01348     this->active_policy_strategies_.request_processing_strategy()->
01349       system_id_to_servant (system_id);
01350 
01351   if (servant != 0)
01352     {
01353       // ATTENTION: Trick locking here, see class header for details
01354       TAO::Portable_Server::Non_Servant_Upcall non_servant_upcall (*this);
01355       ACE_UNUSED_ARG (non_servant_upcall);
01356 
01357       // The POA invokes _add_ref once on the Servant before returning
01358       // it. If the application uses reference counting, the caller of
01359       // id_to_servant is responsible for invoking _remove_ref once on
01360       // the returned Servant when it is finished with it. A
01361       // conforming caller need not invoke _remove_ref on the returned
01362       // Servant if the type of the Servant uses the default reference
01363       // counting inherited from ServantBase.
01364       servant->_add_ref ();
01365     }
01366 
01367   return servant;
01368 }
01369 
01370 bool
01371 TAO_Root_POA::is_poa_generated (CORBA::Object_ptr reference,
01372                                 PortableServer::ObjectId &system_id)
01373 {
01374   TAO::ObjectKey_var key = reference->_key ();
01375 
01376   TAO_Object_Adapter::poa_name poa_system_name;
01377   CORBA::Boolean is_root = false;
01378   CORBA::Boolean is_persistent = false;
01379   CORBA::Boolean is_system_id = false;
01380   TAO::Portable_Server::Temporary_Creation_Time poa_creation_time;
01381 
01382   int const result = this->parse_key (key.in (),
01383                                       poa_system_name,
01384                                       system_id,
01385                                       is_root,
01386                                       is_persistent,
01387                                       is_system_id,
01388                                       poa_creation_time);
01389   if (result != 0 ||
01390       !this->root () &&
01391       poa_system_name != this->system_name () ||
01392       is_root != this->root () ||
01393       is_system_id != this->system_id () ||
01394       !this->validate_lifespan (is_persistent, poa_creation_time))
01395     {
01396       // The passed reference is NOT generated by this POA
01397       return false;
01398     }
01399   else
01400     {
01401       // The passed reference is generated by this POA
01402       return true;
01403     }
01404 }
01405 
01406 PortableServer::ObjectId *
01407 TAO_Root_POA::reference_to_id (CORBA::Object_ptr reference
01408                                )
01409 {
01410   // Make sure that the reference is valid.
01411   if (CORBA::is_nil (reference))
01412     {
01413       throw ::CORBA::BAD_PARAM ();
01414     }
01415 
01416   // The WrongPolicy exception is declared to allow future extensions.
01417 
01418   // This operation is valid only if the reference was created by the
01419   // POA on which the operation is being performed.  If the object
01420   // reference was not created by this POA, the WrongAdapter exception
01421   // is raised.
01422   PortableServer::ObjectId system_id;
01423   bool const is_generated = this->is_poa_generated (reference,
01424                                                     system_id
01425                                                    );
01426 
01427   if (!is_generated)
01428     {
01429       throw PortableServer::POA::WrongAdapter ();
01430     }
01431 
01432   // Lock access for the duration of this transaction.
01433   TAO_POA_GUARD_RETURN (0);
01434 
01435   return this->active_policy_strategies_.servant_retention_strategy()->
01436     system_id_to_object_id (system_id);
01437 }
01438 
01439 PortableServer::Servant
01440 TAO_Root_POA::find_servant (const PortableServer::ObjectId &system_id
01441                             )
01442 {
01443   return this->active_policy_strategies_.servant_retention_strategy()->
01444     find_servant (system_id);
01445 }
01446 
01447 int
01448 TAO_Root_POA::unbind_using_user_id (const PortableServer::ObjectId &user_id)
01449 {
01450   return this->active_policy_strategies_.servant_retention_strategy()->
01451     unbind_using_user_id  (user_id);
01452 }
01453 
01454 void
01455 TAO_Root_POA::cleanup_servant (
01456   PortableServer::Servant servant,
01457   const PortableServer::ObjectId &user_id
01458   )
01459 {
01460   this->active_policy_strategies_.request_processing_strategy()->
01461     cleanup_servant (servant, user_id);
01462 }
01463 
01464 PortableServer::Servant
01465 TAO_Root_POA::id_to_servant_i (const PortableServer::ObjectId &id
01466                                )
01467 {
01468 
01469   PortableServer::Servant servant =
01470     this->active_policy_strategies_.request_processing_strategy()->
01471       id_to_servant (id);
01472 
01473   if (servant != 0)
01474     {
01475       // ATTENTION: Trick locking here, see class header for details
01476       TAO::Portable_Server::Non_Servant_Upcall non_servant_upcall (*this);
01477       ACE_UNUSED_ARG (non_servant_upcall);
01478 
01479       // The POA invokes _add_ref once on the Servant before returning
01480       // it. If the application uses reference counting, the caller of
01481       // id_to_servant is responsible for invoking _remove_ref once on
01482       // the returned Servant when it is finished with it. A
01483       // conforming caller need not invoke _remove_ref on the returned
01484       // Servant if the type of the Servant uses the default reference
01485       // counting inherited from ServantBase.
01486       servant->_add_ref ();
01487     }
01488 
01489   return servant;
01490 }
01491 
01492 PortableServer::Servant
01493 TAO_Root_POA::user_id_to_servant_i (const PortableServer::ObjectId &id
01494                                     )
01495 {
01496   return this->active_policy_strategies_.servant_retention_strategy()->
01497     user_id_to_servant (id);
01498 }
01499 
01500 CORBA::Object_ptr
01501 TAO_Root_POA::id_to_reference_i (const PortableServer::ObjectId &id,
01502                                  bool indirect
01503                                  )
01504 {
01505   return this->active_policy_strategies_.servant_retention_strategy()->
01506     id_to_reference (id, indirect);
01507 }
01508 
01509 CORBA::OctetSeq *
01510 TAO_Root_POA::id (void)
01511 {
01512   CORBA::OctetSeq *id = 0;
01513   ACE_NEW_THROW_EX (id,
01514                     CORBA::OctetSeq (this->id_),
01515                     CORBA::NO_MEMORY ());
01516 
01517   return id;
01518 }
01519 
01520 PortableServer::Servant
01521 TAO_Root_POA::locate_servant_i (const char *operation,
01522                                 const PortableServer::ObjectId &system_id,
01523                                 TAO::Portable_Server::Servant_Upcall &servant_upcall,
01524                                 TAO::Portable_Server::POA_Current_Impl &poa_current_impl,
01525                                 bool &wait_occurred_restart_call
01526                                 )
01527 {
01528   return this->active_policy_strategies_.request_processing_strategy()->
01529     locate_servant (operation,
01530                     system_id,
01531                     servant_upcall,
01532                     poa_current_impl,
01533                     wait_occurred_restart_call
01534                    );
01535 }
01536 
01537 /* static */
01538 int
01539 TAO_Root_POA::parse_key (const TAO::ObjectKey &key,
01540                          TAO_Object_Adapter::poa_name &poa_system_name,
01541                          PortableServer::ObjectId &system_id,
01542                          CORBA::Boolean &is_root,
01543                          CORBA::Boolean &is_persistent,
01544                          CORBA::Boolean &is_system_id,
01545                          TAO::Portable_Server::Temporary_Creation_Time &poa_creation_time)
01546 {
01547   // Get the object key octets.
01548   const CORBA::Octet *key_data = key.get_buffer ();
01549 
01550   // Skip the object key prefix since we have already checked for this.
01551   CORBA::ULong starting_at = TAO_OBJECTKEY_PREFIX_SIZE;
01552 
01553   // Check the root indicator.
01554   char root_key_type = key_data[starting_at];
01555   if (root_key_type == TAO_Root_POA::root_key_char ())
01556     {
01557       is_root = true;
01558     }
01559   else if (root_key_type == TAO_Root_POA::non_root_key_char ())
01560     {
01561       is_root = false;
01562     }
01563   else
01564     {
01565       // Incorrect key
01566       return -1;
01567     }
01568 
01569   // Skip past the system id indicator
01570   starting_at += TAO_Root_POA::root_key_type_length ();
01571 
01572   // Check the system id indicator.
01573   char system_id_key_type = key_data[starting_at];
01574   if (system_id_key_type == TAO_Root_POA::system_id_key_char ())
01575     {
01576       is_system_id = true;
01577     }
01578   else if (system_id_key_type == TAO_Root_POA::user_id_key_char ())
01579     {
01580       is_system_id = false;
01581     }
01582   else
01583     {
01584       // Incorrect key
01585       return -1;
01586     }
01587 
01588   // Skip past the system id indicator
01589   starting_at += TAO_Root_POA::system_id_key_type_length ();
01590 
01591   // Check the persistence indicator
01592   char persistent_key_type = key_data[starting_at];
01593   if (persistent_key_type == TAO_Root_POA::persistent_key_char ())
01594     {
01595       is_persistent = true;
01596     }
01597   else if (persistent_key_type == TAO_Root_POA::transient_key_char ())
01598     {
01599       is_persistent = false;
01600     }
01601   else
01602     {
01603       // Incorrect key
01604       return -1;
01605     }
01606 
01607   // Skip past the persistent indicator
01608   starting_at += TAO_Root_POA::persistent_key_type_length ();
01609 
01610 #if (POA_NO_TIMESTAMP == 0)
01611   // Grab the timestamp for transient POAs.
01612   if (!is_persistent)
01613     {
01614       // Take the creation time for the timestamp
01615       poa_creation_time.creation_time (key_data + starting_at);
01616 
01617       // Skip past the timestamp
01618       starting_at += TAO::Portable_Server::Creation_Time::creation_time_length ();
01619     }
01620 #else
01621   ACE_UNUSED_ARG (poa_creation_time);
01622 #endif /* POA_NO_TIMESTAMP */
01623 
01624   // Calculate the size of the POA name.
01625   CORBA::ULong poa_name_size = 0;
01626   if (!is_persistent)
01627     {
01628       // Transient POAs have fixed size.
01629       poa_name_size = TAO_Object_Adapter::transient_poa_name_size ();
01630     }
01631   else if (is_system_id)
01632     {
01633       // System ids have fixed size.
01634       poa_name_size = static_cast <CORBA::ULong>
01635                                   (key.length () - starting_at -
01636                                    TAO_Active_Object_Map::system_id_size ());
01637     }
01638   else
01639     {
01640       // Get the size from the object key.
01641       ACE_OS::memcpy (&poa_name_size,
01642                       key_data + starting_at,
01643                       sizeof (poa_name_size));
01644       poa_name_size = ACE_NTOHL (poa_name_size);
01645 
01646       starting_at += sizeof (poa_name_size);
01647     }
01648 
01649   // Grep the name if there is a name
01650   if (!is_root)
01651     {
01652       poa_system_name.replace (poa_name_size,
01653                                poa_name_size,
01654                                (CORBA::Octet *) key_data + starting_at,
01655                                0);
01656 
01657       starting_at += poa_name_size;
01658     }
01659 
01660   // The rest is the system id.
01661   CORBA::ULong system_id_size = key.length () - starting_at;
01662 
01663   // Reset <system_id>.
01664   system_id.length (system_id_size);
01665   CORBA::Octet * buf = system_id.get_buffer ();
01666   ACE_OS::memcpy (buf, key_data + starting_at, system_id_size);
01667 
01668   // Success
01669   return 0;
01670 }
01671 
01672 TAO::ObjectKey *
01673 TAO_Root_POA::create_object_key (const PortableServer::ObjectId &id)
01674 {
01675   // Calculate the space required for the key.
01676   CORBA::ULong buffer_size =
01677     this->id_.length () +
01678     id.length ();
01679 
01680   // Create the buffer for the key.
01681   CORBA::Octet *buffer = TAO::ObjectKey::allocbuf (buffer_size);
01682 
01683   // First copy the POA id into the key.
01684   ACE_OS::memcpy (&buffer[0],
01685                   this->id_.get_buffer (),
01686                   this->id_.length ());
01687 
01688   // Then copy the object id into the key.
01689   ACE_OS::memcpy (&buffer[this->id_.length ()],
01690                   id.get_buffer (),
01691                   id.length ());
01692 
01693   // Create the key, giving the ownership of the buffer to the
01694   // sequence.
01695   TAO::ObjectKey *key = 0;
01696   ACE_NEW_RETURN (key,
01697                   TAO::ObjectKey (buffer_size,
01698                                   buffer_size,
01699                                   buffer,
01700                                   1),
01701                   0);
01702 
01703   return key;
01704 }
01705 
01706 void
01707 TAO_Root_POA::set_id (TAO_Root_POA *parent)
01708 {
01709   // Calculate the prefix size.
01710   CORBA::ULong prefix_size = 0;
01711   prefix_size += TAO_OBJECTKEY_PREFIX_SIZE;
01712 
01713   // If we are dealing with a persistent POA and user ids are being
01714   // used, then we need to add the POA name length field to the object
01715   // key. Otherwise, the POA name length can be calculated by looking
01716   // at the remainder after extracting other parts of the key.
01717   bool const add_poa_name_length =
01718     this->is_persistent () &&
01719     !this->system_id ();
01720 
01721   // Size required by the POA name.
01722   CORBA::ULong poa_name = 0;
01723 
01724   // Calculate the space required for the POA name.
01725   CORBA::ULong poa_name_length = this->system_name_->length ();
01726   if (parent != 0)
01727     {
01728       poa_name += poa_name_length;
01729     }
01730 
01731   // Check if we need to added the length of the POA name.
01732   if (add_poa_name_length)
01733     {
01734       poa_name += sizeof (poa_name_length);
01735     }
01736 
01737   // Get the space needed for the lifespan length
01738   // byte.
01739   CORBA::ULong const lifespan_key_length =
01740     this->active_policy_strategies_.lifespan_strategy()->key_length ();
01741 
01742   CORBA::ULong const id_assignment_key_length =
01743     this->active_policy_strategies_.id_assignment_strategy()->key_type_length ();
01744 
01745   // Calculate the space required for the POA id.
01746   CORBA::ULong const buffer_size =
01747     prefix_size +
01748     this->root_key_type_length () +
01749     id_assignment_key_length +
01750     lifespan_key_length +
01751     poa_name;
01752 
01753   // Create the buffer for the POA id.
01754   this->id_.length (buffer_size);
01755   CORBA::Octet *buffer = &this->id_[0];
01756 
01757   // Keeps track of where the next infomation goes; start at 0 byte.
01758   CORBA::ULong starting_at = 0;
01759 
01760   // Add the object key prefix.
01761   ACE_OS::memcpy (&buffer[starting_at],
01762                   &objectkey_prefix[0],
01763                   TAO_OBJECTKEY_PREFIX_SIZE);
01764 
01765   starting_at += TAO_OBJECTKEY_PREFIX_SIZE;
01766 
01767   // Copy the root byte.
01768   if (parent != 0)
01769     {
01770       buffer[starting_at] = (CORBA::Octet) TAO_Root_POA::non_root_key_char ();
01771     }
01772   else
01773     {
01774       buffer[starting_at] = (CORBA::Octet) TAO_Root_POA::root_key_char ();
01775     }
01776   starting_at += this->root_key_type_length ();
01777 
01778   // Add the id_assignment part
01779   this->active_policy_strategies_.id_assignment_strategy()->create_key (buffer, starting_at);
01780 
01781   // Add the lifespan part
01782   this->active_policy_strategies_.lifespan_strategy()->create_key (buffer, starting_at);
01783 
01784   // Check if we need to added the length of the POA name.
01785   if (add_poa_name_length)
01786     {
01787       poa_name_length = ACE_HTONL (poa_name_length);
01788       ACE_OS::memcpy (&buffer[starting_at],
01789                       &poa_name_length,
01790                       sizeof (poa_name_length));
01791       starting_at += sizeof (poa_name_length);
01792     }
01793 
01794   // Put the POA name into the key (for non-root POAs).
01795   if (parent != 0)
01796     {
01797       ACE_OS::memcpy (&buffer[starting_at],
01798                       this->system_name_->get_buffer (),
01799                       this->system_name_->length ());
01800       starting_at += this->system_name_->length ();
01801     }
01802 }
01803 
01804 int
01805 TAO_Root_POA::is_poa_generated_id (const PortableServer::ObjectId &id)
01806 {
01807 #if defined (POA_NAME_IN_POA_GENERATED_ID)
01808 
01809   // Grab the buffer
01810   const char *id_buffer = (const char *) id.get_buffer ();
01811 
01812   // Check to see if the POA name is the first part of the id
01813   return
01814     this->name_.length () < id.length () &&
01815     ACE_OS::strncmp (id_buffer,
01816                      this->name_.c_str (),
01817                      this->name_.length ()) == 0;
01818 #else /* POA_NAME_IN_POA_GENERATED_ID */
01819 
01820   ACE_UNUSED_ARG (id);
01821   return 1;
01822 
01823 #endif /* POA_NAME_IN_POA_GENERATED_ID */
01824 }
01825 
01826 void
01827 TAO_Root_POA::set_folded_name (TAO_Root_POA *parent)
01828 {
01829   size_t length = 0;
01830   size_t parent_length = 0;
01831 
01832   if (parent != 0)
01833     {
01834       parent_length = parent->folded_name ().length ();
01835       length += parent_length;
01836     }
01837 
01838   length += this->name_.length ();
01839   length += TAO_Root_POA::name_separator_length ();
01840 
01841   this->folded_name_.length (static_cast <CORBA::ULong> (length));
01842   CORBA::Octet *folded_name_buffer = this->folded_name_.get_buffer ();
01843 
01844   if (parent != 0)
01845     {
01846       ACE_OS::memcpy (folded_name_buffer,
01847                       parent->folded_name ().get_buffer (),
01848                       parent_length);
01849     }
01850 
01851   ACE_OS::memcpy (&folded_name_buffer[parent_length],
01852                   this->name_.c_str (),
01853                   this->name_.length ());
01854 
01855   folded_name_buffer[length - TAO_Root_POA::name_separator_length ()] = TAO_Root_POA::name_separator ();
01856 }
01857 
01858 int
01859 TAO_Root_POA::parse_ir_object_key (const TAO::ObjectKey &object_key,
01860                                    PortableServer::ObjectId &user_id)
01861 {
01862   TAO_Object_Adapter::poa_name poa_system_name;
01863   CORBA::Boolean is_root = false;
01864   CORBA::Boolean is_persistent = false;
01865   CORBA::Boolean is_system_id = false;
01866   TAO::Portable_Server::Temporary_Creation_Time poa_creation_time;
01867 
01868   return TAO_Root_POA::parse_key (object_key,
01869                                   poa_system_name,
01870                                   user_id,
01871                                   is_root,
01872                                   is_persistent,
01873                                   is_system_id,
01874                                   poa_creation_time);
01875 }
01876 
01877 TAO_Object_Adapter &
01878 TAO_Root_POA::object_adapter (void)
01879 {
01880   return *this->object_adapter_;
01881 }
01882 
01883 CORBA::Object_ptr
01884 TAO_Root_POA::invoke_key_to_object (void)
01885 {
01886   PortableServer::ObjectId_var &system_id =
01887     *this->key_to_object_params_.system_id_;
01888 
01889   // Create object key.
01890   TAO::ObjectKey_var key =
01891     this->create_object_key (system_id.in ());
01892 
01893   return this->key_to_object (key.in (),
01894                               this->key_to_object_params_.type_id_,
01895                               this->key_to_object_params_.servant_,
01896                               this->key_to_object_params_.collocated_,
01897                               this->key_to_object_params_.priority_,
01898                               this->key_to_object_params_.indirect_);
01899 }
01900 
01901 CORBA::Object_ptr
01902 TAO_Root_POA::key_to_object (const TAO::ObjectKey &key,
01903                              const char *type_id,
01904                              TAO_ServantBase *servant,
01905                              CORBA::Boolean collocated,
01906                              CORBA::Short priority,
01907                              bool indirect)
01908 {
01909   // Check if the ORB is still running, otherwise throw an exception.
01910   // @@ What if the ORB was destroyed?  In that case we shouldn't even
01911   //    get here!
01912   this->orb_core_.check_shutdown ();
01913 
01914   //
01915   // ImplRepo related.
01916   //
01917 #if (TAO_HAS_MINIMUM_CORBA == 0)
01918 
01919   CORBA::Object_ptr obj = CORBA::Object::_nil ();
01920 
01921   if (indirect && this->active_policy_strategies_.lifespan_strategy()->use_imr ()
01922          && this->orb_core ().imr_endpoints_in_ior ())
01923     {
01924       // Check to see if we alter the IOR.
01925       CORBA::Object_var imr = this->orb_core ().implrepo_service ();
01926 
01927       if (CORBA::is_nil (imr.in ())
01928           || !imr->_stubobj ()
01929           || !imr->_stubobj ()->profile_in_use ())
01930         {
01931           if (TAO_debug_level > 1)
01932             {
01933               ACE_DEBUG ((LM_DEBUG,
01934                           "Missing ImR IOR, will not use the ImR\n"));
01935             }
01936           goto orbkey;
01937         }
01938 
01939       CORBA::String_var imr_str =
01940         imr->_stubobj ()->profile_in_use ()->to_string ();
01941 
01942       if (TAO_debug_level > 0)
01943         ACE_DEBUG ((LM_DEBUG,
01944                     "IMR IOR = \n%s\n",
01945                     ACE_TEXT_CHAR_TO_TCHAR (imr_str.in ())));
01946 
01947       // Search for "corbaloc:" alone, without the protocol.  This code
01948       // should be protocol neutral.
01949       const char corbaloc[] = "corbaloc:";
01950       char *pos = ACE_OS::strstr (imr_str.inout (), corbaloc);
01951       pos = ACE_OS::strchr (pos + sizeof (corbaloc), ':');
01952 
01953       pos = ACE_OS::strchr (pos + 1,
01954                             imr->_stubobj ()->profile_in_use ()->object_key_delimiter ());
01955 
01956       if (pos)
01957         pos[1] = 0;  // Crop the string.
01958       else
01959         {
01960           if (TAO_debug_level > 0)
01961             ACE_ERROR ((LM_ERROR,
01962                         "Could not parse ImR IOR, skipping ImRification\n"));
01963           goto orbkey;
01964         }
01965 
01966       ACE_CString ior (imr_str.in ());
01967 
01968       // Add the key.
01969 
01970       CORBA::String_var key_str;
01971       TAO::ObjectKey::encode_sequence_to_string (key_str.inout (), key);
01972 
01973       ior += key_str.in ();
01974 
01975       if (TAO_debug_level > 0)
01976         ACE_DEBUG ((LM_DEBUG,
01977                     "ImR-ified IOR = \n%s\n",
01978                     ACE_TEXT_CHAR_TO_TCHAR (ior.c_str ())));
01979 
01980       obj = this->orb_core_.orb ()->string_to_object (ior.c_str ());
01981 
01982       return obj;
01983     }
01984 
01985 orbkey:
01986 
01987 #else
01988   ACE_UNUSED_ARG (indirect);
01989 #endif /* TAO_HAS_MINIMUM_CORBA */
01990 
01991   TAO_Stub *data = this->key_to_stub_i (key, type_id, priority);
01992 
01993   TAO_Stub_Auto_Ptr safe_data (data);
01994 
01995   CORBA::Object_ptr tmp;
01996 
01997   if (this->orb_core_.optimize_collocation_objects ())
01998     {
01999       ACE_NEW_THROW_EX (tmp, CORBA::Object (data,
02000                                             collocated,
02001                                             servant),
02002                         CORBA::INTERNAL ());
02003 
02004     }
02005   else
02006     {
02007       ACE_NEW_THROW_EX (tmp,
02008                         CORBA::Object (data,
02009                                        collocated),
02010                         CORBA::INTERNAL ());
02011     }
02012 
02013   data->servant_orb (this->orb_core_.orb ());
02014 
02015   // Transfer ownership to the Object.
02016   (void) safe_data.release ();
02017 
02018   return tmp;
02019 }
02020 
02021 TAO_Stub *
02022 TAO_Root_POA::key_to_stub (const TAO::ObjectKey &key,
02023                            const char *type_id,
02024                            CORBA::Short priority)
02025 {
02026   // Check if the ORB is still running, otherwise throw an exception.
02027   // @@ What if the ORB was destroyed?  In that case we shouldn't even
02028   //    get here!
02029   this->orb_core_.check_shutdown ();
02030 
02031   return this->key_to_stub_i (key, type_id, priority);
02032 }
02033 
02034 TAO_Stub *
02035 TAO_Root_POA::key_to_stub_i (const TAO::ObjectKey &key,
02036                              const char *type_id,
02037                              CORBA::Short priority)
02038 {
02039   CORBA::PolicyList_var client_exposed_policies =
02040     this->client_exposed_policies (priority);
02041 
02042   TAO_Acceptor_Filter* filter = 0;
02043 
02044 #if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO)
02045   if (this->filter_factory_ == 0)
02046     this->filter_factory_
02047       = ACE_Dynamic_Service<TAO_Acceptor_Filter_Factory>::instance ("TAO_Acceptor_Filter_Factory");
02048 
02049   filter =
02050     this->filter_factory_->create_object (this->poa_manager_);
02051 #else
02052   ACE_NEW_RETURN (filter,
02053                   TAO_Default_Acceptor_Filter (),
02054                   0);
02055 #endif
02056 
02057   // Give ownership to the auto pointer.
02058   auto_ptr<TAO_Acceptor_Filter> new_filter (filter);
02059 
02060   TAO_Stub *data =
02061     this->create_stub_object (
02062       key,
02063       type_id,
02064       client_exposed_policies._retn (),
02065       filter,
02066       this->orb_core_.lane_resources ().acceptor_registry ());
02067 
02068   return data;
02069 }
02070 
02071 void
02072 TAO_Root_POA::establish_components (void)
02073 {
02074   TAO_IORInterceptor_Adapter *ior_adapter =
02075     this->orb_core_.ior_interceptor_adapter ();
02076 
02077   if (ior_adapter)
02078     {
02079       ior_adapter->establish_components (this);
02080     }
02081 }
02082 
02083 void
02084 TAO_Root_POA::components_established (PortableInterceptor::IORInfo_ptr info)
02085 {
02086   TAO_IORInterceptor_Adapter *ior_adapter =
02087     this->orb_core_.ior_interceptor_adapter ();
02088 
02089   if (ior_adapter)
02090     {
02091       ior_adapter->components_established (info);
02092     }
02093 }
02094 
02095 void
02096 TAO_Root_POA::save_ior_component (const IOP::TaggedComponent &component)
02097 {
02098   CORBA::ULong const old_len = this->tagged_component_.length ();
02099 
02100   this->tagged_component_.length (old_len + 1);
02101   this->tagged_component_[old_len] = component;
02102 }
02103 
02104 void
02105 TAO_Root_POA::
02106 save_ior_component_and_profile_id (const IOP::TaggedComponent &component,
02107                                    IOP::ProfileId profile_id)
02108 {
02109   // The length of this->tagged_component_id_ is the same as the
02110   // length of the profile_id_array_ since we are trying to make a
02111   // one-to-one link between these two arrays. So, whenever
02112   // this->tagged_component_id_ is increased, we need to increase the
02113   // size of this->profile_id_array_ also.
02114 
02115   CORBA::ULong const old_len = this->tagged_component_id_.length ();
02116 
02117   CORBA::ULong const new_len = old_len + 1;
02118 
02119   this->tagged_component_id_.length (new_len);
02120   this->tagged_component_id_[old_len] = component;
02121 
02122   this->profile_id_array_.size (new_len);
02123   this->profile_id_array_[old_len] = profile_id;
02124 }
02125 
02126 TAO_Stub *
02127 TAO_Root_POA::create_stub_object (const TAO::ObjectKey &object_key,
02128                                   const char *type_id,
02129                                   CORBA::PolicyList *policy_list,
02130                                   TAO_Acceptor_Filter *filter,
02131                                   TAO_Acceptor_Registry &acceptor_registry)
02132 {
02133   bool error = false;
02134 
02135   // Count the number of endpoints.
02136   size_t const profile_count = acceptor_registry.endpoint_count ();
02137 
02138   // Create a profile container and have acceptor registries populate
02139   // it with profiles as appropriate.
02140   TAO_MProfile mprofile (0);
02141 
02142   // Allocate space for storing the profiles.  There can never be more
02143   // profiles than there are endpoints.  In some cases, there can be
02144   // less profiles than endpoints.
02145   int result = mprofile.set (static_cast <CORBA::ULong> (profile_count));
02146   if (result == -1)
02147     error = true;
02148 
02149   if (!error)
02150     {
02151       result =
02152         filter->fill_profile (object_key,
02153                               mprofile,
02154                               acceptor_registry.begin (),
02155                               acceptor_registry.end ());
02156       if (result == -1)
02157         error = true;
02158     }
02159 
02160   if (!error)
02161     result = filter->encode_endpoints (mprofile);
02162 
02163   if (result == -1)
02164     error = true;
02165 
02166   if (error)
02167     throw ::CORBA::INTERNAL (
02168       CORBA::SystemException::_tao_minor_code (
02169         TAO_MPROFILE_CREATION_ERROR,
02170         0),
02171       CORBA::COMPLETED_NO);
02172 
02173   // Make sure we have at least one profile.  <mp> may end up being
02174   // empty if none of the acceptor endpoints have the right priority
02175   // for this object, for example.
02176   if (mprofile.profile_count () == 0)
02177     throw ::CORBA::BAD_PARAM (
02178       CORBA::SystemException::_tao_minor_code (
02179         TAO_MPROFILE_CREATION_ERROR,
02180         0),
02181       CORBA::COMPLETED_NO);
02182 
02183   TAO_Stub *stub =
02184     this->orb_core_.create_stub_object (mprofile, type_id, policy_list);
02185 
02186   // Add the saved tagged components methods to the profiles.
02187   CORBA::ULong len = this->tagged_component_.length ();
02188   for (CORBA::ULong i = 0; i != len; ++i)
02189     {
02190       this->add_ior_component (mprofile, this->tagged_component_[i]);
02191       }
02192 
02193   len = this->tagged_component_id_.length ();
02194 
02195   for (CORBA::ULong k = 0; k != len; ++k)
02196     {
02197       this->add_ior_component_to_profile (mprofile,
02198                                           this->tagged_component_id_[k],
02199                                           this->profile_id_array_[k]);
02200     }
02201 
02202   return stub;
02203 }
02204 
02205 CORBA::PolicyList *
02206 TAO_Root_POA::client_exposed_policies (CORBA::Short /* object_priority */)
02207 {
02208   CORBA::PolicyList *client_exposed_policies = 0;
02209   ACE_NEW_THROW_EX (client_exposed_policies,
02210                     CORBA::PolicyList (),
02211                     CORBA::NO_MEMORY (TAO::VMCID,
02212                                       CORBA::COMPLETED_NO));
02213 
02214   CORBA::PolicyList_var policies = client_exposed_policies;
02215 
02216   // Add in all of the client exposed policies.
02217   this->policies_.add_client_exposed_fixed_policies (client_exposed_policies);
02218 
02219   return policies._retn ();
02220 }
02221 
02222 TAO_SERVANT_LOCATION
02223 TAO_Root_POA::locate_servant_i (const PortableServer::ObjectId &system_id,
02224                                 PortableServer::Servant &servant)
02225 {
02226   return this->active_policy_strategies_.request_processing_strategy()->
02227           locate_servant (system_id, servant);
02228 }
02229 
02230 TAO_SERVANT_LOCATION
02231 TAO_Root_POA::servant_present (const PortableServer::ObjectId &system_id,
02232                                PortableServer::Servant &servant)
02233 {
02234   return this->active_policy_strategies_.servant_retention_strategy()->
02235           servant_present (system_id, servant);
02236 }
02237 
02238 PortableServer::Servant
02239 TAO_Root_POA::find_servant (
02240         const PortableServer::ObjectId &system_id,
02241         TAO::Portable_Server::Servant_Upcall &servant_upcall,
02242         TAO::Portable_Server::POA_Current_Impl &poa_current_impl)
02243 {
02244   return this->active_policy_strategies_.servant_retention_strategy()->
02245           find_servant (system_id,
02246                         servant_upcall,
02247                         poa_current_impl);
02248 }
02249 
02250 int
02251 TAO_Root_POA::find_servant_priority (
02252          const PortableServer::ObjectId &system_id,
02253          CORBA::Short &priority)
02254 {
02255   return this->active_policy_strategies_.servant_retention_strategy()->
02256           find_servant_priority (system_id, priority);
02257 }
02258 
02259 TAO::ORT_Adapter_Factory *
02260 TAO_Root_POA::ORT_adapter_factory (void)
02261 {
02262   return ACE_Dynamic_Service<TAO::ORT_Adapter_Factory>::instance
02263     (orb_core_.configuration (),
02264            TAO_Root_POA::ort_adapter_factory_name ());
02265 }
02266 
02267 TAO::ORT_Adapter *
02268 TAO_Root_POA::ORT_adapter_i (void)
02269 {
02270   if (this->ort_adapter_ != 0)
02271     return this->ort_adapter_;
02272 
02273   try
02274     {
02275       TAO::ORT_Adapter_Factory * ort_ap_factory = this->ORT_adapter_factory ();
02276 
02277       if (!ort_ap_factory)
02278         return 0;
02279 
02280       // Get the full adapter name of this POA, do this before we
02281       // create the adapter so that in case this fails, we just
02282       // return 0 and not a not activated adapter
02283       PortableInterceptor::AdapterName *adapter_name = this->adapter_name_i ();
02284 
02285       this->ort_adapter_ = ort_ap_factory->create ();
02286 
02287       if (!this->ort_adapter_)
02288         return 0;
02289 
02290       // @todo We have to look at this, we activate it but hold the POA lock,
02291       // in case we are called by ORT_adapter, we shouldn't keep the lock
02292       // here, but then the ort_adapter should be guarded against multiple
02293       // activations.
02294       this->ort_adapter_->activate (this->orb_core_.server_id (),
02295                                     this->orb_core_.orbid (),
02296                                     adapter_name,
02297                                     this);
02298     }
02299   catch (const ::CORBA::Exception& ex)
02300     {
02301       ex._tao_print_exception (
02302         "(%P|%t) Cannot initialize the "
02303         "object_reference_template_adapter\n");
02304     }
02305 
02306   return this->ort_adapter_;
02307 }
02308 
02309 #if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO)
02310 
02311 PortableServer::AdapterActivator_ptr
02312 TAO_Root_POA::the_activator (void)
02313 {
02314   // Lock access for the duration of this transaction.
02315   TAO_POA_GUARD_RETURN (PortableServer::AdapterActivator::_nil ());
02316 
02317   return PortableServer::AdapterActivator::_duplicate (this->adapter_activator_.in ());
02318 }
02319 
02320 void
02321 TAO_Root_POA::the_activator (PortableServer::AdapterActivator_ptr adapter_activator
02322                              )
02323 {
02324   // Lock access for the duration of this transaction.
02325   TAO_POA_GUARD;
02326 
02327   this->adapter_activator_ = PortableServer::AdapterActivator::_duplicate (adapter_activator);
02328 }
02329 
02330 #endif /* TAO_HAS_MINIMUM_POA == 0 && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO)*/
02331 
02332 #if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO)
02333 
02334 PortableServer::ServantManager_ptr
02335 TAO_Root_POA::get_servant_manager (void)
02336 {
02337   // Lock access for the duration of this transaction.
02338   TAO_POA_GUARD_RETURN (PortableServer::ServantManager::_nil ());
02339 
02340   return this->active_policy_strategies_.request_processing_strategy()->
02341     get_servant_manager ();
02342 }
02343 
02344 void
02345 TAO_Root_POA::set_servant_manager (PortableServer::ServantManager_ptr imgr)
02346 {
02347   // Lock access for the duration of this transaction.
02348   TAO_POA_GUARD;
02349 
02350   this->active_policy_strategies_.request_processing_strategy()->
02351     set_servant_manager (imgr);
02352 }
02353 
02354 PortableServer::Servant
02355 TAO_Root_POA::get_servant_i (void)
02356 {
02357   return this->active_policy_strategies_.request_processing_strategy()->
02358     get_servant ();
02359 }
02360 
02361 PortableServer::Servant
02362 TAO_Root_POA::get_servant (void)
02363 {
02364   // Lock access for the duration of this transaction.
02365   TAO_POA_GUARD_RETURN (0);
02366 
02367   PortableServer::Servant servant = this->get_servant_i ();
02368 
02369   if (servant != 0)
02370     {
02371       // ATTENTION: Trick locking here, see class header for details
02372       TAO::Portable_Server::Non_Servant_Upcall non_servant_upcall (*this);
02373       ACE_UNUSED_ARG (non_servant_upcall);
02374 
02375       // The POA invokes _add_ref once on the Servant before returning
02376       // it. If the application uses reference counting, the caller of
02377       // get_servant is responsible for invoking _remove_ref once on
02378       // the returned Servant when it is finished with it. A
02379       // conforming caller need not invoke _remove_ref on the returned
02380       // Servant if the type of the Servant uses the default reference
02381       // counting inherited from ServantBase.
02382       servant->_add_ref ();
02383 
02384       return servant;
02385     }
02386   else
02387     {
02388       // If no servant has been associated with the POA, the NoServant
02389       // exception is raised.
02390       throw PortableServer::POA::NoServant ();
02391     }
02392 }
02393 
02394 void
02395 TAO_Root_POA::set_servant (PortableServer::Servant servant)
02396 {
02397   // Lock access for the duration of this transaction.
02398   TAO_POA_GUARD;
02399 
02400   this->active_policy_strategies_.request_processing_strategy()->
02401     set_servant (servant);
02402 }
02403 
02404 #endif /* TAO_HAS_MINIMUM_POA == 0 && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) */
02405 
02406 bool
02407 TAO_Root_POA::is_servant_activation_allowed (PortableServer::Servant servant,
02408                                              bool &wait_occurred_restart_call)
02409 {
02410   return this->active_policy_strategies_.id_uniqueness_strategy ()->
02411     is_servant_activation_allowed (servant, wait_occurred_restart_call);
02412 }
02413 
02414 bool
02415 TAO_Root_POA::has_system_id (void) const
02416 {
02417   return this->active_policy_strategies_.id_assignment_strategy ()->
02418     has_system_id ();
02419 }
02420 
02421 int
02422 TAO_Root_POA::rebind_using_user_id_and_system_id (
02423   PortableServer::Servant servant,
02424   const PortableServer::ObjectId &user_id,
02425   const PortableServer::ObjectId &system_id,
02426   TAO::Portable_Server::Servant_Upcall &servant_upcall)
02427 {
02428   return this->active_policy_strategies_.servant_retention_strategy ()->
02429     rebind_using_user_id_and_system_id (servant,
02430                                         user_id,
02431                                         system_id,
02432                                         servant_upcall);
02433 }
02434 
02435 CORBA::Boolean
02436 TAO_Root_POA::servant_has_remaining_activations (PortableServer::Servant servant)
02437 {
02438   return this->active_policy_strategies_.servant_retention_strategy ()->
02439     servant_has_remaining_activations (servant);
02440 }
02441 
02442 bool
02443 TAO_Root_POA::allow_implicit_activation (void) const
02444 {
02445   return this->active_policy_strategies_.implicit_activation_strategy ()->
02446     allow_implicit_activation ();
02447 }
02448 
02449 bool
02450 TAO_Root_POA::allow_multiple_activations (void) const
02451 {
02452   return this->active_policy_strategies_.id_uniqueness_strategy ()->
02453     allow_multiple_activations ();
02454 }
02455 
02456 void
02457 TAO_Root_POA::post_invoke_servant_cleanup(
02458   const PortableServer::ObjectId &system_id,
02459   const TAO::Portable_Server::Servant_Upcall &servant_upcall)
02460 {
02461   this->active_policy_strategies_.request_processing_strategy ()->
02462     post_invoke_servant_cleanup (system_id, servant_upcall);
02463 }
02464 
02465 CORBA::Short
02466 TAO_Root_POA::server_priority (void) const
02467 {
02468   return this->cached_policies_.server_priority ();
02469 }
02470 
02471 int
02472 TAO_Root_POA::is_servant_active (
02473   PortableServer::Servant servant,
02474   bool &wait_occurred_restart_call)
02475 {
02476   return this->active_policy_strategies_.servant_retention_strategy ()->
02477     is_servant_in_map (servant, wait_occurred_restart_call);
02478 }
02479 
02480 TAO::Portable_Server::Cached_Policies&
02481 TAO_Root_POA::cached_policies (void)
02482 {
02483   return this->cached_policies_;
02484 }
02485 
02486 TAO_Network_Priority_Hook*
02487 TAO_Root_POA::network_priority_hook (void)
02488 {
02489   return this->network_priority_hook_;
02490 }
02491 
02492 TAO::Portable_Server::Cached_Policies::PriorityModel
02493 TAO_Root_POA::priority_model (void) const
02494 {
02495   return cached_policies_.priority_model ();
02496 }
02497 
02498 #if (TAO_HAS_MINIMUM_POA == 0)
02499 int
02500 TAO_Root_POA::enter ()
02501 {
02502   return this->active_policy_strategies_.thread_strategy ()->enter();
02503 }
02504 #endif /* TAO_HAS_MINIMUM_POA == 0 */
02505 
02506 #if (TAO_HAS_MINIMUM_POA == 0)
02507 int
02508 TAO_Root_POA::exit ()
02509 {
02510   return this->active_policy_strategies_.thread_strategy ()->exit();
02511 }
02512 #endif /* TAO_HAS_MINIMUM_POA == 0 */
02513 
02514 bool
02515 TAO_Root_POA::validate_lifespan (
02516   CORBA::Boolean is_persistent,
02517   const TAO::Portable_Server::Temporary_Creation_Time& creation_time) const
02518 {
02519   return this->active_policy_strategies_.lifespan_strategy()->
02520     validate (is_persistent, creation_time);
02521 }
02522 
02523 CORBA::Boolean
02524 TAO_Root_POA::root (void) const
02525 {
02526   return true;
02527 }
02528 
02529 TAO::ORT_Adapter *
02530 TAO_Root_POA::ORT_adapter (void)
02531 {
02532   if (this->ort_adapter_ != 0)
02533     return this->ort_adapter_;
02534 
02535   // Lock access for the duration of this transaction.
02536   TAO_POA_GUARD_RETURN (0);
02537 
02538   // DCL ..
02539   if (this->ort_adapter_ != 0)
02540     {
02541       return this->ort_adapter_;
02542     }
02543 
02544   return this->ORT_adapter_i ();
02545 }
02546 
02547 CORBA::Policy *
02548 TAO_Root_POA::server_protocol (void)
02549 {
02550   return 0;
02551 }
02552 
02553 void
02554 TAO_Root_POA::Key_To_Object_Params::set (PortableServer::ObjectId_var &system_id,
02555                                          const char *type_id,
02556                                          TAO_ServantBase *servant,
02557                                          CORBA::Boolean collocated,
02558                                          CORBA::Short priority,
02559                                          bool indirect)
02560 {
02561   this->system_id_ = &system_id;
02562   this->type_id_ = type_id;
02563   this->servant_ = servant;
02564   this->collocated_ = collocated;
02565   this->priority_ = priority;
02566   this->indirect_ = indirect;
02567 }
02568 
02569 CORBA::ULong
02570 TAO_Root_POA::waiting_servant_deactivation (void) const
02571 {
02572   return this->active_policy_strategies_.servant_retention_strategy ()->
02573           waiting_servant_deactivation ();
02574 }
02575 
02576 void
02577 TAO_Root_POA::ort_adapter_factory_name (const char *name)
02578 {
02579   TAO_POA_Static_Resources::instance ()->ort_adapter_factory_name_ =
02580     name;
02581 }
02582 
02583 CORBA::Policy_ptr
02584 TAO_Root_POA::get_policy (CORBA::PolicyType policy)
02585 {
02586   return this->policies_.get_policy (policy);
02587 }
02588 
02589 void
02590 TAO_Root_POA::check_state (void)
02591 {
02592   this->active_policy_strategies_.lifespan_strategy ()->check_state ();
02593 }
02594 
02595 const char *
02596 TAO_Root_POA::ort_adapter_factory_name (void)
02597 {
02598   return TAO_POA_Static_Resources::instance ()->ort_adapter_factory_name_.c_str();
02599 }
02600 
02601 void
02602 TAO_Root_POA::imr_client_adapter_name (const char *name)
02603 {
02604   TAO_POA_Static_Resources::instance ()->imr_client_adapter_name_ = name;
02605 }
02606 
02607 const char *
02608 TAO_Root_POA::imr_client_adapter_name (void)
02609 {
02610   return TAO_POA_Static_Resources::instance ()->imr_client_adapter_name_.c_str();
02611 }
02612 
02613 PortableServer::POAManager_ptr
02614 TAO_Root_POA::the_POAManager (void)
02615 {
02616   return PortableServer::POAManager::_duplicate (&this->poa_manager_);
02617 }
02618 
02619 #if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO)
02620 PortableServer::POAManagerFactory_ptr
02621 TAO_Root_POA::the_POAManagerFactory (void)
02622 {
02623   return PortableServer::POAManagerFactory::_duplicate (&this->poa_manager_factory_);
02624 }
02625 #endif
02626 
02627 CORBA::ORB_ptr
02628 TAO_Root_POA::_get_orb (void)
02629 {
02630   return CORBA::ORB::_duplicate (this->orb_core_.orb ());
02631 }
02632 
02633 // Initialize instance_ to 0, since this is what we test for in the call
02634 // to instance ().  Note that this does not require a constructor call, so
02635 // it is always initialized by the time that instance () can be called.
02636 TAO_POA_Static_Resources* TAO_POA_Static_Resources::instance_ = 0;
02637 
02638 // Force an instance to be created at module initialization time,
02639 // since we do not want to worry about double checked locking and
02640 // the race condition to initialize the lock.
02641 TAO_POA_Static_Resources* TAO_POA_Static_Resources::initialization_reference_ =
02642   TAO_POA_Static_Resources::instance ();
02643 
02644 TAO_POA_Static_Resources*
02645 TAO_POA_Static_Resources::instance (void)
02646 {
02647   if (TAO_POA_Static_Resources::instance_ == 0)
02648     {
02649       // This new is never freed on purpose.  The data specified by
02650       // it needs to be around for the last shared library that references
02651       // this class.  This could occur in a destructor in a shared library
02652       // that is unloaded after this one.  One solution to avoid this
02653       // harmless memory leak would be to use reference counting.
02654       ACE_NEW_RETURN (TAO_POA_Static_Resources::instance_,
02655                       TAO_POA_Static_Resources (),
02656                       0);
02657     }
02658 
02659   return TAO_POA_Static_Resources::instance_;
02660 }
02661 
02662 TAO_POA_Static_Resources::TAO_POA_Static_Resources (void)
02663   : ort_adapter_factory_name_ ("ORT_Adapter_Factory"),
02664     imr_client_adapter_name_ ("ImR_Client_Adapter")
02665 {
02666 }
02667 
02668 void
02669 TAO_Root_POA::poa_activated_hook ()
02670 {
02671 }
02672 
02673 void
02674 TAO_Root_POA::poa_deactivated_hook ()
02675 {
02676 }
02677 
02678 void
02679 TAO_Root_POA::servant_activated_hook (PortableServer::Servant,
02680                                       const PortableServer::ObjectId&)
02681 {
02682 }
02683 
02684 void
02685 TAO_Root_POA::servant_deactivated_hook (PortableServer::Servant,
02686                                         const PortableServer::ObjectId&)
02687 {
02688 }
02689 
02690 TAO_END_VERSIONED_NAMESPACE_DECL

Generated on Sun Jan 27 13:23:44 2008 for TAO_PortableServer by doxygen 1.3.6