Object_Adapter.cpp

Go to the documentation of this file.
00001 // Object_Adapter.cpp,v 1.93 2006/06/20 06:28:24 jwillemsen Exp
00002 
00003 // -- PortableServer Include --
00004 #include "tao/PortableServer/Object_Adapter.h"
00005 #include "tao/PortableServer/Non_Servant_Upcall.h"
00006 #include "tao/PortableServer/Servant_Upcall.h"
00007 #include "tao/PortableServer/Root_POA.h"
00008 #include "tao/PortableServer/Regular_POA.h"
00009 #include "tao/PortableServer/Creation_Time.h"
00010 #include "tao/PortableServer/POA_Guard.h"
00011 #include "tao/PortableServer/Default_Servant_Dispatcher.h"
00012 #include "tao/PortableServer/Collocated_Object_Proxy_Broker.h"
00013 #include "tao/PortableServer/POAManager.h"
00014 #include "tao/PortableServer/POAManagerFactory.h"
00015 #include "tao/PortableServer/Servant_Base.h"
00016 
00017 // -- ACE Include --
00018 #include "ace/Auto_Ptr.h"
00019 #include "ace/Log_Msg.h"
00020 #include "ace/OS_NS_string.h"
00021 
00022 // -- TAO Include --
00023 #include "tao/PortableInterceptorC.h"
00024 #include "tao/ORB.h"
00025 #include "tao/ORB_Core.h"
00026 #include "tao/TSS_Resources.h"
00027 #include "tao/TAO_Server_Request.h"
00028 #include "tao/Stub.h"
00029 #include "tao/Profile.h"
00030 #include "tao/MProfile.h"
00031 #include "tao/debug.h"
00032 #include "tao/PortableInterceptor.h"
00033 #include "tao/ORBInitializer_Registry.h"
00034 #include "tao/Thread_Lane_Resources_Manager.h"
00035 #include "tao/Thread_Lane_Resources.h"
00036 #include "tao/Protocols_Hooks.h"
00037 #include "tao/ServerRequestInterceptor_Adapter.h"
00038 
00039 #if !defined (__ACE_INLINE__)
00040 # include "tao/PortableServer/Object_Adapter.i"
00041 #endif /* __ACE_INLINE__ */
00042 
00043 #include "tao/PortableServer/ThreadPolicy.h"
00044 #include "tao/PortableServer/LifespanPolicy.h"
00045 #include "tao/PortableServer/IdAssignmentPolicy.h"
00046 #include "tao/PortableServer/IdUniquenessPolicy.h"
00047 #include "tao/PortableServer/ImplicitActivationPolicy.h"
00048 #include "tao/PortableServer/RequestProcessingPolicy.h"
00049 #include "tao/PortableServer/ServantRetentionPolicy.h"
00050 
00051 ACE_RCSID (PortableServer,
00052            Object_Adapter,
00053            "Object_Adapter.cpp,v 1.93 2006/06/20 06:28:24 jwillemsen Exp")
00054 
00055 #if !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO)
00056 namespace PortableServer
00057 {
00058   class POAManagerFactory;
00059   typedef POAManagerFactory *POAManagerFactory_ptr;
00060 }
00061 #endif
00062 
00063 // Timeprobes class
00064 #include "tao/Timeprobe.h"
00065 
00066 #if defined (ACE_ENABLE_TIMEPROBES)
00067 
00068 static const char *TAO_Object_Adapter_Timeprobe_Description[] =
00069 {
00070   "Object_Adapter::dispatch_servant - start",
00071   "Object_Adapter::dispatch_servant - end",
00072 
00073   "POA::parse_key - start",
00074   "POA::parse_key - end",
00075 
00076   "Object_Adapter::find_poa - start",
00077   "Object_Adapter::find_poa - end",
00078 
00079   "POA::locate_servant - start",
00080   "POA::locate_servant - end",
00081 
00082   "Servant::_dispatch - start",
00083   "Servant::_dispatch - end",
00084 };
00085 
00086 enum
00087 {
00088   // Timeprobe description table start key
00089   TAO_OBJECT_ADAPTER_DISPATCH_SERVANT_START = 200,
00090   TAO_OBJECT_ADAPTER_DISPATCH_SERVANT_END,
00091 
00092   TAO_POA_PARSE_KEY_START,
00093   TAO_POA_PARSE_KEY_END,
00094 
00095   TAO_OBJECT_ADAPTER_FIND_POA_START,
00096   TAO_OBJECT_ADAPTER_FIND_POA_END,
00097 
00098   TAO_POA_LOCATE_SERVANT_START,
00099   TAO_POA_LOCATE_SERVANT_END,
00100 
00101   TAO_SERVANT_DISPATCH_START,
00102   TAO_SERVANT_DISPATCH_END
00103 };
00104 
00105 // Setup Timeprobes
00106 ACE_TIMEPROBE_EVENT_DESCRIPTIONS (TAO_Object_Adapter_Timeprobe_Description,
00107                                   TAO_OBJECT_ADAPTER_DISPATCH_SERVANT_START);
00108 
00109 #endif /* ACE_ENABLE_TIMEPROBES */
00110 
00111 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00112 
00113 /* static */
00114 CORBA::ULong TAO_Object_Adapter::transient_poa_name_size_ = 0;
00115 
00116 void
00117 TAO_Object_Adapter::set_transient_poa_name_size (const TAO_Server_Strategy_Factory::Active_Object_Map_Creation_Parameters &creation_parameters)
00118 {
00119   if (TAO_Object_Adapter::transient_poa_name_size_ == 0)
00120     {
00121       switch (creation_parameters.poa_lookup_strategy_for_transient_id_policy_)
00122         {
00123 #if (TAO_HAS_MINIMUM_POA_MAPS == 0)
00124         case TAO_LINEAR:
00125           TAO_Object_Adapter::transient_poa_name_size_ =
00126             sizeof (CORBA::ULong);
00127           break;
00128         case TAO_DYNAMIC_HASH:
00129           TAO_Object_Adapter::transient_poa_name_size_ =
00130             sizeof (CORBA::ULong);
00131           break;
00132 #endif /* TAO_HAS_MINIMUM_POA_MAPS == 0 */
00133         case TAO_ACTIVE_DEMUX:
00134         default:
00135           TAO_Object_Adapter::transient_poa_name_size_ =
00136             static_cast <CORBA::ULong>(
00137                              ACE_Active_Map_Manager_Key::size ());
00138           break;
00139         }
00140     }
00141 }
00142 
00143 TAO_Object_Adapter::TAO_Object_Adapter (const TAO_Server_Strategy_Factory::Active_Object_Map_Creation_Parameters &creation_parameters,
00144                                         TAO_ORB_Core &orb_core)
00145   : hint_strategy_ (0),
00146     servant_dispatcher_ (0),
00147     persistent_poa_name_map_ (0),
00148     transient_poa_map_ (0),
00149     orb_core_ (orb_core),
00150     enable_locking_ (orb_core_.server_factory ()->enable_poa_locking ()),
00151     thread_lock_ (),
00152     lock_ (TAO_Object_Adapter::create_lock (enable_locking_,
00153                                             thread_lock_)),
00154     reverse_lock_ (*lock_),
00155     non_servant_upcall_condition_ (thread_lock_),
00156     non_servant_upcall_in_progress_ (0),
00157     non_servant_upcall_nesting_level_ (0),
00158     non_servant_upcall_thread_ (ACE_OS::NULL_thread),
00159     root_ (0),
00160     default_validator_ (orb_core),
00161     default_poa_policies_ ()
00162 {
00163   TAO_Object_Adapter::set_transient_poa_name_size (creation_parameters);
00164 
00165   Hint_Strategy *hint_strategy = 0;
00166   if (creation_parameters.use_active_hint_in_poa_names_)
00167     ACE_NEW (hint_strategy,
00168              Active_Hint_Strategy (creation_parameters.poa_map_size_));
00169   else
00170     ACE_NEW (hint_strategy,
00171              No_Hint_Strategy);
00172 
00173   // Give ownership to the auto pointer.
00174   auto_ptr<Hint_Strategy> new_hint_strategy (hint_strategy);
00175 
00176   new_hint_strategy->object_adapter (this);
00177 
00178   persistent_poa_name_map *ppnm = 0;
00179   switch (creation_parameters.poa_lookup_strategy_for_persistent_id_policy_)
00180     {
00181     case TAO_LINEAR:
00182 #if (TAO_HAS_MINIMUM_POA_MAPS == 0)
00183       ACE_NEW (ppnm,
00184                persistent_poa_name_linear_map (creation_parameters.poa_map_size_));
00185 
00186       break;
00187 #else
00188       ACE_ERROR ((LM_ERROR,
00189                   "linear option for -ORBPersistentidPolicyDemuxStrategy "
00190                   "not supported with minimum POA maps. "
00191                   "Ingoring option to use default... \n"));
00192       /* FALL THROUGH */
00193 #endif /* TAO_HAS_MINIMUM_POA_MAPS == 0 */
00194     case TAO_DYNAMIC_HASH:
00195     default:
00196       ACE_NEW (ppnm,
00197                persistent_poa_name_hash_map (creation_parameters.poa_map_size_));
00198       break;
00199     }
00200   // Give ownership to the auto pointer.
00201   auto_ptr<persistent_poa_name_map> new_persistent_poa_name_map (ppnm);
00202 
00203   transient_poa_map *tpm = 0;
00204   switch (creation_parameters.poa_lookup_strategy_for_transient_id_policy_)
00205     {
00206 #if (TAO_HAS_MINIMUM_POA_MAPS == 0)
00207     case TAO_LINEAR:
00208       ACE_NEW (tpm,
00209                transient_poa_linear_map (creation_parameters.poa_map_size_));
00210       break;
00211     case TAO_DYNAMIC_HASH:
00212       ACE_NEW (tpm,
00213                transient_poa_hash_map (creation_parameters.poa_map_size_));
00214       break;
00215 #else
00216     case TAO_LINEAR:
00217     case TAO_DYNAMIC_HASH:
00218       ACE_ERROR ((LM_ERROR,
00219                   "linear and dynamic options for -ORBTransientidPolicyDemuxStrategy "
00220                   "are not supported with minimum POA maps. "
00221                   "Ingoring option to use default... \n"));
00222       /* FALL THROUGH */
00223 #endif /* TAO_HAS_MINIMUM_POA_MAPS == 0 */
00224     case TAO_ACTIVE_DEMUX:
00225     default:
00226       ACE_NEW (tpm,
00227                transient_poa_active_map (creation_parameters.poa_map_size_));
00228       break;
00229     }
00230   // Give ownership to the auto pointer.
00231   auto_ptr<transient_poa_map> new_transient_poa_map (tpm);
00232 
00233   this->hint_strategy_ =
00234     new_hint_strategy.release ();
00235   this->persistent_poa_name_map_ =
00236     new_persistent_poa_name_map.release ();
00237   this->transient_poa_map_ =
00238     new_transient_poa_map.release ();
00239 }
00240 
00241 void
00242 TAO_Object_Adapter::init_default_policies (TAO_POA_Policy_Set &policies
00243                                            ACE_ENV_ARG_DECL)
00244 {
00245   // Initialize the default policies.
00246 #if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO)
00247 
00248   TAO::Portable_Server::ThreadPolicy thread_policy (PortableServer::ORB_CTRL_MODEL);
00249   policies.merge_policy (&thread_policy ACE_ENV_ARG_PARAMETER);
00250   ACE_CHECK;
00251 
00252 #endif /* TAO_HAS_MINIMUM_POA == 0 */
00253 
00254 #if !defined (CORBA_E_MICRO)
00255   // Lifespan policy.
00256   TAO::Portable_Server::LifespanPolicy lifespan_policy (PortableServer::TRANSIENT);
00257   policies.merge_policy (&lifespan_policy ACE_ENV_ARG_PARAMETER);
00258   ACE_CHECK;
00259 #endif
00260 
00261 #if !defined (CORBA_E_MICRO)
00262   // ID uniqueness policy.
00263   TAO::Portable_Server::IdUniquenessPolicy id_uniqueness_policy (PortableServer::UNIQUE_ID);
00264   policies.merge_policy (&id_uniqueness_policy ACE_ENV_ARG_PARAMETER);
00265   ACE_CHECK;
00266 #endif
00267 
00268 #if !defined (CORBA_E_MICRO)
00269   // ID assignment policy.
00270   TAO::Portable_Server::IdAssignmentPolicy id_assignment_policy (PortableServer::SYSTEM_ID);
00271   policies.merge_policy (&id_assignment_policy ACE_ENV_ARG_PARAMETER);
00272   ACE_CHECK;
00273 #endif
00274 
00275 #if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO)
00276   // Implicit activation policy.
00277   TAO::Portable_Server::ImplicitActivationPolicy implicit_activation_policy
00278     (PortableServer::NO_IMPLICIT_ACTIVATION);
00279   policies.merge_policy (&implicit_activation_policy ACE_ENV_ARG_PARAMETER);
00280   ACE_CHECK;
00281 
00282   // Servant retention policy.
00283   TAO::Portable_Server::ServantRetentionPolicy servant_retention_policy
00284     (PortableServer::RETAIN);
00285   policies.merge_policy (&servant_retention_policy ACE_ENV_ARG_PARAMETER);
00286   ACE_CHECK;
00287 
00288   // Request processing policy.
00289   TAO::Portable_Server::RequestProcessingPolicy request_processing_policy
00290     (PortableServer::USE_ACTIVE_OBJECT_MAP_ONLY);
00291   policies.merge_policy (&request_processing_policy ACE_ENV_ARG_PARAMETER);
00292   ACE_CHECK;
00293 #endif /* TAO_HAS_MINIMUM_POA == 0 */
00294 #if defined (CORBA_E_MICRO)
00295   ACE_UNUSED_ARG (policies);
00296 #endif
00297 }
00298 
00299 TAO_Object_Adapter::~TAO_Object_Adapter (void)
00300 {
00301   delete this->hint_strategy_;
00302   delete this->persistent_poa_name_map_;
00303   delete this->transient_poa_map_;
00304   delete this->lock_;
00305 
00306   delete this->servant_dispatcher_;
00307 }
00308 
00309 /* static */
00310 ACE_Lock *
00311 TAO_Object_Adapter::create_lock (int enable_locking,
00312                                  TAO_SYNCH_MUTEX &thread_lock)
00313 {
00314 #if defined (ACE_HAS_THREADS)
00315   if (enable_locking)
00316     {
00317       ACE_Lock *the_lock = 0;
00318       ACE_NEW_RETURN (the_lock,
00319                       ACE_Lock_Adapter<TAO_SYNCH_MUTEX> (thread_lock),
00320                       0);
00321       return the_lock;
00322     }
00323 #else
00324   ACE_UNUSED_ARG (enable_locking);
00325   ACE_UNUSED_ARG (thread_lock);
00326 #endif /* ACE_HAS_THREADS */
00327 
00328   ACE_Lock *the_lock = 0;
00329   ACE_NEW_RETURN (the_lock,
00330                   ACE_Lock_Adapter<ACE_SYNCH_NULL_MUTEX> (),
00331                   0);
00332   return the_lock;
00333 }
00334 
00335 int
00336 TAO_Object_Adapter::dispatch_servant (const TAO::ObjectKey &key,
00337                                       TAO_ServerRequest &req,
00338                                       CORBA::Object_out forward_to
00339                                       ACE_ENV_ARG_DECL)
00340 {
00341   ACE_FUNCTION_TIMEPROBE (TAO_OBJECT_ADAPTER_DISPATCH_SERVANT_START);
00342 
00343   // This object is magical, i.e., it has a non-trivial constructor
00344   // and destructor.
00345   TAO::Portable_Server::Servant_Upcall servant_upcall (&this->orb_core_);
00346 
00347   // Set up state in the POA et al (including the POA Current), so
00348   // that we know that this servant is currently in an upcall.
00349   const char *operation = req.operation ();
00350   int result =
00351     servant_upcall.prepare_for_upcall (key,
00352                                        operation,
00353                                        forward_to
00354                                        ACE_ENV_ARG_PARAMETER);
00355   ACE_CHECK_RETURN (result);
00356 
00357   if (result != TAO_Adapter::DS_OK)
00358     return result;
00359 
00360   // Preprocess request.
00361   if (req.collocated ())
00362     {
00363       servant_upcall.pre_invoke_collocated_request (
00364         ACE_ENV_SINGLE_ARG_PARAMETER);
00365       ACE_CHECK_RETURN (result);
00366     }
00367   else
00368     {
00369       servant_upcall.pre_invoke_remote_request (req
00370                                                 ACE_ENV_ARG_PARAMETER);
00371       ACE_CHECK_RETURN (result);
00372     }
00373 
00374   // Servant dispatch.
00375   {
00376     ACE_FUNCTION_TIMEPROBE (TAO_SERVANT_DISPATCH_START);
00377 
00378     do_dispatch (req, servant_upcall ACE_ENV_ARG_PARAMETER);
00379     ACE_CHECK_RETURN (result);
00380   }
00381 
00382   return result;
00383 }
00384 
00385 void
00386 TAO_Object_Adapter::locate_poa (const TAO::ObjectKey &key,
00387                                 PortableServer::ObjectId &system_id,
00388                                 TAO_Root_POA *&poa
00389                                 ACE_ENV_ARG_DECL)
00390 {
00391   TAO_Object_Adapter::poa_name poa_system_name;
00392   CORBA::Boolean is_root = false;
00393   CORBA::Boolean is_persistent = false;
00394   CORBA::Boolean is_system_id = false;
00395   TAO::Portable_Server::Temporary_Creation_Time poa_creation_time;
00396 
00397   int result = 0;
00398 
00399   {
00400     ACE_FUNCTION_TIMEPROBE (TAO_POA_PARSE_KEY_START);
00401 
00402     result = TAO_Root_POA::parse_key (key,
00403                                       poa_system_name,
00404                                       system_id,
00405                                       is_root,
00406                                       is_persistent,
00407                                       is_system_id,
00408                                       poa_creation_time);
00409   }
00410 
00411   if (result != 0)
00412     ACE_THROW (CORBA::OBJ_ADAPTER ());
00413 
00414   {
00415     ACE_FUNCTION_TIMEPROBE (TAO_OBJECT_ADAPTER_FIND_POA_START);
00416 
00417     result = this->find_poa (poa_system_name,
00418                              is_persistent,
00419                              is_root,
00420                              poa_creation_time,
00421                              poa
00422                              ACE_ENV_ARG_PARAMETER);
00423     ACE_CHECK;
00424   }
00425 
00426   if (result != 0)
00427     ACE_THROW (CORBA::OBJECT_NOT_EXIST (CORBA::OMGVMCID | 2,
00428                                         CORBA::COMPLETED_NO));
00429 }
00430 
00431 int
00432 TAO_Object_Adapter::activate_poa (const poa_name &folded_name,
00433                                   TAO_Root_POA *&poa
00434                                   ACE_ENV_ARG_DECL)
00435 {
00436   int result = -1;
00437 
00438 #if (TAO_HAS_MINIMUM_POA == 0) &&  !defined (CORBA_E_MICRO)
00439 
00440   iteratable_poa_name ipn (folded_name);
00441   iteratable_poa_name::iterator iterator = ipn.begin ();
00442   iteratable_poa_name::iterator end = ipn.end ();
00443 
00444   TAO_Root_POA *parent = this->root_;
00445   if (parent == 0 || parent->name () != *iterator)
00446     ACE_THROW_RETURN (CORBA::OBJ_ADAPTER (),
00447                       -1);
00448   else
00449     ++iterator;
00450 
00451   for (;
00452        iterator != end;
00453        ++iterator)
00454     {
00455       TAO_Root_POA *current = 0;
00456 
00457       ACE_TRY
00458         {
00459           current = parent->find_POA_i (*iterator,
00460                                         1
00461                                         ACE_ENV_ARG_PARAMETER);
00462           ACE_TRY_CHECK;
00463         }
00464       ACE_CATCH (PortableServer::POA::AdapterNonExistent, ex)
00465         {
00466           return -1;
00467         }
00468       ACE_ENDTRY;
00469       ACE_CHECK_RETURN (-1);
00470 
00471       parent = current;
00472     }
00473 
00474   poa = parent;
00475   result = 0;
00476 #else
00477   ACE_UNUSED_ARG (folded_name);
00478   ACE_UNUSED_ARG (poa);
00479   ACE_ENV_ARG_NOT_USED; // FUZZ: ignore check_for_ace_check
00480 #endif /* TAO_HAS_MINIMUM_POA == 0 */
00481 
00482   return result;
00483 }
00484 
00485 int
00486 TAO_Object_Adapter::find_transient_poa (const poa_name &system_name,
00487                                         CORBA::Boolean root,
00488                                         const TAO::Portable_Server::Temporary_Creation_Time &poa_creation_time,
00489                                         TAO_Root_POA *&poa
00490                                         ACE_ENV_ARG_DECL_NOT_USED)
00491 {
00492   int result = 0;
00493 
00494   if (root)
00495     {
00496       poa = this->root_;
00497     }
00498   else
00499     {
00500       result = this->transient_poa_map_->find (system_name,
00501                                                poa);
00502     }
00503 
00504   if (poa == 0
00505       || (result == 0 && !poa->validate_lifespan (false, poa_creation_time)))
00506     result = -1;
00507 
00508   return result;
00509 }
00510 
00511 int
00512 TAO_Object_Adapter::bind_poa (const poa_name &folded_name,
00513                               TAO_Root_POA *poa,
00514                               poa_name_out system_name)
00515 {
00516   if (poa->persistent ())
00517     return this->bind_persistent_poa (folded_name,
00518                                       poa,
00519                                       system_name);
00520   else
00521     return this->bind_transient_poa (poa,
00522                                      system_name);
00523 }
00524 
00525 int
00526 TAO_Object_Adapter::unbind_poa (TAO_Root_POA *poa,
00527                                 const poa_name &folded_name,
00528                                 const poa_name &system_name)
00529 {
00530   if (poa->persistent ())
00531     return this->unbind_persistent_poa (folded_name,
00532                                         system_name);
00533   else
00534     return this->unbind_transient_poa (system_name);
00535 }
00536 
00537 int
00538 TAO_Object_Adapter::locate_servant_i (const TAO::ObjectKey &key
00539                                       ACE_ENV_ARG_DECL)
00540 {
00541   ACE_FUNCTION_TIMEPROBE (TAO_POA_LOCATE_SERVANT_START);
00542 
00543   PortableServer::ObjectId id;
00544   TAO_Root_POA *poa = 0;
00545 
00546   this->locate_poa (key,
00547                     id,
00548                     poa
00549                     ACE_ENV_ARG_PARAMETER);
00550   ACE_CHECK_RETURN (-1);
00551 
00552   PortableServer::Servant servant = 0;
00553   TAO_SERVANT_LOCATION servant_location =
00554     poa->locate_servant_i (id,
00555                            servant
00556                            ACE_ENV_ARG_PARAMETER);
00557   ACE_CHECK_RETURN (-1);
00558 
00559   switch (servant_location)
00560     {
00561     case TAO_SERVANT_FOUND:
00562       // Optimistic attitude
00563     case TAO_DEFAULT_SERVANT:
00564     case TAO_SERVANT_MANAGER:
00565       return 0;
00566 
00567     case TAO_SERVANT_NOT_FOUND:
00568       return -1;
00569     }
00570 
00571   return -1;
00572 }
00573 
00574 TAO_SERVANT_LOCATION
00575 TAO_Object_Adapter::find_servant_i (const TAO::ObjectKey &key,
00576                                     PortableServer::Servant &servant
00577                                     ACE_ENV_ARG_DECL)
00578 {
00579   PortableServer::ObjectId id;
00580   TAO_Root_POA *poa = 0;
00581 
00582   this->locate_poa (key,
00583                     id,
00584                     poa
00585                     ACE_ENV_ARG_PARAMETER);
00586   ACE_CHECK_RETURN (TAO_SERVANT_NOT_FOUND);
00587 
00588   TAO_SERVANT_LOCATION servant_location = poa->locate_servant_i (id,
00589                                                                  servant
00590                                                                  ACE_ENV_ARG_PARAMETER);
00591   ACE_CHECK_RETURN (TAO_SERVANT_NOT_FOUND);
00592 
00593   return servant_location;
00594 }
00595 
00596 void
00597 TAO_Object_Adapter::open (ACE_ENV_SINGLE_ARG_DECL)
00598 {
00599   // Add in the default POA policies to the default list.
00600   this->init_default_policies (this->default_poa_policies ()
00601                                ACE_ENV_ARG_PARAMETER);
00602   ACE_CHECK;
00603 
00604   // If a POA extension hasn't changed the servant dispatcher, initialize the
00605   // default one.
00606   if (this->servant_dispatcher_ == 0)
00607     {
00608       ACE_NEW (this->servant_dispatcher_,
00609                TAO_Default_Servant_Dispatcher);
00610     }
00611 
00612 #if !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO)
00613   ACE_NEW_THROW_EX (this->poa_manager_factory_,
00614                     TAO_POAManager_Factory (*this),
00615                     CORBA::NO_MEMORY ());
00616 
00617   ::CORBA::PolicyList policy;
00618   PortableServer::POAManager_var poa_manager
00619     = poa_manager_factory_->create_POAManager (TAO_DEFAULT_ROOTPOAMANAGER_NAME,
00620                                               policy
00621                                               ACE_ENV_ARG_PARAMETER);
00622   ACE_CHECK;
00623 #else
00624   PortableServer::POAManager_var poa_manager;
00625   PortableServer::POAManager_ptr pm = PortableServer::POAManager::_nil ();
00626   ::CORBA::PolicyList policy_list;
00627   PortableServer::POAManagerFactory_ptr fptr;
00628   ACE_NEW_THROW_EX (pm,
00629                     TAO_POA_Manager (*this, 0, policy_list, fptr),
00630                     CORBA::NO_MEMORY
00631                     (CORBA::SystemException::_tao_minor_code (0, ENOMEM),
00632                       CORBA::COMPLETED_NO));
00633   ACE_CHECK_RETURN (::PortableServer::POAManager::_nil ());
00634   poa_manager = pm;
00635 #endif
00636 
00637   // This makes sure that the default resources are open when the Root
00638   // POA is created.
00639   this->orb_core_.thread_lane_resources_manager ().open_default_resources (ACE_ENV_SINGLE_ARG_PARAMETER);
00640   ACE_CHECK;
00641 
00642   TAO_POA_Policy_Set policies (this->default_poa_policies ());
00643 
00644 #if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO)
00645   // Specify the implicit activation policy since it should
00646   // be different from the default.  Note that merge_policy
00647   // takes a const reference and makes its own copy of the
00648   // policy.  (Otherwise, we'd have to allocate the policy
00649   // on the heap.)
00650   // Implicit activation policy.
00651   TAO::Portable_Server::ImplicitActivationPolicy implicit_activation_policy
00652     (PortableServer::IMPLICIT_ACTIVATION);
00653   policies.merge_policy (&implicit_activation_policy ACE_ENV_ARG_PARAMETER);
00654   ACE_CHECK;
00655 #endif /* TAO_HAS_MINIMUM_POA == 0 */
00656 
00657   // Merge policies from the ORB level.
00658   this->validator ().merge_policies (policies.policies ()
00659                                      ACE_ENV_ARG_PARAMETER);
00660   ACE_CHECK;
00661 
00662   // If any of the policy objects specified are not valid for the ORB
00663   // implementation, if conflicting policy objects are specified, or
00664   // if any of the specified policy objects require prior
00665   // administrative action that has not been performed, an
00666   // InvalidPolicy exception is raised containing the index in the
00667   // policies parameter value of the first offending policy object.
00668   policies.validate_policies (this->validator (),
00669                               this->orb_core_
00670                               ACE_ENV_ARG_PARAMETER);
00671   ACE_CHECK;
00672 
00673   // Construct a new POA
00674   TAO_Root_POA::String root_poa_name (TAO_DEFAULT_ROOTPOA_NAME);
00675   this->root_ =
00676     this->servant_dispatcher_->create_Root_POA (root_poa_name,
00677                                                 poa_manager.in (),
00678                                                 policies,
00679                                                 this->lock (),
00680                                                 this->thread_lock (),
00681                                                 this->orb_core_,
00682                                                 this
00683                                                 ACE_ENV_ARG_PARAMETER);
00684   ACE_CHECK;
00685 
00686   // The Object_Adapter will keep a reference to the Root POA so that
00687   // on its destruction, it can check whether the Root POA has been
00688   // destroyed yet or not.
00689   this->root_->_add_ref ();
00690 
00691   // Lock access for the duration of this transaction.
00692   TAO::Portable_Server::POA_Guard poa_guard (*this->root_ ACE_ENV_ARG_PARAMETER);
00693   ACE_CHECK;
00694 
00695   // Iterate over the registered IOR interceptors so that they may be
00696   // given the opportunity to add tagged components to the profiles
00697   // for this servant.
00698   this->root_->establish_components (ACE_ENV_SINGLE_ARG_PARAMETER);
00699   ACE_CHECK;
00700 }
00701 
00702 void
00703 TAO_Object_Adapter::close (int wait_for_completion
00704                            ACE_ENV_ARG_DECL)
00705 {
00706   this->check_close (wait_for_completion ACE_ENV_ARG_PARAMETER);
00707   ACE_CHECK;
00708 
00709   // Shutting down the ORB causes all object adapters to be destroyed,
00710   // since they cannot exist in the absence of an ORB. Shut down is
00711   // complete when all ORB processing (including request processing
00712   // and object deactivation or other operations associated with
00713   // object adapters) has completed and the object adapters have been
00714   // destroyed. In the case of the POA, this means that all object
00715   // etherealizations have finished and root POA has been destroyed
00716   // (implying that all descendent POAs have also been destroyed).
00717   TAO_Root_POA *root = 0;
00718   TAO_POAManager_Factory* factory = 0;
00719   {
00720     ACE_GUARD (ACE_Lock, ace_mon, this->lock ());
00721     if (this->root_ == 0)
00722       return;
00723     root = this->root_;
00724     this->root_ = 0;
00725     if (this->poa_manager_factory_ == 0)
00726       return;
00727     factory = this->poa_manager_factory_;
00728     this->poa_manager_factory_ = 0;
00729   }
00730   CORBA::Boolean etherealize_objects = 1;
00731   root->destroy (etherealize_objects,
00732                  wait_for_completion
00733                  ACE_ENV_ARG_PARAMETER);
00734   ACE_CHECK;
00735   ::CORBA::release (root);
00736 #if !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO)
00737   ::CORBA::release (factory);
00738 #endif
00739 }
00740 
00741 void
00742 TAO_Object_Adapter::check_close (int wait_for_completion
00743                                  ACE_ENV_ARG_DECL)
00744 {
00745   TAO_Root_POA::check_for_valid_wait_for_completions (this->orb_core (),
00746                                                  wait_for_completion
00747                                                  ACE_ENV_ARG_PARAMETER);
00748   ACE_CHECK;
00749 }
00750 
00751 int
00752 TAO_Object_Adapter::priority (void) const
00753 {
00754   return 0;
00755 }
00756 
00757 int
00758 TAO_Object_Adapter::dispatch (TAO::ObjectKey &key,
00759                               TAO_ServerRequest &request,
00760                               CORBA::Object_out forward_to
00761                               ACE_ENV_ARG_DECL)
00762 {
00763   if (ACE_OS::memcmp (key.get_buffer (),
00764                       &TAO_Root_POA::objectkey_prefix[0],
00765                       TAO_Root_POA::TAO_OBJECTKEY_PREFIX_SIZE) != 0)
00766     {
00767       return TAO_Adapter::DS_MISMATCHED_KEY;
00768     }
00769 
00770   int result = 0;
00771 
00772 #if TAO_HAS_INTERCEPTORS == 1
00773   TAO::ServerRequestInterceptor_Adapter *sri_adapter =
00774     orb_core_.serverrequestinterceptor_adapter ();
00775 
00776   ACE_TRY
00777     {
00778       if (sri_adapter != 0)
00779         {
00780 #if TAO_HAS_EXTENDED_FT_INTERCEPTORS == 1
00781           CORBA::OctetSeq_var ocs;
00782           sri_adapter->tao_ft_interception_point (request,
00783                                                  0,  // args
00784                                                  0,  // nargs
00785                                                  0,  // servant_upcall
00786                                                  0,  // exceptions
00787                                                  0, // nexceptions
00788                                                  ocs.out ()
00789                                                  ACE_ENV_ARG_PARAMETER);
00790           ACE_TRY_CHECK;
00791 
00792           /// If we have a cached result, just go ahead and send the reply
00793           /// and let us  return
00794           if (ocs.ptr () != 0)
00795             {
00796               // request.result_seq (
00797               request.send_cached_reply (ocs.inout ());
00798 
00799               return TAO_Adapter::DS_OK;
00800             }
00801 
00802           // If a PortableInterceptor::ForwardRequest exception was
00803           // thrown, then set the forward_to object reference and return
00804           // with the appropriate return status.
00805           forward_to.ptr () = request.forward_location ();
00806           if (!CORBA::is_nil (request.forward_location ()))
00807             {
00808               return TAO_Adapter::DS_FORWARD;
00809             }
00810 #endif /*TAO_HAS_EXTENDED_FT_INTERCEPTORS*/
00811 
00812           // The receive_request_service_contexts() interception point
00813           // must be invoked before the operation is dispatched to the
00814           // servant.
00815           sri_adapter->receive_request_service_contexts (request,
00816                                                          0,  // args
00817                                                          0,  // nargs
00818                                                          0,  // servant_upcall
00819                                                          0,  // exceptions
00820                                                          0   // nexceptions
00821                                                          ACE_ENV_ARG_PARAMETER);
00822           ACE_TRY_CHECK;
00823 
00824           // If a PortableInterceptor::ForwardRequest exception was
00825           // thrown, then set the forward_to object reference and return
00826           // with the appropriate return status.
00827           forward_to.ptr () = request.forward_location ();
00828           if (!CORBA::is_nil (request.forward_location ()))
00829             {
00830               return TAO_Adapter::DS_FORWARD;
00831             }
00832         }
00833 #endif  /* TAO_HAS_INTERCEPTORS == 1 */
00834 
00835       result = this->dispatch_servant (key,
00836                                        request,
00837                                        forward_to
00838                                        ACE_ENV_ARG_PARAMETER);
00839 
00840 #if TAO_HAS_INTERCEPTORS == 1
00841       ACE_TRY_CHECK;
00842 
00843       if (result == TAO_Adapter::DS_FORWARD)
00844         {
00845           request.forward_location (forward_to.ptr ());
00846           if (sri_adapter != 0)
00847             {
00848               sri_adapter->send_other (request,
00849                                        0,  // args
00850                                        0,  // nargs
00851                                        0,  // servant_upcall
00852                                        0,  // exceptions
00853                                        0   // nexceptions
00854                                        ACE_ENV_ARG_PARAMETER);
00855               ACE_TRY_CHECK;
00856             }
00857         }
00858     }
00859   ACE_CATCHANY
00860     {
00861       // Just assume the current exception is a system exception, the
00862       // status can only change when the interceptor changes this
00863       // and this is only done when the sri_adapter is available. If we
00864       // don't have an sri_adapter we just rethrow the exception
00865       PortableInterceptor::ReplyStatus status =
00866         PortableInterceptor::SYSTEM_EXCEPTION;
00867 
00868       if (sri_adapter != 0)
00869         {
00870           request.caught_exception (&ACE_ANY_EXCEPTION);
00871 
00872           sri_adapter->send_exception (request,
00873                                        0,  // args
00874                                        0,  // nargs
00875                                        0,  // servant_upcall
00876                                        0,  // exceptions
00877                                        0   // nexceptions
00878                                        ACE_ENV_ARG_PARAMETER);
00879           ACE_TRY_CHECK;
00880 
00881           status =
00882             request.reply_status ();
00883         }
00884 
00885       // Only re-throw the exception if it hasn't been transformed by
00886       // the send_exception() interception point (e.g. to a
00887       // LOCATION_FORWARD).
00888       if (status == PortableInterceptor::SYSTEM_EXCEPTION
00889           || status == PortableInterceptor::USER_EXCEPTION)
00890         {
00891           ACE_RE_THROW;
00892         }
00893     }
00894   ACE_ENDTRY;
00895   ACE_CHECK_RETURN (result);
00896 #endif  /* TAO_HAS_INTERCEPTORS == 1 */
00897 
00898   return result;
00899 }
00900 
00901 const char *
00902 TAO_Object_Adapter::name (void) const
00903 {
00904   return TAO_OBJID_ROOTPOA;
00905 }
00906 
00907 CORBA::Object_ptr
00908 TAO_Object_Adapter::root (void)
00909 {
00910   return CORBA::Object::_duplicate (this->root_);
00911 }
00912 
00913 CORBA::Object_ptr
00914 TAO_Object_Adapter::create_collocated_object (TAO_Stub *stub,
00915                                               const TAO_MProfile &mp)
00916 {
00917   TAO_ServantBase *sb = this->get_collocated_servant (mp);
00918 
00919   // Set the servant ORB.  Do not duplicate the ORB here since
00920   // TAO_Stub::servant_orb() duplicates it.
00921   stub->servant_orb (this->orb_core_.orb ());
00922 
00923   // It is ok to create a collocated object even when <sb> is
00924   // zero. This constructor will set the stub collocated indicator and
00925   // the strategized proxy broker if required.
00926   CORBA::Object_ptr x;
00927   ACE_NEW_RETURN (x,
00928                   CORBA::Object (stub,
00929                                  1,
00930                                  sb),
00931                   CORBA::Object::_nil ());
00932 
00933   // Success.
00934   return x;
00935 }
00936 
00937 CORBA::Long
00938 TAO_Object_Adapter::initialize_collocated_object (TAO_Stub *stub)
00939 {
00940   // If we have been forwarded: use the forwarded profiles
00941   const TAO_MProfile &mp = stub->forward_profiles () ? *(stub->forward_profiles ())
00942                                                      : stub->base_profiles ();
00943 
00944   TAO_ServantBase *sb = this->get_collocated_servant (mp);
00945 
00946   // Set the servant ORB.  Do not duplicate the ORB here since
00947   // TAO_Stub::servant_orb() duplicates it.
00948   stub->servant_orb (this->orb_core_.orb ());
00949 
00950   // It is ok to set the object as a collocated object even when
00951   // <sb> is zero.
00952   stub->collocated_servant (sb);
00953 
00954   // Mark the stub as collocated. This will set the strategized object
00955   // proxy broker if required.
00956   stub->is_collocated (true);
00957 
00958   // Return 0 (success) iff we found a servant.
00959   return ! sb;
00960 }
00961 
00962 TAO_ServantBase *
00963 TAO_Object_Adapter::get_collocated_servant (const TAO_MProfile &mp)
00964 {
00965   for (TAO_PHandle j = 0;
00966        j != mp.profile_count ();
00967        ++j)
00968     {
00969       const TAO_Profile *profile = mp.get_profile (j);
00970       TAO::ObjectKey_var objkey = profile->_key ();
00971 
00972       if (ACE_OS::memcmp (objkey->get_buffer (),
00973                           &TAO_Root_POA::objectkey_prefix[0],
00974                           TAO_Root_POA::TAO_OBJECTKEY_PREFIX_SIZE) != 0)
00975         continue;
00976 
00977       TAO_ServantBase *servant = 0;
00978 
00979       ACE_DECLARE_NEW_CORBA_ENV;
00980       ACE_TRY
00981         {
00982           this->find_servant (objkey.in (),
00983               servant
00984               ACE_ENV_ARG_PARAMETER);
00985           ACE_TRY_CHECK;
00986         }
00987       ACE_CATCHANY
00988         {
00989         }
00990       ACE_ENDTRY;
00991 
00992       return servant;
00993     }
00994 
00995   return 0;
00996 }
00997 
00998 // ****************************************************************
00999 
01000 TAO_Object_Adapter::Hint_Strategy::~Hint_Strategy (void)
01001 {
01002 }
01003 
01004 void
01005 TAO_Object_Adapter::Hint_Strategy::object_adapter (TAO_Object_Adapter *oa)
01006 {
01007   this->object_adapter_ = oa;
01008 }
01009 
01010 TAO_Object_Adapter::Active_Hint_Strategy::Active_Hint_Strategy (CORBA::ULong map_size)
01011   : persistent_poa_system_map_ (map_size)
01012 {
01013 }
01014 
01015 TAO_Object_Adapter::Active_Hint_Strategy::~Active_Hint_Strategy (void)
01016 {
01017 }
01018 
01019 int
01020 TAO_Object_Adapter::Active_Hint_Strategy::find_persistent_poa (
01021   const poa_name &system_name,
01022   TAO_Root_POA *&poa
01023   ACE_ENV_ARG_DECL)
01024 {
01025   poa_name folded_name;
01026   int result = this->persistent_poa_system_map_.recover_key (system_name,
01027                                                              folded_name);
01028 
01029   if (result == 0)
01030     {
01031       result = this->persistent_poa_system_map_.find (system_name,
01032                                                       poa);
01033       if (result != 0
01034           || folded_name != poa->folded_name ())
01035         {
01036           result =
01037             this->object_adapter_->persistent_poa_name_map_->find (folded_name,
01038                                                                    poa);
01039           if (result != 0)
01040             {
01041               result =
01042                 this->object_adapter_->activate_poa (folded_name,
01043                                                      poa
01044                                                      ACE_ENV_ARG_PARAMETER);
01045               ACE_CHECK_RETURN (-1);
01046             }
01047         }
01048     }
01049 
01050   return result;
01051 }
01052 
01053 int
01054 TAO_Object_Adapter::Active_Hint_Strategy::bind_persistent_poa (
01055   const poa_name &folded_name,
01056   TAO_Root_POA *poa,
01057   poa_name_out system_name)
01058 {
01059   poa_name name = folded_name;
01060   int result = this->persistent_poa_system_map_.bind_modify_key (poa,
01061                                                                  name);
01062 
01063   if (result == 0)
01064     {
01065       result =
01066         this->object_adapter_->persistent_poa_name_map_->bind (folded_name,
01067                                                                poa);
01068 
01069       if (result != 0)
01070         this->persistent_poa_system_map_.unbind (name);
01071       else
01072         ACE_NEW_RETURN (system_name,
01073                         poa_name (name),
01074                         -1);
01075     }
01076 
01077   return result;
01078 }
01079 
01080 int
01081 TAO_Object_Adapter::Active_Hint_Strategy::unbind_persistent_poa (
01082   const poa_name &folded_name,
01083   const poa_name &system_name)
01084 {
01085   int result = this->persistent_poa_system_map_.unbind (system_name);
01086 
01087   if (result == 0)
01088     result =
01089       this->object_adapter_->persistent_poa_name_map_->unbind (folded_name);
01090 
01091   return result;
01092 }
01093 
01094 TAO_Object_Adapter::No_Hint_Strategy::~No_Hint_Strategy (void)
01095 {
01096 }
01097 
01098 int
01099 TAO_Object_Adapter::No_Hint_Strategy::find_persistent_poa (
01100   const poa_name &system_name,
01101   TAO_Root_POA *&poa
01102   ACE_ENV_ARG_DECL)
01103 {
01104   int result =
01105     this->object_adapter_->persistent_poa_name_map_->find (system_name,
01106                                                            poa);
01107   if (result != 0)
01108     {
01109       result =
01110         this->object_adapter_->activate_poa (system_name,
01111                                              poa
01112                                              ACE_ENV_ARG_PARAMETER);
01113       ACE_CHECK_RETURN (-1);
01114     }
01115 
01116   return result;
01117 }
01118 
01119 int
01120 TAO_Object_Adapter::No_Hint_Strategy::bind_persistent_poa (
01121   const poa_name &folded_name,
01122   TAO_Root_POA *poa,
01123   poa_name_out system_name)
01124 {
01125   int result =
01126     this->object_adapter_->persistent_poa_name_map_->bind (folded_name,
01127                                                            poa);
01128   if (result == 0)
01129     ACE_NEW_RETURN (system_name,
01130                     poa_name (folded_name),
01131                     -1);
01132   return result;
01133 }
01134 
01135 int
01136 TAO_Object_Adapter::No_Hint_Strategy::unbind_persistent_poa (
01137   const poa_name & folded_name,
01138   const poa_name & /* system_name */)
01139 {
01140   return this->object_adapter_->persistent_poa_name_map_->unbind (folded_name);
01141 }
01142 
01143 TAO_Object_Adapter::poa_name_iterator::poa_name_iterator (
01144   int begin,
01145   CORBA::ULong size,
01146   const CORBA::Octet *folded_buffer)
01147   : size_ (size),
01148     folded_buffer_ (folded_buffer),
01149     last_separator_ ((CORBA::ULong) ~0)
01150 {
01151   if (begin)
01152     {
01153       this->position_ = (CORBA::ULong) ~0;
01154       this->operator++ ();
01155     }
01156   else
01157     this->position_ = this->size_;
01158 }
01159 
01160 bool
01161 TAO_Object_Adapter::poa_name_iterator::operator== (const poa_name_iterator &rhs) const
01162 {
01163   return this->position_ == rhs.position_;
01164 }
01165 
01166 bool
01167 TAO_Object_Adapter::poa_name_iterator::operator!= (const poa_name_iterator &rhs) const
01168 {
01169   return !this->operator== (rhs);
01170 }
01171 
01172 ACE_CString
01173 TAO_Object_Adapter::poa_name_iterator::operator* () const
01174 {
01175   CORBA::ULong start_at =
01176     this->last_separator_ +
01177     TAO_Root_POA::name_separator_length ();
01178 
01179   CORBA::ULong how_many =
01180     this->position_
01181     - this->last_separator_
01182     - TAO_Root_POA::name_separator_length ();
01183 
01184   return ACE_CString (reinterpret_cast <const char *>
01185                                        (&this->folded_buffer_[start_at]),
01186                       how_many);
01187 }
01188 
01189 TAO_Object_Adapter::poa_name_iterator &
01190 TAO_Object_Adapter::poa_name_iterator::operator++ (void)
01191 {
01192   for (this->last_separator_ = this->position_;
01193        ;
01194        )
01195     {
01196       ++this->position_;
01197       if (this->position_ < this->size_)
01198         {
01199           if (this->folded_buffer_[this->position_] == TAO_Root_POA::name_separator ())
01200             break;
01201         }
01202       else
01203         break;
01204     }
01205 
01206   return *this;
01207 }
01208 
01209 TAO_Object_Adapter::iteratable_poa_name::iteratable_poa_name (
01210   const poa_name &folded_name)
01211   : folded_name_ (folded_name)
01212 {
01213 }
01214 
01215 TAO_Object_Adapter::iteratable_poa_name::iterator
01216 TAO_Object_Adapter::iteratable_poa_name::begin (void) const
01217 {
01218   return iterator (1,
01219                    this->folded_name_.length (),
01220                    this->folded_name_.get_buffer ());
01221 }
01222 
01223 TAO_Object_Adapter::iteratable_poa_name::iterator
01224 TAO_Object_Adapter::iteratable_poa_name::end (void) const
01225 {
01226   return iterator (0,
01227                    this->folded_name_.length (),
01228                    this->folded_name_.get_buffer ());
01229 }
01230 
01231 void
01232 TAO_Object_Adapter::wait_for_non_servant_upcalls_to_complete (CORBA::Environment &ACE_TRY_ENV)
01233 {
01234 #if defined (ACE_HAS_EXCEPTIONS)
01235   ACE_UNUSED_ARG (ACE_TRY_ENV); // FUZZ: ignore check_for_ace_check
01236 #endif
01237 
01238   // Check if a non-servant upcall is in progress.  If a non-servant
01239   // upcall is in progress, wait for it to complete.  Unless of
01240   // course, the thread making the non-servant upcall is this thread.
01241   while (this->enable_locking_ &&
01242          this->non_servant_upcall_in_progress_ &&
01243          ! ACE_OS::thr_equal (this->non_servant_upcall_thread_,
01244                               ACE_OS::thr_self ()))
01245     {
01246       // If so wait...
01247       int result =
01248         this->non_servant_upcall_condition_.wait ();
01249       if (result == -1)
01250         ACE_THROW (CORBA::OBJ_ADAPTER ());
01251     }
01252 }
01253 
01254 void
01255 TAO_Object_Adapter::wait_for_non_servant_upcalls_to_complete (void)
01256 {
01257   // Non-exception throwing version.
01258   ACE_TRY_NEW_ENV
01259     {
01260       this->wait_for_non_servant_upcalls_to_complete (ACE_TRY_ENV);
01261       ACE_TRY_CHECK;
01262     }
01263   ACE_CATCHANY
01264     {
01265       ACE_ERROR ((LM_ERROR,
01266                   "TAO_Object_Adapter::wait_for_non_servant_upcalls_to_complete "
01267                   "threw exception it should not have!\n"));
01268     }
01269   ACE_ENDTRY;
01270 }
01271 
01272 void
01273 TAO_Object_Adapter::servant_dispatcher (TAO_Servant_Dispatcher *dispatcher)
01274 {
01275   if (this->servant_dispatcher_)
01276     delete this->servant_dispatcher_;
01277 
01278   this->servant_dispatcher_ = dispatcher;
01279 }
01280 
01281 void
01282 TAO_Object_Adapter::do_dispatch (TAO_ServerRequest& req,
01283                                  TAO::Portable_Server::Servant_Upcall& upcall
01284                                  ACE_ENV_ARG_DECL)
01285 {
01286   upcall.servant ()->_dispatch(req,
01287                                &upcall
01288                                ACE_ENV_ARG_PARAMETER);
01289   ACE_CHECK;
01290 }
01291 
01292 TAO_END_VERSIONED_NAMESPACE_DECL

Generated on Thu Nov 9 12:40:39 2006 for TAO_PortableServer by doxygen 1.3.6