Package org.apache.tuscany.core.config

Examples of org.apache.tuscany.core.config.ComponentTypeIntrospector


        ca[1] = MockFactory.createComponent("TestServiceInitOnly", ModuleScopeInitOnlyComponent.class,
                Scope.MODULE);
        ca[2] = MockFactory.createComponent("TestServiceDestroyOnly", ModuleScopeDestroyOnlyComponent.class,
                Scope.MODULE);
        List<ContextFactory<Context>> configs = new ArrayList<ContextFactory<Context>>();
        ComponentTypeIntrospector introspector = MockFactory.getIntrospector();
        ca[0].getImplementation().setComponentType(introspector.introspect(ModuleScopeInitDestroyComponent.class));
        ca[1].getImplementation().setComponentType(introspector.introspect(ModuleScopeInitOnlyComponent.class));
        ca[2].getImplementation().setComponentType(introspector.introspect(ModuleScopeDestroyOnlyComponent.class));
        for (AtomicComponent aCa : ca) {
            builder.build(aCa);
            configs.add((ContextFactory<Context>) aCa.getContextFactory());

        }
View Full Code Here


        ca[0] = MockFactory.createComponent("TestServiceEagerInitDestroy", ModuleScopeEagerInitDestroyComponent.class,
                Scope.MODULE);
        ca[1] = MockFactory.createComponent("TestServiceEagerInit", ModuleScopeEagerInitComponent.class,
                Scope.MODULE);
        List<ContextFactory<Context>> configs = new ArrayList<ContextFactory<Context>>();
        ComponentTypeIntrospector introspector = MockFactory.getIntrospector();
        ComponentType type = introspector.introspect(OrderedInitPojo.class);
        ca[0].getImplementation().setComponentType(introspector.introspect(ModuleScopeEagerInitDestroyComponent.class));
        ca[1].getImplementation().setComponentType(introspector.introspect(ModuleScopeEagerInitComponent.class));
        for (AtomicComponent aCa : ca) {
            builder.build(aCa);
            configs.add((ContextFactory<Context>) aCa.getContextFactory());
        }
        return configs;
