Examples of SCADefinitions


Examples of org.apache.tuscany.sca.definitions.SCADefinitions

    public void fixmeTestPolicyIntents() throws Exception {
        ModelResolver resolver = new TestModelResolver(getClass().getClassLoader());
       
        URL url = getClass().getResource("definitions.xml");
        URI uri = URI.create("definitions.xml");
        SCADefinitions scaDefns = policyDefinitionsProcessor.read(null, uri, url);
               
        InputStream is = getClass().getResourceAsStream("Calculator.composite");
        XMLStreamReader reader = inputFactory.createXMLStreamReader(is);
        Composite composite = (Composite)staxProcessor.read(reader);
        assertNotNull(composite);
View Full Code Here

Examples of org.apache.tuscany.sca.definitions.SCADefinitions

    public void testPolicySets() throws Exception {
        ModelResolver resolver = new TestModelResolver(getClass().getClassLoader());
       
        URL url = getClass().getResource("definitions_with_policysets.xml");
        URI uri = URI.create("definitions_with_policysets.xml");
        SCADefinitions policyDefinitions = policyDefinitionsProcessor.read(null, uri, url);
               
        InputStream is = getClass().getResourceAsStream("Calculator.composite");
        XMLStreamReader reader = inputFactory.createXMLStreamReader(is);
        Composite composite = (Composite)staxProcessor.read(reader);
        assertNotNull(composite);
       
        for ( Component component : composite.getComponents() ) {
            for ( PolicySet policySet : policyDefinitions.getPolicySets() ) {
                component.getApplicablePolicySets().add(policySet);
            }
        }
       
        staxProcessor.resolve(policyDefinitions, resolver);
View Full Code Here

Examples of org.apache.tuscany.sca.definitions.SCADefinitions

        InterfaceContractMapper mapper = utilities.getUtility(InterfaceContractMapper.class);
        DocumentBuilderFactory documentBuilderFactory = factories.getFactory(DocumentBuilderFactory.class);
        TransformerFactory transformerFactory = factories.getFactory(TransformerFactory.class);
       
        //Create a composite builder
        SCADefinitions aggregatedDefinitions = new SCADefinitionsImpl();
        for ( SCADefinitions definition : ((List<SCADefinitions>)policyDefinitions) ) {
            SCADefinitionsUtil.aggregateSCADefinitions(definition, aggregatedDefinitions);
        }
        compositeBuilder = ReallySmallRuntimeBuilder.createCompositeBuilder(monitor,
                                                                            assemblyFactory,
View Full Code Here

Examples of org.apache.tuscany.sca.definitions.SCADefinitions

        try {
            URLArtifactProcessorExtensionPoint documentProcessors = registry.getExtensionPoint(URLArtifactProcessorExtensionPoint.class);
            URLArtifactProcessor<SCADefinitions> definitionsProcessor = documentProcessors.getProcessor(SCADefinitions.class);
            SCADefinitionsProviderExtensionPoint scaDefnProviders = registry.getExtensionPoint(SCADefinitionsProviderExtensionPoint.class);
           
            SCADefinitions systemSCADefinitions = new SCADefinitionsImpl();
            SCADefinitions aSCADefn = null;
            for ( SCADefinitionsProvider aProvider : scaDefnProviders.getSCADefinitionsProviders() ) {
               aSCADefn = aProvider.getSCADefinition();
               SCADefinitionsUtil.aggregateSCADefinitions(aSCADefn, systemSCADefinitions);
            }
           
View Full Code Here

Examples of org.apache.tuscany.sca.definitions.SCADefinitions

        TransformerFactory transformerFactory = factories.getFactory(TransformerFactory.class);
        UtilityExtensionPoint utilities = registry.getExtensionPoint(UtilityExtensionPoint.class);
        InterfaceContractMapper mapper = utilities.getUtility(InterfaceContractMapper.class);

        //Create a composite builder
        SCADefinitions aggregatedDefinitions = new SCADefinitionsImpl();
        for (SCADefinitions definition : ((List<SCADefinitions>)policyDefinitions)) {
            SCADefinitionsUtil.aggregateSCADefinitions(definition, aggregatedDefinitions);
        }
        compositeBuilder =
            RuntimeBuilder.createCompositeBuilder(monitor,
View Full Code Here

Examples of org.apache.tuscany.sca.definitions.SCADefinitions

            URLArtifactProcessor<SCADefinitions> definitionsProcessor =
                documentProcessors.getProcessor(SCADefinitions.class);
            SCADefinitionsProviderExtensionPoint scaDefnProviders =
                registry.getExtensionPoint(SCADefinitionsProviderExtensionPoint.class);

            SCADefinitions systemSCADefinitions = new SCADefinitionsImpl();
            SCADefinitions aSCADefn = null;
            for (SCADefinitionsProvider aProvider : scaDefnProviders.getSCADefinitionsProviders()) {
                aSCADefn = aProvider.getSCADefinition();
                SCADefinitionsUtil.aggregateSCADefinitions(aSCADefn, systemSCADefinitions);
            }
View Full Code Here

Examples of org.apache.tuscany.sca.definitions.SCADefinitions

        // Add policy definitions to the list of policy definitions
        if (model instanceof SCADefinitions) {
            policyDefinitions.add((SCADefinitions)model);

            SCADefinitions definitions = (SCADefinitions)model;
            for (Intent intent : definitions.getPolicyIntents() ) {
                policyDefinitionsResolver.addModel(intent);
            }

            for (PolicySet policySet : definitions.getPolicySets() ) {
                policyDefinitionsResolver.addModel(policySet);
            }

            for (IntentAttachPointType attachPointType : definitions.getBindingTypes() ) {
                policyDefinitionsResolver.addModel(attachPointType);
            }

            for (IntentAttachPointType attachPointType : definitions.getImplementationTypes() ) {
                policyDefinitionsResolver.addModel(attachPointType);
            }
            for (Object binding : definitions.getBindings() ) {
                policyDefinitionsResolver.addModel(binding);
            }
        }
    }
View Full Code Here

Examples of org.apache.tuscany.sca.definitions.SCADefinitions

        InputStream is = getClass().getResourceAsStream("TestAllCalculator.composite");
        Composite composite = staxProcessor.read(is, Composite.class);
       
        URL url = getClass().getResource("test_definitions.xml");
        URI uri = URI.create("test_definitions.xml");
        SCADefinitions scaDefns = (SCADefinitions)policyDefinitionsProcessor.read(null, uri, url);
        assertNotNull(scaDefns);
        policyDefinitionsProcessor.resolve(scaDefns, resolver);
       
        staxProcessor.resolve(composite, resolver);
        compositeBuilder.build(composite);
View Full Code Here

Examples of org.apache.tuscany.sca.definitions.SCADefinitions

        is.close();
        assertNotNull(composite);
       
        URL url = getClass().getResource("test_definitions.xml");
        URI uri = URI.create("test_definitions.xml");
        SCADefinitions scaDefns = (SCADefinitions)policyDefinitionsProcessor.read(null, uri, url);
        assertNotNull(scaDefns);
       
        policyDefinitionsProcessor.resolve(scaDefns, resolver);
       
        staxProcessor.resolve(composite, resolver);
View Full Code Here

Examples of org.apache.tuscany.sca.definitions.SCADefinitions

        Composite composite = (Composite)staxProcessor.read(reader);
        is.close();
       
        URL url = getClass().getResource("test_definitions.xml");
        URI uri = URI.create("test_definitions.xml");
        SCADefinitions scaDefns = (SCADefinitions)policyDefinitionsProcessor.read(null, uri, url);
        assertNotNull(scaDefns);
       
        policyDefinitionsProcessor.resolve(scaDefns, resolver);
       
        staxProcessor.resolve(composite, resolver);
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.