summaryrefslogtreecommitdiff
path: root/TAO/tao/Request_Dispatcher.cpp
blob: 78004b7ad6d1df21b1d2db7e18f89c6304a6e4a5 (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
// $Id$

#include "Request_Dispatcher.h"
#include "TAO_Server_Request.h"
#include "ORB_Core.h"

ACE_RCSID(tao, GIOP_Message_Base, "$Id$")

TAO_Request_Dispatcher::~TAO_Request_Dispatcher (void)
{
}

void
TAO_Request_Dispatcher::dispatch (TAO_ORB_Core *orb_core,
                                  TAO_ServerRequest &request,
                                  void *context,
                                  CORBA::Object_out forward_to,
                                  CORBA::Environment &ACE_TRY_ENV)
  ACE_THROW_SPEC ((CORBA::SystemException))
{
  // Dispatch based on object key

  if (request.profile_has_dispatch_info ())
    {
      // Get the IOP::Tagged profile.
      IOP::TaggedProfile &tagged_profile =
        request.profile ().tagged_profile ();

      // Extract the object key from the TaggedProfile.
      if (request.profile ().extract_object_key (tagged_profile) != 1)
        {
          ACE_TRY_THROW (CORBA::MARSHAL (TAO_DEFAULT_MINOR_CODE,
                                         CORBA::COMPLETED_NO));
        }
    }

  // Dispatch.
  orb_core->adapter_registry ()->dispatch (request.object_key (),
                                           request,
                                           context,
                                           forward_to,
                                           ACE_TRY_ENV);
  ACE_TRY_CHECK;
}