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

Examples of org.apache.tuscany.core.implementation.system.builder.SystemBindingBuilder


        ScopeContainer scope = new ModuleScopeContainer(work);
        scope.start();

        Connector connector = new ConnectorImpl();
        SystemComponentBuilder builder = new SystemComponentBuilder();
        SystemBindingBuilder bindingBuilder = new SystemBindingBuilder();

        CompositeComponent grandParent = new CompositeComponentImpl("grandparent", null, null, null);
        CompositeComponent parent = new CompositeComponentImpl("parent", grandParent, null, null);

        // create a context in the grandparent that the reference will be autowired to
        ComponentDefinition<SystemImplementation> targetComponentDefinition = MockComponentFactory.createTarget();
        AtomicComponent targetComponentComponent = builder.build(parent, targetComponentDefinition, deploymentContext);
        grandParent.register(targetComponentComponent);

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


        ScopeContainer scope = new ModuleScopeContainer(work);
        scope.start();

        ConnectorImpl connector = new ConnectorImpl();
        SystemComponentBuilder builder = new SystemComponentBuilder();
        SystemBindingBuilder bindingBuilder = new SystemBindingBuilder();

        CompositeComponent parent = new CompositeComponentImpl(null, null, null, null);

        BoundServiceDefinition<SystemBinding> serviceDefinition = MockComponentFactory.createBoundService();
        ComponentDefinition<SystemImplementation> componentDefinition = MockComponentFactory.createTarget();

        AtomicComponent sourceComponent = builder.build(parent, componentDefinition, deploymentContext);
        parent.register(sourceComponent);

        Service service = bindingBuilder.build(parent, serviceDefinition, deploymentContext);
        parent.register(service);

        connector.connect(sourceComponent);
        connector.connect(service);
View Full Code Here

    private Builder createBuilder(ScopeRegistry scopeRegistry) {
        BuilderRegistry builderRegistry = new BuilderRegistryImpl(scopeRegistry);
        SystemCompositeBuilder builder = new SystemCompositeBuilder(builderRegistry, createConnector());
        builderRegistry.register(SystemCompositeImplementation.class, builder);
        builderRegistry.register(SystemImplementation.class, new SystemComponentBuilder());
        builderRegistry.register(SystemBinding.class, new SystemBindingBuilder());
        return builderRegistry;
    }
View Full Code Here

TOP

Related Classes of org.apache.tuscany.core.implementation.system.builder.SystemBindingBuilder

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.