Package org.apache.tuscany.core.context

Examples of org.apache.tuscany.core.context.SystemCompositeContext.stop()


        Assert.assertNotNull(targetRef);
        Target target = (Target) ((AtomicContext) context.getContext("target")).getTargetInstance();
        Assert.assertSame(target, targetRef);
        Assert.assertSame(target, source.getTarget());
        context.publish(new ModuleStop(this));
        context.stop();
    }

    public void testStatelessToModuleScope() throws Exception {
        SystemCompositeContext context = createContext();
        context.start();
View Full Code Here


        source = (Source) ((AtomicContext) context.getContext("source")).getTargetInstance();
        Target target = (Target) ((AtomicContext) context.getContext("target")).getTargetInstance();
        Assert.assertSame(target, targetRef);
        Assert.assertSame(target, source.getTarget());
        context.publish(new ModuleStop(this));
        context.stop();
    }

    public void testModuleToStatelessScope() throws Exception {
        SystemCompositeContext context = createContext();
        context.start();
View Full Code Here

        Source source2 = (Source) ((AtomicContext) context.getContext("source")).getTargetInstance();
        // should be the same since the module scope component was alreadyy created and the stateless
        // component will be "attached" to it
        Assert.assertSame(source.getTarget(), source2.getTarget());
        context.publish(new ModuleStop(this));
        context.stop();
    }

    public void testMultiplicity() throws Exception {
        SystemCompositeContext context = createContext();
        context.start();
View Full Code Here

    public void contextDestroyed(ServletContextEvent servletContextEvent) {
        moduleContext.publish(new ModuleStop(this));
        moduleContext.stop();
        SystemCompositeContext systemContext = runtime.getSystemContext();
        systemContext.publish(new ModuleStop(this));
        systemContext.stop();
        runtime.stop();
        servletContextEvent.getServletContext().removeAttribute(MODULE_COMPONENT_NAME);
        servletContextEvent.getServletContext().removeAttribute(TUSCANY_RUNTIME_NAME);
    }
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.