Package org.apache.tuscany.sca.assembly

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


    public void start(ExtensionPointRegistry registry) {

        // Create the CRUD implementation factory
        ModelFactoryExtensionPoint factories = registry.getExtensionPoint(ModelFactoryExtensionPoint.class);
        AssemblyFactory assemblyFactory = factories.getFactory(AssemblyFactory.class);
        JavaInterfaceFactory javaFactory = new DefaultJavaInterfaceFactory();
        JavaInterfaceIntrospectorExtensionPoint visitors = registry.getExtensionPoint(JavaInterfaceIntrospectorExtensionPoint.class);
        JavaInterfaceIntrospector introspector = new ExtensibleJavaInterfaceIntrospector(javaFactory, visitors);
        CRUDImplementationFactory crudFactory = new DefaultCRUDImplementationFactory(assemblyFactory, javaFactory, introspector);
View Full Code Here


        // Start the runtime
        runtime.start();
       
        // Create an in-memory domain level composite
        AssemblyFactory assemblyFactory = runtime.getAssemblyFactory();
        domainComposite = assemblyFactory.createComposite();
        domainComposite.setName(new QName(Constants.SCA_NS, "domain"));
        domainComposite.setURI(uri);

        // Create a domain composite helper
        domainCompositeHelper = new DomainCompositeHelper();
View Full Code Here

        }
    }

    private Composite createComposite(String compositeURI) {
        // Create composite model
        AssemblyFactory assemblyFactory = modelFactories.getFactory(AssemblyFactory.class);
        Composite composite = assemblyFactory.createComposite();
        composite.setURI(compositeURI);
        composite.setUnresolved(true);
        return composite;
    }
View Full Code Here

        analyseProblems();

        // Create a top level composite to host our composite
        // This is temporary to make the activator happy
        AssemblyFactory assemblyFactory = runtime.getAssemblyFactory();
        Composite tempComposite = assemblyFactory.createComposite();
        tempComposite.setName(new QName("http://tempuri.org", "temp"));
        tempComposite.setURI("http://tempuri.org");

        // Include the node composite in the top-level composite
        tempComposite.getIncludes().add(composite);
View Full Code Here

        // Start the runtime
        runtime.start();
       
        // Create an in-memory domain level composite
        AssemblyFactory assemblyFactory = runtime.getAssemblyFactory();
        domainComposite = assemblyFactory.createComposite();
        domainComposite.setName(new QName(Constants.SCA10_NS, "domain"));
        domainComposite.setURI(uri);
       
        getCompositeActivator().setDomainComposite(domainComposite);
       
View Full Code Here

        return serviceReference.getService();
    }

    private <B> ServiceReference<B> createServiceReference(Class<B> businessInterface, String targetURI) {
        try {
            AssemblyFactory assemblyFactory = runtime.getAssemblyFactory();
            Composite composite = assemblyFactory.createComposite();
            composite.setName(new QName(Constants.SCA10_TUSCANY_NS, "default"));
            RuntimeComponent component = (RuntimeComponent)assemblyFactory.createComponent();
            component.setName("default");
            component.setURI("default");
            runtime.getCompositeActivator().configureComponentContext(component);
            composite.getComponents().add(component);
            RuntimeComponentReference reference = (RuntimeComponentReference)assemblyFactory.createComponentReference();
            reference.setName("default");
            ModelFactoryExtensionPoint factories =
                runtime.getExtensionPointRegistry().getExtensionPoint(ModelFactoryExtensionPoint.class);
            JavaInterfaceFactory javaInterfaceFactory = factories.getFactory(JavaInterfaceFactory.class);
            InterfaceContract interfaceContract = javaInterfaceFactory.createJavaInterfaceContract();
View Full Code Here

        } catch (URISyntaxException e) {
            throw new ServiceRuntimeException(e);
        }

        // Create an in-memory domain level composite
        AssemblyFactory assemblyFactory = runtime.getAssemblyFactory();
        domainComposite = assemblyFactory.createComposite();
        domainComposite.setName(new QName(Constants.SCA10_NS, "domain"));
        domainComposite.setURI(domainURI);

        //when the deployable composites were specified when initializing the runtime
        if (composites != null && composites.length > 0 && composites[0].length() > 0) {
View Full Code Here

        return serviceReference.getService();
    }

    private <B> ServiceReference<B> createServiceReference(Class<B> businessInterface, String targetURI) {
        try {
            AssemblyFactory assemblyFactory = runtime.getAssemblyFactory();
            Composite composite = assemblyFactory.createComposite();
            composite.setName(new QName(Constants.SCA10_TUSCANY_NS, "default"));
            RuntimeComponent component = (RuntimeComponent)assemblyFactory.createComponent();
            component.setName("default");
            component.setURI("default");
            runtime.getCompositeActivator().configureComponentContext(component);
            composite.getComponents().add(component);
            RuntimeComponentReference reference = (RuntimeComponentReference)assemblyFactory.createComponentReference();
            reference.setName("default");
            ModelFactoryExtensionPoint factories =
                runtime.getExtensionPointRegistry().getExtensionPoint(ModelFactoryExtensionPoint.class);
            JavaInterfaceFactory javaInterfaceFactory = factories.getFactory(JavaInterfaceFactory.class);
            InterfaceContract interfaceContract = javaInterfaceFactory.createJavaInterfaceContract();
View Full Code Here

    }

    public void testRead() throws Exception {
        XMLStreamReader reader = xmlInputFactory.createXMLStreamReader(new StringReader(VALID_XML));

        AssemblyFactory assemblyFactory = new DefaultAssemblyFactory();
        ContributionFactory contributionFactory = new DefaultContributionFactory();
        ContributionMetadataProcessor processor =
            new ContributionMetadataProcessor(assemblyFactory, contributionFactory, null);
        Contribution contribution = contributionFactory.createContribution();
        contribution.setModelResolver(new TestModelResolver(contribution, null));
View Full Code Here

        assertEquals(2, contribution.getDeployables().size());
  }

    public void testReadInvalid() throws Exception {
        XMLStreamReader reader = xmlInputFactory.createXMLStreamReader(new StringReader(INVALID_XML));
        AssemblyFactory assemblyFactory = new DefaultAssemblyFactory();
        ContributionFactory contributionFactory = new DefaultContributionFactory();
        ContributionMetadataProcessor processor =
            new ContributionMetadataProcessor(assemblyFactory, contributionFactory, null);
        Contribution contribution = contributionFactory.createContribution();
        contribution.setModelResolver(new TestModelResolver(contribution, null));
View Full Code Here

TOP

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

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.