Package org.apache.tuscany.sca.assembly

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


        return dependentContributions;
    }

    public String start(String contributionURI, Reader compositeXML) throws ContributionReadException, XMLStreamException, ActivationException, ValidationException {
        Monitor monitor = deployer.createMonitor();
        Composite composite = deployer.loadXMLDocument(compositeXML, monitor);
        monitor.analyzeProblems();
        return start(contributionURI, composite);
    }
View Full Code Here


                            if (compositeName == null) {
                                error(context.getMonitor(), "AttributeCompositeMissing", reader);
                                //throw new ContributionReadException("Attribute 'composite' is missing");
                            } else {
                                if (contribution != null) {
                                    Composite composite = assemblyFactory.createComposite();
                                    composite.setName(compositeName);
                                    composite.setUnresolved(true);
                                    contribution.getDeployables().add(composite);
                                }
                            }
                        } else {
View Full Code Here

        }

        // Resolve deployable composites
        List<Composite> deployables = contribution.getDeployables();
        for (int i = 0, n = deployables.size(); i < n; i++) {
            Composite deployable = deployables.get(i);
            Composite resolved = (Composite)resolver.resolveModel(Composite.class, deployable, context);
            if (resolved != deployable) {
                deployables.set(i, resolved);
            }
        }
View Full Code Here

   
    @Test
    public void testReadComposite() throws Exception {
        InputStream is = getClass().getResourceAsStream("Calculator.composite");
        XMLStreamReader reader = inputFactory.createXMLStreamReader(is);
        Composite composite = (Composite)staxProcessor.read(reader, context);
        assertNotNull(composite);
    }
View Full Code Here

   
    @Test
    public void testReadPolicies() throws Exception {
        InputStream is = getClass().getResourceAsStream("PoliciedCalculator.composite");
        XMLStreamReader reader = inputFactory.createXMLStreamReader(is);
        Composite composite = (Composite)staxProcessor.read(reader, context);
        assertNotNull(composite);
    }
View Full Code Here

    }

    @Test
    public void testReadWriteComposite() throws Exception {
        InputStream is = getClass().getResourceAsStream("Calculator.composite");
        Composite composite = (Composite)staxProcessor.read(inputFactory.createXMLStreamReader(is), context);
        assertNotNull(composite);
        ByteArrayOutputStream bos = new ByteArrayOutputStream();
        staxProcessor.write(composite, outputFactory.createXMLStreamWriter(bos), context);
        System.out.println(bos.toString());
    }
View Full Code Here

    private boolean attachDeploymentComposite(Contribution contribution, Reader xml, String location, boolean attached, ProcessorContext context)
        throws XMLStreamException, ContributionReadException {

        // Read the composite model
        Composite composite = deployer.loadXMLDocument(xml, context.getMonitor());

        // Replace the deployable composites with the deployment composites
        // Clear the deployable composites if it's the first deployment composite
        deployer.attachDeploymentComposite(contribution, composite, attached);
        if (!attached) {
View Full Code Here

        for (BindingConfiguration config : configuration.getBindings()) {
            bindingBaseURIs.put(config.getBindingType(), config.getBaseURIs());
        }
        List<Contribution> allContributions = getAllContributions(configuration.getDomainURI());
       
        Composite domainComposite = deployer.build(contributions, allContributions, bindingBaseURIs, monitor);
        analyzeProblems(monitor);
       
        // postBuildEndpointReferenceMatching(domainComposite);
       
        return domainComposite;
View Full Code Here

                    Reader xml = new StringReader(dc.getContent());
                    attached = attachDeploymentComposite(contribution, xml, null, attached, context);
                } else if (dc.getLocation() != null) {
                    URI dcURI = createURI(dc.getLocation());
                    if (!dcURI.isAbsolute()) {
                        Composite composite = null;
                        // The location is pointing to an artifact within the contribution
                        for (Artifact a : contribution.getArtifacts()) {
                            if (dcURI.toString().equals(a.getURI())) {
                                composite = (Composite)a.getModel();
                                if (!attached) {
View Full Code Here

        TestUtils.checkProblems(customBuilder);
        checkScenario2and3Results("http://scenario2", true);
    }
   
    private void checkScenario2and3Results(String namespace, boolean nonWiring) {
        Composite domainComposite = customBuilder.getDomainComposite();
       
        // Test that endpoint structure matches expected
        String structure = TestUtils.printStructure(domainComposite, "");
        System.out.println(structure);
       
View Full Code Here

TOP

Related Classes of org.apache.tuscany.sca.assembly.Composite

Copyright © 2018 www.massapicom. 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.