Examples of ModuleStart


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

    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");
        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

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

     */
    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);
        assertNotNull(target);
        Source source = (Source) app1a.getContext("source").getInstance(null);
        assertEquals(target, source.getTarget());
        source.getTarget().getString();
View Full Code Here

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

    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));
        CompositeContext system1a = (CompositeContext) system1.getContext("system1a");
        system1a.publish(new ModuleStart(this));

        Source source = (Source) system1a.getContext("source").getInstance(null);
        assertEquals(target, source.getTarget());
        source.getTarget().getString();
        runtime.stop();
View Full Code Here

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

     */
    public void testScenario4() throws Exception {
        RuntimeContext runtime = createScenario4Runtime();
        SystemCompositeContext system = runtime.getSystemContext();
        CompositeContext system1 = (CompositeContext) system.getContext("system1");
        system1.publish(new ModuleStart(this));
        Target target = (Target) system1.getContext("target").getInstance(null);
        assertNotNull(target);
        CompositeContext system1a = (CompositeContext) system1.getContext("system1a");
        system1a.publish(new ModuleStart(this));

        Source source = (Source) system1a.getContext("source").getInstance(null);
        assertEquals(target, source.getTarget());
        source.getTarget().getString();
        runtime.stop();
View Full Code Here

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

     */
    public void testScenario5() throws Exception {
        RuntimeContext runtime = createScenario5Runtime();
        SystemCompositeContext system = runtime.getSystemContext();
        CompositeContext system1 = (CompositeContext) system.getContext("system1");
        system1.publish(new ModuleStart(this));
        Target target = (Target) system.getContext("target").getInstance(null);
        assertNotNull(target);
        CompositeContext system1a = (CompositeContext) system1.getContext("system1a");
        system1a.publish(new ModuleStart(this));

        Source source = (Source) system1a.getContext("source").getInstance(null);
        assertEquals(target, source.getTarget());
        source.getTarget().getString();
        runtime.stop();
View Full Code Here

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

        Component source = MockFactory.createSystemComponent("source", Source.class, AutowireSourceImpl.class, Scope.MODULE);
        app1aComponent.getImplementation().getComponents().add(source);
        app1Component.getImplementation().getComponents().add(app1aComponent);
        CompositeContext root = runtime.getRootContext();
        root.registerModelObject(app1Component);
        system.publish(new ModuleStart(this));
        return runtime;
    }
View Full Code Here

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

        system.registerModelObject(system2Component);

        Component source = MockFactory.createSystemComponent("source", Source.class, AutowireSourceImpl.class, Scope.MODULE);
        system1aComponent.getImplementation().getComponents().add(source);
        system.registerModelObject(system1Component);
        system.publish(new ModuleStart(this));
        return runtime;
    }
View Full Code Here

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

        system1Component.getImplementation().getComponents().add(target);

        Component source = MockFactory.createSystemComponent("source", Source.class, AutowireSourceImpl.class, Scope.MODULE);
        system1aComponent.getImplementation().getComponents().add(source);
        system.registerModelObject(system1Component);
        system.publish(new ModuleStart(this));
        return runtime;
    }
View Full Code Here

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

        system.registerModelObject(target);

        Component source = MockFactory.createSystemComponent("source", Source.class, AutowireSourceImpl.class, Scope.MODULE);
        system1aComponent.getImplementation().getComponents().add(source);
        system.registerModelObject(system1Component);
        system.publish(new ModuleStart(this));
        return runtime;
    }
View Full Code Here

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

                throw e;
            }
            CompositeContext compositeCtx = (CompositeContext) context;
            compositeCtx.start();
            if (moduleScopeStarted) {
                compositeCtx.publish(new ModuleStart(this));
            }
            contexts.put(compositeCtx.getName(), compositeCtx);
        }
    }
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.