Examples of stop()


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

        Assert.assertEquals((byte) 1, instance.getTestByte());
        Assert.assertEquals("test", instance.getTestString());

        Assert.assertTrue(instance.initialized());
        ctx.destroy();
        ctx.stop();
        Assert.assertTrue(instance.destroyed());
    }


    public void testDefaultScopeIsModuleScope() throws Exception {
View Full Code Here

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

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

    private static SystemAssemblyFactory systemFactory = new SystemAssemblyFactoryImpl();

    /**
 
View Full Code Here

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

    }

    public void removeContext(String ctxName) throws ScopeRuntimeException {
        Context context = contexts.remove(ctxName);
        if (context != null) {
            context.stop();
        }
    }

    public void removeContextByKey(String ctxName, Object key) throws ScopeRuntimeException {
        throw new UnsupportedOperationException();
View Full Code Here

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

            return;
        }
        for(Lifecycle context: contexts.values()) {
            try {
                if (context.getLifecycleState() == RUNNING) {
                    context.stop();
                }
            } catch (CoreRuntimeException e){
                // TODO send monitoring event
            }
        }
View Full Code Here

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

Examples of org.apache.tuscany.core.context.scope.CompositeScopeContext.stop()

        scopeContainer.registerFactory(MockFactory.createCompositeConfiguration("CompositeComponent"));
        scopeContainer.start();
        scopeContainer.onEvent(new ModuleStart(this));
        scopeContainer.getContext("CompositeComponent");
        scopeContainer.onEvent(new ModuleStop(this));
        scopeContainer.stop();
    }

    /**
     * Tests adding a context after its parent has been started
     */
 
View Full Code Here

Examples of org.apache.tuscany.core.context.scope.ModuleScopeContext.stop()

        scope.onEvent(new ModuleStop(this));

        Assert.assertTrue(initDestroy.isDestroyed());
        Assert.assertTrue(destroyOnly.isDestroyed());

        scope.stop();
    }

    public void testEagerInit() throws Exception {
        EventContext ctx = new EventContextImpl();
        ModuleScopeContext scope = new ModuleScopeContext(ctx);
View Full Code Here

Examples of org.apache.tuscany.core.context.scope.RequestScopeContext.stop()

        // end request
        scope.onEvent(new RequestEnd(this, new Object()));
        Assert.assertTrue(initDestroy.isDestroyed());
        Assert.assertTrue(destroyOnly.isDestroyed());

        scope.stop();
    }

    /**
     * Test instances destroyed in proper (i.e. reverse) order
     */
 
View Full Code Here

Examples of org.apache.tuscany.core.context.scope.SessionScopeContext.stop()

    public void testSetNullComponents() throws Exception {
        EventContext ctx = new EventContextImpl();
        SessionScopeContext scope = new SessionScopeContext(ctx);
        scope.registerFactories(new ArrayList<ContextFactory<Context>>());
        scope.start();
        scope.stop();
    }

    public void testGetContextByKey() throws Exception {
        EventContext ctx = new EventContextImpl();
        SessionScopeContext scope = new SessionScopeContext(ctx);
View Full Code Here

Examples of org.apache.tuscany.core.context.scope.StatelessScopeContext.stop()

        Assert.assertNotNull(comp1);
        // second request
        StatelessComponentImpl comp2 = (StatelessComponentImpl) scope.getContext("TestService1").getInstance(null);
        Assert.assertNotNull(comp2);
        Assert.assertNotSame(comp1, comp2);
        scope.stop();
    }

    public void testRegisterContextBeforeRequest() throws Exception {
        EventContext ctx = new EventContextImpl();
        StatelessScopeContext scope = new StatelessScopeContext(ctx);
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.