当前位置: 首页>>代码示例>>C++>>正文


C++ TAO_ServerRequest::is_forwarded方法代码示例

本文整理汇总了C++中TAO_ServerRequest::is_forwarded方法的典型用法代码示例。如果您正苦于以下问题:C++ TAO_ServerRequest::is_forwarded方法的具体用法?C++ TAO_ServerRequest::is_forwarded怎么用?C++ TAO_ServerRequest::is_forwarded使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TAO_ServerRequest的用法示例。


在下文中一共展示了TAO_ServerRequest::is_forwarded方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: if

void
TAO_DynamicImplementation::_dispatch (
  TAO_ServerRequest &request,
  TAO::Portable_Server::Servant_Upcall * /* context */)
{
  // No need to do any of this if the client isn't waiting.
  if (request.response_expected ())
    {
      if (request.is_forwarded ())
        {
          request.init_reply ();
          request.tao_send_reply ();

          // No need to invoke in this case.
          return;
        }
      else if (request.sync_with_server ())
        {
          // The last line before the call to this function
          // was an ACE_CHECK_RETURN, so if we're here, we
          // know there is no exception so far, and that's all
          // a SYNC_WITH_SERVER client request cares about.
          request.send_no_exception_reply ();
        }
    }

  // Create DSI request object.
  CORBA::ServerRequest *dsi_request = 0;
  ACE_NEW (dsi_request,
           CORBA::ServerRequest (request));

  try
    {
      // Delegate to user.
      this->invoke (dsi_request);

      // Only if the client is waiting.
      if (request.response_expected () && !request.sync_with_server ())
        {
          dsi_request->dsi_marshal ();
        }
    }
  catch (::CORBA::Exception& ex)
    {
      // Only if the client is waiting.
      if (request.response_expected () && !request.sync_with_server ())
        {
          if (request.collocated ()
               && request.operation_details ()->cac () != 0)
            {
              // If we have a cac it will handle the exception and no
              // need to do any further processing
              request.operation_details ()->cac ()->handle_corba_exception (
                request, &ex);
              return;
            }
          else
            request.tao_send_reply_exception (ex);
        }
    }

  ::CORBA::release (dsi_request);
}
开发者ID:OspreyHub,项目名称:ATCD,代码行数:63,代码来源:Dynamic_Implementation.cpp

示例2: catch

int
TAO_Object_Adapter::dispatch (TAO::ObjectKey &key,
                              TAO_ServerRequest &request,
                              CORBA::Object_out forward_to)
{
  if (key.length() < TAO_Root_POA::TAO_OBJECTKEY_PREFIX_SIZE
      || ACE_OS::memcmp (key.get_buffer (),
                         &TAO_Root_POA::objectkey_prefix[0],
                         TAO_Root_POA::TAO_OBJECTKEY_PREFIX_SIZE) != 0)
    {
      return TAO_Adapter::DS_MISMATCHED_KEY;
    }

  int result = 0;

#if TAO_HAS_INTERCEPTORS == 1
  TAO::ServerRequestInterceptor_Adapter *sri_adapter =
    orb_core_.serverrequestinterceptor_adapter ();

  try
    {
      if (sri_adapter != 0)
        {
#if TAO_HAS_EXTENDED_FT_INTERCEPTORS == 1
          CORBA::OctetSeq_var ocs;
          sri_adapter->tao_ft_interception_point (request,
                                                 0,  // args
                                                 0,  // nargs
                                                 0,  // servant_upcall
                                                 0,  // exceptions
                                                 0, // nexceptions
                                                 ocs.out ());

          /// If we have a cached result, just go ahead and send the reply
          /// and let us  return
          if (ocs.ptr () != 0)
            {
              // request.result_seq (
              request.send_cached_reply (ocs.inout ());

              return TAO_Adapter::DS_OK;
            }

          // If a PortableInterceptor::ForwardRequest exception was
          // thrown, then set the forward_to object reference and return
          // with the appropriate return status.
          forward_to.ptr () = request.forward_location ();
          if (request.is_forwarded ())
            {
              return TAO_Adapter::DS_FORWARD;
            }
#endif /*TAO_HAS_EXTENDED_FT_INTERCEPTORS*/

          // The receive_request_service_contexts() interception point
          // must be invoked before the operation is dispatched to the
          // servant.
          sri_adapter->receive_request_service_contexts (request,
                                                         0,  // args
                                                         0,  // nargs
                                                         0,  // servant_upcall
                                                         0,  // exceptions
                                                         0);   // nexceptions

          // If a PortableInterceptor::ForwardRequest exception was
          // thrown, then set the forward_to object reference and return
          // with the appropriate return status.
          forward_to.ptr () = request.forward_location ();
          if (request.is_forwarded ())
            {
              return TAO_Adapter::DS_FORWARD;
            }
        }
#endif  /* TAO_HAS_INTERCEPTORS == 1 */

      result = this->dispatch_servant (key, request, forward_to);

#if TAO_HAS_INTERCEPTORS == 1

      if (result == TAO_Adapter::DS_FORWARD)
        {
          request.reply_status (GIOP::LOCATION_FORWARD);
          request.pi_reply_status (PortableInterceptor::LOCATION_FORWARD);
          request.forward_location (forward_to.ptr ());
          if (sri_adapter != 0)
            {
              sri_adapter->send_other (request,
                                       0,  // args
                                       0,  // nargs
                                       0,  // servant_upcall
                                       0,  // exceptions
                                       0   // nexceptions
                                      );
            }
        }
    }
  catch ( ::CORBA::Exception& ex)
    {
      // Just assume the current exception is a system exception, the
      // status can only change when the interceptor changes this
      // and this is only done when the sri_adapter is available. If we
//.........这里部分代码省略.........
开发者ID:OspreyHub,项目名称:ATCD,代码行数:101,代码来源:Object_Adapter.cpp


注:本文中的TAO_ServerRequest::is_forwarded方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。