Package org.apache.tuscany.spi.component

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


        BoundReferenceDefinition<SystemBinding> targetReferenceDefinition = MockComponentFactory.createBoundReference();
        ComponentDefinition<SystemImplementation> sourceComponentDefinition =
            MockComponentFactory.createSourceWithTargetReference();

        AtomicComponent sourceComponent = builder.build(parent, sourceComponentDefinition, deploymentContext);
        Reference reference = bindingBuilder.build(parent, targetReferenceDefinition, deploymentContext);

        parent.register(sourceComponent);
        parent.register(reference);
        connector.connect(reference.getInboundWire(), reference.getOutboundWire(), true);
        connector.connect(sourceComponent);
        grandParent.register(parent);
        grandParent.start();
        scope.onEvent(new CompositeStart(this, parent));
        Source source = (Source) parent.getSystemChild("source").getServiceInstance();
View Full Code Here


                wireService.checkCompatibility(inboundContract, outboundContract, true);
            } catch (IncompatibleServiceContractException e) {
                throw new Axis2BindingBuilderRuntimeException(e);
            }
           
            Reference reference = new Axis2Reference(boundReferenceDefinition.getName(), parent, wireService, wsBinding,
                    inboundContract, workContext);
            reference.setBindingServiceContract(outboundContract);
           
            return reference;
           
        } catch (InvalidServiceContractException e) {
            throw new Axis2BindingBuilderRuntimeException(e);
View Full Code Here

        }
    }

    public void testGetServiceInstanceNotService() {
        CompositeComponent composite = new CompositeComponentImpl("parent", null, null, null);
        Reference reference = getReference("foo");
        composite.register(reference);
        try {
            composite.getServiceInstance("foo");
            fail();
        } catch (IllegalTargetException e) {
View Full Code Here

        CompositeComponent composite = new CompositeComponentImpl("parent", null, null, null);
        composite.prepare();
    }

    private Reference getReference(String name) {
        Reference reference = EasyMock.createNiceMock(Reference.class);
        EasyMock.expect(reference.isSystem()).andReturn(false).atLeastOnce();
        reference.getName();
        expectLastCall().andReturn(name).anyTimes();
        reference.getInterface();
        expectLastCall().andReturn(Object.class).atLeastOnce();
        replay(reference);
        return reference;
    }
View Full Code Here

TOP

Related Classes of org.apache.tuscany.spi.component.Reference

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.