@@ -0,0 +1,3076 @@
+import org.vertx.java.core.AsyncResult;%0Aimport org.vertx.java.core.Handler;%0Aimport org.vertx.java.core.eventbus.Message;%0Aimport org.vertx.java.core.json.JsonObject;%0Aimport org.vertx.java.platform.Verticle;%0A%0A/*%0A * Copyright 2014 the original author or authors.%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A * http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0A%0A/**%0A * Cluster data example.%0A *%0A * @author Jordan Halterman%0A */%0Apublic class DataExample extends Verticle %7B%0A%0A  @Override%0A  public void start() %7B%0A    // Set a key in the cluster.%0A    JsonObject message = new JsonObject()%0A        .putString(%22action%22, %22set%22)%0A        .putString(%22key%22, %22test%22)%0A        .putString(%22value%22, %22Hello world!%22);%0A    vertx.eventBus().sendWithTimeout(%22cluster%22, message, 30000, new Handler%3CAsyncResult%3CMessage%3CJsonObject%3E%3E%3E() %7B%0A      @Override%0A      public void handle(AsyncResult%3CMessage%3CJsonObject%3E%3E result) %7B%0A        if (result.failed()) %7B%0A          container.logger().error(result.cause());%0A        %7D%0A        else if (result.result().body().getString(%22status%22).equals(%22ok%22)) %7B%0A%0A          // Get the value from the cluster.%0A          JsonObject message = new JsonObject()%0A              .putString(%22action%22, %22get%22)%0A              .putString(%22key%22, %22test%22);%0A          vertx.eventBus().sendWithTimeout(%22cluster%22, message, 30000, new Handler%3CAsyncResult%3CMessage%3CJsonObject%3E%3E%3E() %7B%0A            @Override%0A            public void handle(AsyncResult%3CMessage%3CJsonObject%3E%3E result) %7B%0A              if (result.failed()) %7B%0A                container.logger().error(result.cause());%0A              %7D%0A              else if (result.result().body().getString(%22status%22).equals(%22ok%22)) %7B%0A                container.logger().info(%22Value of test is %22 + result.result().body().getString(%22result%22));%0A%0A                // Delete the key from the cluster.%0A                JsonObject message = new JsonObject()%0A                    .putString(%22action%22, %22delete%22)%0A                    .putString(%22key%22, %22test%22);%0A                vertx.eventBus().sendWithTimeout(%22cluster%22, message, 30000, new Handler%3CAsyncResult%3CMessage%3CJsonObject%3E%3E%3E() %7B%0A                  @Override%0A                  public void handle(AsyncResult%3CMessage%3CJsonObject%3E%3E result) %7B%0A                    if (result.failed()) %7B%0A                      container.logger().error(result.cause());%0A                    %7D%0A                    else if (result.result().body().getString(%22status%22).equals(%22ok%22)) %7B%0A                      container.logger().info(%22Deleted key test%22);%0A                    %7D%0A                  %7D%0A                %7D);%0A              %7D%0A            %7D%0A          %7D);%0A        %7D%0A      %7D%0A    %7D);%0A  %7D%0A%0A%7D%0A

Add data example.