Package org.apache.tuscany.core.implementation.system.wire

Examples of org.apache.tuscany.core.implementation.system.wire.SystemOutboundWire


            throw new BuilderConfigException("Target not found: [" + targetName + ']');
        }
        String name = boundServiceDefinition.getName();
        InboundWire inboundWire =
            new SystemInboundWireImpl(name, interfaze, target);
        SystemOutboundWire outboundWire =
            new SystemOutboundWireImpl(name, targetName, interfaze);
        SystemService service = new SystemServiceImpl(boundServiceDefinition.getName(), parent);
        service.setInboundWire(inboundWire);
        service.setOutboundWire(outboundWire);
        return service;
View Full Code Here


        String name = boundReferenceDefinition.getName();
        SystemReferenceImpl reference = new SystemReferenceImpl(name, interfaze, parent);
        SystemInboundWire inboundWire = new SystemInboundWireImpl(name, interfaze);
        String refName = boundReferenceDefinition.getName();
        boolean required = boundReferenceDefinition.isRequired();
        SystemOutboundWire outboundWire = new SystemOutboundAutowire(refName, interfaze, autowireComponent, required);
        reference.setInboundWire(inboundWire);
        reference.setOutboundWire(outboundWire);
        return reference;
    }
View Full Code Here

        return true;
    }

    protected ObjectFactory<?> createWireFactory(RuntimeWire wire) {
        assert wire instanceof SystemOutboundWire : "Wire must be an instance of " + SystemOutboundWire.class.getName();
        SystemOutboundWire systemWire = (SystemOutboundWire) wire;
        return new SystemWireObjectFactory(systemWire);
    }
View Full Code Here

        }

        sourceConfig.addReferenceSite(setter.getName(), setter);
        SystemAtomicComponent sourceCtx = new SystemAtomicComponentImpl(source, sourceConfig);
        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

        configuration.addConstructorParamName("foo");
        configuration.addConstructorParamName("ref");
        SystemAtomicComponentImpl component = new SystemAtomicComponentImpl("foo", configuration);
        component.addPropertyFactory("foo", new SingletonObjectFactory<String>("baz"));
        Foo target = new Foo();
        SystemOutboundWire wire = EasyMock.createMock(SystemOutboundWire.class);
        EasyMock.expect(wire.getTargetService()).andReturn(target);
        EasyMock.expect(wire.getReferenceName()).andReturn("ref").anyTimes();
        EasyMock.replay(wire);
        component.addOutboundWire(wire);
        Bar bar = (Bar) component.createInstance();
        assertEquals("baz", bar.foo);
        assertEquals(target, bar.ref);
View Full Code Here

TOP

Related Classes of org.apache.tuscany.core.implementation.system.wire.SystemOutboundWire

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.