Пример #1
0
  Invocation_Status
  DII_Invocation_Adapter::invoke_twoway (
        TAO_Operation_Details &op,
        CORBA::Object_var &effective_target,
        Profile_Transport_Resolver &r,
        ACE_Time_Value *&max_wait_time,
        Invocation_Retry_State *retry_state)
  {
    ACE_UNUSED_ARG (retry_state);

    // Simple sanity check
    if (this->mode_ != TAO_DII_INVOCATION ||
        this->type_ != TAO_TWOWAY_INVOCATION)
      {
        throw ::CORBA::INTERNAL (
          CORBA::SystemException::_tao_minor_code (
            TAO::VMCID,
            EINVAL),
          CORBA::COMPLETED_NO);
      }

    TAO_Transport* const transport = r.transport ();

    if (!transport)
      {
        // Way back, we failed to find a profile we could connect to.
        // We've come this far only so we reach the interception points
        // in case they can fix things. Time to bail....
        throw CORBA::TRANSIENT (CORBA::OMGVMCID | 2, CORBA::COMPLETED_NO);
      }

    TAO::DII_Invocation synch (this->target_,
                               r,
                               op,
                               this->exception_list_,
                               this->request_);

    // forward requested byte order
    synch._tao_byte_order (this->_tao_byte_order ());

    Invocation_Status status = synch.remote_twoway (max_wait_time);

    if (status == TAO_INVOKE_RESTART &&
        (synch.reply_status () == GIOP::LOCATION_FORWARD ||
         synch.reply_status () == GIOP::LOCATION_FORWARD_PERM))
      {
        CORBA::Boolean const permanent_forward =
          (synch.reply_status () == GIOP::LOCATION_FORWARD_PERM);

        effective_target = synch.steal_forwarded_reference ();

        this->object_forwarded (effective_target,
                                r.stub (),
                                permanent_forward);
      }
    return status;
  }
Пример #2
0
  Invocation_Status
  Asynch_Invocation_Adapter::invoke_twoway (
    TAO_Operation_Details &op,
    CORBA::Object_var &effective_target,
    Profile_Transport_Resolver &r,
    ACE_Time_Value *&max_wait_time,
    Invocation_Retry_State *retry_state)
  {
    ACE_UNUSED_ARG (retry_state);

    // Simple sanity check
    if (this->mode_ != TAO_ASYNCHRONOUS_CALLBACK_INVOCATION
        || this->type_ != TAO_TWOWAY_INVOCATION)
      {
        throw ::CORBA::INTERNAL (
          CORBA::SystemException::_tao_minor_code (
            TAO::VMCID,
            EINVAL),
          CORBA::COMPLETED_NO);
      }

    if (this->safe_rd_.get () && r.transport ())
      {
        this->safe_rd_->transport (r.transport ());
        // AMI Timeout Handling Begin
        ACE_Time_Value tmp;

        if (this->get_timeout (r.stub (), tmp))
          {
            this->safe_rd_->schedule_timer (op.request_id (), *max_wait_time);
          }
      }

    // Loose ownership of the reply dispatcher
    TAO::Asynch_Remote_Invocation asynch (
       effective_target.in (),
       r,
       op,
       this->safe_rd_.release ());

    Invocation_Status const s = asynch.remote_invocation (max_wait_time);

    if (s == TAO_INVOKE_RESTART &&
        (asynch.reply_status () == GIOP::LOCATION_FORWARD ||
         asynch.reply_status () == GIOP::LOCATION_FORWARD_PERM))
      {
        CORBA::Boolean const permanent_forward =
          (asynch.reply_status () == GIOP::LOCATION_FORWARD_PERM);

        effective_target = asynch.steal_forwarded_reference ();

        this->object_forwarded (effective_target, r.stub (), permanent_forward);
      }

    return s;
  }
