Examples of addOutboundWire()


Examples of org.apache.tuscany.core.implementation.java.JavaAtomicComponent.addOutboundWire()

        for (Map.Entry<String, Member> entry : members.entrySet()) {
            configuration.addReferenceSite(entry.getKey(), entry.getValue());
        }
        JavaAtomicComponent sourceContext = new JavaAtomicComponent(sourceName, configuration, null);
        OutboundWire outboundWire = createReferenceWire(targetName, sourceReferenceClass, sourceHeadInterceptor);
        sourceContext.addOutboundWire(outboundWire);
        targetScope.register(targetContext);
        sourceScope.register(sourceContext);
        connect(outboundWire, inboundWire, targetContext, false);
        Map<String, AtomicComponent> contexts = new HashMap<String, AtomicComponent>();
        contexts.put(sourceName, sourceContext);
View Full Code Here

Examples of org.apache.tuscany.core.implementation.java.JavaAtomicComponent.addOutboundWire()

        configuration.setParent(parent);

        JavaAtomicComponent source = new JavaAtomicComponent("source", configuration, null);
        OutboundWire outboundWire = createOutboundWire(new QualifiedName("target/Target"), Target.class);
        outboundWire.setContainer(source);
        source.addOutboundWire(outboundWire);
        JavaAtomicComponent target = new JavaAtomicComponent("target", configuration, null);
        InboundWire targetWire = MockFactory.createTargetWire("Target", Target.class);
        targetWire.setContainer(target);
        target.addInboundWire(targetWire);
        InboundWire inboundWire = target.getInboundWire("Target");
View Full Code Here

Examples of org.apache.tuscany.core.implementation.system.component.SystemAtomicComponentImpl.addOutboundWire()

        configuration.setInstanceFactory(new PojoObjectFactory<SourceImpl>(SourceImpl.class.getConstructor()));
        SystemAtomicComponent sourceContext = new SystemAtomicComponentImpl("source", configuration);
        QualifiedName qName = new QualifiedName("service");
        OutboundWire outboundWire = new SystemOutboundWireImpl("setTarget", qName, Target.class);
        outboundWire.setTargetWire(inboundWire);
        sourceContext.addOutboundWire(outboundWire);
        sourceContext.start();
        assertSame(((Source) sourceContext.getServiceInstance()).getTarget(), target);
        // wires should pass back direct ref
        EasyMock.verify(inboundWire);
    }
View Full Code Here

Examples of org.apache.tuscany.core.implementation.system.component.SystemAtomicComponentImpl.addOutboundWire()

        for (ReferenceDefinition reference : componentType.getReferences().values()) {
            if (reference.isAutowire()) {
                Class interfaze = reference.getServiceContract().getInterfaceClass();
                OutboundWire wire =
                    new SystemOutboundAutowire(reference.getName(), interfaze, parent, reference.isRequired());
                component.addOutboundWire(wire);
            }
        }
        return component;
    }
View Full Code Here

Examples of org.apache.tuscany.core.implementation.system.component.SystemAtomicComponentImpl.addOutboundWire()

        QualifiedName targetName = new QualifiedName(target);
        SystemOutboundWire wire = new SystemOutboundWireImpl(setter.getName(), targetName, targetClass);
        InboundWire inboundWire = new SystemInboundWireImpl(targetName.getPortName(), targetClass, targetComponent);
        wire.setTargetWire(inboundWire);

        sourceCtx.addOutboundWire(wire);
        contexts.put(source, sourceCtx);
        contexts.put(target, targetComponent);
        return contexts;
    }
View Full Code Here

Examples of org.apache.tuscany.spi.component.SystemAtomicComponent.addOutboundWire()

        configuration.setInstanceFactory(new PojoObjectFactory<SourceImpl>(SourceImpl.class.getConstructor()));
        SystemAtomicComponent sourceContext = new SystemAtomicComponentImpl("source", configuration);
        QualifiedName qName = new QualifiedName("service");
        OutboundWire outboundWire = new SystemOutboundWireImpl("setTarget", qName, Target.class);
        outboundWire.setTargetWire(inboundWire);
        sourceContext.addOutboundWire(outboundWire);
        sourceContext.start();
        assertSame(((Source) sourceContext.getServiceInstance()).getTarget(), target);
        // wires should pass back direct ref
        EasyMock.verify(inboundWire);
    }
View Full Code Here

Examples of org.apache.tuscany.spi.component.SystemAtomicComponent.addOutboundWire()

        QualifiedName targetName = new QualifiedName(target);
        SystemOutboundWire wire = new SystemOutboundWireImpl(setter.getName(), targetName, targetClass);
        InboundWire inboundWire = new SystemInboundWireImpl(targetName.getPortName(), targetClass, targetComponent);
        wire.setTargetWire(inboundWire);

        sourceCtx.addOutboundWire(wire);
        contexts.put(source, sourceCtx);
        contexts.put(target, targetComponent);
        return contexts;
    }
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.