Examples of registerModelObject()


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

        systemEp.getBindings().add(systemFactory.createSystemBinding());
        Service service = systemFactory.createService();
        service.setName("system1/target.ep");
        (systemEp.getConfiguredReference().getTargetConfiguredServices().get(0)).setPort(service);

        system.registerModelObject(systemEp);
        ModuleComponent app1Component = createAppModuleComponent("app1");
        ModuleComponent app1aComponent = createAppModuleComponent("app1a");
        Component source = MockFactory.createSystemComponent("source", Source.class, AutowireSourceImpl.class, Scope.MODULE);
        app1aComponent.getImplementation().getComponents().add(source);
        app1Component.getImplementation().getComponents().add(app1aComponent);
View Full Code Here

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

        Component target = MockFactory.createSystemComponent("target", Target.class, TargetImpl.class, Scope.MODULE);
        system2Component.getImplementation().getComponents().add(target);
        EntryPoint ep = MockFactory.createEPSystemBinding("target.ep", Target.class, "target", target);
        system2Component.getImplementation().getEntryPoints().add(ep);
        system.registerModelObject(system2Component);

        Component source = MockFactory.createSystemComponent("source", Source.class, AutowireSourceImpl.class, Scope.MODULE);
        system1aComponent.getImplementation().getComponents().add(source);
        system.registerModelObject(system1Component);
        system.publish(new ModuleStart(this));
View Full Code Here

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

        system2Component.getImplementation().getEntryPoints().add(ep);
        system.registerModelObject(system2Component);

        Component source = MockFactory.createSystemComponent("source", Source.class, AutowireSourceImpl.class, Scope.MODULE);
        system1aComponent.getImplementation().getComponents().add(source);
        system.registerModelObject(system1Component);
        system.publish(new ModuleStart(this));
        return runtime;
    }

    private RuntimeContext createScenario4Runtime() throws Exception {
View Full Code Here

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

        Component target = MockFactory.createSystemComponent("target", Target.class, TargetImpl.class, Scope.MODULE);
        system1Component.getImplementation().getComponents().add(target);

        Component source = MockFactory.createSystemComponent("source", Source.class, AutowireSourceImpl.class, Scope.MODULE);
        system1aComponent.getImplementation().getComponents().add(source);
        system.registerModelObject(system1Component);
        system.publish(new ModuleStart(this));
        return runtime;
    }

    private RuntimeContext createScenario5Runtime() throws Exception {
View Full Code Here

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

        ModuleComponent system1Component = MockFactory.createSystemCompositeComponent("system1");
        ModuleComponent system1aComponent = MockFactory.createSystemCompositeComponent("system1a");
        system1Component.getImplementation().getComponents().add(system1aComponent);

        Component target = MockFactory.createSystemComponent("target", Target.class, TargetImpl.class, Scope.MODULE);
        system.registerModelObject(target);

        Component source = MockFactory.createSystemComponent("source", Source.class, AutowireSourceImpl.class, Scope.MODULE);
        system1aComponent.getImplementation().getComponents().add(source);
        system.registerModelObject(system1Component);
        system.publish(new ModuleStart(this));
View Full Code Here

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

        Component target = MockFactory.createSystemComponent("target", Target.class, TargetImpl.class, Scope.MODULE);
        system.registerModelObject(target);

        Component source = MockFactory.createSystemComponent("source", Source.class, AutowireSourceImpl.class, Scope.MODULE);
        system1aComponent.getImplementation().getComponents().add(source);
        system.registerModelObject(system1Component);
        system.publish(new ModuleStart(this));
        return runtime;
    }

    private ModuleComponent createAppModuleComponent(String name) throws ConfigurationLoadException {
View Full Code Here

Examples of org.apache.tuscany.core.context.impl.CompositeContextImpl.registerModelObject()

     * Checks that registration of duplicate named model objects before context start throws an exception
     */
    public void testRegisterSameName() throws Exception {
        CompositeContext parent = new CompositeContextImpl("test.parent", null, new DefaultScopeStrategy(),
                new EventContextImpl(), new MockConfigContext(builders));
        parent.registerModelObject(MockFactory.createSystemCompositeComponent("test.child"));
        try {
            parent.registerModelObject(MockFactory.createSystemCompositeComponent("test.child"));
            parent.start();
            fail("Expected " + DuplicateNameException.class.getName());
        } catch (DuplicateNameException e) {
View Full Code Here

Examples of org.apache.tuscany.core.context.impl.CompositeContextImpl.registerModelObject()

    public void testRegisterSameName() throws Exception {
        CompositeContext parent = new CompositeContextImpl("test.parent", null, new DefaultScopeStrategy(),
                new EventContextImpl(), new MockConfigContext(builders));
        parent.registerModelObject(MockFactory.createSystemCompositeComponent("test.child"));
        try {
            parent.registerModelObject(MockFactory.createSystemCompositeComponent("test.child"));
            parent.start();
            fail("Expected " + DuplicateNameException.class.getName());
        } catch (DuplicateNameException e) {
            // expected
        }
View Full Code Here

Examples of org.apache.tuscany.core.context.impl.CompositeContextImpl.registerModelObject()

     * Checks that registration of duplicate named model objects after context start throws an exception
     */
    public void testRegisterSameNameAfterStart() throws Exception {
        CompositeContext parent = new CompositeContextImpl("test.parent", null, new DefaultScopeStrategy(),
                new EventContextImpl(), new MockConfigContext(builders));
        parent.registerModelObject(MockFactory.createSystemCompositeComponent("test.child"));
        parent.start();
        CompositeContext child = (CompositeContext) parent.getContext("test.child");
        Assert.assertNotNull(child);
        try {
            parent.registerModelObject(MockFactory.createSystemCompositeComponent("test.child"));
View Full Code Here

Examples of org.apache.tuscany.core.context.impl.CompositeContextImpl.registerModelObject()

        parent.registerModelObject(MockFactory.createSystemCompositeComponent("test.child"));
        parent.start();
        CompositeContext child = (CompositeContext) parent.getContext("test.child");
        Assert.assertNotNull(child);
        try {
            parent.registerModelObject(MockFactory.createSystemCompositeComponent("test.child"));
            fail("Expected " + DuplicateNameException.class.getName());
        } catch (DuplicateNameException e) {
            // expected
        }
    }
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.