Examples of ModuleStart


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

            SystemCompositeContext systemContext = runtime.getSystemContext();
            BootstrapHelper.bootstrapStaxLoader(systemContext, modelContext);
            ModuleComponentConfigurationLoader loader = BootstrapHelper.getConfigurationLoader(systemContext, modelContext);
            ModuleComponent systemModuleComponent = loader.loadSystemModuleComponent(SYSTEM_MODULE_COMPONENT, SYSTEM_MODULE_COMPONENT);
            CompositeContext context = BootstrapHelper.registerModule(systemContext, systemModuleComponent);
            context.publish(new ModuleStart(this));

            TomcatHost host = systemContext.resolveInstance(TomcatHost.class);
            host.setHost(this);
        } catch (ConfigurationLoadException e) {
            getLogger().warn(sm.getString("runtime.loadSystemFailed", e.getResourceURI()), e);
View Full Code Here

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

        CompositeContext child = (CompositeContext) parent.getContext("test.child");
        Component component = factory.createSystemComponent("TestService1", ModuleScopeSystemComponent.class, ModuleScopeSystemComponentImpl.class, Scope.MODULE);
        parent.registerModelObject(component);
        EntryPoint ep = MockFactory.createEPSystemBinding("TestService1EP", ModuleScopeSystemComponent.class, "TestService1", component);
        parent.registerModelObject(ep);
        parent.publish(new ModuleStart(this));
        child.publish(new ModuleStart(this));
        Assert.assertNotNull(parent.getContext("TestService1EP").getInstance(null));
        try {
            ((ModuleContext) child).locateService("TestService1EP");
            fail("Expexcted " + ServiceNotFoundException.class.getName());
        } catch (ServiceNotFoundException e) {
View Full Code Here

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

        CompositeContext child = (CompositeContext) parent.getContext("test.child");
        Component component = factory.createSystemComponent("TestService1", ModuleScopeSystemComponent.class, ModuleScopeSystemComponentImpl.class, Scope.MODULE);
       
        component.initialize(new AssemblyContextImpl(factory, null, null));
        child.registerModelObject(component);
        parent.publish(new ModuleStart(this));
        child.publish(new ModuleStart(this));
        Assert.assertNotNull(child.getContext("TestService1").getInstance(null));
        try {
            ((ModuleContext) parent).locateService("test.child/TestService1");
            fail("Expected " + ServiceUnavailableException.class.getName()
                    + " since [test.child/TestService1] is not an entry point");
View Full Code Here

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

        CompositeContext system = runtimeContext.getSystemContext();
        Assert.assertNotNull(system);
        // register system components
        system.registerModelObject(MockFactory.createSystemModule());
        // start the module scope
        system.publish(new ModuleStart(this));
        // register the first module
       
        // register the second module

        // start the modules
View Full Code Here

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

        MockInterceptorBuilder interceptorBuilder = new MockInterceptorBuilder(mockInterceptor, false);
        registry.registerTargetBuilder(interceptorBuilder);
        runtime.getRootContext().registerModelObject(MockFactory.createCompositeComponent("test.module"));
        CompositeContext child = (CompositeContext) runtime.getRootContext().getContext("test.module");
        child.registerModelObject(MockFactory.createModuleWithEntryPoint(Scope.MODULE));
        child.publish(new ModuleStart(this));
        Object id = new Object();
        child.publish(new RequestStart(this, id));
        EntryPointContext ctx = (EntryPointContext) child.getContext("source");
        Assert.assertNotNull(ctx);
        InvocationHandler handler = (InvocationHandler) ctx.getHandler();
View Full Code Here

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

        MockInterceptorBuilder interceptorBuilder = new MockInterceptorBuilder(mockInterceptor, false);
        registry.registerTargetBuilder(interceptorBuilder);
        runtime.getRootContext().registerModelObject(MockFactory.createCompositeComponent("test.module"));
        CompositeContext child = (CompositeContext) runtime.getRootContext().getContext("test.module");
        child.registerModelObject(MockFactory.createModuleWithEntryPoint(Scope.SESSION));
        child.publish(new ModuleStart(this));

        // first session
        Object session = new Object();
        Object id = new Object();
        child.publish(new RequestStart(this, id));
View Full Code Here

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

        MockInterceptorBuilder interceptorBuilder = new MockInterceptorBuilder(mockInterceptor, false);
        registry.registerTargetBuilder(interceptorBuilder);
        runtime.getRootContext().registerModelObject(MockFactory.createCompositeComponent("test.module"));
        CompositeContext child = (CompositeContext) runtime.getRootContext().getContext("test.module");
        child.registerModelObject(MockFactory.createModuleWithEntryPoint(Scope.INSTANCE));
        child.publish(new ModuleStart(this));
        Object id = new Object();
        child.publish(new RequestStart(this, id));
        EntryPointContext ctx = (EntryPointContext) child.getContext("source");
        Assert.assertNotNull(ctx);
        InvocationHandler handler = (InvocationHandler) ctx.getHandler();
View Full Code Here

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

        MockInterceptorBuilder interceptorBuilder = new MockInterceptorBuilder(mockInterceptor, false);
        registry.registerTargetBuilder(interceptorBuilder);
        runtime.getRootContext().registerModelObject(MockFactory.createCompositeComponent("test.module"));
        CompositeContext child = (CompositeContext) runtime.getRootContext().getContext("test.module");
        child.registerModelObject(MockFactory.createModuleWithEntryPoint(Scope.REQUEST));
        child.publish(new ModuleStart(this));
        Object id = new Object();
        child.publish(new RequestStart(this, id));
        EntryPointContext ctx = (EntryPointContext) child.getContext("source");
        Assert.assertNotNull(ctx);
        InvocationHandler handler = (InvocationHandler) ctx.getHandler();
View Full Code Here

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

        Assert.assertNotNull(ctx);
        runtime.getRootContext().registerModelObject(MockFactory.createCompositeComponent("test"));
        CompositeContext testCtx = (CompositeContext) runtime.getRootContext().getContext("test");
        Assert.assertNotNull(testCtx);
        testCtx.registerModelObject(MockFactory.createModule());
        testCtx.publish(new ModuleStart(this));
        GenericComponent source = (GenericComponent)testCtx.getContext("source").getInstance(null);
        Assert.assertNotNull(source);
        GenericComponent target = (GenericComponent)testCtx.getContext("target").getInstance(null);
        Assert.assertNotNull(target);
        source.getGenericComponent().getString();
View Full Code Here

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

        Assert.assertNotNull(ctx);
        runtime.getRootContext().registerModelObject(MockFactory.createCompositeComponent("test"));
        CompositeContext testCtx = (CompositeContext) runtime.getRootContext().getContext("test");
        Assert.assertNotNull(testCtx);
        testCtx.registerModelObject(MockFactory.createModule(Scope.MODULE,Scope.SESSION));
        testCtx.publish(new ModuleStart(this));
       
        // first session
        Object session = new Object();
        Object id = new Object();
        testCtx.publish(new RequestStart(this,id));
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.