Examples of PolicyError


Examples of org.omg.CORBA.PolicyError

    public InvocationPolicyFactory() {}

    public Policy create_policy(int type, Any value) throws PolicyError {

        if (type != INVOCATION_POLICY_TYPE.value) {
            throw new PolicyError("Invalid InvocationPolicyType", (short) 0);
        }

        short policyValue = InvocationPolicyValueHelper.extract(value);

        switch (policyValue) {
        case SHARED.value :
        case UNSHARED.value :
        case EITHER.value :
            break;
        default :
            throw new PolicyError("Invalid InvocationPolicyValue", (short) 1);
        }

        return new InvocationPolicyImpl(policyValue);
    }
View Full Code Here

Examples of org.omg.CORBA.PolicyError

    public OTSPolicyFactory() {}

    public Policy create_policy(int type, Any value) throws PolicyError {

        if (type != OTS_POLICY_TYPE.value) {
            throw new PolicyError("Invalid OTSPolicyType", (short) 0);
        }

        short policyValue = OTSPolicyValueHelper.extract(value);

        switch (policyValue) {
        case REQUIRES.value :
        case ADAPTS.value :
        case FORBIDS.value :
            break;
        default :
            throw new PolicyError("Invalid OTSPolicyValue", (short) 1);
        }

        return new OTSPolicyImpl(policyValue);
    }
View Full Code Here

Examples of org.omg.CORBA.PolicyError

    public Policy create_policy( int type, Any any )
        throws PolicyError
    {
        if( type != BIDIRECTIONAL_POLICY_TYPE.value )
        {
            throw new PolicyError("Invalid policy type of " + type,
                                  BAD_POLICY.value );
        }
       
        short value = BidirectionalPolicyValueHelper.extract( any );
       
        if( value != NORMAL.value &&
            value != BOTH.value )
        {
            throw new PolicyError("Invalid value for BiDir policy of " + value,
                                  BAD_POLICY_VALUE.value);
        }
       
        return new BiDirPolicy( value );
    }
View Full Code Here

Examples of org.omg.CORBA.PolicyError

/*    */ {
/*    */   public Policy create_policy(int type, Any value)
/*    */     throws PolicyError
/*    */   {
/* 50 */     if (type != 305419896) {
/* 51 */       throw new PolicyError();
/*    */     }
/* 53 */     String codebase = value.extract_string();
/* 54 */     return new CodebasePolicy(codebase);
/*    */   }
View Full Code Here

Examples of org.omg.CORBA.PolicyError

/*    */
/*    */   public Policy create_policy(int type, Any value)
/*    */     throws PolicyError
/*    */   {
/* 58 */     if (type != -2023406815) {
/* 59 */       throw new PolicyError();
/*    */     }
/*    */
/* 63 */     IorSecurityConfigMetaData metadata = (IorSecurityConfigMetaData)value.extract_Value();
/*    */
/* 66 */     return new CSIv2Policy(metadata, this.codec);
View Full Code Here

Examples of org.omg.CORBA.PolicyError

    public final static int POLICY_TYPE = 0x41534600;

    public Policy create_policy(int type, Any value) throws PolicyError {
        if (type != POLICY_TYPE) {
            throw new PolicyError(org.omg.CORBA.BAD_POLICY.value);
        }

        return new ServerPolicy((ServerPolicy.Config) value.extract_Value());
    }
View Full Code Here

Examples of org.omg.CORBA.PolicyError

    public final static int POLICY_TYPE = 0x41534601;

    public Policy create_policy(int type, Any value) throws PolicyError {
        if (type != POLICY_TYPE) {
            throw new PolicyError(org.omg.CORBA.BAD_POLICY.value);
        }

        return new ClientPolicy((CSSConfig) value.extract_Value());
    }
View Full Code Here

Examples of org.omg.CORBA.PolicyError

public class ClientTransactionPolicyFactory extends LocalObject implements PolicyFactory {
    public final static int POLICY_TYPE = 0x41534603;

    public Policy create_policy(int type, Any value) throws PolicyError {
        if (type != POLICY_TYPE) {
            throw new PolicyError(org.omg.CORBA.BAD_POLICY.value);
        }
        return new ClientTransactionPolicy(((ClientTransactionPolicyConfig)value.extract_Value()));
    }
View Full Code Here

Examples of org.omg.CORBA.PolicyError

public class ServerTransactionPolicyFactory extends LocalObject implements PolicyFactory {
    public final static int POLICY_TYPE = 0x41534602;

    public Policy create_policy(int type, Any value) throws PolicyError {
        if (type != POLICY_TYPE) {
            throw new PolicyError(org.omg.CORBA.BAD_POLICY.value);
        }
        return new ServerTransactionPolicy((ServerTransactionPolicyConfig) value.extract_Value());
    }
View Full Code Here

Examples of org.omg.CORBA.PolicyError

    public Policy create_policy( int type, Any any )
        throws PolicyError
    {
        if( type != BIDIRECTIONAL_POLICY_TYPE.value )
        {
            throw new PolicyError("Invalid policy type of " + type,
                                  BAD_POLICY.value );
        }

        short value = BidirectionalPolicyValueHelper.extract( any );

        if( value != NORMAL.value &&
            value != BOTH.value )
        {
            throw new PolicyError("Invalid value for BiDir policy of " + value,
                                  BAD_POLICY_VALUE.value);
        }

        return new BiDirPolicy( value );
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.