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

Examples of org.apache.tuscany.core.system.assembly.impl.SystemAssemblyFactoryImpl


    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


     * @param classLoader the classloader to use for application artifacts
     * @return a default AssemblyModelContext
     */
    public static AssemblyContext getModelContext(ClassLoader classLoader) {
        // Create an assembly model factory
        AssemblyFactory modelFactory = new SystemAssemblyFactoryImpl();

        // Create a default assembly model loader
        AssemblyModelLoader modelLoader = new SCDLAssemblyModelLoaderImpl();

        // Create a resource loader from the supplied classloader
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

        Assert.assertSame(system.getContext("TestService1EP").getInstance(null), system.resolveInstance(ModuleScopeSystemComponent.class));
    }

    protected void setUp() throws Exception {
        super.setUp();
        factory = new SystemAssemblyFactoryImpl();
        List<ContextFactoryBuilder> builders = MockFactory.createSystemBuilders();

        system = new SystemCompositeContextImpl("system", null, null, new SystemScopeStrategy(), new EventContextImpl(), new MockConfigContext(builders));
    }
View Full Code Here

        return new CompositeContextImpl("test.context", null, new DefaultScopeStrategy(), new EventContextImpl(),
                new MockConfigContext(builders));
    }

    protected void setUp() throws Exception {
        factory = new SystemAssemblyFactoryImpl();
        super.setUp();
    }
View Full Code Here

    protected abstract CompositeContext createContextHierachy() throws Exception;

    protected void setUp() throws Exception {
        super.setUp();
        factory = new SystemAssemblyFactoryImpl();
        builders = MockFactory.createSystemBuilders();
    }
View Full Code Here

    }


    protected void setUp() throws Exception {
        super.setUp();
        factory = new SystemAssemblyFactoryImpl();
        introspector = ProcessorUtils.createCoreIntrospector(factory);
    }
View Full Code Here

        }
    };

    protected void setUp() throws Exception {
        super.setUp();
        assemblyFactory = new SystemAssemblyFactoryImpl();
        resourceLoader = new ResourceLoaderImpl(getClass().getClassLoader());
        loaderContext = new LoaderContext(resourceLoader);
        modelContext = new AssemblyContextImpl(assemblyFactory, null, resourceLoader);
        xmlFactory = XMLInputFactory.newInstance();
        registry = new StAXLoaderRegistryImpl();
View Full Code Here

    protected void setUp() throws Exception {
        super.setUp();
        monitorFactory = new NullMonitorFactory();
        builderRegistry = BootstrapHelper.bootstrapContextFactoryBuilders(monitorFactory);
        factory = new SystemAssemblyFactoryImpl();

        runtime = new RuntimeContextImpl(monitorFactory, builderRegistry, null);
        runtime.start();
    }
View Full Code Here

        }
    };

    protected void setUp() throws Exception {
        super.setUp();
        assemblyFactory = new SystemAssemblyFactoryImpl();
        resourceLoader = new ResourceLoaderImpl(getClass().getClassLoader());
        loaderContext = new LoaderContext(resourceLoader);
        modelContext = new AssemblyContextImpl(assemblyFactory, null, resourceLoader);
        xmlFactory = XMLInputFactory.newInstance();
        registry = new StAXLoaderRegistryImpl();
View Full Code Here

TOP

Related Classes of org.apache.tuscany.core.system.assembly.impl.SystemAssemblyFactoryImpl

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.