PortableGroup_Request_Dispatcher.cpp

Go to the documentation of this file.
00001 // $Id: PortableGroup_Request_Dispatcher.cpp 76589 2007-01-25 18:04:11Z elliott_c $
00002 
00003 #include "orbsvcs/PortableGroup/UIPMC_Profile.h"
00004 #include "orbsvcs/PortableGroup/PortableGroup_Request_Dispatcher.h"
00005 #include "orbsvcs/PortableGroup/PortableGroup_Loader.h"
00006 
00007 #include "tao/TAO_Server_Request.h"
00008 #include "tao/ORB_Core.h"
00009 
00010 ACE_RCSID (PortableGroup,
00011            PortableGroup_Request_Dispatcher,
00012            "$Id: PortableGroup_Request_Dispatcher.cpp 76589 2007-01-25 18:04:11Z elliott_c $")
00013 
00014 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00015 
00016 PortableGroup_Request_Dispatcher::~PortableGroup_Request_Dispatcher (void)
00017 {
00018 }
00019 
00020 void
00021 PortableGroup_Request_Dispatcher::dispatch (TAO_ORB_Core *orb_core,
00022                                             TAO_ServerRequest &request,
00023                                             CORBA::Object_out forward_to)
00024 {
00025   // Check if the request contains a tagged profile
00026   if (request.profile ().discriminator () == GIOP::ProfileAddr)
00027     {
00028       // Get the IOP::Tagged profile.
00029       const IOP::TaggedProfile &tagged_profile =
00030         request.profile ().tagged_profile ();
00031       PortableGroup::TagGroupTaggedComponent group;
00032 
00033       // Extract a Group ID from the profile if it exists.
00034       int result = TAO_UIPMC_Profile::extract_group_component (tagged_profile,
00035                                                                group);
00036       if (result == 0)
00037         {
00038           // Got a group.  Dispatch based on the group ID
00039           this->group_map_.dispatch (&group,
00040                                      orb_core,
00041                                      request,
00042                                      forward_to);
00043 
00044           return;
00045         }
00046 
00047       // Else, fall through and dispatch based on object key like normal.
00048     }
00049 
00050   // Dispatch based on object key.
00051   orb_core->adapter_registry ()->dispatch (request.object_key (),
00052                                            request,
00053                                            forward_to);
00054 }
00055 
00056 TAO_END_VERSIONED_NAMESPACE_DECL

Generated on Tue Feb 2 17:49:50 2010 for TAO_PortableGroup by  doxygen 1.4.7