Go to the documentation of this file.00001 #include "tao/PI_Server/ServerRequestDetails.h"
00002
00003 #if TAO_HAS_INTERCEPTORS == 1
00004
00005 #if !defined (__ACE_INLINE__)
00006 #include "tao/PI_Server/ServerRequestDetails.inl"
00007 #endif
00008
00009 #include "tao/SystemException.h"
00010
00011 ACE_RCSID (PI_Server,
00012 ServerRequestDetails,
00013 "$Id: ServerRequestDetails.cpp 76995 2007-02-11 12:51:42Z johnnyw $")
00014
00015 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00016
00017 namespace TAO
00018 {
00019 void
00020 ServerRequestDetails::apply_policies (const CORBA::PolicyList &policies)
00021 {
00022
00023 bool processing_mode_applied = false;
00024
00025 CORBA::ULong const plen = policies.length ();
00026
00027 for (CORBA::ULong i = 0; i < plen; ++i)
00028 {
00029 CORBA::Policy_var policy = CORBA::Policy::_duplicate (policies[i]);
00030
00031 if (CORBA::is_nil (policy.in ()))
00032 {
00033
00034 continue;
00035 }
00036
00037
00038 CORBA::PolicyType const policy_type = policy->policy_type ();
00039
00040 if (policy_type == PortableInterceptor::PROCESSING_MODE_POLICY_TYPE)
00041 {
00042 if (processing_mode_applied)
00043 {
00044
00045
00046 throw ::CORBA::INV_POLICY ();
00047 }
00048
00049
00050 processing_mode_applied = true;
00051
00052
00053 PortableInterceptor::ProcessingModePolicy_var pm_policy =
00054 PortableInterceptor::ProcessingModePolicy::_narrow (
00055 policy.in ());
00056
00057
00058 this->processing_mode_ = pm_policy->processing_mode ();
00059 }
00060 else
00061 {
00062
00063 throw ::CORBA::INV_POLICY ();
00064 }
00065 }
00066 }
00067 }
00068
00069 TAO_END_VERSIONED_NAMESPACE_DECL
00070
00071 #endif