Package org.apache.tuscany.spi

Examples of org.apache.tuscany.spi.QualifiedName


        inbound.getInvocationChains();
        EasyMock.expectLastCall().andReturn(Collections.emptyMap());

        List<Class<?>> services = new ArrayList<Class<?>>();
        services.add(Foo.class);
        QualifiedName qName = new QualifiedName("target/bar");
        OutboundWire outbound = EasyMock.createMock(OutboundWire.class);
        EasyMock.expect(outbound.getTargetName()).andReturn(qName).atLeastOnce();
        outbound.getInvocationChains();
        EasyMock.expectLastCall().andReturn(Collections.emptyMap());
        outbound.setTargetWire(EasyMock.eq(inbound));
View Full Code Here


        InboundWire inbound = EasyMock.createMock(InboundWire.class);
        EasyMock.replay(inbound);

        List<Class<?>> services = new ArrayList<Class<?>>();
        services.add(Foo.class);
        QualifiedName qName = new QualifiedName("target/bar");
        OutboundWire outbound = EasyMock.createMock(OutboundWire.class);
        EasyMock.expect(outbound.getReferenceName()).andReturn("foo");
        EasyMock.expect(outbound.getTargetName()).andReturn(qName).atLeastOnce();
        EasyMock.replay(outbound);
View Full Code Here

        if (reference.getTargets().size() != 1) {
            throw new UnsupportedOperationException();
        }
        ServiceContract<?> contract = def.getServiceContract();
        OutboundWire wire = new OutboundWireImpl();
        QualifiedName qName = new QualifiedName(reference.getTargets().get(0).toString());
        wire.setTargetName(qName);
        wire.setServiceContract(contract);
        wire.setReferenceName(reference.getReferenceName());
        for (Operation<?> operation : contract.getOperations().values()) {
            //TODO handle policy
View Full Code Here

            inboundWire.addInvocationChain(operation, inboundChain);
        }

        OutboundWire outboundWire = new OutboundWireImpl();
        outboundWire.setServiceContract(contract);
        outboundWire.setTargetName(new QualifiedName(targetName));
        outboundWire.setContainer(service);

        for (Operation<?> operation : contract.getOperations().values()) {
            OutboundInvocationChain outboundChain = createOutboundChain(operation);
            outboundWire.addInvocationChain(operation, outboundChain);
View Full Code Here

        configuration.setScopeContainer(scope);
        configuration.addReferenceSite("setTarget", SourceImpl.class.getMethod("setTarget", Target.class));
        configuration.addServiceInterface(Source.class);
        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);
View Full Code Here

            throw new IllegalArgumentException("No setter found on source for target");
        }

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

    public void testInvocation() throws InvalidServiceContractException {
        AbstractApplicationContext springContext = createSpringContext();
        SpringCompositeComponent composite = new SpringCompositeComponent("parent", springContext, null, null, null);
        InboundWire inboundWire = ArtifactFactory.createInboundWire("fooService", TestBean.class);
        OutboundWire outboundWire = ArtifactFactory.createOutboundWire("fooService", TestBean.class);
        outboundWire.setTargetName(new QualifiedName("foo"));
        ArtifactFactory.terminateWire(outboundWire);
        Service service =
            new ServiceExtension("fooService", TestBean.class, composite, createWireService());
        service.setInboundWire(inboundWire);
        service.setOutboundWire(outboundWire);
View Full Code Here

        InboundWire inboundWire = ArtifactFactory.createInboundWire(name, serviceInterface);
        OutboundWire outboundWire = ArtifactFactory.createOutboundWire(name, serviceInterface);
        ArtifactFactory.terminateWire(outboundWire);
        service.setInboundWire(inboundWire);
        service.setOutboundWire(outboundWire);
        outboundWire.setTargetName(new QualifiedName("foo"));
        Connector connector = ArtifactFactory.createConnector();
        connector.connect(service);
        ArtifactFactory.terminateWire(inboundWire);
        return service;
    }
View Full Code Here

        configuration.setInstanceFactory(new PojoObjectFactory<TargetImpl>(TargetImpl.class.getConstructor()));
        configuration.addServiceInterface(Target.class);
        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);
View Full Code Here

TOP

Related Classes of org.apache.tuscany.spi.QualifiedName

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.