Package org.apache.tuscany.model.assembly

Examples of org.apache.tuscany.model.assembly.Component.initialize()


        targetContract.setScope(targetScope);
        ConfiguredService cTargetService = factory.createConfiguredService();
        cTargetService.setPort(targetService);
        cTargetService.initialize(assemblyContext);
        targetComponent.getConfiguredServices().add(cTargetService);
        targetComponent.initialize(assemblyContext);

        Reference ref = factory.createReference();
        ref.setName("setGenericComponent");
        JavaServiceContract inter = factory.createJavaServiceContract();
        inter.setInterface(GenericComponent.class);
View Full Code Here


        sourceComponent.getImplementation().getComponentType().getReferences().add(ref);

        ConfiguredReference cref = factory.createConfiguredReference(ref.getName(), "target");
        cref.initialize(assemblyContext);
        sourceComponent.getConfiguredReferences().add(cref);
        sourceComponent.initialize(assemblyContext);

        Module module = factory.createModule();
        module.setName("test.module");
        module.getComponents().add(sourceComponent);
        module.getExternalServices().add(targetES);
View Full Code Here

        targetService.setServiceContract(targetContract);
        targetService.setName("HelloWorldService");
        ConfiguredService cTargetService = factory.createConfiguredService();
        cTargetService.setPort(targetService);
        targetComponent.getConfiguredServices().add(cTargetService);
        targetComponent.initialize(assemblyContext);

        Reference ref = factory.createReference();
        ConfiguredReference cref = factory.createConfiguredReference();
        ref.setName("setHelloWorldService");
        JavaServiceContract inter = factory.createJavaServiceContract();
View Full Code Here

        impl = factory.createSystemImplementation();
        impl.setComponentType(componentType);
        component = factory.createSimpleComponent();
        component.setName("target");
        component.setImplementation(impl);
        component.initialize(assemblyContext);
        module.getComponents().add(component);

        // create source component
        componentType = factory.createComponentType();
        Reference ref = factory.createReference();
View Full Code Here

        component = factory.createSimpleComponent();
        component.setName("source");
        component.setImplementation(impl);
        ConfiguredReference cRef = factory.createConfiguredReference("ref", "target");
        component.getConfiguredReferences().add(cRef);
        component.initialize(assemblyContext);
        module.getComponents().add(component);

        EntryPoint ep = factory.createEntryPoint();
        JavaServiceContract contract = factory.createJavaServiceContract();
        contract.setInterface(ModuleScopeSystemComponent.class);
View Full Code Here

    public void testChildContextIsolation() throws Exception {
        CompositeContext parent = createContextHierachy();
        CompositeContext child = (CompositeContext) parent.getContext("test.child");
        Component component = factory.createSystemComponent("TestService1", ModuleScopeSystemComponent.class, ModuleScopeSystemComponentImpl.class, Scope.MODULE);
       
        component.initialize(new AssemblyContextImpl(factory, null, null));
        child.registerModelObject(component);
        parent.publish(new ModuleStart(this));
        child.publish(new ModuleStart(this));
        Assert.assertNotNull(child.getContext("TestService1").getInstance(null));
        try {
View Full Code Here

     */
    public static Module createSystemModuleWithWiredComponents(String moduleName, Scope sourceScope, Scope targetScope) throws ConfigurationLoadException {

        // create the target component
        Component target = systemFactory.createSystemComponent("target", Target.class, TargetImpl.class, targetScope);
        target.initialize(assemblyContext);

        // create the source componentType
        Component source = systemFactory.createSystemComponent("source", Source.class, SourceImpl.class, sourceScope);
        ComponentType sourceComponentType = source.getImplementation().getComponentType();
        List<Reference> references = sourceComponentType.getReferences();
View Full Code Here

        // wire multiplicity using a setter
        references.add(systemFactory.createReference("setArrayOfTargets", Target.class, Multiplicity.ONE_N));
        configuredReference = systemFactory.createConfiguredReference("setArrayOfTargets", "target");
        configuredReferences.add(configuredReference);

        source.initialize(assemblyContext);

        Module module = systemFactory.createSystemModule();
        module.setImplementationClass(SystemCompositeContextImpl.class);
        module.setComponentType(getComponentType());
        module.setName(moduleName);
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.