Пример #3
0
  Invocation_Status
  Invocation_Adapter::invoke_remote_i (TAO_Stub *stub,
                                       TAO_Operation_Details &details,
                                       CORBA::Object_var &effective_target,
                                       ACE_Time_Value *&max_wait_time,
                                       Invocation_Retry_State *retry_state)
  {
    (void) this->set_response_flags (stub, details);

    CORBA::Octet const rflags = details.response_flags ();
    bool const block_connect =
      rflags != static_cast<CORBA::Octet> (Messaging::SYNC_NONE)
      && rflags != static_cast<CORBA::Octet> (TAO::SYNC_DELAYED_BUFFERING);
    // Create the resolver which will pick (or create) for us a
    // transport and a profile from the effective_target.
    Profile_Transport_Resolver resolver (
      effective_target.in (),
      stub,
      block_connect);
    resolver.resolve (max_wait_time);

    if (TAO_debug_level)
      {
        if (max_wait_time && *max_wait_time == ACE_Time_Value::zero)
          TAOLIB_DEBUG ((LM_DEBUG,
                      ACE_TEXT ("TAO (%P|%t) - Invocation_Adapter::invoke_remote_i, ")
                      ACE_TEXT ("max wait time consumed during transport resolution\n")));
      }
    // Update the request id now that we have a transport
    if (resolver.transport ())
      {
        details.request_id (resolver.transport ()->tms ()->request_id ());
      }
    switch (this->type_)
      {
        case TAO_ONEWAY_INVOCATION:
          {
            return this->invoke_oneway (details,
                                        effective_target,
                                        resolver,
                                        max_wait_time);
          }
        case TAO_TWOWAY_INVOCATION:
          {
            return this->invoke_twoway (details,
                                        effective_target,
                                        resolver,
                                        max_wait_time,
                                        retry_state);

          }
      }
    return TAO_INVOKE_FAILURE;
  }
Пример #4
0
  Invocation_Status
  Invocation_Adapter::invoke_oneway (TAO_Operation_Details &details,
                                     CORBA::Object_var &effective_target,
                                     Profile_Transport_Resolver &r,
                                     ACE_Time_Value *&max_wait_time)
  {
    TAO::Synch_Oneway_Invocation synch (this->target_, r, details);

    // forward requested byte order
    synch._tao_byte_order (this->byte_order_);

    Invocation_Status const s = synch.remote_oneway (max_wait_time);

    if (s == TAO_INVOKE_RESTART &&
        (synch.reply_status () == GIOP::LOCATION_FORWARD ||
         synch.reply_status () == GIOP::LOCATION_FORWARD_PERM))
      {
        CORBA::Boolean const is_permanent_forward =
          (synch.reply_status () == GIOP::LOCATION_FORWARD_PERM);

        effective_target = synch.steal_forwarded_reference ();

        this->object_forwarded (effective_target,
                                r.stub (),
                                is_permanent_forward);
      }

    return s;
  }
Пример #5
0
  Invocation_Status
  Invocation_Adapter::invoke_twoway (TAO_Operation_Details &details,
                                     CORBA::Object_var &effective_target,
                                     Profile_Transport_Resolver &r,
                                     ACE_Time_Value *&max_wait_time,
                                     Invocation_Retry_State *retry_state)
  {
    // Simple sanity check
    if (this->mode_ != TAO_SYNCHRONOUS_INVOCATION ||
        this->type_ != TAO_TWOWAY_INVOCATION)
      {
        throw ::CORBA::INTERNAL (
          CORBA::SystemException::_tao_minor_code (
            TAO::VMCID,
            EINVAL),
          CORBA::COMPLETED_NO);
      }

    TAO::Synch_Twoway_Invocation synch (this->target_,  r, details,
                                        true);

    // forward requested byte order
    synch._tao_byte_order (this->byte_order_);

    synch.set_retry_state (retry_state);

    Invocation_Status const status = synch.remote_twoway (max_wait_time);

    if (status == TAO_INVOKE_RESTART &&
        (synch.reply_status () == GIOP::LOCATION_FORWARD ||
         synch.reply_status () == GIOP::LOCATION_FORWARD_PERM))
      {
        CORBA::Boolean const is_permanent_forward =
          (synch.reply_status () == GIOP::LOCATION_FORWARD_PERM);

        effective_target = synch.steal_forwarded_reference ();

        this->object_forwarded (effective_target,
                                r.stub (),
                                is_permanent_forward);
      }

    return status;
  }