summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/orbsvcs/PortableGroup/PortableGroup_Request_Dispatcher.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/orbsvcs/orbsvcs/PortableGroup/PortableGroup_Request_Dispatcher.cpp')
-rw-r--r--TAO/orbsvcs/orbsvcs/PortableGroup/PortableGroup_Request_Dispatcher.cpp58
1 files changed, 58 insertions, 0 deletions
diff --git a/TAO/orbsvcs/orbsvcs/PortableGroup/PortableGroup_Request_Dispatcher.cpp b/TAO/orbsvcs/orbsvcs/PortableGroup/PortableGroup_Request_Dispatcher.cpp
new file mode 100644
index 00000000000..2375f8e7414
--- /dev/null
+++ b/TAO/orbsvcs/orbsvcs/PortableGroup/PortableGroup_Request_Dispatcher.cpp
@@ -0,0 +1,58 @@
+// This may look like C, but it's really -*- C++ -*-
+//
+// $Id$
+
+#include "PortableGroup_Request_Dispatcher.h"
+#include "PortableGroup_Loader.h"
+#include "UIPMC_Profile.h"
+#include "tao/TAO_Server_Request.h"
+#include "tao/ORB_Core.h"
+
+ACE_RCSID(PortableGroup, PortableGroup_Request_Dispatcher, "$Id$")
+
+PortableGroup_Request_Dispatcher::~PortableGroup_Request_Dispatcher (void)
+{
+}
+
+void
+PortableGroup_Request_Dispatcher::dispatch (TAO_ORB_Core *orb_core,
+ TAO_ServerRequest &request,
+ CORBA::Object_out forward_to
+ TAO_ENV_ARG_PARAMETER)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ // Check if the request contains a tagged profile
+ if (request.profile ().discriminator () == GIOP::ProfileAddr)
+ {
+ // Get the IOP::Tagged profile.
+ const IOP::TaggedProfile &tagged_profile =
+ request.profile ().tagged_profile ();
+ PortableGroup::TagGroupTaggedComponent group;
+
+ // Extract a Group ID from the profile if it exists.
+ int result = TAO_UIPMC_Profile::extract_group_component (tagged_profile,
+ group);
+ if (result == 0)
+ {
+ // Got a group. Dispatch based on the group ID
+ this->group_map_.dispatch (&group,
+ orb_core,
+ request,
+ forward_to
+ TAO_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+
+ return;
+ }
+
+ // Else, fall through and dispatch based on object key like normal.
+ }
+
+ // Dispatch based on object key.
+ orb_core->adapter_registry ()->dispatch (request.object_key (),
+ request,
+ forward_to
+ TAO_ENV_ARG_PARAMETER);
+ ACE_CHECK;
+}
+