Package net.kuujo.vertigo.component

Examples of net.kuujo.vertigo.component.ModuleContext


  public void testDefaultFeederModuleContext() {
    DefaultNetworkConfig network = new DefaultNetworkConfig("test");
    network.addModule("feeder", "com.test~test-module~1.0");
    NetworkContext context = ContextBuilder.buildContext(network, "vertigo");
    assertEquals("vertigo.test", context.address());
    ModuleContext moduleContext = context.component("feeder");
    assertEquals("feeder", moduleContext.name());
    assertEquals("vertigo.test.feeder", moduleContext.address());
    assertEquals("com.test~test-module~1.0", moduleContext.module());
    assertFalse(moduleContext.isVerticle());
    assertTrue(moduleContext.isModule());
    assertEquals(new JsonObject(), moduleContext.config());
    assertEquals(1, moduleContext.numInstances());
    assertNotNull(moduleContext.network());
  }
View Full Code Here


    verticle.setConfig(new JsonObject().putString("foo", "bar"));
    verticle.setInstances(2);
    verticle.setGroup("test");
    NetworkContext context = ContextBuilder.buildContext(network, "vertigo");
    assertEquals("vertigo.test", context.address());
    ModuleContext moduleContext = context.component("feeder");
    assertEquals("feeder", moduleContext.name());
    assertEquals("vertigo.test.feeder", moduleContext.address());
    assertEquals("com.test~test-module~1.0", moduleContext.module());
    assertFalse(moduleContext.isVerticle());
    assertTrue(moduleContext.isModule());
    assertEquals("bar", moduleContext.config().getString("foo"));
    assertEquals(2, moduleContext.numInstances());
    assertEquals(2, moduleContext.instances().size());
    assertEquals("test", moduleContext.group());
    assertNotNull(moduleContext.network());
  }
View Full Code Here

  public void testDefaultWorkerModuleContext() {
    DefaultNetworkConfig network = new DefaultNetworkConfig("test");
    network.addModule("worker", "com.test~test-module~1.0");
    NetworkContext context = ContextBuilder.buildContext(network, "vertigo");
    assertEquals("vertigo.test", context.address());
    ModuleContext moduleContext = context.component("worker");
    assertEquals("worker", moduleContext.name());
    assertEquals("vertigo.test.worker", moduleContext.address());
    assertEquals("com.test~test-module~1.0", moduleContext.module());
    assertFalse(moduleContext.isVerticle());
    assertTrue(moduleContext.isModule());
    assertEquals(new JsonObject(), moduleContext.config());
    assertEquals(1, moduleContext.numInstances());
    assertNotNull(moduleContext.network());
  }
View Full Code Here

    module.setConfig(new JsonObject().putString("foo", "bar"));
    module.setInstances(2);
    module.setGroup("test");
    NetworkContext context = ContextBuilder.buildContext(network, "vertigo");
    assertEquals("vertigo.test", context.address());
    ModuleContext moduleContext = context.component("worker");
    assertEquals("worker", moduleContext.name());
    assertEquals("vertigo.test.worker", moduleContext.address());
    assertEquals("com.test~test-module~1.0", moduleContext.module());
    assertFalse(moduleContext.isVerticle());
    assertTrue(moduleContext.isModule());
    assertEquals("bar", moduleContext.config().getString("foo"));
    assertEquals(2, moduleContext.numInstances());
    assertEquals(2, moduleContext.instances().size());
    assertEquals("test", moduleContext.group());
    assertNotNull(moduleContext.network());
  }
View Full Code Here

    log.info(String.format("%s - Deploying %d instances of %s", NetworkManager.this, component.instances().size(), component.isModule() ? component.asModule().module() : component.asVerticle().main()));
    log.debug(String.format("%s - Deploying component:%n%s", NetworkManager.this, component.toString(true)));
    // If the component is installable then we first need to install the
    // component to all the nodes in the cluster.
    if (component.isModule()) {
      final ModuleContext module = component.asModule();
      // If the component has a group then install the module to the group.
      if (component.group() != null) {
        // Make sure to install the module only to the appropriate deployment group.
        cluster.getGroup(component.group(), new Handler<AsyncResult<Group>>() {
          @Override
View Full Code Here

TOP

Related Classes of net.kuujo.vertigo.component.ModuleContext

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.