View Full Code Here

        AtomicComponent[] ca = new AtomicComponent[3];
        ca[0] = MockFactory.createComponent("one", OrderedInitPojo.class, Scope.MODULE);
        ca[1] = MockFactory.createComponent("two", OrderedInitPojo.class, Scope.MODULE);
        ca[2] = MockFactory.createComponent("three", OrderedInitPojo.class, Scope.MODULE);
        List<ContextFactory<Context>> configs = new ArrayList<ContextFactory<Context>>();
        ComponentTypeIntrospector introspector = MockFactory.getIntrospector();
        ComponentType type = introspector.introspect(OrderedInitPojo.class);
        ca[0].getImplementation().setComponentType(type);
        ca[1].getImplementation().setComponentType(type);
        ca[2].getImplementation().setComponentType(type);
        for (AtomicComponent aCa : ca) {
            builder.build(aCa);
View Full Code Here

            BuilderException, ConfigurationLoadException {
        AtomicComponent[] ca = new AtomicComponent[3];
        ca[0] = MockFactory.createComponent("one", OrderedEagerInitPojo.class, Scope.MODULE);
        ca[1] = MockFactory.createComponent("two", OrderedEagerInitPojo.class, Scope.MODULE);
        ca[2] = MockFactory.createComponent("three", OrderedEagerInitPojo.class, Scope.MODULE);
        ComponentTypeIntrospector introspector = MockFactory.getIntrospector();
        ComponentType type = introspector.introspect(OrderedEagerInitPojo.class);
        ca[0].getImplementation().setComponentType(type);
        ca[1].getImplementation().setComponentType(type);
        ca[2].getImplementation().setComponentType(type);
        List<ContextFactory<Context>> configs = new ArrayList<ContextFactory<Context>>();
        for (AtomicComponent aCa : ca) {
View Full Code Here

        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));
View Full Code Here

    private List<ContextFactory<Context>> createConfigurations() throws BuilderException, ConfigurationLoadException {
        WireFactoryService wireService = new DefaultWireFactoryService(new MessageFactoryImpl(), new JDKWireFactoryFactory(), new DefaultPolicyBuilderRegistry());
        JavaContextFactoryBuilder builder = new JavaContextFactoryBuilder(wireService);
        AtomicComponent component = MockFactory.createComponent("TestService1", SessionScopeComponentImpl.class, Scope.SESSION);
        ComponentTypeIntrospector introspector = MockFactory.getIntrospector();
        ComponentType type = introspector.introspect(SessionScopeComponentImpl.class);
        component.getImplementation().setComponentType(type);
        builder.build(component);
        List<ContextFactory<Context>> configs = new ArrayList<ContextFactory<Context>>();
        configs.add((ContextFactory<Context>) component.getContextFactory());
        return configs;
View Full Code Here

    private ContextFactory<Context> createConfiguration(String name) throws BuilderException, ConfigurationLoadException {
        WireFactoryService wireService = new DefaultWireFactoryService(new MessageFactoryImpl(), new JDKWireFactoryFactory(), new DefaultPolicyBuilderRegistry());
        JavaContextFactoryBuilder builder = new JavaContextFactoryBuilder(wireService);
        AtomicComponent component = MockFactory.createComponent(name, SessionScopeInitDestroyComponent.class, Scope.SESSION);
        ComponentTypeIntrospector introspector = MockFactory.getIntrospector();
        ComponentType type = introspector.introspect(SessionScopeInitDestroyComponent.class);
        component.getImplementation().setComponentType(type);
        builder.build(component);
        return (ContextFactory<Context>) component.getContextFactory();
    }
View Full Code Here

        ca[0] = MockFactory.createComponent("TestServiceInitDestroy", SessionScopeInitDestroyComponent.class,
                Scope.SESSION);
        ca[1] = MockFactory.createComponent("TestServiceInitOnly", SessionScopeInitOnlyComponent.class, Scope.SESSION);
        ca[2] = MockFactory.createComponent("TestServiceDestroyOnly", SessionScopeDestroyOnlyComponent.class,
                Scope.SESSION);
        ComponentTypeIntrospector introspector = MockFactory.getIntrospector();
        ca[0].getImplementation().setComponentType(introspector.introspect(SessionScopeInitDestroyComponent.class));
        ca[1].getImplementation().setComponentType(introspector.introspect(SessionScopeInitOnlyComponent.class));
        ca[2].getImplementation().setComponentType(introspector.introspect(SessionScopeDestroyOnlyComponent.class));
        List<ContextFactory<Context>> configs = new ArrayList<ContextFactory<Context>>();
        for (AtomicComponent aCa : ca) {
            builder.build(aCa);
            configs.add((ContextFactory<Context>) aCa.getContextFactory());
View Full Code Here

            BuilderException, ConfigurationLoadException {
        AtomicComponent[] ca = new AtomicComponent[3];
        ca[0] = MockFactory.createComponent("one", SessionScopedOrderedInitPojo.class, Scope.SESSION);
        ca[1] = MockFactory.createComponent("two", SessionScopedOrderedInitPojo.class, Scope.SESSION);
        ca[2] = MockFactory.createComponent("three", SessionScopedOrderedInitPojo.class, Scope.SESSION);
        ComponentTypeIntrospector introspector = MockFactory.getIntrospector();
        ComponentType type = introspector.introspect(SessionScopedOrderedInitPojo.class);
        ca[0].getImplementation().setComponentType(type);
        ca[1].getImplementation().setComponentType(type);
        ca[2].getImplementation().setComponentType(type);
        List<ContextFactory<Context>> configs = new ArrayList<ContextFactory<Context>>();
        for (AtomicComponent aCa : ca) {
View Full Code Here

                Scope.REQUEST);
        ca[1] = MockFactory.createComponent("TestServiceInitOnly", RequestScopeInitOnlyComponent.class,
                Scope.REQUEST);
        ca[2] = MockFactory.createComponent("TestServiceDestroyOnly", RequestScopeDestroyOnlyComponent.class,
                Scope.REQUEST);
        ComponentTypeIntrospector introspector = MockFactory.getIntrospector();
        ca[0].getImplementation().setComponentType(introspector.introspect(RequestScopeInitDestroyComponent.class));
        ca[1].getImplementation().setComponentType(introspector.introspect(RequestScopeInitOnlyComponent.class));
        ca[2].getImplementation().setComponentType(introspector.introspect(RequestScopeDestroyOnlyComponent.class));
        List<ContextFactory<Context>> configs = new ArrayList<ContextFactory<Context>>();
        for (AtomicComponent aCa : ca) {
            builder.build(aCa);
            configs.add((ContextFactory<Context>) aCa.getContextFactory());
View Full Code Here

TOP

Related Classes of org.apache.tuscany.core.config.ComponentTypeIntrospector

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.