Package org.apache.tuscany.core.context.impl

Examples of org.apache.tuscany.core.context.impl.EventContextImpl


* @version $Rev: 408581 $ $Date: 2006-05-21 23:34:24 -0700 (Sun, 21 May 2006) $
*/
public class SystemCompositeContextImpl extends AbstractCompositeContext implements SystemCompositeContext {
    public SystemCompositeContextImpl() {
        super();
        eventContext = new EventContextImpl();
        scopeStrategy = new SystemScopeStrategy();
    }
View Full Code Here


public class ModuleScopeLifecycleTestCase extends TestCase {

    JavaContextFactoryBuilder builder;

    public void testInitDestroy() throws Exception {
        EventContext ctx = new EventContextImpl();
        ModuleScopeContext scope = new ModuleScopeContext(ctx);
        scope.registerFactories(createComponents());
        scope.start();
        scope.onEvent(new ModuleStart(this));
        ModuleScopeInitDestroyComponent initDestroy = (ModuleScopeInitDestroyComponent) scope.getContext(
View Full Code Here

        scope.stop();
    }

    public void testEagerInit() throws Exception {
        EventContext ctx = new EventContextImpl();
        ModuleScopeContext scope = new ModuleScopeContext(ctx);
        scope.registerFactories(createEagerInitComponents());
        scope.start();
        scope.onEvent(new ModuleStart(this));
        ModuleScopeEagerInitDestroyComponent initDestroy = (ModuleScopeEagerInitDestroyComponent) scope.getContext(
View Full Code Here

        scope.stop();

    }

    public void testDestroyOrder() throws Exception {
        EventContext ctx = new EventContextImpl();
        ModuleScopeContext scope = new ModuleScopeContext(ctx);
        scope.registerFactories(createOrderedInitComponents());
        scope.start();
        scope.onEvent(new ModuleStart(this));
        OrderedInitPojo one = (OrderedInitPojo) scope.getContext("one").getInstance(null);
View Full Code Here

        Assert.assertEquals(0, one.getNumberInstantiated());
        scope.stop();
    }

    public void testEagerInitDestroyOrder() throws Exception {
        EventContext ctx = new EventContextImpl();
        ModuleScopeContext scope = new ModuleScopeContext(ctx);
        scope.registerFactories(createOrderedEagerInitComponents());
        scope.start();
        scope.onEvent(new ModuleStart(this));
        OrderedEagerInitPojo one = (OrderedEagerInitPojo) scope.getContext("one").getInstance(null);
View Full Code Here

        JavaTargetWireBuilder javaWireBuilder = new JavaTargetWireBuilder();
        ScopeStrategy strategy = new DefaultScopeStrategy();
        DefaultWireBuilder wireBuilder = new DefaultWireBuilder();
        wireBuilder.addWireBuilder(javaWireBuilder);
        Module module = MockFactory.createModule();
        EventContext eCtx = new EventContextImpl();
        ScopeContext scopeContext = new ModuleScopeContext(eCtx);
        scopeContext.start();
        scopeContext.onEvent(new ModuleStart(this));
        List<Component> components = module.getComponents();
        Map<String, Component> compMap = new HashMap<String, Component>(components.size());
View Full Code Here



    protected CompositeContext createContextHierachy() throws Exception {
        List<ContextFactoryBuilder> mockBuilders = MockFactory.createSystemBuilders();
        CompositeContext parent = new SystemCompositeContextImpl("test.parent", null, null, new DefaultScopeStrategy(), new EventContextImpl(), new MockConfigContext(mockBuilders));
        parent.registerModelObject(MockFactory.createCompositeComponent("test.child"));
        parent.start();
        CompositeContext child = (CompositeContext) parent.getContext("test.child");
        Assert.assertNotNull(child);
        return parent;
View Full Code Here

*/
public class SystemCompositeContextRegisterTestCase extends CompositeContextRegisterTestCase {

    protected CompositeContext createContext() {
        List<ContextFactoryBuilder> builders = MockFactory.createSystemBuilders();
        return new SystemCompositeContextImpl("test.context", null, null, new DefaultScopeStrategy(), new EventContextImpl(), new MockConfigContext(builders));
    }
View Full Code Here

            }
        }
    }

    private static CompositeContext createContext() {
        return new CompositeContextImpl("test.parent", null, new DefaultScopeStrategy(), new EventContextImpl(), new MockConfigContext(null));
    }
View Full Code Here

    protected void setUp() throws Exception {
        super.setUp();
        factory = new SystemAssemblyFactoryImpl();
        List<ContextFactoryBuilder> builders = MockFactory.createSystemBuilders();

        system = new SystemCompositeContextImpl("system", null, null, new SystemScopeStrategy(), new EventContextImpl(), new MockConfigContext(builders));
    }
View Full Code Here

TOP

Related Classes of org.apache.tuscany.core.context.impl.EventContextImpl

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.