Package org.apache.tuscany.spi.component

Examples of org.apache.tuscany.spi.component.CompositeComponent.register()


        // create the composite component
        String name = componentDefinition.getName();
        CompositeComponent component = new CompositeComponentImpl(name, parent, connector, null);
        for (ComponentDefinition<? extends Implementation> childComponentDefinition : allComponents) {
            component.register(builderRegistry.build(component, childComponentDefinition, deploymentContext));
        }

        for (BoundServiceDefinition<? extends Binding> serviceDefinition : allBoundServices) {
            component.register(builderRegistry.build(component, serviceDefinition, deploymentContext));
        }
View Full Code Here


        for (ComponentDefinition<? extends Implementation> childComponentDefinition : allComponents) {
            component.register(builderRegistry.build(component, childComponentDefinition, deploymentContext));
        }

        for (BoundServiceDefinition<? extends Binding> serviceDefinition : allBoundServices) {
            component.register(builderRegistry.build(component, serviceDefinition, deploymentContext));
        }
        return component;
    }

}
View Full Code Here

        EasyMock.expect(component.getName()).andReturn("source").atLeastOnce();
        EasyMock.expect(component.getServiceInstance()).andReturn(originalSource);
        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

        EasyMock.expect(component.getName()).andReturn("source").atLeastOnce();
        EasyMock.expect(component.getServiceInstance()).andReturn(originalSource);
        EasyMock.expect(component.isSystem()).andReturn(true).atLeastOnce();
        EasyMock.expect(component.getServiceInterfaces()).andReturn(interfaces);
        EasyMock.replay(component);
        parent.register(component);
        Source source = parent.locateSystemService(Source.class, "source");
        assertNotNull(source);
        EasyMock.verify(component);
    }
View Full Code Here

        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

        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

        EasyMock.expect(service.getName()).andReturn("source").atLeastOnce();
        EasyMock.expect(service.isSystem()).andReturn(false).atLeastOnce();
        service.getInterface();
        EasyMock.expectLastCall().andReturn(Source.class);
        EasyMock.replay(service);
        parent.register(service);
        assertNotNull(parent.getService("source"));
        try {
            parent.getSystemService("source");
            fail();
        } catch (ComponentNotFoundException e) {
View Full Code Here

        EasyMock.expect(service.getName()).andReturn("source").atLeastOnce();
        EasyMock.expect(service.isSystem()).andReturn(true).atLeastOnce();
        service.getInterface();
        EasyMock.expectLastCall().andReturn(Source.class);
        EasyMock.replay(service);
        parent.register(service);
        assertNotNull(parent.getSystemService("source"));
        try {
            parent.getService("source");
            fail();
        } catch (ComponentNotFoundException e) {
View Full Code Here

        EasyMock.replay(source);

        EasyMock.expect(outbound.getContainer()).andReturn(source);
        EasyMock.replay(outbound);

        parent.register(source);

        SystemAtomicComponent target = EasyMock.createMock(SystemAtomicComponent.class);
        EasyMock.expect(target.getName()).andReturn("target").atLeastOnce();
        EasyMock.expect(target.getServiceInterfaces()).andReturn(services);
        EasyMock.expect(target.getInboundWire("bar")).andReturn(inbound).atLeastOnce();
View Full Code Here

        EasyMock.replay(target);

        EasyMock.expect(inbound.getContainer()).andReturn(target);
        EasyMock.replay(inbound);

        parent.register(target);
        parent.prepare();
        EasyMock.verify(source);
        EasyMock.verify(target);
        EasyMock.verify(inbound);
        EasyMock.verify(outbound);
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.