Package org.apache.tuscany.model.assembly

Examples of org.apache.tuscany.model.assembly.Module


        cref.setPort(ref);
        cref.initialize(assemblyContext);
        sourceEP.setConfiguredReference(cref);
        sourceEP.initialize(assemblyContext);

        Module module = factory.createModule();
        module.setName("test.module");
        module.getEntryPoints().add(sourceEP);
        module.getExternalServices().add(targetES);
        module.initialize(assemblyContext);
        return module;
    }
View Full Code Here


        cReference4.initialize(assemblyContext);
        source.getConfiguredReferences().add(cReference4);

        source.initialize(assemblyContext);

        Module module = systemFactory.createModule();
        module.setName("system.module");

        module.getComponents().add(source);
        module.getComponents().add(target);
        module.initialize(assemblyContext);
        return module;
    }
View Full Code Here

        cReference4.initialize(assemblyContext);
        source.getConfiguredReferences().add(cReference4);

        source.initialize(assemblyContext);

        Module module = systemFactory.createModule();
        module.setName("system.module");

        module.getComponents().add(source);
        module.getComponents().add(target);
        module.initialize(assemblyContext);
        return module;
    }
View Full Code Here

    private ModuleComponent createAppModuleComponent(String name) throws ConfigurationLoadException {
        AssemblyContext assemblyContext = new AssemblyContextImpl(systemFactory, null, null);
        ModuleComponent mc = systemFactory.createModuleComponent();
        mc.setName(name);
        Module module = systemFactory.createModule();
        module.setImplementationClass(CompositeContextImpl.class);
        module.setComponentType(MockFactory.getComponentType());
        module.setName(name);
        module.initialize(assemblyContext);
        mc.setImplementation(module);
        return mc;
    }
View Full Code Here

public class JavaIntegrationTestCase extends TestCase {
    private JavaAssemblyFactory factory;
    private RuntimeContext runtime;

    public void testModuleWithOneComponent() throws Exception {
        Module module = factory.createModule();
        ModuleComponent moduleComponent = factory.createModuleComponent();
        moduleComponent.setImplementation(module);

//        runtime.registerModelObject(moduleComponent);
    }
View Full Code Here

    }

    public ModuleComponent loadModuleComponent(String name, String uri, URL moduleUri, Collection<URL> moduleFragmentUris) throws ConfigurationLoadException {

        // Load the module file
        Module module=loadModule(moduleUri);
        // Load the sca.fragment files
        if (moduleFragmentUris!=null) {
            for (URL moduleFragmentUri : moduleFragmentUris) {
                ModuleFragment moduleFragment=loadModuleFragment(moduleFragmentUri);
                module.getModuleFragments().add(moduleFragment);
            }
        }

        // Create the module component
        ModuleComponent moduleComponent=assemblyFactory.createModuleComponent();
View Full Code Here

public class CompositeContextRegisterTestCase extends TestCase {
    private SystemAssemblyFactory factory;

    public void testModuleRegistration() throws Exception {
        CompositeContext moduleContext = createContext();
        Module module = MockFactory.createSystemModule();
        moduleContext.registerModelObject(module);
        moduleContext.start();
        moduleContext.publish(new ModuleStart(this));
        GenericSystemComponent component = (GenericSystemComponent) moduleContext.getContext("TestService1").getInstance(null);
        Assert.assertNotNull(component);
View Full Code Here

    }

    public void testModuleRegistrationAfterStart() throws Exception {
        CompositeContext moduleContext = createContext();
        moduleContext.start();
        Module module = MockFactory.createSystemModule();
        moduleContext.registerModelObject(module);
        moduleContext.publish(new ModuleStart(this));
        GenericSystemComponent component = (GenericSystemComponent) moduleContext.getContext("TestService1").getInstance(null);
        Assert.assertNotNull(component);
        GenericSystemComponent ep = (GenericSystemComponent) moduleContext.getContext("TestService1EP").getInstance(null);
View Full Code Here

        try {
            fields = JavaIntrospectionHelper.getAllFields(implClass);
            methods = JavaIntrospectionHelper.getAllUniqueMethods(implClass);
            String name = component.getName();
            if (componentImplementation instanceof Module) {
                Module module = (Module) componentImplementation;
                contextFactory = new SystemContextFactory(name, module, JavaIntrospectionHelper.getDefaultConstructor(implClass), scope);

            } else {
                contextFactory = new SystemContextFactory(name, JavaIntrospectionHelper.getDefaultConstructor(implClass), scope);
            }
View Full Code Here

 
    public void testWireConstruction2() throws Exception {
        RuntimeContext runtime = MockFactory.createCoreRuntime();
        ModuleComponent moduleComponent = createSystemCompositeComponent("test.system");
        Module module = MockFactory.createSystemModuleWithWiredComponents("system.module",Scope.MODULE, Scope.MODULE);
        moduleComponent.setImplementation(module);
        runtime.getSystemContext().registerModelObject(moduleComponent);
        CompositeContext context = (CompositeContext) runtime.getSystemContext().getContext("test.system");
        context.publish(new ModuleStart(this));
        //context.registerModelObject(module);
View Full Code Here

TOP

Related Classes of org.apache.tuscany.model.assembly.Module

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.