RT_POA.cpp

Go to the documentation of this file.
00001 // RT_POA.cpp,v 1.21 2006/04/26 13:42:42 mesnier_p Exp
00002 
00003 #include "tao/RTPortableServer/RT_POA.h"
00004 
00005 #if defined (TAO_HAS_CORBA_MESSAGING) && TAO_HAS_CORBA_MESSAGING != 0
00006 
00007 #include "tao/RTPortableServer/RT_Acceptor_Filters.h"
00008 
00009 #include "tao/ORB_Core.h"
00010 #include "tao/ORB.h"
00011 #include "tao/Server_Strategy_Factory.h"
00012 #include "tao/Environment.h"
00013 #include "tao/Exception.h"
00014 #include "tao/Stub.h"
00015 #include "tao/Policy_Manager.h"
00016 #include "tao/debug.h"
00017 #include "tao/RTCORBA/Thread_Pool.h"
00018 #include "tao/Thread_Lane_Resources.h"
00019 #include "tao/Acceptor_Registry.h"
00020 #include "tao/Thread_Lane_Resources.h"
00021 #include "tao/Thread_Lane_Resources_Manager.h"
00022 
00023 #include "tao/RTCORBA/RT_Policy_i.h"
00024 
00025 #include "tao/PortableServer/Default_Acceptor_Filter.h"
00026 #include "tao/RTPortableServer/RT_Policy_Validator.h"
00027 
00028 #include "ace/Auto_Ptr.h"
00029 
00030 #if !defined (__ACE_INLINE__)
00031 # include "tao/RTPortableServer/RT_POA.i"
00032 #endif /* ! __ACE_INLINE__ */
00033 
00034 ACE_RCSID (RTPortableServer,
00035            RT_POA,
00036            "RT_POA.cpp,v 1.21 2006/04/26 13:42:42 mesnier_p Exp")
00037 
00038 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00039 
00040 TAO_RT_POA::TAO_RT_POA (const TAO_Root_POA::String &name,
00041                         PortableServer::POAManager_ptr poa_manager,
00042                         const TAO_POA_Policy_Set &policies,
00043                         TAO_Root_POA *parent,
00044                         ACE_Lock &lock,
00045                         TAO_SYNCH_MUTEX &thread_lock,
00046                         TAO_ORB_Core &orb_core,
00047                         TAO_Object_Adapter *object_adapter
00048                         ACE_ENV_ARG_DECL)
00049   : TAO_Regular_POA (name,
00050                      poa_manager,
00051                      policies,
00052                      parent,
00053                      lock,
00054                      thread_lock,
00055                      orb_core,
00056                      object_adapter
00057                      ACE_ENV_ARG_PARAMETER),
00058   thread_pool_ (0)
00059 {
00060   ACE_CHECK;
00061 
00062   // Parse the RT policies and update our policy cache.
00063   this->parse_rt_policies (this->policies ()
00064                            ACE_ENV_ARG_PARAMETER);
00065   ACE_CHECK;
00066 }
00067 
00068 TAO_RT_POA::~TAO_RT_POA (void)
00069 {
00070 }
00071 
00072 TAO_Root_POA *
00073 TAO_RT_POA::new_POA (const String &name,
00074                      PortableServer::POAManager_ptr poa_manager,
00075                      const TAO_POA_Policy_Set &policies,
00076                      TAO_Root_POA *parent,
00077                      ACE_Lock &lock,
00078                      TAO_SYNCH_MUTEX &thread_lock,
00079                      TAO_ORB_Core &orb_core,
00080                      TAO_Object_Adapter *object_adapter
00081                      ACE_ENV_ARG_DECL)
00082 {
00083   TAO_RT_POA *poa = 0;
00084 
00085   ACE_NEW_THROW_EX (poa,
00086                     TAO_RT_POA (name,
00087                                 poa_manager,
00088                                 policies,
00089                                 parent,
00090                                 lock,
00091                                 thread_lock,
00092                                 orb_core,
00093                                 object_adapter
00094                                 ACE_ENV_ARG_PARAMETER),
00095                     CORBA::NO_MEMORY ());
00096   ACE_CHECK_RETURN (0);
00097 
00098   return poa;
00099 }
00100 
00101 void
00102 TAO_RT_POA::parse_rt_policies (TAO_POA_Policy_Set &policies
00103                                ACE_ENV_ARG_DECL)
00104 {
00105   {
00106     CORBA::Policy_var policy =
00107       policies.get_cached_policy (TAO_CACHED_POLICY_PRIORITY_MODEL
00108                                   ACE_ENV_ARG_PARAMETER);
00109     ACE_CHECK;
00110 
00111     RTCORBA::PriorityModelPolicy_var priority_model =
00112       RTCORBA::PriorityModelPolicy::_narrow (policy.in ()
00113                                              ACE_ENV_ARG_PARAMETER);
00114     ACE_CHECK;
00115 
00116     if (!CORBA::is_nil (priority_model.in ()))
00117       {
00118         RTCORBA::PriorityModel rt_priority_model =
00119           priority_model->priority_model (ACE_ENV_SINGLE_ARG_PARAMETER);
00120         ACE_CHECK;
00121 
00122         this->cached_policies_.priority_model (
00123           TAO::Portable_Server::Cached_Policies::PriorityModel (rt_priority_model));
00124 
00125         RTCORBA::Priority priority =
00126           priority_model->server_priority (ACE_ENV_SINGLE_ARG_PARAMETER);
00127         ACE_CHECK;
00128 
00129         this->cached_policies_.server_priority (priority);
00130       }
00131   }
00132 
00133   this->thread_pool_ =
00134     TAO_POA_RT_Policy_Validator::extract_thread_pool (this->orb_core_,
00135                                                       policies.policies ()
00136                                                       ACE_ENV_ARG_PARAMETER);
00137   ACE_CHECK;
00138 }
00139 
00140 void
00141 TAO_RT_POA::validate_priority (RTCORBA::Priority priority
00142                                ACE_ENV_ARG_DECL)
00143 {
00144   if (priority < RTCORBA::minPriority
00145            // The line below will always be false unless the value of
00146            // RTCORBA::maxPriority, which is now assigned the value of
00147            // 32767, is changed in RTCORBA.pidl.
00148 //      || priority > RTCORBA::maxPriority
00149      )
00150     {
00151       ACE_THROW (CORBA::BAD_PARAM ());
00152     }
00153 
00154   // If this POA is using a thread pool with lanes, make sure the
00155   // priority matches one of the thread lanes.  Note that in this
00156   // case, bands do not matter since matching the lanes priority is a
00157   // stricter condition than meeting the band ranges.  In addition,
00158   // when the POA was created, the bands had to match the lanes.
00159   if (this->thread_pool_ != 0 &&
00160       this->thread_pool_->with_lanes ())
00161     {
00162       TAO_Thread_Lane **lanes =
00163         this->thread_pool_->lanes ();
00164 
00165       for (CORBA::ULong i = 0;
00166            i != this->thread_pool_->number_of_lanes ();
00167            ++i)
00168         {
00169           if (lanes[i]->lane_priority () == priority)
00170             return;
00171         }
00172 
00173       ACE_THROW (CORBA::BAD_PARAM ());
00174     }
00175   else
00176     // Else we are dealing with a thread pool without lanes.
00177     {
00178       // Check if we have bands.
00179       CORBA::Policy_var bands =
00180         this->policies ().get_cached_policy (
00181           TAO_CACHED_POLICY_RT_PRIORITY_BANDED_CONNECTION
00182           ACE_ENV_ARG_PARAMETER);
00183       ACE_CHECK;
00184 
00185       RTCORBA::PriorityBandedConnectionPolicy_var priority_bands
00186         = RTCORBA::PriorityBandedConnectionPolicy::_narrow (bands.in ()
00187                                                             ACE_ENV_ARG_PARAMETER);
00188       ACE_CHECK;
00189 
00190       TAO_PriorityBandedConnectionPolicy *priority_bands_i =
00191         dynamic_cast <TAO_PriorityBandedConnectionPolicy *>
00192                           (priority_bands.in ());
00193 
00194       if (priority_bands_i)
00195         {
00196           // If we do have bands, make sure that the priority is
00197           // matching one of the bands.
00198           RTCORBA::PriorityBands &bands =
00199             priority_bands_i->priority_bands_rep ();
00200 
00201           for (CORBA::ULong i = 0;
00202                i < bands.length ();
00203                ++i)
00204             {
00205               if (bands[i].low <= priority &&
00206                   bands[i].high >= priority)
00207                 return;
00208             }
00209 
00210           ACE_THROW (CORBA::BAD_PARAM ());
00211         }
00212     }
00213 }
00214 
00215 void
00216 TAO_RT_POA::validate_policies (ACE_ENV_SINGLE_ARG_DECL)
00217 {
00218   // For each of the above operations, if the POA supports the
00219   // IMPLICIT_ACTIVATION option for the ImplicitActivationPolicy then
00220   // the ORB shall raise a WrongPolicy user exception. This relieves
00221   // an ORB implementation of the need to retrieve the target object's
00222   // priority from "somewhere" when a request arrives for an inactive
00223   // object.
00224   if (this->cached_policies_.implicit_activation () ==
00225       PortableServer::IMPLICIT_ACTIVATION)
00226     {
00227       ACE_THROW (PortableServer::POA::WrongPolicy ());
00228     }
00229 
00230   // For each of the above operations, if the POA does not support the
00231   // SERVER_DECLARED option for the PriorityModelPolicy then the ORB
00232   // shall raise a WrongPolicy user exception.
00233   if (this->cached_policies_.priority_model () !=
00234       TAO::Portable_Server::Cached_Policies::SERVER_DECLARED)
00235     {
00236       ACE_THROW (PortableServer::POA::WrongPolicy ());
00237     }
00238 
00239   // In all other respects the semantics of the corresponding
00240   // (i.e. without the name extensions "_with_priority" and
00241   // "_and_priority") PortableServer::POA operations shall be
00242   // observed.
00243 }
00244 
00245 TAO_Stub *
00246 TAO_RT_POA::key_to_stub_i (const TAO::ObjectKey &object_key,
00247                            const char *type_id,
00248                            CORBA::Short priority
00249                            ACE_ENV_ARG_DECL)
00250 {
00251   // Client exposed policies.
00252   CORBA::PolicyList_var client_exposed_policies =
00253     this->client_exposed_policies (priority
00254                                    ACE_ENV_ARG_PARAMETER);
00255   ACE_CHECK_RETURN (0);
00256 
00257   // Server protocol policy.
00258   CORBA::Policy_var protocol =
00259     this->policies ().get_cached_policy (TAO_CACHED_POLICY_RT_SERVER_PROTOCOL
00260                                          ACE_ENV_ARG_PARAMETER);
00261   ACE_CHECK_RETURN (0);
00262 
00263   RTCORBA::ServerProtocolPolicy_var server_protocol_policy =
00264     RTCORBA::ServerProtocolPolicy::_narrow (protocol.in ()
00265                                             ACE_ENV_ARG_PARAMETER);
00266   ACE_CHECK_RETURN (0);
00267 
00268   TAO_ServerProtocolPolicy *server_protocol =
00269     dynamic_cast <TAO_ServerProtocolPolicy *> (server_protocol_policy.in ());
00270 
00271   // Filter for server protocol.
00272   TAO_Server_Protocol_Acceptor_Filter filter (server_protocol->protocols_rep ());
00273 
00274   // If this POA is using the default thread pool or a thread pool
00275   // without lanes, create the IOR with the acceptors in the thread
00276   // pool.
00277   if (this->thread_pool_ == 0 ||
00278       !this->thread_pool_->with_lanes ())
00279     {
00280       TAO_Acceptor_Registry *acceptor_registry = 0;
00281 
00282       if (this->thread_pool_ == 0)
00283         {
00284           TAO_Thread_Lane_Resources_Manager &thread_lane_resources_manager =
00285             this->orb_core_.thread_lane_resources_manager ();
00286 
00287           TAO_Thread_Lane_Resources &resources =
00288             thread_lane_resources_manager.default_lane_resources ();
00289 
00290           acceptor_registry =
00291             &resources.acceptor_registry ();
00292         }
00293       else
00294         {
00295           TAO_Thread_Lane **lanes =
00296             this->thread_pool_->lanes ();
00297 
00298           TAO_Thread_Lane_Resources &resources =
00299             lanes[0]->resources ();
00300 
00301           acceptor_registry =
00302             &resources.acceptor_registry ();
00303         }
00304 
00305       return
00306         this->TAO_Regular_POA::create_stub_object (object_key,
00307                                            type_id,
00308                                            client_exposed_policies._retn (),
00309                                            &filter,
00310                                            *acceptor_registry
00311                                            ACE_ENV_ARG_PARAMETER);
00312     }
00313 
00314   // If this POA has the SERVER_DECLARED policy, create the IOR with
00315   // the acceptors in the only thread lane that matches the priority
00316   // of the object.
00317   if (this->cached_policies_.priority_model () ==
00318       TAO::Portable_Server::Cached_Policies::SERVER_DECLARED)
00319     {
00320       TAO_Thread_Lane **lanes =
00321         this->thread_pool_->lanes ();
00322 
00323       for (CORBA::ULong i = 0;
00324            i != this->thread_pool_->number_of_lanes ();
00325            ++i)
00326         {
00327           if (lanes[i]->lane_priority () == priority)
00328             return this->TAO_Regular_POA::create_stub_object (object_key,
00329                                                       type_id,
00330                                                       client_exposed_policies._retn (),
00331                                                       &filter,
00332                                                       lanes[i]->resources ().acceptor_registry ()
00333                                                       ACE_ENV_ARG_PARAMETER);
00334         }
00335 
00336       ACE_ASSERT (0);
00337     }
00338 
00339   // If this POA has the CLIENT_PROPAGATED policy, create the IOR with
00340   // the acceptors in the thread lanes that matches the bands in this
00341   // POA.  If there are no bands, all the thread lanes are used.
00342   CORBA::Policy_var bands =
00343     this->policies ().get_cached_policy (
00344       TAO_CACHED_POLICY_RT_PRIORITY_BANDED_CONNECTION
00345       ACE_ENV_ARG_PARAMETER);
00346   ACE_CHECK_RETURN (0);
00347 
00348   RTCORBA::PriorityBandedConnectionPolicy_var priority_bands
00349     = RTCORBA::PriorityBandedConnectionPolicy::_narrow (bands.in ()
00350                                                         ACE_ENV_ARG_PARAMETER);
00351   ACE_CHECK_RETURN (0);
00352 
00353   TAO_PriorityBandedConnectionPolicy *priority_bands_i =
00354     dynamic_cast <TAO_PriorityBandedConnectionPolicy *> (priority_bands.in ());
00355 
00356   return this->create_stub_object (object_key,
00357                                    type_id,
00358                                    client_exposed_policies._retn (),
00359                                    &filter,
00360                                    priority_bands_i
00361                                    ACE_ENV_ARG_PARAMETER);
00362 }
00363 
00364 TAO_Stub *
00365 TAO_RT_POA::create_stub_object (const TAO::ObjectKey &object_key,
00366                                 const char *type_id,
00367                                 CORBA::PolicyList *policy_list,
00368                                 TAO_Acceptor_Filter *filter,
00369                                 TAO_PriorityBandedConnectionPolicy *priority_bands
00370                                 ACE_ENV_ARG_DECL)
00371 {
00372   int error = 0;
00373 
00374   // Count the number of endpoints.
00375   size_t profile_count =
00376     this->endpoint_count ();
00377 
00378   // Create a profile container and have acceptor registries populate
00379   // it with profiles as appropriate.
00380   TAO_MProfile mprofile (0);
00381 
00382   // Allocate space for storing the profiles.  There can never be more
00383   // profiles than there are endpoints.  In some cases, there can be
00384   // less profiles than endpoints.
00385   int result =
00386     mprofile.set (static_cast <CORBA::ULong> (profile_count));
00387   if (result == -1)
00388     error = 1;
00389 
00390   TAO_Thread_Lane **lanes =
00391     this->thread_pool_->lanes ();
00392 
00393   // Leave it to the filter to decide which acceptors/in which order
00394   // go into the mprofile.
00395   for (CORBA::ULong i = 0;
00396        i != this->thread_pool_->number_of_lanes () &&
00397          !error;
00398        ++i)
00399     {
00400       if (this->lane_required (lanes[i],
00401                                priority_bands))
00402         {
00403           TAO_Acceptor_Registry &acceptor_registry =
00404             lanes[i]->resources ().acceptor_registry ();
00405 
00406           result =
00407             filter->fill_profile (object_key,
00408                                   mprofile,
00409                                   acceptor_registry.begin (),
00410                                   acceptor_registry.end (),
00411                                   lanes[i]->lane_priority ());
00412           if (result == -1)
00413             error = 1;
00414         }
00415     }
00416 
00417   if (!error)
00418     result = filter->encode_endpoints (mprofile);
00419   if (result == -1)
00420     error = 1;
00421 
00422   if (error)
00423     ACE_THROW_RETURN (CORBA::INTERNAL (
00424                         CORBA::SystemException::_tao_minor_code (
00425                           TAO_MPROFILE_CREATION_ERROR,
00426                           0),
00427                         CORBA::COMPLETED_NO),
00428                       0);
00429 
00430   // Make sure we have at least one profile.  <mp> may end up being
00431   // empty if none of the acceptor endpoints have the right priority
00432   // for this object, for example.
00433   if (mprofile.profile_count () == 0)
00434     ACE_THROW_RETURN (CORBA::BAD_PARAM (
00435                         CORBA::SystemException::_tao_minor_code (
00436                           TAO_MPROFILE_CREATION_ERROR,
00437                           0),
00438                         CORBA::COMPLETED_NO),
00439                       0);
00440 
00441   return
00442     this->orb_core_.create_stub_object (mprofile,
00443                                         type_id,
00444                                         policy_list
00445                                         ACE_ENV_ARG_PARAMETER);
00446 }
00447 
00448 size_t
00449 TAO_RT_POA::endpoint_count (void)
00450 {
00451   size_t profile_count = 0;
00452 
00453   TAO_Thread_Lane **lanes =
00454     this->thread_pool_->lanes ();
00455 
00456   for (CORBA::ULong i = 0;
00457        i != this->thread_pool_->number_of_lanes ();
00458        ++i)
00459     profile_count +=
00460       lanes[i]->resources ().acceptor_registry ().endpoint_count ();
00461 
00462   return profile_count;
00463 }
00464 
00465 int
00466 TAO_RT_POA::lane_required (TAO_Thread_Lane *lane,
00467                            TAO_PriorityBandedConnectionPolicy *priority_bands)
00468 {
00469   if (priority_bands == 0)
00470     return 1;
00471 
00472   RTCORBA::PriorityBands &bands =
00473     priority_bands->priority_bands_rep ();
00474 
00475   for (CORBA::ULong i = 0;
00476        i < bands.length ();
00477        ++i)
00478     {
00479       if (bands[i].low <= lane->lane_priority () &&
00480           bands[i].high >= lane->lane_priority ())
00481         return 1;
00482     }
00483 
00484   return 0;
00485 }
00486 
00487 CORBA::PolicyList *
00488 TAO_RT_POA::client_exposed_policies (CORBA::Short object_priority
00489                                      ACE_ENV_ARG_DECL)
00490 {
00491   CORBA::PolicyList *client_exposed_policies = 0;
00492   ACE_NEW_THROW_EX (client_exposed_policies,
00493                     CORBA::PolicyList (),
00494                     CORBA::NO_MEMORY (TAO::VMCID,
00495                                       CORBA::COMPLETED_NO));
00496   ACE_CHECK_RETURN (0);
00497 
00498   CORBA::PolicyList_var safe_client_exposed_policies = client_exposed_policies;
00499 
00500   // Add in all of the client exposed policies.
00501   this->policies_.add_client_exposed_fixed_policies (client_exposed_policies
00502                                                      ACE_ENV_ARG_PARAMETER);
00503   ACE_CHECK_RETURN (0);
00504 
00505   // Check if the priority model policy has been set, and if so, let
00506   // the client know about it.
00507   CORBA::Short poa_priority =
00508     this->cached_policies_.server_priority ();
00509 
00510   if (poa_priority != TAO_INVALID_PRIORITY)
00511     {
00512       TAO::Portable_Server::Cached_Policies::PriorityModel priority_model =
00513         this->cached_policies_.priority_model ();
00514 
00515       // If the priority model is client propagated, let the client
00516       // about the default server priority (the POA priority).  If
00517       // the priority model is server declared, tell the client the
00518       // servant's priority.
00519       CORBA::Short priority;
00520       if (priority_model == TAO::Portable_Server::Cached_Policies::CLIENT_PROPAGATED)
00521         priority = poa_priority;
00522       else
00523         priority = object_priority;
00524 
00525       const CORBA::ULong current_length =
00526         client_exposed_policies->length ();
00527       client_exposed_policies->length (current_length + 1);
00528 
00529       TAO_PriorityModelPolicy *priority_model_policy;
00530       ACE_NEW_THROW_EX (priority_model_policy,
00531                         TAO_PriorityModelPolicy (RTCORBA::PriorityModel (priority_model),
00532                                                  priority),
00533                         CORBA::NO_MEMORY (TAO::VMCID,
00534                                           CORBA::COMPLETED_NO));
00535       ACE_CHECK_RETURN (0);
00536 
00537       (*client_exposed_policies)[current_length] = priority_model_policy;
00538     }
00539 
00540   return safe_client_exposed_policies._retn ();
00541 }
00542 
00543 
00544 // Standard POA interfaces
00545 PortableServer::POA_ptr
00546 TAO_RT_POA::create_POA (const char *adapter_name,
00547                         PortableServer::POAManager_ptr poa_manager,
00548                         const CORBA::PolicyList &policies
00549                         ACE_ENV_ARG_DECL)
00550   ACE_THROW_SPEC ((CORBA::SystemException,
00551                    PortableServer::POA::AdapterAlreadyExists,
00552                    PortableServer::POA::InvalidPolicy))
00553 {
00554   PortableServer::POA_ptr poa = this->TAO_Regular_POA::create_POA (adapter_name,
00555                                                            poa_manager,
00556                                                            policies
00557                                                            ACE_ENV_ARG_PARAMETER);
00558   ACE_CHECK_RETURN (poa);
00559   return poa;
00560 }
00561 
00562 PortableServer::POA_ptr
00563 TAO_RT_POA::find_POA (const char *adapter_name,
00564                       CORBA::Boolean activate_it
00565                       ACE_ENV_ARG_DECL)
00566   ACE_THROW_SPEC ((CORBA::SystemException,
00567                    PortableServer::POA::AdapterNonExistent))
00568 {
00569   PortableServer::POA_ptr poa = this->TAO_Regular_POA::find_POA (adapter_name,
00570                                                          activate_it
00571                                                          ACE_ENV_ARG_PARAMETER);
00572   ACE_CHECK_RETURN (poa);
00573   return poa;
00574 }
00575 
00576 void
00577 TAO_RT_POA::destroy (CORBA::Boolean etherealize_objects,
00578                      CORBA::Boolean wait_for_completion
00579                      ACE_ENV_ARG_DECL)
00580   ACE_THROW_SPEC ((CORBA::SystemException))
00581 {
00582   this->TAO_Regular_POA::destroy (etherealize_objects,
00583                           wait_for_completion
00584                           ACE_ENV_ARG_PARAMETER);
00585   ACE_CHECK;
00586 }
00587 
00588 
00589 #if (TAO_HAS_MINIMUM_POA == 0)
00590 
00591 PortableServer::ThreadPolicy_ptr
00592 TAO_RT_POA::create_thread_policy (PortableServer::ThreadPolicyValue value
00593                                   ACE_ENV_ARG_DECL)
00594   ACE_THROW_SPEC ((CORBA::SystemException))
00595 {
00596   PortableServer::ThreadPolicy_ptr policy =
00597     this->TAO_Regular_POA::create_thread_policy (value
00598                                          ACE_ENV_ARG_PARAMETER);
00599   ACE_CHECK_RETURN (policy);
00600   return policy;
00601 }
00602 
00603 #endif /* TAO_HAS_MINIMUM_POA == 0 */
00604 
00605 PortableServer::LifespanPolicy_ptr
00606 TAO_RT_POA::create_lifespan_policy (PortableServer::LifespanPolicyValue value
00607                                     ACE_ENV_ARG_DECL)
00608   ACE_THROW_SPEC ((CORBA::SystemException))
00609 {
00610   PortableServer::LifespanPolicy_ptr policy =
00611     this->TAO_Regular_POA::create_lifespan_policy (value
00612                                            ACE_ENV_ARG_PARAMETER);
00613   ACE_CHECK_RETURN (policy);
00614   return policy;
00615 }
00616 
00617 PortableServer::IdUniquenessPolicy_ptr
00618 TAO_RT_POA::create_id_uniqueness_policy (PortableServer::IdUniquenessPolicyValue value
00619                                          ACE_ENV_ARG_DECL)
00620   ACE_THROW_SPEC ((CORBA::SystemException))
00621 {
00622   PortableServer::IdUniquenessPolicy_ptr policy =
00623     this->TAO_Regular_POA::create_id_uniqueness_policy (value
00624                                                 ACE_ENV_ARG_PARAMETER);
00625   ACE_CHECK_RETURN (policy);
00626   return policy;
00627 }
00628 
00629 
00630 PortableServer::IdAssignmentPolicy_ptr
00631 TAO_RT_POA::create_id_assignment_policy (PortableServer::IdAssignmentPolicyValue value
00632                                          ACE_ENV_ARG_DECL)
00633   ACE_THROW_SPEC ((CORBA::SystemException))
00634 {
00635   PortableServer::IdAssignmentPolicy_ptr policy =
00636     this->TAO_Regular_POA::create_id_assignment_policy (value
00637                                                 ACE_ENV_ARG_PARAMETER);
00638   ACE_CHECK_RETURN (policy);
00639   return policy;
00640 }
00641 
00642 
00643 #if (TAO_HAS_MINIMUM_POA == 0)
00644 
00645 PortableServer::ImplicitActivationPolicy_ptr
00646 TAO_RT_POA::create_implicit_activation_policy (PortableServer::ImplicitActivationPolicyValue value
00647                                                ACE_ENV_ARG_DECL)
00648   ACE_THROW_SPEC ((CORBA::SystemException))
00649 {
00650   PortableServer::ImplicitActivationPolicy_ptr policy =
00651     this->TAO_Regular_POA::create_implicit_activation_policy (value
00652                                                       ACE_ENV_ARG_PARAMETER);
00653   ACE_CHECK_RETURN (policy);
00654   return policy;
00655 }
00656 
00657 PortableServer::ServantRetentionPolicy_ptr
00658 TAO_RT_POA::create_servant_retention_policy (PortableServer::ServantRetentionPolicyValue value
00659                                              ACE_ENV_ARG_DECL)
00660   ACE_THROW_SPEC ((CORBA::SystemException))
00661 {
00662   PortableServer::ServantRetentionPolicy_ptr policy =
00663     this->TAO_Regular_POA::create_servant_retention_policy (value
00664                                                     ACE_ENV_ARG_PARAMETER);
00665   ACE_CHECK_RETURN (policy);
00666   return policy;
00667 }
00668 
00669 
00670 PortableServer::RequestProcessingPolicy_ptr
00671 TAO_RT_POA::create_request_processing_policy (PortableServer::RequestProcessingPolicyValue value
00672                                               ACE_ENV_ARG_DECL)
00673   ACE_THROW_SPEC ((CORBA::SystemException))
00674 {
00675   PortableServer::RequestProcessingPolicy_ptr policy =
00676     this->TAO_Regular_POA::create_request_processing_policy (value
00677                                                      ACE_ENV_ARG_PARAMETER);
00678   ACE_CHECK_RETURN (policy);
00679   return policy;
00680 }
00681 
00682 
00683 #endif /* TAO_HAS_MINIMUM_POA == 0 */
00684 
00685 char *
00686 TAO_RT_POA::the_name (ACE_ENV_SINGLE_ARG_DECL)
00687   ACE_THROW_SPEC ((CORBA::SystemException))
00688 {
00689   char * name =
00690     this->TAO_Regular_POA::the_name (ACE_ENV_SINGLE_ARG_PARAMETER);
00691   ACE_CHECK_RETURN (name);
00692   return name;
00693 }
00694 
00695 PortableServer::POA_ptr
00696 TAO_RT_POA::the_parent (ACE_ENV_SINGLE_ARG_DECL)
00697   ACE_THROW_SPEC ((CORBA::SystemException))
00698 {
00699   PortableServer::POA_ptr parent =
00700     this->TAO_Regular_POA::the_parent (ACE_ENV_SINGLE_ARG_PARAMETER);
00701   ACE_CHECK_RETURN (parent);
00702   return parent;
00703 }
00704 
00705 PortableServer::POAList *
00706 TAO_RT_POA::the_children (ACE_ENV_SINGLE_ARG_DECL)
00707   ACE_THROW_SPEC ((CORBA::SystemException))
00708 {
00709   PortableServer::POAList *children =
00710     this->TAO_Regular_POA::the_children (ACE_ENV_SINGLE_ARG_PARAMETER);
00711   ACE_CHECK_RETURN (children);
00712   return children;
00713 }
00714 
00715 PortableServer::POAManager_ptr
00716 TAO_RT_POA::the_POAManager (ACE_ENV_SINGLE_ARG_DECL)
00717   ACE_THROW_SPEC ((CORBA::SystemException))
00718 {
00719   PortableServer::POAManager_ptr poa_manager =
00720     this->TAO_Regular_POA::the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
00721   ACE_CHECK_RETURN (poa_manager);
00722   return poa_manager;
00723 }
00724 
00725 
00726 #if (TAO_HAS_MINIMUM_POA == 0)
00727 
00728 PortableServer::AdapterActivator_ptr
00729 TAO_RT_POA::the_activator (ACE_ENV_SINGLE_ARG_DECL)
00730   ACE_THROW_SPEC ((CORBA::SystemException))
00731 {
00732   PortableServer::AdapterActivator_ptr activator =
00733     this->TAO_Regular_POA::the_activator (ACE_ENV_SINGLE_ARG_PARAMETER);
00734   ACE_CHECK_RETURN (activator);
00735   return activator;
00736 }
00737 
00738 void
00739 TAO_RT_POA::the_activator (PortableServer::AdapterActivator_ptr adapter_activator
00740                            ACE_ENV_ARG_DECL)
00741   ACE_THROW_SPEC ((CORBA::SystemException))
00742 {
00743   this->TAO_Regular_POA::the_activator (adapter_activator
00744                                 ACE_ENV_ARG_PARAMETER);
00745   ACE_CHECK;
00746 }
00747 
00748 PortableServer::ServantManager_ptr
00749 TAO_RT_POA::get_servant_manager (ACE_ENV_SINGLE_ARG_DECL)
00750   ACE_THROW_SPEC ((CORBA::SystemException,
00751                    PortableServer::POA::WrongPolicy))
00752 {
00753   PortableServer::ServantManager_ptr servant_manager =
00754     this->TAO_Regular_POA::get_servant_manager (ACE_ENV_SINGLE_ARG_PARAMETER);
00755   ACE_CHECK_RETURN (servant_manager);
00756   return servant_manager;
00757 }
00758 
00759 void
00760 TAO_RT_POA::set_servant_manager (PortableServer::ServantManager_ptr imgr
00761                                  ACE_ENV_ARG_DECL)
00762   ACE_THROW_SPEC ((CORBA::SystemException,
00763                    PortableServer::POA::WrongPolicy))
00764 {
00765   this->TAO_Regular_POA::set_servant_manager (imgr
00766                                       ACE_ENV_ARG_PARAMETER);
00767   ACE_CHECK;
00768 }
00769 
00770 PortableServer::Servant
00771 TAO_RT_POA::get_servant (ACE_ENV_SINGLE_ARG_DECL)
00772   ACE_THROW_SPEC ((CORBA::SystemException,
00773                    PortableServer::POA::NoServant,
00774                    PortableServer::POA::WrongPolicy))
00775 {
00776   PortableServer::Servant servant =
00777     this->TAO_Regular_POA::get_servant (ACE_ENV_SINGLE_ARG_PARAMETER);
00778   ACE_CHECK_RETURN (servant);
00779   return servant;
00780 }
00781 
00782 void
00783 TAO_RT_POA::set_servant (PortableServer::Servant servant
00784                          ACE_ENV_ARG_DECL)
00785   ACE_THROW_SPEC ((CORBA::SystemException,
00786                    PortableServer::POA::WrongPolicy))
00787 {
00788   this->TAO_Regular_POA::set_servant (servant
00789                               ACE_ENV_ARG_PARAMETER);
00790   ACE_CHECK;
00791 }
00792 
00793 #endif /* TAO_HAS_MINIMUM_POA == 0 */
00794 
00795 PortableServer::ObjectId *
00796 TAO_RT_POA::activate_object (PortableServer::Servant p_servant
00797                              ACE_ENV_ARG_DECL)
00798   ACE_THROW_SPEC ((CORBA::SystemException,
00799                    PortableServer::POA::ServantAlreadyActive,
00800                    PortableServer::POA::WrongPolicy))
00801 {
00802   PortableServer::ObjectId *object_id =
00803     this->TAO_Regular_POA::activate_object (p_servant
00804                                     ACE_ENV_ARG_PARAMETER);
00805   ACE_CHECK_RETURN (object_id);
00806   return object_id;
00807 }
00808 
00809 void
00810 TAO_RT_POA::activate_object_with_id (const PortableServer::ObjectId &id,
00811                                      PortableServer::Servant p_servant
00812                                      ACE_ENV_ARG_DECL)
00813   ACE_THROW_SPEC ((CORBA::SystemException,
00814                    PortableServer::POA::ServantAlreadyActive,
00815                    PortableServer::POA::ObjectAlreadyActive,
00816                    PortableServer::POA::WrongPolicy))
00817 {
00818   this->TAO_Regular_POA::activate_object_with_id (id,
00819                                           p_servant
00820                                           ACE_ENV_ARG_PARAMETER);
00821   ACE_CHECK;
00822 }
00823 
00824 void
00825 TAO_RT_POA::deactivate_object (const PortableServer::ObjectId &oid
00826                                ACE_ENV_ARG_DECL)
00827   ACE_THROW_SPEC ((CORBA::SystemException,
00828                    PortableServer::POA::ObjectNotActive,
00829                    PortableServer::POA::WrongPolicy))
00830 {
00831   this->TAO_Regular_POA::deactivate_object (oid
00832                                     ACE_ENV_ARG_PARAMETER);
00833   ACE_CHECK;
00834 }
00835 
00836 CORBA::Object_ptr
00837 TAO_RT_POA::create_reference (const char *intf
00838                               ACE_ENV_ARG_DECL)
00839   ACE_THROW_SPEC ((CORBA::SystemException,
00840                    PortableServer::POA::WrongPolicy))
00841 {
00842   CORBA::Object_ptr obj =
00843     this->TAO_Regular_POA::create_reference (intf
00844                                      ACE_ENV_ARG_PARAMETER);
00845   ACE_CHECK_RETURN (obj);
00846   return obj;
00847 }
00848 
00849 CORBA::Object_ptr
00850 TAO_RT_POA::create_reference_with_id (const PortableServer::ObjectId &oid,
00851                                       const char *intf
00852                                       ACE_ENV_ARG_DECL)
00853   ACE_THROW_SPEC ((CORBA::SystemException))
00854 {
00855   CORBA::Object_ptr obj =
00856     this->TAO_Regular_POA::create_reference_with_id (oid,
00857                                              intf
00858                                              ACE_ENV_ARG_PARAMETER);
00859   ACE_CHECK_RETURN (obj);
00860   return obj;
00861 }
00862 
00863 PortableServer::ObjectId *
00864 TAO_RT_POA::servant_to_id (PortableServer::Servant p_servant
00865                            ACE_ENV_ARG_DECL)
00866   ACE_THROW_SPEC ((CORBA::SystemException,
00867                    PortableServer::POA::ServantNotActive,
00868                    PortableServer::POA::WrongPolicy))
00869 {
00870   PortableServer::ObjectId *object_id =
00871     this->TAO_Regular_POA::servant_to_id (p_servant
00872                                   ACE_ENV_ARG_PARAMETER);
00873   ACE_CHECK_RETURN (object_id);
00874   return object_id;
00875 }
00876 
00877 CORBA::Object_ptr
00878 TAO_RT_POA::servant_to_reference (PortableServer::Servant p_servant
00879                                   ACE_ENV_ARG_DECL)
00880   ACE_THROW_SPEC ((CORBA::SystemException,
00881                    PortableServer::POA::ServantNotActive,
00882                    PortableServer::POA::WrongPolicy))
00883 {
00884   CORBA::Object_ptr obj =
00885     this->TAO_Regular_POA::servant_to_reference (p_servant
00886                                          ACE_ENV_ARG_PARAMETER);
00887   ACE_CHECK_RETURN (obj);
00888   return obj;
00889 }
00890 
00891 
00892 PortableServer::Servant
00893 TAO_RT_POA::reference_to_servant (CORBA::Object_ptr reference
00894                                   ACE_ENV_ARG_DECL)
00895   ACE_THROW_SPEC ((CORBA::SystemException,
00896                    PortableServer::POA::ObjectNotActive,
00897                    PortableServer::POA::WrongAdapter,
00898                    PortableServer::POA::WrongPolicy))
00899 {
00900   PortableServer::Servant servant =
00901     this->TAO_Regular_POA::reference_to_servant (reference
00902                                          ACE_ENV_ARG_PARAMETER);
00903   ACE_CHECK_RETURN (servant);
00904   return servant;
00905 }
00906 
00907 PortableServer::ObjectId *
00908 TAO_RT_POA::reference_to_id (CORBA::Object_ptr reference
00909                              ACE_ENV_ARG_DECL)
00910   ACE_THROW_SPEC ((CORBA::SystemException,
00911                    PortableServer::POA::WrongAdapter,
00912                    PortableServer::POA::WrongPolicy))
00913 {
00914   PortableServer::ObjectId *object_id =
00915     this->TAO_Regular_POA::reference_to_id (reference
00916                                     ACE_ENV_ARG_PARAMETER);
00917   ACE_CHECK_RETURN (object_id);
00918   return object_id;
00919 }
00920 
00921 PortableServer::Servant
00922 TAO_RT_POA::id_to_servant (const PortableServer::ObjectId &oid
00923                            ACE_ENV_ARG_DECL)
00924   ACE_THROW_SPEC ((CORBA::SystemException,
00925                    PortableServer::POA::ObjectNotActive,
00926                    PortableServer::POA::WrongPolicy))
00927 {
00928   PortableServer::Servant servant =
00929     this->TAO_Regular_POA::id_to_servant (oid
00930                                   ACE_ENV_ARG_PARAMETER);
00931   ACE_CHECK_RETURN (servant);
00932   return servant;
00933 }
00934 
00935 CORBA::Object_ptr
00936 TAO_RT_POA::id_to_reference (const PortableServer::ObjectId &oid
00937                              ACE_ENV_ARG_DECL)
00938   ACE_THROW_SPEC ((CORBA::SystemException,
00939                    PortableServer::POA::ObjectNotActive,
00940                    PortableServer::POA::WrongPolicy))
00941 {
00942   CORBA::Object_ptr obj =
00943     this->TAO_Regular_POA::id_to_reference (oid
00944                                     ACE_ENV_ARG_PARAMETER);
00945   ACE_CHECK_RETURN (obj);
00946   return obj;
00947 }
00948 
00949 CORBA::OctetSeq *
00950 TAO_RT_POA::id (ACE_ENV_SINGLE_ARG_DECL)
00951   ACE_THROW_SPEC ((CORBA::SystemException))
00952 {
00953   return this->TAO_Regular_POA::id (ACE_ENV_SINGLE_ARG_PARAMETER);
00954 }
00955 
00956 TAO_END_VERSIONED_NAMESPACE_DECL
00957 
00958 #endif /* TAO_HAS_CORBA_MESSAGING && TAO_HAS_CORBA_MESSAGING != 0 */

Generated on Thu Nov 9 12:55:46 2006 for TAO_RTPortableServer by doxygen 1.3.6