summaryrefslogtreecommitdiff
path: root/TAO/tao/ClientRequestInfo.inl
blob: 0fed4cfe47c733ca534ab40fb50d35725cb6f45e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
// -*- C++ -*-
//
// $Id$

ACE_INLINE void
TAO_ClientRequestInfo::exception (CORBA::Exception *exception)
{
  if (CORBA::SystemException::_downcast (exception) != 0)
    this->reply_status_ = PortableInterceptor::SYSTEM_EXCEPTION;
  else if (CORBA::UserException::_downcast (exception) != 0)
    this->reply_status_ = PortableInterceptor::USER_EXCEPTION;

  // @@ Is it possible for both of the above downcasts to fail?

  this->caught_exception_ = exception;
}

ACE_INLINE void
TAO_ClientRequestInfo::response_expected (CORBA::Boolean flag)
{
  this->response_expected_ = flag;
}

ACE_INLINE void
TAO_ClientRequestInfo::reply_status (int invoke_status)
{
  switch (invoke_status)
    {
    case TAO_INVOKE_OK:
      this->reply_status_ = PortableInterceptor::SUCCESSFUL;
      break;
    case TAO_INVOKE_RESTART:
      if (this->invocation_->received_location_forward ())
        this->reply_status_ = PortableInterceptor::LOCATION_FORWARD;
      else
        this->reply_status_ = PortableInterceptor::TRANSPORT_RETRY;
      break;
    default:
      // We should only get here if the invocation status is
      // TAO_INVOKE_EXCEPTION, i.e. a CORBA::SystemException, so set
      // the appropriate reply status.
      this->reply_status_ = PortableInterceptor::SYSTEM_EXCEPTION;
      break;
    }
}

ACE_INLINE void
TAO_ClientRequestInfo::forward_reference (
  PortableInterceptor::ForwardRequest &)
{
  // Note that we're converting the ForwardRequest exception in to a
  // LOCATION_FORWARD reply, so we do not set the exception status.
  //
  // The forward object reference is not handled here.  Rather, it is
  // handled by the TAO_GIOP_Invocation object so that its profiles
  // can be added to the list of forward profiles.

  this->reply_status_ = PortableInterceptor::LOCATION_FORWARD;
}