Package org.apache.tuscany.core.context.event

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


        }
    }

    private void stopContext(Context ctx) {
        if (moduleContext != null) {
            moduleContext.publish(new ModuleStop(this));
        }
        CompositeContext rootContext = runtime.getRootContext();
        rootContext.removeContext(moduleContext.getName());
        valve.setEnabled(false);
        //ctx.getPipeline().removeValve(valve);
View Full Code Here


        Target targetRef = source.getTarget();
        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();
    }
View Full Code Here

        Assert.assertNotNull(targetRef);
        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();
    }
View Full Code Here

        Assert.assertNotSame(target, targetRef);
        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();
    }
View Full Code Here

    @Override
    public void stop() {
        setModuleContext(null);
        moduleContext.publish(new RequestEnd(this, new Object()));
        moduleContext.publish(new HttpSessionEnd(this, sessionKey));
        moduleContext.publish(new ModuleStop(this));
        moduleContext.stop();
        monitor.moduleStopped(moduleContext.getName());
    }
View Full Code Here

    /**
     * Shut down the Tuscany runtime.
     */
    public void shutdown() {
        runtime.getSystemContext().publish(new ModuleStop(this));
        runtime.stop();
    }
View Full Code Here

        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

        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

        system = new SystemCompositeContextImpl("system", null, null, new SystemScopeStrategy(), new EventContextImpl(), new MockConfigContext(builders));
    }

    protected void tearDown() throws Exception {
        system.publish(new ModuleStop(this));
        system.stop();
        super.tearDown();
    }
View Full Code Here

        servletContext.setAttribute(TUSCANY_RUNTIME_NAME, runtime);
        servletContext.setAttribute(MODULE_COMPONENT_NAME, moduleContext);
    }

    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

Related Classes of org.apache.tuscany.core.context.event.ModuleStop

Copyright © 2018 www.massapicom. 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.