Examples of ModuleStart


Examples of org.apache.tuscany.core.context.event.ModuleStart

     * @throws ConfigurationException
     */
    public static CompositeContext bootstrapStaxLoader(SystemCompositeContext parentContext, AssemblyContext modelContext) throws ConfigurationException {
        ModuleComponent loaderComponent = StAXUtil.bootstrapLoader(SYSTEM_LOADER_COMPONENT, modelContext);
        CompositeContext loaderContext = registerModule(parentContext, loaderComponent);
        loaderContext.publish(new ModuleStart(loaderComponent));
        return loaderContext;
    }
View Full Code Here

Examples of org.apache.tuscany.core.context.event.ModuleStart

        RuntimeContext runtime = MockFactory.createCoreRuntime();
        ModuleComponent child1 = createHierarchy();
        runtime.getSystemContext().registerModelObject(child1);
        CompositeContext child1Ctx = (CompositeContext) runtime.getSystemContext().getContext("child1");
        Assert.assertNotNull(child1Ctx);
        child1Ctx.publish(new ModuleStart(this));
        analyzeLeafComponents(child1Ctx);
        CompositeContext child2Ctx = (CompositeContext) child1Ctx.getContext("child2");
        Assert.assertNotNull(child2Ctx);
        child2Ctx.publish(new ModuleStart(this));
        analyzeLeafComponents(child2Ctx);
        CompositeContext child3Ctx = (CompositeContext) child2Ctx.getContext("child3");
        Assert.assertNotNull(child3Ctx);
        child3Ctx.publish(new ModuleStart(this));
        analyzeLeafComponents(child3Ctx);
       
        Assert.assertNull(child1Ctx.getContext("child3")); // sanity check
    }
View Full Code Here

Examples of org.apache.tuscany.core.context.event.ModuleStart

        RuntimeContext runtime = MockFactory.createCoreRuntime();
        ModuleComponent child1 = createHierarchy();
        runtime.getRootContext().registerModelObject(child1);
        CompositeContext child1Ctx = (CompositeContext) runtime.getRootContext().getContext("child1");
        Assert.assertNotNull(child1Ctx);
        child1Ctx.publish(new ModuleStart(this));
        analyzeLeafComponents(child1Ctx);
        CompositeContext child2Ctx = (CompositeContext) child1Ctx.getContext("child2");
        Assert.assertNotNull(child2Ctx);
        child2Ctx.publish(new ModuleStart(this));
        analyzeLeafComponents(child2Ctx);
        CompositeContext child3Ctx = (CompositeContext) child2Ctx.getContext("child3");
        Assert.assertNotNull(child3Ctx);
        child3Ctx.publish(new ModuleStart(this));
        analyzeLeafComponents(child3Ctx);
       
        Assert.assertNull(child1Ctx.getContext("child3")); // sanity check
        child1Ctx.publish(new ModuleStop(this));
    }
View Full Code Here

Examples of org.apache.tuscany.core.context.event.ModuleStart

        Component component = factory.createSystemComponent("TestService1", ModuleScopeSystemComponent.class, ModuleScopeSystemComponentImpl.class, Scope.MODULE);
        EntryPoint ep = MockFactory.createEPSystemBinding("TestService1EP", ModuleScopeSystemComponent.class, "TestService1", component);
        childContext.registerModelObject(component);
        childContext.registerModelObject(ep);
        childContext.publish(new ModuleStart(this));
        Assert.assertNotNull(system.getContext("system.child").getInstance(new QualifiedName("./TestService1EP")));
        childContext.publish(new ModuleStop(this));
    }
View Full Code Here

Examples of org.apache.tuscany.core.context.event.ModuleStart

        Component component = factory.createSystemComponent("TestService1", ModuleScopeSystemComponent.class, ModuleScopeSystemComponentImpl.class, Scope.MODULE);
        EntryPoint ep = MockFactory.createEPSystemBinding("TestService1EP", ModuleScopeSystemComponent.class, "TestService1", component);
        system.registerModelObject(component);
        system.registerModelObject(ep);
        system.start();
        system.publish(new ModuleStart(this));
        Assert.assertSame(system.getContext("TestService1EP").getInstance(null), system.resolveInstance(ModuleScopeSystemComponent.class));
    }
View Full Code Here

Examples of org.apache.tuscany.core.context.event.ModuleStart

    public void testAutowireRegisterAfterStart() throws Exception {
        Component component = factory.createSystemComponent("TestService1", ModuleScopeSystemComponent.class, ModuleScopeSystemComponentImpl.class, Scope.MODULE);
        system.registerModelObject(component);
        system.start();
        system.publish(new ModuleStart(this));
        EntryPoint ep = MockFactory.createEPSystemBinding("TestService1EP", ModuleScopeSystemComponent.class, "TestService1", component);
        system.registerModelObject(ep);
        Assert.assertSame(system.getContext("TestService1EP").getInstance(null), system.resolveInstance(ModuleScopeSystemComponent.class));
    }
View Full Code Here

Examples of org.apache.tuscany.core.context.event.ModuleStart

    }

    public void testAutowireModuleRegisterBeforeStart() throws Exception {
        system.registerModelObject(MockFactory.createSystemModule());
        system.start();
        system.publish(new ModuleStart(this));
        Assert.assertSame(system.getContext("TestService1EP").getInstance(null), system.resolveInstance(ModuleScopeSystemComponent.class));
    }
View Full Code Here

Examples of org.apache.tuscany.core.context.event.ModuleStart

        Assert.assertSame(system.getContext("TestService1EP").getInstance(null), system.resolveInstance(ModuleScopeSystemComponent.class));
    }

    public void testAutowireModuleRegisterAfterStart() throws Exception {
        system.start();
        system.publish(new ModuleStart(this));
        system.registerModelObject(MockFactory.createSystemModule());
        Assert.assertSame(system.getContext("TestService1EP").getInstance(null), system.resolveInstance(ModuleScopeSystemComponent.class));
    }
View Full Code Here

Examples of org.apache.tuscany.core.context.event.ModuleStart

        SystemCompositeContext systemContext = runtime.getSystemContext();
        BootstrapHelper.bootstrapStaxLoader(systemContext, modelContext);
        ModuleComponentConfigurationLoader loader = BootstrapHelper.getConfigurationLoader(systemContext, modelContext);
        ModuleComponent systemModuleComponent = loader.loadSystemModuleComponent(SYSTEM_MODULE_COMPONENT, SYSTEM_MODULE_COMPONENT);
        CompositeContext context = BootstrapHelper.registerModule(systemContext, systemModuleComponent);
        context.publish(new ModuleStart(this));

        // Load the SCDL configuration of the application module
        CompositeContext rootContext = runtime.getRootContext();
        ModuleComponent moduleComponent = loader.loadModuleComponent(name, uri);
        moduleContext = BootstrapHelper.registerModule(rootContext, moduleComponent);

        moduleContext.publish(new ModuleStart(this));
    }
View Full Code Here

Examples of org.apache.tuscany.core.context.event.ModuleStart

        ContextFactoryBuilderRegistry builderRegistry = BootstrapHelper.bootstrapContextFactoryBuilders(monitorFactory);
        DefaultWireBuilder wireBuilder = new DefaultWireBuilder();
        runtime = new RuntimeContextImpl(monitorFactory, builderRegistry, wireBuilder);
        runtime.start();
        systemContext = runtime.getSystemContext();
        systemContext.publish(new ModuleStart(this));
    }
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.