org.jacorb.orb.policies

Class PolicyManager

Implemented Interfaces:
IDLEntity, LocalInterface, Object, PolicyManager, PolicyManagerOperations, java.io.Serializable

public class PolicyManager
extends _PolicyManagerLocalBase

Implementation of the ORB-level policy management interface as per CORBA 2.6, p. 4-43 to 4-45: This PolicyManager has operations through which a set of Policies can be applied and the current overriding Policy settings can be obtained. Policies applied at the ORB level override any system defaults. The ORB?s PolicyManager is obtained through an invocation of ORB::resolve_initial_references, specifying an identifier of "ORBPolicyManager."

Version:
$Id: PolicyManager.java,v 1.3 2004/05/06 12:40:00 nicolas Exp $

Author:
Gerald Brose, mailto:gerald.brose@acm.org

Constructor Summary

PolicyManager(ORB orb)
public c'tor

Method Summary

Policy[]
get_policy_overrides(int[] ts)
Returns a PolicyList containing the overridden Polices for the requested PolicyTypes.
void
set_policy_overrides(Policy policies, SetOverrideType set_add)
Modifies the current set of overrides with the requested list of Policy overrides.

Methods inherited from class org.omg.CORBA._PolicyManagerLocalBase

_ids

Methods inherited from class org.omg.CORBA.LocalObject

_create_request, _create_request, _duplicate, _get_domain_managers, _get_interface, _get_interface_def, _get_policy, _hash, _ids, _invoke, _is_a, _is_equivalent, _is_local, _non_existent, _orb, _release, _releaseReply, _request, _request, _servant_postinvoke, _servant_preinvoke, _set_policy_override, validate_connection

Constructor Details

PolicyManager

public PolicyManager(ORB orb)
public c'tor

Method Details

get_policy_overrides

public Policy[] get_policy_overrides(int[] ts)
Returns a PolicyList containing the overridden Polices for the requested PolicyTypes. If the specified sequence is empty, all Policy overrides at this scope will be returned. If none of the requested PolicyTypes are overridden at the target PolicyManager, an empty sequence is returned. This accessor returns only those Policy overrides that have been set at the specific scope corresponding to the target PolicyManager (no evaluation is done with respect to overrides at other scopes).
Specified by:
get_policy_overrides in interface PolicyManagerOperations

Parameters:
ts - a sequence of overridden policy types identifying the policies that are to be retrieved.

Returns:
the list of overridden policies of the types specified by ts


set_policy_overrides

public void set_policy_overrides(Policy policies,
                                 SetOverrideType set_add)
            throws InvalidPolicies
Modifies the current set of overrides with the requested list of Policy overrides. 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 PolicyManager, or they should be added to a clean PolicyManager free of any other overrides (SET_OVERRIDE).

Invoking set_policy_overrides with an empty sequence of policies and a mode of SET_OVERRIDE removes all overrides from a PolicyManager. 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. If the request would put the set of overriding policies for the target PolicyManager in an inconsistent state, no policies are changed or added, and the exception InvalidPolicies is raised. There is no evaluation of compatibility with policies set within other PolicyManagers.

Specified by:
set_policy_overrides in interface PolicyManagerOperations

Parameters:
policies - a sequence of Policy objects that are to be associated with the PolicyManager object.
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 PolicyManager object. If the value of this parameter is SET_OVERRIDE, the supplied policies completely replace all existing overrides associated with the PolicyManager object. If the value of this parameter is ADD_OVERRIDE, the supplied policies are added to the existing overrides associated with the PolicyManager object, except that if a supplied Policy object has the same PolicyType value as an existing override, the supplied Policy object replaces the existing override.