/** * Reads the policies as a pair PolicyType/encapsuled policy data * @param input */ public void partialRead(CDRInputStream input) { int size = input.read_ulong(); Policy policy = null; for (int i = 0; i< size; i++) { policy = PolicyFactory.readPolicy(input); if(policy != null) { try { setPolicy(policy); } catch (PolicyError e) {//unreachable } } } }
/** * Parse the ORB nominal Bidirectional Policy. * * @param str * the policy value. * @pre Values must be "NORMAL", "BOTH". * @exception org.omg.CORBA.INITIALIZE * if the string does not contains a valid value. */ //TODO: remove iiop, this is por ORB's policy manager... public void parse_bidirectional(String str) { if (str == null) return; short value = 0; if (str.equals("NORMAL")) { return; } else if (str.equals("BOTH")) { try { policy_context.setPolicy( new BidirectionalPolicyImpl(org.omg.BiDirPolicy.BOTH.value)); } catch (PolicyError pe) {} } else { throw new org.omg.CORBA.INITIALIZE("Invalid value" + bidirectional_name + "=" + str); } }
/** * Parse the max_blocked_time value. * * @param str * the value digits. * @pre Values must be >= 0. * @exception org.omg.CORBA.INITIALIZE * if the string does not contains a valid value. */ public void parse_max_blocked_time(String str) { if (str == null) return; long value = parse_long(max_blocked_time_name, str); if (value < 0) throw new INITIALIZE(max_blocked_time_name + ":invalid value " + value + " (minimum blocked 0)"); if (value != DEFAULT_MAX_BLOCKED_TIME) { // converts to TimeT (from ms to units of 100 ns) value = UTC.toTimeT(value); try { policy_context.setPolicy( new RelativeRoundtripTimeoutPolicyImpl(value)); } catch (PolicyError pe) {} max_blocked_time = value; } }
public static BidirectionalPolicyImpl createPolicy(Any val) throws org.omg.CORBA.PolicyError { try { short policy_value = BidirectionalPolicyValueHelper.extract(val); if ((policy_value != org.omg.BiDirPolicy.BOTH.value) && (policy_value != org.omg.BiDirPolicy.NORMAL.value)) throw new PolicyError(BAD_POLICY_VALUE.value); return new BidirectionalPolicyImpl(policy_value); } catch (BAD_PARAM bp) { throw new PolicyError(BAD_POLICY_VALUE.value); } }
public void add_server_request_interceptor_with_policy ( ServerRequestInterceptor interceptor, Policy[] policies ) throws DuplicateName, PolicyError { // XXX ignore policies for now add_server_request_interceptor( interceptor ) ; }
public void add_ior_interceptor_with_policy ( IORInterceptor interceptor, Policy[] policies ) throws DuplicateName, PolicyError { // XXX ignore policies for now add_ior_interceptor( interceptor ) ; }
/** * Create policy using the previously registered factory. */ public Policy create_policy(int type, Any value) throws PolicyError { Integer policy = new Integer(type); PolicyFactory forge = (PolicyFactory) policyFactories.get(policy); if (forge == null) throw new PolicyError("No factory registered for policy " + type, (short) type); else return forge.create_policy(type, value); }
public static ThreadPolicyImpl createPolicy(Any val) throws org.omg.CORBA.PolicyError { try { ThreadPolicyValue value = ThreadPolicyValueHelper.extract(val); return new ThreadPolicyImpl(value); } catch (BAD_PARAM bp) { throw new PolicyError(BAD_POLICY_VALUE.value); } }
public static RequestProcessingPolicyImpl createPolicy(Any val) throws org.omg.CORBA.PolicyError { try { RequestProcessingPolicyValue value = RequestProcessingPolicyValueHelper.extract(val); return new RequestProcessingPolicyImpl(value); } catch (BAD_PARAM bp) { throw new PolicyError(BAD_POLICY_VALUE.value); } }
public static LifespanPolicyImpl createPolicy(Any val) throws org.omg.CORBA.PolicyError { try { LifespanPolicyValue value = LifespanPolicyValueHelper.extract(val); return new LifespanPolicyImpl(value); } catch (BAD_PARAM bp) { throw new PolicyError(BAD_POLICY_VALUE.value); } }
public static IdAssignmentPolicyImpl createPolicy(Any val) throws org.omg.CORBA.PolicyError { try { IdAssignmentPolicyValue value = IdAssignmentPolicyValueHelper.extract(val); return new IdAssignmentPolicyImpl(value); } catch (BAD_PARAM bp) { throw new PolicyError(BAD_POLICY_VALUE.value); } }
public static IdUniquenessPolicyImpl createPolicy(Any val) throws org.omg.CORBA.PolicyError { try { IdUniquenessPolicyValue value = IdUniquenessPolicyValueHelper.extract(val); return new IdUniquenessPolicyImpl(value); } catch (BAD_PARAM bp) { throw new PolicyError(BAD_POLICY_VALUE.value); } }
public static ImplicitActivationPolicyImpl createPolicy(Any val) throws org.omg.CORBA.PolicyError { try { ImplicitActivationPolicyValue value = ImplicitActivationPolicyValueHelper.extract(val); return new ImplicitActivationPolicyImpl(value); } catch (BAD_PARAM bp) { throw new PolicyError(BAD_POLICY_VALUE.value); } }
public static ServantRetentionPolicyImpl createPolicy (Any val) throws org.omg.CORBA.PolicyError { try { ServantRetentionPolicyValue value = ServantRetentionPolicyValueHelper.extract(val); return new ServantRetentionPolicyImpl(value); } catch (BAD_PARAM bp) { throw new PolicyError(BAD_POLICY_VALUE.value); } }
/** * <code>createPolicy</code> create a new CompressionLowValuePolicyImpl. * * @param val an <code>Any</code> value * @return a <code>CompressionLowValuePolicyImpl</code> value * @exception org.omg.CORBA.PolicyError if an error occurs */ public static CompressionLowValuePolicyImpl createPolicy(Any val) throws org.omg.CORBA.PolicyError { try { int policy_value = CompressionLowValuePolicyValueHelper.extract(val); return new CompressionLowValuePolicyImpl(policy_value); } catch (BAD_PARAM bp) { throw new PolicyError(BAD_POLICY_VALUE.value); } }
/** * <code>createPolicy</code> . * * @param val an <code>Any</code> value * @return a <code>CompressorIdLevelListPolicyImpl</code> value * @exception org.omg.CORBA.PolicyError if an error occurs */ public static CompressorIdLevelListPolicyImpl createPolicy(Any val) throws org.omg.CORBA.PolicyError { try { CompressorIdLevel[] policy_value = CompressorIdLevelListHelper.extract(val); return new CompressorIdLevelListPolicyImpl(policy_value); } catch (BAD_PARAM bp) { throw new PolicyError(BAD_POLICY_VALUE.value); } }
/** * <code>createPolicy</code> . * * @param val an <code>Any</code> value * @return a <code>CompressionMinRatioPolicyImpl</code> value * @exception org.omg.CORBA.PolicyError if an error occurs */ public static CompressionMinRatioPolicyImpl createPolicy(Any val) throws org.omg.CORBA.PolicyError { try { float policy_value = CompressionMinRatioPolicyValueHelper.extract(val); return new CompressionMinRatioPolicyImpl(policy_value); } catch (BAD_PARAM bp) { throw new PolicyError(BAD_POLICY_VALUE.value); } }
/** * Describe <code>createPolicy</code> method here. * * @param val an <code>Any</code> value * @return a <code>CompressionEnablingPolicyImpl</code> value * @exception org.omg.CORBA.PolicyError if an error occurs */ public static CompressionEnablingPolicyImpl createPolicy(Any val) throws org.omg.CORBA.PolicyError { try { boolean policy_value = CompressionEnablingPolicyValueHelper.extract(val); return new CompressionEnablingPolicyImpl(policy_value); } catch (BAD_PARAM bp) { throw new PolicyError(BAD_POLICY_VALUE.value); } }
public synchronized void setPolicies(Policy[] policies, SetOverrideType set_add) throws org.omg.CORBA.InvalidPolicies { if (set_add == SetOverrideType.SET_OVERRIDE) { clear(); } java.util.Vector errors = null; for (short i = 0; i < policies.length; i++) { try { setPolicy(policies[i]); } catch (PolicyError pe) { if (errors == null) errors = new java.util.Vector(); errors.add(new Short(i)); } } if (errors != null) { InvalidPolicies ex = new InvalidPolicies(); int size = errors.size(); ex.indices = new short[size]; for (int i = 0; i < size; i++) ex.indices[i] = ((Short) errors.elementAt(i)).shortValue(); throw ex; } }