Package org.apache.tuscany.sca.definitions.xml

Examples of org.apache.tuscany.sca.definitions.xml.SCADefinitionsDocumentProcessor


        staxProcessors.addArtifactProcessor(compositeProcessor);

        JavaImplementationProcessor javaProcessor = new JavaImplementationProcessor(modelFactories);
        staxProcessors.addArtifactProcessor(javaProcessor)
       
        scaDefnDocProcessor = new SCADefinitionsDocumentProcessor(staxProcessors, staxProcessor, inputFactory, policyFactory);
    }
View Full Code Here


        return domainBuilder;
    }
   
    private SCADefinitions loadSCADefinitions(ExtensionPointRegistry registry) throws ActivationException {
        URLArtifactProcessorExtensionPoint documentProcessors = registry.getExtensionPoint(URLArtifactProcessorExtensionPoint.class);
        SCADefinitionsDocumentProcessor definitionsProcessor = (SCADefinitionsDocumentProcessor)documentProcessors.getProcessor(SCADefinitions.class);
       
        scaDefinitions = new SCADefinitionsImpl();
        try {
            Map<ClassLoader, Set<URL>> scaDefinitionFiles =
            ServiceDiscovery.getInstance().getServiceResources("definitions.xml");
           
            for ( ClassLoader cl : scaDefinitionFiles.keySet() ) {
                for ( URL scaDefnUrl : scaDefinitionFiles.get(cl) ) {
                    SCADefinitions defnSubset = definitionsProcessor.read(null, null, scaDefnUrl);
                    SCADefinitionsUtil.aggregateSCADefinitions(defnSubset, scaDefinitions);
                }
            }
           
            definitionsProcessor.resolve(scaDefinitions, definitionsProcessor.getSCADefinitionsResolver());
        } catch ( ContributionReadException e ) {
            throw new ActivationException(e);
        } catch ( ContributionResolveException e ) {
            throw new ActivationException(e);
        } catch ( IOException e ) {
View Full Code Here

        documentProcessors.addArtifactProcessor(new ConstrainingTypeDocumentProcessor(staxProcessor, validatingInputFactory));

        // Create and register document processor for definitions.xml
        //TODO No XMLSchema validation for definitions.xml for now
        // as the XSD for it is not quite right yet
        SCADefinitionsDocumentProcessor definitionsDocumentProcessor =
            new SCADefinitionsDocumentProcessor(staxProcessors, staxProcessor, inputFactory, policyFactory);
        documentProcessors.addArtifactProcessor(definitionsDocumentProcessor);
        ModelResolver domainModelResolver = definitionsDocumentProcessor.getSCADefinitionsResolver();

        // Create Model Resolver extension point
        ModelResolverExtensionPoint modelResolvers = registry.getExtensionPoint(ModelResolverExtensionPoint.class);

        // Create contribution package processor extension point
View Full Code Here

        // Create Stax processors
        DefaultStAXArtifactProcessorExtensionPoint staxProcessors = new DefaultStAXArtifactProcessorExtensionPoint(new DefaultModelFactoryExtensionPoint());
        ExtensibleStAXArtifactProcessor staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, XMLInputFactory.newInstance(), XMLOutputFactory.newInstance());
        staxProcessors.addArtifactProcessor(new MockPolicyProcessor());
       
        scaDefnDocProcessor = new SCADefinitionsDocumentProcessor(staxProcessors,
                                                                  staxProcessor,
                                                                  inputFactory,
                                                                  policyFactory);
       
        URL url = getClass().getResource("test_definitions.xml");
View Full Code Here

    }
   
    private void  loadSCADefinitions(ExtensionPointRegistry registry) throws ActivationException {
        try {
            URLArtifactProcessorExtensionPoint documentProcessors = registry.getExtensionPoint(URLArtifactProcessorExtensionPoint.class);
            SCADefinitionsDocumentProcessor definitionsProcessor = (SCADefinitionsDocumentProcessor)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);
            }
           
            //we cannot expect that providers will add the intents and policysets into the resolver
            //so we do this here explicitly
            for ( Intent intent : systemSCADefinitions.getPolicyIntents() ) {
                definitionsProcessor.getSCADefinitionsResolver().addModel(intent);
            }
           
            for ( PolicySet policySet : systemSCADefinitions.getPolicySets() ) {
                definitionsProcessor.getSCADefinitionsResolver().addModel(policySet);
            }
           
            for ( IntentAttachPointType attachPoinType : systemSCADefinitions.getBindingTypes() ) {
                definitionsProcessor.getSCADefinitionsResolver().addModel(attachPoinType);
            }
           
            for ( IntentAttachPointType attachPoinType : systemSCADefinitions.getImplementationTypes() ) {
                definitionsProcessor.getSCADefinitionsResolver().addModel(attachPoinType);
            }
           
            //now that all system sca definitions have been read, lets resolve them rightaway
            definitionsProcessor.resolve(systemSCADefinitions,
                                         definitionsProcessor.getSCADefinitionsResolver());
        } catch ( Exception e ) {
            throw new ActivationException(e);
        }
       
        /*URLArtifactProcessorExtensionPoint documentProcessors = registry.getExtensionPoint(URLArtifactProcessorExtensionPoint.class);
View Full Code Here

        documentProcessors.addArtifactProcessor(new ConstrainingTypeDocumentProcessor(staxProcessor, validatingInputFactory));

        // Create and register document processor for definitions.xml
        //TODO No XMLSchema validation for definitions.xml for now
        // as the XSD for it is not quite right yet
        SCADefinitionsDocumentProcessor definitionsDocumentProcessor =
            new SCADefinitionsDocumentProcessor(staxProcessors, staxProcessor, inputFactory, policyFactory);
        documentProcessors.addArtifactProcessor(definitionsDocumentProcessor);
        ModelResolver domainModelResolver = definitionsDocumentProcessor.getSCADefinitionsResolver();

        // Create Model Resolver extension point
        ModelResolverExtensionPoint modelResolvers = registry.getExtensionPoint(ModelResolverExtensionPoint.class);

        // Create contribution package processor extension point
View Full Code Here

       
        // Create document processors
        documentProcessors.addArtifactProcessor(new CompositeDocumentProcessor(staxProcessor, inputFactory, scaDefnSink));
        documentProcessors.addArtifactProcessor(new ComponentTypeDocumentProcessor(staxProcessor, inputFactory));
        documentProcessors.addArtifactProcessor(new ConstrainingTypeDocumentProcessor(staxProcessor, inputFactory));
        scaDefnDocProcessor = new SCADefinitionsDocumentProcessor(staxProcessors, staxProcessor, inputFactory, policyFactory);
        documentProcessors.addArtifactProcessor(scaDefnDocProcessor);
       
        URL url = getClass().getResource("CalculatorComponent.constrainingType");
        URI uri = URI.create("CalculatorComponent.constrainingType");
        ConstrainingType constrainingType = (ConstrainingType)documentProcessor.read(null, uri, url);
View Full Code Here

        assemblyFactory = new DefaultAssemblyFactory();
        scaBindingFactory = new TestSCABindingFactoryImpl();
        policyFactory = new DefaultPolicyFactory();
        mapper = new InterfaceContractMapperImpl();
       
        scaDefnDocProcessor = new SCADefinitionsDocumentProcessor(staxProcessors, staxProcessor, inputFactory, policyFactory);
       
    }
View Full Code Here

        staxProcessors.addArtifactProcessor(new CompositeProcessor(new DefaultContributionFactory(), assemblyFactory, policyFactory, staxProcessor));
        staxProcessors.addArtifactProcessor(new ComponentTypeProcessor(assemblyFactory, policyFactory, staxProcessor));
        staxProcessors.addArtifactProcessor(new ConstrainingTypeProcessor(assemblyFactory, policyFactory, staxProcessor));
        staxProcessors.addArtifactProcessor(new WSPolicyProcessor());
        resolver = new TestModelResolver();
        scaDefnDocProcessor = new SCADefinitionsDocumentProcessor(staxProcessors, staxProcessor, XMLInputFactory.newInstance(), policyFactory);
    }
View Full Code Here

        staxProcessors.addArtifactProcessor(compositeProcessor);

        JavaImplementationProcessor javaProcessor = new JavaImplementationProcessor(modelFactories);
        staxProcessors.addArtifactProcessor(javaProcessor)
       
        scaDefnDocProcessor = new SCADefinitionsDocumentProcessor(staxProcessors, staxProcessor, inputFactory, policyFactory);
    }
View Full Code Here

TOP

Related Classes of org.apache.tuscany.sca.definitions.xml.SCADefinitionsDocumentProcessor

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.