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

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


        moduleContext2.registerModelObject(component2);
        moduleContext2.registerModelObject(entryPoint2);
        moduleContext2.registerModelObject(externalService2);

        moduleContext1.publish(new ModuleStart(this));
        moduleContext2.publish(new ModuleStart(this));
        Assert.assertNotNull(moduleContext2.getContext("ExternalService2").getInstance(null));
        Assert.assertNotNull(moduleContext1.getContext("ExternalService1").getInstance(null));
    }

    /**
 
View Full Code Here


        ExternalService es = MockFactory.createESSystemBinding("TestServiceES", "tuscany.system/TestService1EP");
        moduleContext.registerModelObject(es);

        // start the modules and test inter-module system wires
        systemContext.publish(new ModuleStart(this));
        moduleContext.publish(new ModuleStart(this));

        Assert.assertNotNull(systemContext.getContext("TestService1EP").getInstance(null));
        GenericSystemComponent testService = (GenericSystemComponent) systemContext.getContext("TestService1").getInstance(null);
        Assert.assertNotNull(testService);
        GenericSystemComponent testES = (GenericSystemComponent) moduleContext.getContext("TestServiceES").getInstance(null);
View Full Code Here

        runtime.registerModelObject(moduleComponent);
        CompositeContextImpl moduleContext = (CompositeContextImpl) runtime.getContext("test.module");
        Assert.assertNotNull(moduleContext);
        ExternalService es = MockFactory.createESSystemBinding("TestService2ES", "tuscany.system/TestService2EP");
        moduleContext.registerModelObject(es);
        moduleContext.publish(new ModuleStart(this));
        Assert.assertNotNull(moduleContext.getContext("TestService2ES").getInstance(null));

        moduleContext.publish(new ModuleStop(this));
        system.publish(new ModuleStop(this));
        runtime.stop();
View Full Code Here

        ExternalService es = MockFactory.createESSystemBinding("TestService2ES", "tuscany.system/TestService2EP");
        moduleContext.registerModelObject(es);
        moduleContext.publish(new ModuleStart(this));
        Assert.assertNotNull(moduleContext.getContext("TestService2ES").getInstance(null));

        moduleContext.publish(new ModuleStop(this));
        system.publish(new ModuleStop(this));
        runtime.stop();
    }

    protected void setUp() throws Exception {
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.