Package org.switchyard.config.model.composite

Examples of org.switchyard.config.model.composite.ComponentReferenceModel.addPolicyRequirement()


            if (refRequires != null) {
                for (SecurityPolicy secPolicy : refRequires.security()) {
                    if (!secPolicy.supports(PolicyType.INTERACTION)) {
                        throw BeanMessages.MESSAGES.referenceOnlyCouldBeMarkedWithInteractionPolicyButIsNotTheOne(secPolicy.toString());
                    }
                    referenceModel.addPolicyRequirement(secPolicy.getQName());
                }
                for (TransactionPolicy txPolicy : refRequires.transaction()) {
                    if (!txPolicy.supports(PolicyType.INTERACTION)) {
                        throw BeanMessages.MESSAGES.referenceOnlyCouldBeMarkedWithInteractionPolicyButIsNotTheOne(txPolicy.toString());
                    }
View Full Code Here


                }
                for (TransactionPolicy txPolicy : refRequires.transaction()) {
                    if (!txPolicy.supports(PolicyType.INTERACTION)) {
                        throw BeanMessages.MESSAGES.referenceOnlyCouldBeMarkedWithInteractionPolicyButIsNotTheOne(txPolicy.toString());
                    }
                    referenceModel.addPolicyRequirement(txPolicy.getQName());
                }
                // Make sure we don't have conflicting policies
                QName ptx = TransactionPolicy.PROPAGATES_TRANSACTION.getQName();
                QName stx = TransactionPolicy.SUSPENDS_TRANSACTION.getQName();
                if (referenceModel.hasPolicyRequirement(ptx) && referenceModel.hasPolicyRequirement(stx)) {
View Full Code Here

        Assert.assertTrue(svc.hasPolicyRequirement(POLICY_FOO));
        Assert.assertTrue(svc.hasPolicyRequirement(POLICY_BAR));

        // Test reference policy
        ComponentReferenceModel ref = new V1ComponentReferenceModel(SwitchYardNamespace.DEFAULT.uri());
        ref.addPolicyRequirement(POLICY_BAR);
        Assert.assertTrue(ref.hasPolicyRequirement(POLICY_BAR));
        Assert.assertFalse(ref.hasPolicyRequirement(POLICY_FOO));
        svc.addPolicyRequirement(POLICY_FOO);
        Assert.assertTrue(svc.hasPolicyRequirement(POLICY_FOO));
    }
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.