Previous Table of Contents Next


4.3.9 Overriding Associated Policies on an Object Reference


   4.3.9.1 set_policy_overrides

   The set_policy_overrides operation returns a new object reference with the new policies associated with it. It takes two input parameters. The first parameter policies is a sequence of references to Policy objects. The second parameter set_add of type SetOverrideType indicates whether these policies should be added onto any other overrides that already exist (ADD_OVERRIDE) in the object reference, or they should be added to a clean override free object reference (SET_OVERRIDE). This operation associates the policies passed in the first parameter with a newly created object reference that it returns. Only certain policies that pertain to the invocation of an operation at the client end can be overridden using this operation. Attempts to override any other policy will result in the raising of the CORBA::NO_PERMISSION exception.

   enum SetOverrideType {SET_OVERRIDE, ADD_OVERRIDE};

   Object set_policy_overrides(

in PolicyList policies,
in SetOverrideType set_add
) raises (InvalidPolicies);

   Parameter(s)

   policies - a sequence of Policy objects that are to be associated with the new copy of the object reference returned by this operation. If the sequence contains two or more Policy objects with the same PolicyType value, the operation raises the standard system exception BAD_PARAM with minor code 30.

   set_add - whether the association is in addition to (ADD_OVERRIDE) or as a replacement of (SET_OVERRIDE) any existing overrides already associated with the object reference. If the value of this parameter is SET_OVERRIDE, the supplied policies completely replace all existing overrides associated with the object reference. If the value of this parameter is ADD_OVERRIDE, the supplied policies are added to the existing overrides associated with the object reference, except that if a supplied Policy object has the same PolicyType value as an existing override, the supplied Policy object replaces the existing override.

   Return Value

   A copy of the object reference with the overrides from policies associated with it in accordance with the value of set_add.

   Exception(s)

   InvalidPolicies - raised when an attempt is made to override any policy that cannot be overridden.