Package org.apache.tuscany.core.system.assembly

Examples of org.apache.tuscany.core.system.assembly.SystemAssemblyFactory


    public static OverrideOption overrideOption(String overrideOption, OverrideOption def) {
        return overrideOption == null ? def : OVERRIDE_OPTIONS.get(overrideOption);
    }

    public static ModuleComponent bootstrapLoader(String name, AssemblyContext context) throws ConfigurationLoadException {
        SystemAssemblyFactory factory = new SystemAssemblyFactoryImpl();
        ComponentTypeIntrospector introspector = ProcessorUtils.createCoreIntrospector(factory);
        Module module = factory.createModule();
        module.setName("org.apache.tuscany.core.system.loader");

        List<Component> components = module.getComponents();

        // bootstrap the minimal set of loaders needed to read the system module files
        // all others should be defined in the system.module file
        components.add(bootstrapLoader(factory, introspector, ModuleLoader.class));
        components.add(bootstrapLoader(factory, introspector, ModuleFragmentLoader.class));
        Component propFactory = factory.createSystemComponent("org.apache.tuscany.core.system.loader.DefaultPropertyFactory", StAXPropertyFactory.class, StringParserPropertyFactory.class, Scope.MODULE);
        introspector.introspect(StAXPropertyFactory.class);
        components.add(propFactory);
        components.add(bootstrapLoader(factory, introspector, ComponentLoader.class));
        components.add(bootstrapLoader(factory, introspector, EntryPointLoader.class));
        components.add(bootstrapLoader(factory, introspector, InterfaceJavaLoader.class));
        components.add(bootstrapLoader(factory, introspector, SystemImplementationLoader.class));
        components.add(bootstrapLoader(factory, introspector, SystemBindingLoader.class));
        // do not add additional loaders above - they should be in the system.module file

        // bootstrap the registries needed by the bootstrap loaders above
        bootstrapService(factory, introspector, module, StAXLoaderRegistry.class, StAXLoaderRegistryImpl.class);
        bootstrapService(factory, introspector, module, SystemAssemblyFactory.class, SystemAssemblyFactoryImpl.class);
        bootstrapService(factory, introspector, module, ComponentTypeIntrospector.class, Java5ComponentTypeIntrospector.class);

        ModuleComponent mc = factory.createModuleComponent();
        mc.setName(name);
        mc.setImplementation(module);
        mc.initialize(context);
        return mc;
    }
View Full Code Here


        assertSame(MONITOR2, instance.monitor2);
    }

    protected void setUp() throws Exception {
        super.setUp();
        SystemAssemblyFactory factory = new SystemAssemblyFactoryImpl();
        MockMonitorFactory monitorFactory = new MockMonitorFactory();
        builder = new SystemContextFactoryBuilder(monitorFactory);
        component = factory.createSystemComponent("test", TestService.class, TestComponent.class, Scope.MODULE);
        component.getImplementation().setComponentType(MockFactory.getIntrospector().introspect(TestComponent.class));
    }
View Full Code Here

TOP

Related Classes of org.apache.tuscany.core.system.assembly.SystemAssemblyFactory

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.