@@ -0,0 +1,2723 @@
+package com.blankstyle.vine.impl;%0A%0Aimport java.util.HashMap;%0Aimport java.util.Map;%0A%0Aimport org.vertx.java.core.AsyncResult;%0Aimport org.vertx.java.core.Future;%0Aimport org.vertx.java.core.Handler;%0Aimport org.vertx.java.core.Vertx;%0Aimport org.vertx.java.core.impl.DefaultFutureResult;%0Aimport org.vertx.java.core.json.JsonObject;%0Aimport org.vertx.java.platform.Container;%0A%0Aimport com.blankstyle.vine.Feeder;%0Aimport com.blankstyle.vine.Root;%0Aimport com.blankstyle.vine.RootException;%0A%0A/**%0A * A local root implementation.%0A *%0A * This root does not communicate with a remote root and seeds are not assigned%0A * to specific machines. Seeds are simply started using the local Vert.x%0A * container.%0A *%0A * @author Jordan Halterman%0A */%0Apublic class LocalRoot implements Root %7B%0A%0A  protected static final String ADDRESS_KEY = %22address%22;%0A%0A  protected static final String SEEDS_KEY = %22seeds%22;%0A%0A  protected Vertx vertx;%0A%0A  private Container container;%0A%0A  private Map%3CString, String%3E deploymentMap = new HashMap%3CString, String%3E();%0A%0A  public LocalRoot(Vertx vertx, Container container) %7B%0A    this.vertx = vertx;%0A    this.container = container;%0A  %7D%0A%0A  @Override%0A  public void setVertx(Vertx vertx) %7B%0A    this.vertx = vertx;%0A  %7D%0A%0A  @Override%0A  public Vertx getVertx() %7B%0A    return vertx;%0A  %7D%0A%0A  @Override%0A  public void setContainer(Container container) %7B%0A    this.container = container;%0A  %7D%0A%0A  @Override%0A  public Container getContainer() %7B%0A    return container;%0A  %7D%0A%0A  @Override%0A  public void deploy(JsonObject config, final Handler%3CAsyncResult%3CFeeder%3E%3E feedHandler) %7B%0A    String name = config.getString(%22name%22);%0A    if (name == null) %7B%0A      name = config.getString(%22address%22);%0A    %7D%0A    deploy(name, config, feedHandler);%0A  %7D%0A%0A  @Override%0A  public void deploy(final String name, JsonObject config, final Handler%3CAsyncResult%3CFeeder%3E%3E feedHandler) %7B%0A    final Future%3CFeeder%3E future = new DefaultFutureResult%3CFeeder%3E();%0A    future.setHandler(feedHandler);%0A%0A    JsonObject context = new JsonObject();%0A    final String address = config.getString(ADDRESS_KEY);%0A    if (deploymentMap.containsKey(address)) %7B%0A      future.setFailure(new RootException(%22Cannot redeploy vine.%22));%0A      return;%0A    %7D%0A%0A    context.putString(%22address%22, address);%0A    context.putObject(SEEDS_KEY, config.getObject(SEEDS_KEY));%0A    container.deployVerticle(%22com.blankstyle.vine.VineVerticle%22, context, new Handler%3CAsyncResult%3CString%3E%3E() %7B%0A      @Override%0A      public void handle(AsyncResult%3CString%3E result) %7B%0A        if (result.succeeded()) %7B%0A          deploymentMap.put(address, result.result());%0A          future.setResult(new DefaultFeeder(address, vertx.eventBus()));%0A        %7D%0A        else %7B%0A          future.setFailure(result.cause());%0A        %7D%0A      %7D%0A    %7D);%0A  %7D%0A%0A%7D%0A

Add local root implementation.