Examples of OperationsConfigurator


Examples of org.apache.tuscany.sca.assembly.OperationsConfigurator

                    resolvePolicySets(policiedBinding.getPolicySets(), resolver);
                    //validate if attached policysets apply to the binding
                    validatePolicySets(contract, policiedBinding);
                }
                if (binding instanceof OperationsConfigurator) {
                    OperationsConfigurator opConfigurator = (OperationsConfigurator)binding;
                    for (ConfiguredOperation confOp : opConfigurator.getConfiguredOperations()) {
                        resolveIntents(confOp.getRequiredIntents(), resolver);
                        resolvePolicySets(confOp.getPolicySets(), resolver);
                    }
                }
            }

            // Resolve callback bindings
            if (contract.getCallback() != null) {
                resolveIntents(contract.getCallback().getRequiredIntents(), resolver);
                resolvePolicySets(contract.getCallback().getPolicySets(), resolver);
                //inherit the contract's policy intents and policysets
                addInheritedIntents(contract.getRequiredIntents(), contract.getCallback().getRequiredIntents());
                addInheritedPolicySets(contract.getPolicySets(), contract.getCallback().getPolicySets());
               
                for (int i = 0, n = contract.getCallback().getBindings().size(); i < n; i++) {
                    Binding binding = contract.getCallback().getBindings().get(i);
                    extensionProcessor.resolve(binding, resolver);

                    if (binding instanceof IntentAttachPoint) {
                        IntentAttachPoint policiedBinding = (IntentAttachPoint)binding;
                        resolveIntents(policiedBinding.getRequiredIntents(), resolver);
                    }
                    if (binding instanceof PolicySetAttachPoint) {
                        PolicySetAttachPoint policiedBinding = (PolicySetAttachPoint)binding;
                        resolvePolicySets(policiedBinding.getPolicySets(), resolver);
                        validatePolicySets(contract.getCallback(), policiedBinding);
                    }
                    if (binding instanceof OperationsConfigurator) {
                        OperationsConfigurator opConfigurator = (OperationsConfigurator)binding;
                        for (ConfiguredOperation confOp : opConfigurator.getConfiguredOperations()) {
                            resolveIntents(confOp.getRequiredIntents(), resolver);
                            resolvePolicySets(confOp.getPolicySets(), resolver);
                        }
                    }
                }
View Full Code Here

Examples of org.apache.tuscany.sca.assembly.OperationsConfigurator

                fail();
            }
        }

        //test for proper aggregation of policy intents and policysets on operations of implementation
        OperationsConfigurator opConf = (OperationsConfigurator)composite.getComponents().get(5);
        assertEquals(opConf.getConfiguredOperations().get(0).getRequiredIntents().size(), 4);
        for ( Intent intent :  opConf.getConfiguredOperations().get(0).getRequiredIntents()) {
            String intentName = intent.getName().getLocalPart();
            if ( !(intentName.equals("tuscanyIntent_1") || intentName.equals("tuscanyIntent_4") ||
                intentName.equals("tuscanyIntent_5") || intentName.equals("tuscanyIntent_6") ) ) {
                fail();
            }
        }
       
        opConf = (OperationsConfigurator)composite.getComponents().get(6);
        assertEquals(opConf.getConfiguredOperations().get(0).getRequiredIntents().size(), 3);
        for ( Intent intent :  opConf.getConfiguredOperations().get(0).getRequiredIntents()) {
            String intentName = intent.getName().getLocalPart();
            if ( !(intentName.equals("tuscanyIntent_1") || intentName.equals("tuscanyIntent_4") ||
                intentName.equals("tuscanyIntent_6.qualified2") ) ) {
                fail();
            }
View Full Code Here

Examples of org.apache.tuscany.sca.assembly.OperationsConfigurator

                fail();
            }
        }

        //test for computation of policysets on operations of implementation
        OperationsConfigurator opConf = (OperationsConfigurator)composite.getComponents().get(5);
        assertEquals(opConf.getConfiguredOperations().get(0).getPolicySets().size(), 3);
        for ( PolicySet policySet : opConf.getConfiguredOperations().get(0).getPolicySets() ) {
            String policySetName = policySet.getName().getLocalPart();
            if ( !(policySetName.equals("tuscanyPolicySet_1") || policySetName.equals("tuscanyPolicySet_2")
                    || policySetName.equals("tuscanyPolicySet_3")) ) {
                fail();
            }
        }
       
        opConf = (OperationsConfigurator)composite.getComponents().get(6);
        assertEquals(opConf.getConfiguredOperations().get(0).getPolicySets().size(), 3);
        for ( PolicySet policySet : opConf.getConfiguredOperations().get(0).getPolicySets() ) {
            String policySetName = policySet.getName().getLocalPart();
            if ( !(policySetName.equals("tuscanyPolicySet_1") || policySetName.equals("tuscanyPolicySet_2")
                    || policySetName.equals("tuscanyPolicySet_4")) ) {
                fail();
            }
View Full Code Here

Examples of org.apache.tuscany.sca.assembly.OperationsConfigurator

                    List<PolicyHandler> applicablePolicyHandlers = null;
                    for (InvocationChain chain : wire.getInvocationChains() ) {
                        applicablePolicyHandlers = new ArrayList<PolicyHandler>();
                        if ( javaImpl instanceof OperationsConfigurator ) {
                            String operationName = chain.getTargetOperation().getName();
                            OperationsConfigurator opConfigurator = (OperationsConfigurator)component;
                            for ( ConfiguredOperation confOp : opConfigurator.getConfiguredOperations() ) {
                                if ( confOp.getName().equals(operationName)) {
                                    for ( PolicySet policySet : confOp.getPolicySets() ) {
                                        policyHandler = getPolicyHandler(policySet, javaImpl.getPolicyHandlerClassNames());
                                        policyHandler.setUp(javaImpl);
                                        applicablePolicyHandlers.add(policyHandler);
View Full Code Here

Examples of org.apache.tuscany.sca.assembly.OperationsConfigurator

                            policyProcessor.readPolicies(operation, reader);
                        } else {
                            policyProcessor.readPolicies(operation, reader);
                        }
                       
                        OperationsConfigurator opConfigurator = null;
                        if ( compositeService != null ) {
                            opConfigurator = compositeService;
                        } else if ( componentService != null ) {
                            opConfigurator = componentService;
                        } else if ( compositeReference != null ) {
                            opConfigurator = compositeReference;
                        } else if ( componentReference != null ) {
                            opConfigurator = componentReference;
                        }
                       
                        opConfigurator.getConfiguredOperations().add(operation);
                    } else if (IMPLEMENTATION_COMPOSITE_QNAME.equals(name)) {

                        // Read an implementation.composite
                        Composite implementation = assemblyFactory.createComposite();
                        implementation.setName(getQName(reader, NAME));
View Full Code Here

Examples of org.apache.tuscany.sca.assembly.OperationsConfigurator

                           
                            resolvePolicySets(policiedImpl.getPolicySets(), resolver);
                            PolicyValidationUtils.validatePolicySets(policiedImpl);
                           
                            if ( implementation instanceof OperationsConfigurator ) {
                                OperationsConfigurator opsConfigurator = (OperationsConfigurator)implementation;
                                for ( ConfiguredOperation implOp : opsConfigurator.getConfiguredOperations() ) {
                                    resolveIntents(implOp.getRequiredIntents(), resolver);
                                    PolicyValidationUtils.validateIntents(implOp, policiedImpl.getType());
                                   
                                    resolvePolicySets(implOp.getPolicySets(), resolver);
                                    PolicyValidationUtils.validatePolicySets(implOp,
View Full Code Here

Examples of org.apache.tuscany.sca.assembly.OperationsConfigurator

                        addInheritedPolicySets(contract.getApplicablePolicySets(), policiedBinding.getApplicablePolicySets());
                        PolicyValidationUtils.validatePolicySets(policiedBinding);
                    }
                   
                    if (binding instanceof OperationsConfigurator) {
                        OperationsConfigurator opConfigurator = (OperationsConfigurator)binding;
                        for (ConfiguredOperation confOp : opConfigurator.getConfiguredOperations()) {
                            resolveIntents(confOp.getRequiredIntents(), resolver);
                            PolicyValidationUtils.validateIntents(confOp, ((PolicySetAttachPoint)binding).getType());
                           
                            resolvePolicySets(confOp.getPolicySets(), resolver);
                            resolvePolicySets(confOp.getApplicablePolicySets(), resolver);
                            //inherit the applicable policysets from parent binding as whatever applies to that
                            //applies to the binding as well
                            addInheritedPolicySets(((PolicySetAttachPoint)binding).getApplicablePolicySets(),
                                                   confOp.getApplicablePolicySets());
                            PolicyValidationUtils.validatePolicySets(confOp, ((PolicySetAttachPoint)binding).getType());
                        }
                    }
                }
   
                // Resolve callback bindings
                if (contract.getCallback() != null) {
                    resolveIntents(contract.getCallback().getRequiredIntents(), resolver);
                    resolvePolicySets(contract.getCallback().getPolicySets(), resolver);
                    resolvePolicySets(contract.getCallback().getApplicablePolicySets(), resolver);
                    //inherit the contract's policy intents and policysets
                    addInheritedPolicySets(contract.getApplicablePolicySets(), contract.getCallback().getApplicablePolicySets());
                   
                    for (int i = 0, n = contract.getCallback().getBindings().size(); i < n; i++) {
                        Binding binding = contract.getCallback().getBindings().get(i);
                        extensionProcessor.resolve(binding, resolver);
   
                        if (binding instanceof IntentAttachPoint) {
                            IntentAttachPoint policiedBinding = (IntentAttachPoint)binding;
                           
                            if ( policiedBinding.getType().isUnresolved() ) {
                                IntentAttachPointType resolved =
                                    resolver.resolveModel(IntentAttachPointType.class,
                                                          policiedBinding.getType());
                                policiedBinding.setType(resolved);
                            }
                           
                            resolveIntents(policiedBinding.getRequiredIntents(), resolver);
                            PolicyValidationUtils.validateIntents(policiedBinding, policiedBinding.getType());
                        }
                       
                        if (binding instanceof PolicySetAttachPoint) {
                            PolicySetAttachPoint policiedBinding = (PolicySetAttachPoint)binding;
                            resolvePolicySets(policiedBinding.getPolicySets(), resolver);
                            //validate if attached policysets apply to the binding
                            resolvePolicySets(policiedBinding.getApplicablePolicySets(), resolver);
                            //inherit the applicable policysets from parent contract as whatever applies to that
                            //applies to the binding as well
                            addInheritedPolicySets(contract.getApplicablePolicySets(), policiedBinding.getApplicablePolicySets());
                            PolicyValidationUtils.validatePolicySets(policiedBinding);
                        }
                       
                        if (binding instanceof OperationsConfigurator) {
                            OperationsConfigurator opConfigurator = (OperationsConfigurator)binding;
                            for (ConfiguredOperation confOp : opConfigurator.getConfiguredOperations()) {
                                resolveIntents(confOp.getRequiredIntents(), resolver);
                                PolicyValidationUtils.validateIntents(confOp, ((PolicySetAttachPoint)binding).getType());
                               
                                resolvePolicySets(confOp.getPolicySets(), resolver);
                                resolvePolicySets(confOp.getApplicablePolicySets(), resolver);
View Full Code Here

Examples of org.apache.tuscany.sca.assembly.OperationsConfigurator

                            policyProcessor.readPolicies(operation, reader);
                        } else {
                            policyProcessor.readPolicies(operation, reader);
                        }
                       
                        OperationsConfigurator opConfigurator = null;
                        if ( compositeService != null ) {
                            opConfigurator = compositeService;
                        } else if ( componentService != null ) {
                            opConfigurator = componentService;
                        } else if ( compositeReference != null ) {
                            opConfigurator = compositeReference;
                        } else if ( componentReference != null ) {
                            opConfigurator = componentReference;
                        }
                       
                        opConfigurator.getConfiguredOperations().add(operation);
                    } else if (IMPLEMENTATION_COMPOSITE_QNAME.equals(name)) {

                        // Read an implementation.composite
                        Composite implementation = assemblyFactory.createComposite();
                        implementation.setName(getQName(reader, NAME));
View Full Code Here

Examples of org.apache.tuscany.sca.assembly.OperationsConfigurator

                    List<PolicyHandler> applicablePolicyHandlers = null;
                    for (InvocationChain chain : wire.getInvocationChains()) {
                        applicablePolicyHandlers = new ArrayList<PolicyHandler>();
                        if (javaImpl instanceof OperationsConfigurator) {
                            String operationName = chain.getTargetOperation().getName();
                            OperationsConfigurator opConfigurator = (OperationsConfigurator)component;
                            for (ConfiguredOperation confOp : opConfigurator.getConfiguredOperations()) {
                                if (confOp.getName().equals(operationName)) {
                                    for (PolicySet policySet : confOp.getPolicySets()) {
                                        policyHandler =
                                            PolicyHandlerUtils.findPolicyHandler(policySet, javaImpl
                                                .getPolicyHandlerClassNames());
View Full Code Here

Examples of org.apache.tuscany.sca.assembly.OperationsConfigurator

                           
                            resolvePolicySets(policiedImpl.getPolicySets(), resolver);
                            PolicyValidationUtils.validatePolicySets(policiedImpl);
                           
                            if ( implementation instanceof OperationsConfigurator ) {
                                OperationsConfigurator opsConfigurator = (OperationsConfigurator)implementation;
                                for ( ConfiguredOperation implOp : opsConfigurator.getConfiguredOperations() ) {
                                    resolveIntents(implOp.getRequiredIntents(), resolver);
                                    PolicyValidationUtils.validateIntents(implOp, policiedImpl.getType());
                                   
                                    resolvePolicySets(implOp.getPolicySets(), resolver);
                                    PolicyValidationUtils.validatePolicySets(implOp,
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.