CORBA::Object::set_policy_overrides - (operation) return a new object reference, which will be associated with the specified policies



  module CORBA
    typedef sequence <Policy> PolicyList ;
    enum SetOverrideType { SET_OVERRIDE, ADD_OVERRIDE } ;
    exception InvalidPolicies
      { sequence <unsigned short> indicies ; } ;
    interface Object
      Object set_policy_overrides
          ( in PolicyList policies, in SetOverrideType set_add )
          raises ( InvalidPolicies ) ;
      } ;
    } ;


  #include <orb.h>
  typedef struct
      CORBA_unsigned_long              _maximum ;
      CORBA_unsigned_long              _length ;
      CORBA_Policy                   * _buffer ;
      CORBA_PolicyList ;
  typedef CORBA_unsigned_long          CORBA_SetOverrideType ;
  #define CORBA_SET_OVERRIDE           0
  #define CORBA_ADD_OVERRIDE           1
  typedef struct
      CORBA_sequence_unsigned_short    indices ;
      CORBA_InvalidPolicies ;
  #define ex_CORBA_InvalidPolicies     "IDL:CORBA/InvalidPolicies:1.0"
  CORBA_Object CORBA_Object_set_policy_overrides
      ( CORBA_Object o, CORBA_PolicyList * policies,
      SetOverrideType set_add, CORBA_Environment * ev ) ;


  #include <orb.h>
  namespace CORBA
    class PolicyList
      { [...] /* mapped from sequence<Policy> */ } ;
    enum SetOverrideType { SET_OVERRIDE, ADD_OVERRIDE } ;
    class InvalidPolicies : public UserException
      { [...]
        UnsignedShortSeq indices ;
        [...] /* mapped as a user exception */
      } ;
    class Object
          Object_ptr _set_policy_overrides
              ( const PolicyList &, SetOverrideType ) ;
      } ;
    } ;


  package org.omg.CORBA ;
  public class SetOverrideType
    implements org.omg.CORBA.portable.IDLEntity
      public static final int _SET_OVERRIDE = 0;
      public static final SetOverrideType SET_OVERRIDE
          = new EnumType ( _SET_OVERRIDE ) ;
      public static final int _ADD_OVERRIDE = 1;
      public static final SetOverrideType ADD_OVERRIDE
          = new EnumType ( _ADD_OVERRIDE ) ;
      [...] // mapped as standard Java enum mapping
  final public class InvalidPolicies
    extends org.omg.CORBA.UserException
      public short [] indices ;
      [...] // mapped as Java exception
  public interface Object
      org.omg.CORBA.Object _set_policy_overrides
          ( Policy[] policies, SetOverrideType set_add ) ;






The CORBA::Object::set_policy_overrides operation creates a new object reference, with which are associated the new, specified policies. Association of a policy with an object reference implicitly associates that policy with the object itself. See Note 1.


policies (in, PolicyList, sequence)

The list of policies to be associated with the new object reference.

set_add (in, SetOverrideType, enum)

Specifies whether the policies are to replace, or are to be added to, the object references existing policies.

SET_OVERRIDE - the supplied policies completely replace the policies already associated with the given object

ADD_OVERRIDE - the supplied policies are added, in addition to the policies already associated with the given object; if there is already a policy of the same type as a given policy, then the new policy replaces the existing policy of the same type


(C mapping only) the target object


(C mapping only) a pointer to the CORBA_Environment


A new object reference, associated with the specified policies.



An attempt has been made to override a policy which cannot be overridden.

(standard system exceptions)


  1. The effective policies associated with an object are based on ORB-level policies, thread-level policies, and object-level policies. These policies must be reconciled together. This operation is used to set the object-level policies. Policies set at this level may override the policies established at the more enclosing (ORB and thread) levels.

  2. (C++ mapping only) The IDL header is named orb.idl. The C++ mapping specification does not mention a specific header name. One might presume the header name should be orb.h. However, some ORB vendors are more imaginative, and use other, different header file names.

  3. (C++ mapping only) The C++ mapping of names may vary, depending on the implementation's support for nested classes and namespaces. The rules are:

        if C++ namespace is supported,
            then map IDL module to C++ namespace
        else if C++ nested classes are supported,
            then map IDL module to a C++ class
            use the C mapping for names

    The C++ synopsis, above, assumes namespace support. For other situations, adjust accordingly.

  4. Not to be confused with the operation of the same name on the CORBA::PolicyManager local interface. The Object::set_policy_overrides operation is used to set policies for a single object. The PolicyManager::set_policy_overrides operation is used to set policies on a domain's policy manager, which implicitly sets such policies on all objects within that domain.




Copyright 2012 Michael Marking. This document is distributed as part of corbadoc, a documentation-only package with the goal of describing the main CORBA-related definitions from the OMG specifications. This is version corbadoc-0.1.3-prototype, released 2011.12.23. corbadoc is an incomplete work in progress; this is a snapshot release. New releases will be posted at

The corbadoc documents, including this one, are licensed under the GNU Free Documentation License, v.1.3.