Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

ClientRequestInfo_i.cpp

Go to the documentation of this file.
00001 #include "tao_pch.h"
00002 // -*- C++ -*-
00003 
00004 #include "ClientRequestInfo_i.h"
00005 #include "Invocation.h"
00006 #include "Stub.h"
00007 #include "AbstractBase.h"
00008 #include "Profile.h"
00009 #include "Tagged_Components.h"
00010 #include "debug.h"
00011 
00012 ACE_RCSID (TAO,
00013            ClientRequestInfo_i,
00014            "$Id: ClientRequestInfo_i.cpp,v 1.1.1.1.2.3 2003/04/21 19:10:23 chad Exp $")
00015 
00016 #if TAO_HAS_INTERCEPTORS == 1
00017 
00018 # if !defined (__ACE_INLINE__)
00019 #   include "ClientRequestInfo_i.inl"
00020 # endif /* !__ACE_INLINE__ */
00021 
00022 TAO_ClientRequestInfo_i::TAO_ClientRequestInfo_i (TAO_GIOP_Invocation *inv,
00023                                                   CORBA::Object_ptr target)
00024   : invocation_ (inv),
00025     target_ (target), // No need to duplicate.
00026     abstract_target_ (CORBA::AbstractBase::_nil ()),
00027     caught_exception_ (0),
00028     response_expected_ (1),
00029     reply_status_ (-1),
00030     rs_pi_current_ ()
00031 {
00032   this->setup_picurrent ();
00033 }
00034 
00035 TAO_ClientRequestInfo_i::TAO_ClientRequestInfo_i (
00036     TAO_GIOP_Invocation *inv,
00037     CORBA::AbstractBase_ptr abstract_target
00038   )
00039   : invocation_ (inv),
00040     target_ (CORBA::Object::_nil ()),
00041     abstract_target_ (abstract_target), // No need to duplicate.
00042     caught_exception_ (0),
00043     response_expected_ (1),
00044     reply_status_ (-1),
00045     rs_pi_current_ ()
00046 {
00047   this->setup_picurrent ();
00048 }
00049 
00050 TAO_ClientRequestInfo_i::~TAO_ClientRequestInfo_i (void)
00051 {
00052 }
00053 
00054 void
00055 TAO_ClientRequestInfo_i::setup_picurrent (void)
00056 {
00057   // Retrieve the thread scope current (no TSS access incurred yet).
00058   TAO_PICurrent *pi_current =
00059     this->invocation_->orb_core ()->pi_current ();
00060 
00061   // If the slot count is zero, then there is nothing to copy.
00062   // Prevent any copying (and hence TSS accesses) from occurring.
00063   if (pi_current != 0 && pi_current->slot_count () != 0)
00064     {
00065       // Retrieve the thread scope current.
00066       TAO_PICurrent_Impl *tsc = pi_current->tsc ();
00067 
00068       // Copy the TSC to the RSC.
00069       this->rs_pi_current_.copy (*tsc, 0);  // Shallow copy
00070 
00071       // PICurrent will potentially have to call back on the request
00072       // scope current so that it can deep copy the contents of the
00073       // thread scope current if the contents of the thread scope
00074       // current are about to be modified.  It is necessary to do this
00075       // deep copy once in order to completely isolate the request
00076       // scope current from the thread scope current.  This is only
00077       // necessary, if the thread scope current is modified after its
00078       // contents have been *logically* copied to the request scope
00079       // current.
00080       //
00081       // Only set the TSC's peer if a copy was actually performed.
00082       if (this->rs_pi_current_.dirty ())
00083         tsc->pi_peer (&this->rs_pi_current_);
00084     }
00085 }
00086 
00087 CORBA::Object_ptr
00088 TAO_ClientRequestInfo_i::target (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
00089   ACE_THROW_SPEC ((CORBA::SystemException))
00090 {
00091   if (CORBA::is_nil (this->target_))
00092     {
00093       return this->abstract_target_->_to_object ();
00094     }
00095 
00096   return CORBA::Object::_duplicate (this->target_);
00097 }
00098 
00099 CORBA::Object_ptr
00100 TAO_ClientRequestInfo_i::effective_target (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
00101   ACE_THROW_SPEC ((CORBA::SystemException))
00102 {
00103   if (this->reply_status_ == PortableInterceptor::LOCATION_FORWARD)
00104     {
00105       // TAO_GIOP_Invocation::forward_reference() already duplicates
00106       // the reference before returning it so there is no need to
00107       // duplicate it here.
00108       return this->invocation_->forward_reference ();
00109     }
00110 
00111   if (CORBA::is_nil (this->target_))
00112     {
00113       return this->abstract_target_->_to_object ();
00114     }
00115 
00116   return CORBA::Object::_duplicate (this->target_);
00117 }
00118 
00119 IOP::TaggedProfile *
00120 TAO_ClientRequestInfo_i::effective_profile (ACE_ENV_SINGLE_ARG_DECL)
00121   ACE_THROW_SPEC ((CORBA::SystemException))
00122 {
00123   IOP::TaggedProfile *tagged_profile = 0;
00124   ACE_NEW_THROW_EX (tagged_profile,
00125                     IOP::TaggedProfile,
00126                     CORBA::NO_MEMORY (
00127                       CORBA::SystemException::_tao_minor_code (
00128                         TAO_DEFAULT_MINOR_CODE,
00129                         ENOMEM),
00130                       CORBA::COMPLETED_NO));
00131   ACE_CHECK_RETURN (0);
00132 
00133   IOP::TaggedProfile_var safe_tagged_profile = tagged_profile;
00134 
00135   IOP::TaggedProfile &ep =
00136     this->target_->_stubobj ()->profile_in_use ()->create_tagged_profile ();
00137 
00138   tagged_profile->tag = ep.tag;
00139   tagged_profile->profile_data = ep.profile_data;  // Deep copy
00140 
00141   return safe_tagged_profile._retn ();
00142 }
00143 
00144 // Use at own risk. There is no way currently of extracting an
00145 // exception from an Any. This method is in place just to be compliant
00146 // with the spec.
00147 CORBA::Any *
00148 TAO_ClientRequestInfo_i::received_exception (ACE_ENV_SINGLE_ARG_DECL)
00149   ACE_THROW_SPEC ((CORBA::SystemException))
00150 {
00151   if (this->reply_status_ != PortableInterceptor::SYSTEM_EXCEPTION
00152       && this->reply_status_ != PortableInterceptor::USER_EXCEPTION)
00153     {
00154       ACE_THROW_RETURN (CORBA::BAD_INV_ORDER (CORBA::OMGVMCID | 14,
00155                                               CORBA::COMPLETED_NO), 0);
00156     }
00157 
00158   // The spec says that if it is a user exception which can't be
00159   // inserted then the UNKNOWN exception needs to be thrown with minor
00160   // code 1.
00161 
00162   CORBA::Any * temp = 0;
00163 
00164   ACE_NEW_THROW_EX (temp,
00165                     CORBA::Any,
00166                     CORBA::NO_MEMORY (
00167                       CORBA::SystemException::_tao_minor_code (
00168                         TAO_DEFAULT_MINOR_CODE,
00169                         ENOMEM),
00170                       CORBA::COMPLETED_NO));
00171   ACE_CHECK_RETURN (0);
00172 
00173   CORBA::Any_var caught_exception = temp;
00174 
00175   if (this->caught_exception_ != 0)
00176     *temp <<= *(this->caught_exception_);
00177 
00178   return caught_exception._retn ();
00179 }
00180 
00181 char *
00182 TAO_ClientRequestInfo_i::received_exception_id (
00183     ACE_ENV_SINGLE_ARG_DECL)
00184   ACE_THROW_SPEC ((CORBA::SystemException))
00185 {
00186   if (this->reply_status_ != PortableInterceptor::SYSTEM_EXCEPTION
00187       && this->reply_status_ != PortableInterceptor::USER_EXCEPTION)
00188     {
00189       ACE_THROW_RETURN (CORBA::BAD_INV_ORDER (CORBA::OMGVMCID | 14,
00190                                               CORBA::COMPLETED_NO),
00191                         0);
00192     }
00193 
00194   return CORBA::string_dup (this->caught_exception_->_rep_id ());
00195 }
00196 
00197 IOP::TaggedComponent *
00198 TAO_ClientRequestInfo_i::get_effective_component (
00199     IOP::ComponentId id
00200     ACE_ENV_ARG_DECL)
00201   ACE_THROW_SPEC ((CORBA::SystemException))
00202 {
00203   TAO_Tagged_Components &ecs =
00204     this->target_->_stubobj ()->profile_in_use ()->tagged_components ();
00205 
00206   IOP::MultipleComponentProfile &components = ecs.components ();
00207 
00208   CORBA::ULong len = components.length ();
00209   for (CORBA::ULong i = 0; i < len; ++i)
00210     {
00211       if (components[i].tag == id)
00212         {
00213           IOP::TaggedComponent *tagged_component = 0;
00214 
00215           // Only allocate a sequence if we have a tagged component
00216           // that matches the given IOP::ComponentId.
00217           ACE_NEW_THROW_EX (tagged_component,
00218                             IOP::TaggedComponent,
00219                             CORBA::NO_MEMORY (
00220                               CORBA::SystemException::_tao_minor_code (
00221                                 TAO_DEFAULT_MINOR_CODE,
00222                                 ENOMEM),
00223                               CORBA::COMPLETED_NO));
00224           ACE_CHECK_RETURN (0);
00225 
00226           IOP::TaggedComponent_var safe_tagged_component =
00227             tagged_component;
00228 
00229           (*tagged_component) = components[i];  // Deep copy
00230 
00231           return safe_tagged_component._retn ();
00232         }
00233     }
00234 
00235   // No tagged component was found that matched the given
00236   // IOP::ComponentId.
00237   ACE_THROW_RETURN (CORBA::BAD_PARAM (CORBA::OMGVMCID | 28,
00238                                       CORBA::COMPLETED_NO),
00239                     0);
00240 }
00241 
00242 IOP::TaggedComponentSeq *
00243 TAO_ClientRequestInfo_i::get_effective_components (
00244     IOP::ComponentId id
00245     ACE_ENV_ARG_DECL)
00246   ACE_THROW_SPEC ((CORBA::SystemException))
00247 {
00248   TAO_Tagged_Components &ecs =
00249     this->target_->_stubobj ()->profile_in_use ()->tagged_components ();
00250 
00251   IOP::MultipleComponentProfile &components = ecs.components ();
00252 
00253   IOP::TaggedComponentSeq *tagged_components = 0;
00254   IOP::TaggedComponentSeq_var safe_tagged_components;
00255 
00256   CORBA::ULong len = components.length ();
00257   for (CORBA::ULong i = 0; i < len; ++i)
00258     {
00259       if (components[i].tag == id)
00260         {
00261           if (tagged_components == 0)
00262             {
00263               // Only allocate a sequence if we have tagged components
00264               // to place into the sequence.
00265               ACE_NEW_THROW_EX (tagged_components,
00266                                 IOP::TaggedComponentSeq,
00267                                 CORBA::NO_MEMORY (
00268                                   CORBA::SystemException::_tao_minor_code (
00269                                     TAO_DEFAULT_MINOR_CODE,
00270                                     ENOMEM),
00271                                   CORBA::COMPLETED_NO));
00272               ACE_CHECK_RETURN (0);
00273 
00274               safe_tagged_components = tagged_components;
00275             }
00276 
00277           CORBA::ULong old_len = safe_tagged_components->length ();
00278           safe_tagged_components->length (old_len + 1);
00279 
00280           safe_tagged_components[old_len] = components[i];  // Deep copy
00281         }
00282     }
00283 
00284   if (tagged_components == 0)
00285     {
00286       // No tagged component sequence was allocated, meaning no tagged
00287       // components were found that matched the given
00288       // IOP::ComponentId.
00289       ACE_THROW_RETURN (CORBA::BAD_PARAM (CORBA::OMGVMCID | 28,
00290                                           CORBA::COMPLETED_NO),
00291                         0);
00292     }
00293 
00294   return safe_tagged_components._retn ();
00295 }
00296 
00297 CORBA::Policy_ptr
00298 TAO_ClientRequestInfo_i::get_request_policy (CORBA::PolicyType type
00299                                            ACE_ENV_ARG_DECL)
00300   ACE_THROW_SPEC ((CORBA::SystemException))
00301 {
00302   // @@ Do we need to look anywhere else for the request policies?
00303 
00304 #if TAO_HAS_CORBA_MESSAGING == 1
00305   return this->target_->_get_policy (type
00306                                       ACE_ENV_ARG_PARAMETER);
00307 #else
00308   ACE_UNUSED_ARG (type);
00309 
00310   ACE_THROW_RETURN (CORBA::NO_IMPLEMENT (
00311                       CORBA::SystemException::_tao_minor_code (
00312                         TAO_DEFAULT_MINOR_CODE,
00313                         ENOTSUP),
00314                       CORBA::COMPLETED_NO),
00315                     0);
00316 #endif  /* TAO_HAS_CORBA_MESSAGING == 1 */
00317 }
00318 
00319 void
00320 TAO_ClientRequestInfo_i::add_request_service_context (
00321     const IOP::ServiceContext & service_context,
00322     CORBA::Boolean replace
00323     ACE_ENV_ARG_DECL)
00324   ACE_THROW_SPEC ((CORBA::SystemException))
00325 {
00326   // Get the service context from the list
00327   TAO_Service_Context &service_context_list =
00328     this->invocation_->request_service_context ();
00329 
00330   if (service_context_list.set_context (service_context, replace) == 0)
00331     {
00332       ACE_THROW (CORBA::BAD_INV_ORDER (CORBA::OMGVMCID | 15,
00333                                        CORBA::COMPLETED_NO));
00334     }
00335 }
00336 
00337 CORBA::ULong
00338 TAO_ClientRequestInfo_i::request_id (ACE_ENV_SINGLE_ARG_DECL)
00339   ACE_THROW_SPEC ((CORBA::SystemException))
00340 {
00341   // @todo We may have to worry about AMI once we support interceptors
00342   //       in AMI requests since the Invocation object no longer
00343   //       exists once an AMI request has been made.  In that case,
00344   //       the reply dispatcher address should be used.
00345 
00346   // The request ID must be unique across all outstanding requests.
00347   // To avoid synchronization overhead, the address of this Invocation
00348   // object is used as the request ID.  This guarantees that the
00349   // request ID is unique without being forced to acquire a lock.
00350   //
00351   // For 64-bit platforms, we right shift 8 bits and then use the
00352   // lower 32 bits of that shifted value.  Rather than losing the
00353   // upper 32 bits of significant digits by taking the lower 32 bits,
00354   // we only lose the upper 24 by doing the shift.  Basically, the
00355   // resulting request ID will comprised of bits 8 through 39.  This is
00356   // made possible by the fact that this Invocation object is large
00357   // enough to increase the likelihood that those bits (0 through 39)
00358   // are unique.  In particular, this->buffer_ is 512 bytes
00359   // (ACE_CDR::DEFAULT_BUFSIZE) long by default; implying that
00360   // dropping the lower 8 bits of the this Invocation object's 64 bit
00361   // address (i.e. 256 bytes) is not a problem.
00362 
00363   CORBA::ULong id = 0;
00364 
00365   // Note that we reinterpret_cast to an "unsigned long" instead of
00366   // CORBA::ULong since we need to first cast to an integer large
00367   // enough to hold an address to avoid compile-time warnings on some
00368   // 64-bit platforms.
00369 
00370   // 32 bit address
00371   if (sizeof (this) == 4)
00372     id = ACE_static_cast (CORBA::ULong,
00373                           ACE_reinterpret_cast (ptr_arith_t,
00374                                                 this->invocation_));
00375 
00376   // 64 bit address -- bits 8 through 39  (see notes above!)
00377   // In this case, we make sure this object is large enough to safely
00378   // do the right shift.  This is necessary since the size of the
00379   // buffer that makes this object is configurable.
00380   else if (sizeof (this) == 8
00381            && sizeof (*(this->invocation_)) > 256 /* 2 << 8 */)
00382     id =
00383       (ACE_static_cast(CORBA::ULong,
00384        ACE_reinterpret_cast (ptr_arith_t,
00385                              this->invocation_)) >> 8) & 0xFFFFFFFFu;
00386 
00387   // 64 bit address -- lower 32 bits
00388   else if (sizeof (this) == 8)
00389     id = ACE_static_cast(CORBA::ULong,
00390                          ACE_reinterpret_cast (ptr_arith_t,
00391                                                this->invocation_)) &
00392                          0xFFFFFFFFu;
00393 
00394   // @@ The following request ID generator prevents the
00395   //    PortableInterceptor::ClientRequestInterceptor::send_request()
00396   //    interception point from occuring before the call to connect,
00397   //    thus preventing us from adding an optimization that itself
00398   //    prevents a connection from being unnecessarily performed.
00399   //    Thus, the ClientRequestInfo object is forced to have its own
00400   //    request ID generator in order to make it possible to implement
00401   //    the above optimization.
00402   //
00403   //    Ideally, this request ID generator should go away, especially
00404   //    since it adds a lock to the critical path.
00405   //   else    // Fallback
00406   //     id = this->invocation_->request_id ();
00407 
00408   else
00409     {
00410       if (TAO_debug_level > 0)
00411         ACE_ERROR ((LM_ERROR,
00412                     "(%P|%t) ClientRequestInfo::request_id() failed\n"
00413                     "(%P|%t) since its request ID generator is not\n"
00414                     "(%P|%t) supported on this platform.\n"));
00415 
00416       ACE_THROW_RETURN (CORBA::INTERNAL (), 0);
00417     }
00418 
00419   return id;
00420 }
00421 
00422 char *
00423 TAO_ClientRequestInfo_i::operation (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
00424   ACE_THROW_SPEC ((CORBA::SystemException))
00425 {
00426   return CORBA::string_dup (this->invocation_->operation ());
00427 }
00428 
00429 Dynamic::ParameterList *
00430 TAO_ClientRequestInfo_i::arguments (ACE_ENV_SINGLE_ARG_DECL)
00431   ACE_THROW_SPEC ((CORBA::SystemException))
00432 {
00433   ACE_THROW_RETURN (CORBA::BAD_INV_ORDER (CORBA::OMGVMCID | 14,
00434                                           CORBA::COMPLETED_NO),
00435                     0);
00436 }
00437 
00438 Dynamic::ExceptionList *
00439 TAO_ClientRequestInfo_i::exceptions (ACE_ENV_SINGLE_ARG_DECL)
00440   ACE_THROW_SPEC ((CORBA::SystemException))
00441 {
00442   ACE_THROW_RETURN (CORBA::BAD_INV_ORDER (CORBA::OMGVMCID | 14,
00443                                           CORBA::COMPLETED_NO),
00444                     0);
00445 }
00446 
00447 Dynamic::ContextList *
00448 TAO_ClientRequestInfo_i::contexts (ACE_ENV_SINGLE_ARG_DECL)
00449   ACE_THROW_SPEC ((CORBA::SystemException))
00450 {
00451   ACE_THROW_RETURN (CORBA::BAD_INV_ORDER (CORBA::OMGVMCID | 14,
00452                                           CORBA::COMPLETED_NO),
00453                     0);
00454 }
00455 
00456 Dynamic::RequestContext *
00457 TAO_ClientRequestInfo_i::operation_context (ACE_ENV_SINGLE_ARG_DECL)
00458   ACE_THROW_SPEC ((CORBA::SystemException))
00459 {
00460   ACE_THROW_RETURN (CORBA::BAD_INV_ORDER (CORBA::OMGVMCID | 14,
00461                                           CORBA::COMPLETED_NO),
00462                     0);
00463 }
00464 
00465 CORBA::Any *
00466 TAO_ClientRequestInfo_i::result (ACE_ENV_SINGLE_ARG_DECL)
00467   ACE_THROW_SPEC ((CORBA::SystemException))
00468 {
00469   ACE_THROW_RETURN (CORBA::BAD_INV_ORDER (CORBA::OMGVMCID | 14,
00470                                           CORBA::COMPLETED_NO),
00471                     0);
00472 }
00473 
00474 CORBA::Boolean
00475 TAO_ClientRequestInfo_i::response_expected (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
00476   ACE_THROW_SPEC ((CORBA::SystemException))
00477 {
00478   return this->response_expected_;
00479 }
00480 
00481 Messaging::SyncScope
00482 TAO_ClientRequestInfo_i::sync_scope (ACE_ENV_SINGLE_ARG_DECL)
00483   ACE_THROW_SPEC ((CORBA::SystemException))
00484 {
00485   TAO_GIOP_Oneway_Invocation *inv =
00486     ACE_dynamic_cast (TAO_GIOP_Oneway_Invocation *,
00487                       this->invocation_);
00488 
00489   // The response_expected_ check is a precautionary measure for
00490   // platforms that do not support RTTI, i.e. where the dynamic_cast
00491   // above would incorrectly work.  If the response_expected flag is
00492   // not equal to zero then it is fairly safe to assume that the
00493   // invocation is not a one-way, meaning that the sync_scope() method
00494   // is not available.
00495   if (inv != 0 && this->response_expected_ == 0)
00496     return inv->sync_scope ();
00497 
00498   ACE_THROW_RETURN (CORBA::BAD_INV_ORDER (CORBA::OMGVMCID | 14,
00499                                           CORBA::COMPLETED_NO),
00500                     -1);
00501 }
00502 
00503 PortableInterceptor::ReplyStatus
00504 TAO_ClientRequestInfo_i::reply_status (ACE_ENV_SINGLE_ARG_DECL)
00505   ACE_THROW_SPEC ((CORBA::SystemException))
00506 {
00507   if (this->reply_status_ == -1)
00508     // A reply hasn't been received yet.
00509     ACE_THROW_RETURN (CORBA::BAD_INV_ORDER (CORBA::OMGVMCID | 14,
00510                                             CORBA::COMPLETED_NO),
00511                       -1);
00512 
00513   return this->reply_status_;
00514 }
00515 
00516 CORBA::Object_ptr
00517 TAO_ClientRequestInfo_i::forward_reference (ACE_ENV_SINGLE_ARG_DECL)
00518   ACE_THROW_SPEC ((CORBA::SystemException))
00519 {
00520   if (this->reply_status_ != PortableInterceptor::LOCATION_FORWARD)
00521     ACE_THROW_RETURN (CORBA::BAD_INV_ORDER (CORBA::OMGVMCID | 14,
00522                                             CORBA::COMPLETED_NO),
00523                       CORBA::Object::_nil ());
00524 
00525   // TAO_GIOP_Invocation::forward_reference() already duplicates the
00526   // reference before returning it so there is no need to duplicate it
00527   // here.
00528   return this->invocation_->forward_reference ();
00529 }
00530 
00531 CORBA::Any *
00532 TAO_ClientRequestInfo_i::get_slot (PortableInterceptor::SlotId id
00533                                    ACE_ENV_ARG_DECL)
00534   ACE_THROW_SPEC ((CORBA::SystemException,
00535                    PortableInterceptor::InvalidSlot))
00536 {
00537   return this->rs_pi_current_.get_slot (id
00538                                         ACE_ENV_ARG_PARAMETER);
00539 }
00540 
00541 IOP::ServiceContext *
00542 TAO_ClientRequestInfo_i::get_request_service_context (
00543     IOP::ServiceId id
00544     ACE_ENV_ARG_DECL)
00545   ACE_THROW_SPEC ((CORBA::SystemException))
00546 {
00547   // Get the service context from the list
00548   TAO_Service_Context &service_context_list =
00549     this->invocation_->request_service_context ();
00550 
00551   return this->get_service_context_i (service_context_list,
00552                                       id
00553                                        ACE_ENV_ARG_PARAMETER);
00554 }
00555 
00556 
00557 IOP::ServiceContext *
00558 TAO_ClientRequestInfo_i::get_reply_service_context (
00559     IOP::ServiceId id
00560     ACE_ENV_ARG_DECL)
00561   ACE_THROW_SPEC ((CORBA::SystemException))
00562 {
00563   // Get the service context from the list
00564   TAO_Service_Context &service_context_list =
00565     this->invocation_->reply_service_context ();
00566 
00567   return this->get_service_context_i (service_context_list,
00568                                       id
00569                                        ACE_ENV_ARG_PARAMETER);
00570 }
00571 
00572 IOP::ServiceContext *
00573 TAO_ClientRequestInfo_i::get_service_context_i (
00574     TAO_Service_Context &service_context_list,
00575     IOP::ServiceId id
00576     ACE_ENV_ARG_DECL)
00577   ACE_THROW_SPEC ((CORBA::SystemException))
00578 {
00579   IOP::ServiceContext_var service_context;
00580 
00581   if (service_context_list.get_context (id, service_context.out ()) != 0)
00582     {
00583       // Found.
00584       return service_context._retn ();
00585     }
00586   else
00587     {
00588       // Not found.
00589       ACE_THROW_RETURN (CORBA::BAD_PARAM (CORBA::OMGVMCID | 26,
00590                                           CORBA::COMPLETED_NO),
00591                         0);
00592     }
00593 }
00594 
00595 void
00596 TAO_ClientRequestInfo_i::reply_status (int invoke_status)
00597 {
00598   switch (invoke_status)
00599     {
00600     case TAO_INVOKE_OK:
00601       this->reply_status_ = PortableInterceptor::SUCCESSFUL;
00602       break;
00603     case TAO_INVOKE_RESTART:
00604       if (this->invocation_->received_location_forward ())
00605         this->reply_status_ = PortableInterceptor::LOCATION_FORWARD;
00606       else
00607         this->reply_status_ = PortableInterceptor::TRANSPORT_RETRY;
00608       break;
00609     default:
00610       // We should only get here if the invocation status is
00611       // TAO_INVOKE_EXCEPTION, i.e. a CORBA::SystemException, so set
00612       // the appropriate reply status.
00613       this->reply_status_ = PortableInterceptor::SYSTEM_EXCEPTION;
00614       break;
00615     }
00616 }
00617 
00618 #endif /* TAO_HAS_INTERCEPTORS == 1 */

Generated on Mon Jun 16 13:48:04 2003 for TAO by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002