#include <ClientRequestDetails.h>
Public Member Functions | |
ClientRequestDetails (void) | |
void | apply_policies (const CORBA::PolicyList &policies ACE_ENV_ARG_DECL) |
bool | should_be_processed (bool is_remote_request) const |
Private Attributes | |
PortableInterceptor::ProcessingMode | processing_mode_ |
Each time a client request interceptor is registered with an ORB, a ClientRequestDetails object will be created and associated with the registered client request interceptor. If the interceptor is registered with policies, the policies will be used to adjust the values in the ClientRequestDetails appropriately.
Definition at line 51 of file ClientRequestDetails.h.
|
Definition at line 10 of file ClientRequestDetails.inl.
00011 : processing_mode_(PortableInterceptor::LOCAL_AND_REMOTE) 00012 { 00013 } |
|
Definition at line 18 of file ClientRequestDetails.cpp. References CORBA::Policy::_duplicate(), CORBA::Policy::_narrow(), ACE_CHECK, ACE_ENV_ARG_PARAMETER, ACE_ENV_SINGLE_ARG_PARAMETER, ACE_THROW, CORBA::is_nil(), and processing_mode_.
00021 { 00022 // Flag to check for duplicate ProcessingModePolicy objects in the list. 00023 bool processing_mode_applied = false; 00024 00025 const CORBA::ULong 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 // Just ignore nil policies... 00034 continue; 00035 } 00036 00037 // Obtain the PolicyType from the current Policy object. 00038 const CORBA::PolicyType policy_type = 00039 policy->policy_type (ACE_ENV_SINGLE_ARG_PARAMETER); 00040 ACE_CHECK; 00041 00042 if (policy_type == PortableInterceptor::PROCESSING_MODE_POLICY_TYPE) 00043 { 00044 if (processing_mode_applied) 00045 { 00046 // This is the second time we have run into this policy type, 00047 // and that is not allowed. 00048 ACE_THROW (CORBA::INV_POLICY ()); 00049 } 00050 00051 // Flip the flag to true in order to trap any dupes. 00052 processing_mode_applied = true; 00053 00054 // Narrow the Policy to the ProcessingModePolicy interface. 00055 PortableInterceptor::ProcessingModePolicy_var pm_policy = 00056 PortableInterceptor::ProcessingModePolicy::_narrow ( 00057 policy.in () 00058 ACE_ENV_ARG_PARAMETER); 00059 ACE_CHECK; 00060 00061 // Save the value of the ProcessingModePolicy in our data member. 00062 this->processing_mode_ = 00063 pm_policy->processing_mode (ACE_ENV_SINGLE_ARG_PARAMETER); 00064 ACE_CHECK; 00065 } 00066 else 00067 { 00068 // We don't support the current policy type. 00069 ACE_THROW (CORBA::INV_POLICY ()); 00070 } 00071 } 00072 } |
|
Returns true if the ProcessingMode setting permits the "firing" of the associated client request interceptor based upon the remote vs. collocated nature of the current servant request that is being dispatched. Definition at line 17 of file ClientRequestDetails.inl. References processing_mode_.
00018 { 00019 return ((this->processing_mode_ == PortableInterceptor::LOCAL_AND_REMOTE) || 00020 ((this->processing_mode_ == PortableInterceptor::REMOTE_ONLY) && 00021 (is_remote_request)) || 00022 ((this->processing_mode_ == PortableInterceptor::LOCAL_ONLY) && 00023 (!is_remote_request))); 00024 } |
|
The ProcessingMode setting that can be adjusted via the PortableInterceptor::ProcessingModePolicy. Definition at line 70 of file ClientRequestDetails.h. Referenced by apply_policies(), and should_be_processed(). |