Examples of AtomicComponent


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

            impl.setComponentType(introspector.introspect(ServiceImpl.class));
        } catch (ConfigurationException e) {
            throw new AssertionError();
        }
        impl.initialize(null);
        AtomicComponent component = assemblyFactory.createSimpleComponent();
        component.setImplementation(impl);
        return component;
    }
View Full Code Here

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

    private List<ContextFactory<Context>> createConfigurations() throws BuilderException, ConfigurationLoadException {
        PolicyBuilderRegistry policyRegistry = new DefaultPolicyBuilderRegistry();
        WireFactoryService wireService = new DefaultWireFactoryService(new MessageFactoryImpl(), new JDKWireFactoryFactory(), policyRegistry);
        JavaContextFactoryBuilder builder = new JavaContextFactoryBuilder(wireService);
        AtomicComponent component = MockFactory.createComponent("TestService1", ModuleScopeComponentImpl.class, Scope.MODULE);
        builder.build(component);
        List<ContextFactory<Context>> configs = new ArrayList<ContextFactory<Context>>();
        configs.add((ContextFactory<Context>) component.getContextFactory());
        return configs;
    }
View Full Code Here

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

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

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

        scope.stop();
    }


    private List<ContextFactory<Context>> createConfigurations() throws BuilderException, ConfigurationLoadException {
        AtomicComponent component = MockFactory.createComponent("TestService1", RequestScopeComponentImpl.class,
                Scope.REQUEST);
        WireFactoryService wireService = new DefaultWireFactoryService(new MessageFactoryImpl(), new JDKWireFactoryFactory(), new DefaultPolicyBuilderRegistry());
        JavaContextFactoryBuilder builder = new JavaContextFactoryBuilder(wireService);
        builder.build(component);
        List<ContextFactory<Context>> configs = new ArrayList<ContextFactory<Context>>();
        configs.add((ContextFactory<Context>) component.getContextFactory());
        return configs;
    }
View Full Code Here

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

        configs.add((ContextFactory<Context>) component.getContextFactory());
        return configs;
    }

    private ContextFactory<Context> createConfiguration(String name) throws BuilderException, ConfigurationLoadException {
        AtomicComponent component = MockFactory.createComponent(name, RequestScopeComponentImpl.class,
                Scope.REQUEST);
        WireFactoryService wireService = new DefaultWireFactoryService(new MessageFactoryImpl(), new JDKWireFactoryFactory(), new DefaultPolicyBuilderRegistry());
        JavaContextFactoryBuilder builder = new JavaContextFactoryBuilder(wireService);
        builder.build(component);
        return (ContextFactory<Context>) component.getContextFactory();
    }
View Full Code Here

Examples of org.apache.tuscany.spi.component.AtomicComponent

                    references.add(reference);
                }
            }
            registerAutowire(reference);
        } else if (child instanceof AtomicComponent) {
            AtomicComponent atomic = (AtomicComponent) child;
            registerAutowire(atomic);
        } else if (child instanceof CompositeComponent) {
            CompositeComponent component = (CompositeComponent) child;
            if (lifecycleState == RUNNING && component.getLifecycleState() == UNINITIALIZED) {
                component.start();
View Full Code Here

Examples of org.apache.tuscany.spi.component.AtomicComponent

        EasyMock.expect(component.isSystem()).andReturn(true).atLeastOnce();
        EasyMock.expect(component.getServiceInterfaces()).andReturn(interfaces);
        EasyMock.replay(component);
        parent.register(component);
        assertNull(parent.getChild("source"));
        AtomicComponent target = (AtomicComponent) parent.getSystemChild("source");
        Source source = (Source) target.getServiceInstance();
        assertNotNull(source);
        EasyMock.verify(component);
    }
View Full Code Here

Examples of org.apache.tuscany.spi.component.AtomicComponent

        CompositeComponent parent = new CompositeComponentImpl("foo", null, null, null);
        parent.start();
        List<Class<?>> interfaces = new ArrayList<Class<?>>();
        interfaces.add(Source.class);
        Source originalSource = new SourceImpl();
        AtomicComponent component = EasyMock.createMock(AtomicComponent.class);
        EasyMock.expect(component.getName()).andReturn("source").atLeastOnce();
        EasyMock.expect(component.getServiceInstance()).andReturn(originalSource);
        EasyMock.expect(component.isSystem()).andReturn(false).atLeastOnce();
        EasyMock.expect(component.getServiceInterfaces()).andReturn(interfaces);
        EasyMock.replay(component);
        parent.register(component);
        Source source = parent.locateService(Source.class, "source");
        assertNotNull(source);
        EasyMock.verify(component);
View Full Code Here

Examples of org.apache.tuscany.spi.component.AtomicComponent

        CompositeComponent parent = new CompositeComponentImpl("foo", null, null, null);
        parent.start();
        List<Class<?>> interfaces = new ArrayList<Class<?>>();
        interfaces.add(Source.class);
        Source originalSource = new SourceImpl();
        AtomicComponent component = EasyMock.createMock(AtomicComponent.class);
        EasyMock.expect(component.getName()).andReturn("source").atLeastOnce();
        EasyMock.expect(component.getServiceInstance()).andReturn(originalSource);
        EasyMock.expect(component.isSystem()).andReturn(false).atLeastOnce();
        EasyMock.expect(component.getServiceInterfaces()).andReturn(interfaces);
        EasyMock.replay(component);
        parent.register(component);
        assertNull(parent.getSystemChild("source"));
        AtomicComponent target = (AtomicComponent) parent.getChild("source");
        Source source = (Source) target.getServiceInstance();
        assertNotNull(source);
        EasyMock.verify(component);
    }
View Full Code Here

Examples of org.apache.tuscany.spi.component.AtomicComponent

        EasyMock.expect(targetWire.getInvocationChains()).andReturn(targetChains);
        targetWire.getSourceCallbackInvocationChains("source");
        EasyMock.expectLastCall().andReturn(Collections.emptyMap());

        // create the target
        AtomicComponent target = EasyMock.createMock(AtomicComponent.class);
        EasyMock.expect(target.getScope()).andReturn(Scope.MODULE);
        EasyMock.expect(target.isSystem()).andReturn(false).atLeastOnce();
        target.getInboundWire(EasyMock.eq("FooService"));
        EasyMock.expectLastCall().andReturn(targetWire).atLeastOnce();
        target.createTargetInvoker(EasyMock.eq("FooService"), EasyMock.eq(operation));
        EasyMock.expectLastCall().andReturn(null);
        EasyMock.replay(target);

        EasyMock.expect(targetWire.getContainer()).andReturn(target);
        EasyMock.replay(targetWire);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.