Examples of GIOPVersionPolicy


Examples of org.apache.yoko.orb.OBPortableServer.GIOPVersionPolicy

        //
        // If policies are provided, they will take precedence
        // over the configuration properties.
        //
        CommunicationsConcurrencyPolicy commsPolicy = null;
        GIOPVersionPolicy giopPolicy = null;

        int nPolicies = policies.length;
        if (nPolicies != 0) {
            for (int i = 0; i < nPolicies; ++i) {
                int policyType = policies[i].policy_type();
                if (policyType == COMMUNICATIONS_CONCURRENCY_POLICY_ID.value) {
                    commsPolicy = CommunicationsConcurrencyPolicyHelper
                            .narrow(policies[i]);
                } else if (policyType == GIOP_VERSION_POLICY_ID.value) {
                    giopPolicy = GIOPVersionPolicyHelper.narrow(policies[i]);
                } else {
                    throw new org.omg.CORBA.PolicyError(
                            org.omg.CORBA.BAD_POLICY_TYPE.value);
                }
            }

        }

        //
        // Check over the POAManager properties and find out whether an
        // unknown property is present
        //
        java.util.Enumeration keys = properties.keys();
        while (keys.hasMoreElements()) {
            String key = (String) keys.nextElement();

            //
            // Ignore yoko.orb.oa.thread_pool
            //
            if (key.equals("yoko.orb.oa.thread_pool"))
                continue;

            //
            // Remove the property prefix
            //
            String prop;
            if (key.startsWith(rootKey))
                prop = key.substring(rootKeyLen);
            else if (key.startsWith("yoko.orb.oa."))
                prop = key.substring("yoko.orb.oa.".length());
            else
                continue;

            //
            // Check for a match among the supported properties
            //
            int i;
            for (i = 0; i < numProps; i++)
                if (prop.equals(props[i]))
                    break;

            //
            // Was the property present?
            //
            if (i >= numProps) {
                String err = key + ": unknown property";
                logger.warning(err);
            }
        }

        //
        // Configuration parameters
        //
        version_.major = (byte) 1;
        version_.minor = (byte) 2;
        int concModel = org.apache.yoko.orb.OB.Server.Threaded;

        //
        // Check for comms policy:
        //
        boolean commsPolicyPresent;
        if (commsPolicy == null) {
            commsPolicyPresent = false;
        } else {
            commsPolicyPresent = true;
            short value = commsPolicy.value();
            if (value == COMMUNICATIONS_CONCURRENCY_POLICY_REACTIVE.value) {
                concModel = org.apache.yoko.orb.OB.Server.Blocking;
            } else if (value == COMMUNICATIONS_CONCURRENCY_POLICY_THREADED.value) {
                concModel = org.apache.yoko.orb.OB.Server.Threaded;
            } else {
                throw new org.omg.CORBA.PolicyError(
                        org.omg.CORBA.BAD_POLICY_VALUE.value);
            }
        }

        //
        // Check for giop policy:
        //
        boolean giopPolicyPresent;
        if (giopPolicy == null) {
            giopPolicyPresent = false;
        } else {
            giopPolicyPresent = true;
            short value = giopPolicy.value();
            if (value == GIOP_VERSION_POLICY_1_0.value) {
                version_.major = (byte) 1;
                version_.minor = (byte) 0;
            } else if (value == GIOP_VERSION_POLICY_1_1.value) {
                version_.major = (byte) 1;
View Full Code Here

Examples of org.apache.yoko.orb.OBPortableServer.GIOPVersionPolicy

        //
        // If policies are provided, they will take precedence
        // over the configuration properties.
        //
        CommunicationsConcurrencyPolicy commsPolicy = null;
        GIOPVersionPolicy giopPolicy = null;

        int nPolicies = policies.length;
        if (nPolicies != 0) {
            for (int i = 0; i < nPolicies; ++i) {
                int policyType = policies[i].policy_type();
                if (policyType == COMMUNICATIONS_CONCURRENCY_POLICY_ID.value) {
                    commsPolicy = CommunicationsConcurrencyPolicyHelper
                            .narrow(policies[i]);
                } else if (policyType == GIOP_VERSION_POLICY_ID.value) {
                    giopPolicy = GIOPVersionPolicyHelper.narrow(policies[i]);
                } else {
                    throw new org.omg.CORBA.PolicyError(
                            org.omg.CORBA.BAD_POLICY_TYPE.value);
                }
            }

        }

        //
        // Check over the POAManager properties and find out whether an
        // unknown property is present
        //
        java.util.Enumeration keys = properties.keys();
        while (keys.hasMoreElements()) {
            String key = (String) keys.nextElement();

            //
            // Ignore yoko.orb.oa.thread_pool
            //
            if (key.equals("yoko.orb.oa.thread_pool"))
                continue;

            //
            // Remove the property prefix
            //
            String prop;
            if (key.startsWith(rootKey))
                prop = key.substring(rootKeyLen);
            else if (key.startsWith("yoko.orb.oa."))
                prop = key.substring("yoko.orb.oa.".length());
            else
                continue;

            //
            // Check for a match among the supported properties
            //
            int i;
            for (i = 0; i < numProps; i++)
                if (prop.equals(props[i]))
                    break;

            //
            // Was the property present?
            //
            if (i >= numProps) {
                String err = key + ": unknown property";
                logger.warning(err);
            }
        }

        //
        // Configuration parameters
        //
        version_.major = (byte) 1;
        version_.minor = (byte) 2;
        int concModel = org.apache.yoko.orb.OB.Server.Threaded;

        //
        // Check for comms policy:
        //
        boolean commsPolicyPresent;
        if (commsPolicy == null) {
            commsPolicyPresent = false;
        } else {
            commsPolicyPresent = true;
            short value = commsPolicy.value();
            if (value == COMMUNICATIONS_CONCURRENCY_POLICY_REACTIVE.value) {
                concModel = org.apache.yoko.orb.OB.Server.Blocking;
            } else if (value == COMMUNICATIONS_CONCURRENCY_POLICY_THREADED.value) {
                concModel = org.apache.yoko.orb.OB.Server.Threaded;
            } else {
                throw new org.omg.CORBA.PolicyError(
                        org.omg.CORBA.BAD_POLICY_VALUE.value);
            }
        }

        //
        // Check for giop policy:
        //
        boolean giopPolicyPresent;
        if (giopPolicy == null) {
            giopPolicyPresent = false;
        } else {
            giopPolicyPresent = true;
            short value = giopPolicy.value();
            if (value == GIOP_VERSION_POLICY_1_0.value) {
                version_.major = (byte) 1;
                version_.minor = (byte) 0;
            } else if (value == GIOP_VERSION_POLICY_1_1.value) {
                version_.major = (byte) 1;
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.