Package org.apache.tuscany.core.context

Examples of org.apache.tuscany.core.context.CompositeContext.publish()


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


    public void testScenario1() throws Exception {
        RuntimeContext runtime = createScenario1Runtime();
        CompositeContext root = runtime.getRootContext();
        SystemCompositeContext system = runtime.getSystemContext();
        CompositeContext system1 = (CompositeContext) system.getContext("system1");
        system1.publish(new ModuleStart(this));
        Target target = (Target) system.getContext("target.system.ep").getInstance(null);
        assertNotNull(target);
        CompositeContext app1 = (CompositeContext) root.getContext("app1");
        app1.publish(new ModuleStart(this));
        CompositeContext app1a = (CompositeContext) app1.getContext("app1a");
View Full Code Here

        CompositeContext system1 = (CompositeContext) system.getContext("system1");
        system1.publish(new ModuleStart(this));
        Target target = (Target) system.getContext("target.system.ep").getInstance(null);
        assertNotNull(target);
        CompositeContext app1 = (CompositeContext) root.getContext("app1");
        app1.publish(new ModuleStart(this));
        CompositeContext app1a = (CompositeContext) app1.getContext("app1a");
        app1a.publish(new ModuleStart(this));
        app1a.publish(new ModuleStop(this));
        app1.publish(new ModuleStop(this));
        Source source = (Source) app1a.getContext("source").getInstance(null);
View Full Code Here

        Target target = (Target) system.getContext("target.system.ep").getInstance(null);
        assertNotNull(target);
        CompositeContext app1 = (CompositeContext) root.getContext("app1");
        app1.publish(new ModuleStart(this));
        CompositeContext app1a = (CompositeContext) app1.getContext("app1a");
        app1a.publish(new ModuleStart(this));
        app1a.publish(new ModuleStop(this));
        app1.publish(new ModuleStop(this));
        Source source = (Source) app1a.getContext("source").getInstance(null);
        assertEquals(target, source.getTarget());
        source.getTarget().getString();
View Full Code Here

        assertNotNull(target);
        CompositeContext app1 = (CompositeContext) root.getContext("app1");
        app1.publish(new ModuleStart(this));
        CompositeContext app1a = (CompositeContext) app1.getContext("app1a");
        app1a.publish(new ModuleStart(this));
        app1a.publish(new ModuleStop(this));
        app1.publish(new ModuleStop(this));
        Source source = (Source) app1a.getContext("source").getInstance(null);
        assertEquals(target, source.getTarget());
        source.getTarget().getString();
        runtime.stop();
View Full Code Here

     */
    public void testScenario2() throws Exception {
        RuntimeContext runtime = createScenario2Runtime();
        CompositeContext root = runtime.getRootContext();
        CompositeContext app1 = (CompositeContext) root.getContext("app1");
        app1.publish(new ModuleStart(this));
        CompositeContext app1b = (CompositeContext) app1.getContext("app1b");
        app1b.publish(new ModuleStart(this));
        CompositeContext app1a = (CompositeContext) app1.getContext("app1a");
        app1a.publish(new ModuleStart(this));
        Target target = (Target) app1b.getContext("target.ep").getInstance(null);
View Full Code Here

        RuntimeContext runtime = createScenario2Runtime();
        CompositeContext root = runtime.getRootContext();
        CompositeContext app1 = (CompositeContext) root.getContext("app1");
        app1.publish(new ModuleStart(this));
        CompositeContext app1b = (CompositeContext) app1.getContext("app1b");
        app1b.publish(new ModuleStart(this));
        CompositeContext app1a = (CompositeContext) app1.getContext("app1a");
        app1a.publish(new ModuleStart(this));
        Target target = (Target) app1b.getContext("target.ep").getInstance(null);
        assertNotNull(target);
        Source source = (Source) app1a.getContext("source").getInstance(null);
View Full Code Here

        CompositeContext app1 = (CompositeContext) root.getContext("app1");
        app1.publish(new ModuleStart(this));
        CompositeContext app1b = (CompositeContext) app1.getContext("app1b");
        app1b.publish(new ModuleStart(this));
        CompositeContext app1a = (CompositeContext) app1.getContext("app1a");
        app1a.publish(new ModuleStart(this));
        Target target = (Target) app1b.getContext("target.ep").getInstance(null);
        assertNotNull(target);
        Source source = (Source) app1a.getContext("source").getInstance(null);
        assertEquals(target, source.getTarget());
        source.getTarget().getString();
View Full Code Here

    public void testScenario3() throws Exception {
        RuntimeContext runtime = createScenario3Runtime();
        SystemCompositeContext system = runtime.getSystemContext();

        CompositeContext system2 = (CompositeContext) system.getContext("system2");
        system2.publish(new ModuleStart(this));
        Target target = (Target) system2.getContext("target.ep").getInstance(null);
        assertNotNull(target);

        CompositeContext system1 = (CompositeContext) system.getContext("system1");
        system1.publish(new ModuleStart(this));
View Full Code Here

        system2.publish(new ModuleStart(this));
        Target target = (Target) system2.getContext("target.ep").getInstance(null);
        assertNotNull(target);

        CompositeContext system1 = (CompositeContext) system.getContext("system1");
        system1.publish(new ModuleStart(this));
        CompositeContext system1a = (CompositeContext) system1.getContext("system1a");
        system1a.publish(new ModuleStart(this));

        Source source = (Source) system1a.getContext("source").getInstance(null);
        assertEquals(target, source.getTarget());
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.