1 #include "tao/DiffServPolicy/DiffServ_Service_Context_Handler.h"
3 #include "tao/DiffServPolicy/Client_Network_Priority_Policy.h"
5 #include "tao/TAO_Server_Request.h"
6 #include "tao/Transport.h"
7 #include "tao/ORB_Core.h"
8 #include "tao/GIOP_Message_Base.h"
9 #include "tao/operation_details.h"
10 #include "tao/Transport_Mux_Strategy.h"
13 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
16 TAO_DiffServ_Service_Context_Handler::process_service_context (
18 const IOP::ServiceContext
&,
25 TAO_DiffServ_Service_Context_Handler::generate_service_context (
28 TAO_Operation_Details
&opdetails
,
29 TAO_Target_Specification
&,
34 CORBA::Policy_var cnpp
=
35 stub
->get_cached_policy (TAO_CACHED_POLICY_CLIENT_NETWORK_PRIORITY
);
37 TAO::NetworkPriorityPolicy_var cnp
=
38 TAO::NetworkPriorityPolicy::_narrow (cnpp
.in ());
40 if (!CORBA::is_nil (cnp
.in ()))
42 TAO::DiffservCodepoint
const reply_diffserv_codepoint
=
43 cnp
->reply_diffserv_codepoint ();
45 CORBA::Long
const rep_dscp_codepoint
= reply_diffserv_codepoint
;
48 if (!(cdr
<< ACE_OutputCDR::from_boolean (TAO_ENCAP_BYTE_ORDER
))
49 || !(cdr
<< rep_dscp_codepoint
))
51 throw CORBA::MARSHAL ();
54 opdetails
.request_service_context ().set_context (IOP::REP_NWPRIORITY
, cdr
);
61 TAO_END_VERSIONED_NAMESPACE_DECL