Package net.kuujo.vertigo.network

Examples of net.kuujo.vertigo.network.NetworkContext.status()


      if (managers.containsKey(context.address())) {
        // Now that we have the network's context we need to watch the network's
        // status key before we begin undeploying the network. Once we unset the
        // network's configuration key the network's manager will automatically
        // begin undeploying the network.
        data.watch(context.status(), MapEvent.Type.CHANGE, new Handler<MapEvent<String, String>>() {
          @Override
          public void handle(MapEvent<String, String> event) {
            // When the network's status key is set to an empty string, that indicates
            // that the network's manager has completely undeployed all components and
            // connections within the network. The manager is the only element of the
View Full Code Here


            // connections within the network. The manager is the only element of the
            // network left running, so we can go ahead and undeploy it.
            if (event.value() != null && event.value().equals("")) {
              // First, stop watching the status key so this handler doesn't accidentally
              // get called again for some reason.
              data.unwatch(context.status(), MapEvent.Type.CHANGE, this, new Handler<AsyncResult<Void>>() {
                @Override
                public void handle(AsyncResult<Void> result) {
                  // Now undeploy the manager from the context cluster. Once the manager
                  // has been undeployed the undeployment of the network is complete.
                  platform.undeployVerticle(managers.remove(context.address()), new Handler<AsyncResult<Void>>() {
View Full Code Here

                        // We can be nice and unset the status key since the manager was undeployed :-)
                        DefaultNodeManager.this.context.execute(new Action<Void>() {
                          @Override
                          public Void perform() {
                            networks.remove(context.address());
                            data.remove(context.status());
                            return null;
                          }
                        }, new Handler<AsyncResult<Void>>() {
                          @Override
                          public void handle(AsyncResult<Void> result) {
View Full Code Here

        // If the new configuration has no components then undeploy the entire network.
        if (context.components().isEmpty()) {
          // We need to watch the network's status key to determine when the network's
          // components have been completely undeployed. Once that happens it's okay
          // to then undeploy the network's manager.
          data.watch(context.status(), MapEvent.Type.CHANGE, new Handler<MapEvent<String, String>>() {
            @Override
            public void handle(MapEvent<String, String> event) {
              // When the network's status key is set to an empty string, that indicates
              // that the network's manager has completely undeployed all components and
              // connections within the network. The manager is the only element of the
View Full Code Here

              // connections within the network. The manager is the only element of the
              // network left running, so we can go ahead and undeploy it.
              if (event.value() != null && event.value().equals("")) {
                // First, stop watching the status key so this handler doesn't accidentally
                // get called again for some reason.
                data.unwatch(context.status(), MapEvent.Type.CHANGE, this, new Handler<AsyncResult<Void>>() {
                  @Override
                  public void handle(AsyncResult<Void> result) {
                    // Now undeploy the manager from the context cluster. Once the manager
                    // has been undeployed the undeployment of the network is complete.
                    platform.undeployVerticle(managers.remove(context.address()), new Handler<AsyncResult<Void>>() {
View Full Code Here

                          // We can be nice and unset the status key since the manager was undeployed :-)
                          DefaultNodeManager.this.context.execute(new Action<Void>() {
                            @Override
                            public Void perform() {
                              networks.remove(context.address());
                              data.remove(context.status());
                              return null;
                            }
                          }, new Handler<AsyncResult<Void>>() {
                            @Override
                            public void handle(AsyncResult<Void> result) {
View Full Code Here

          });
        } else {
          // If only a portion of the running network is being undeployed, we need
          // to watch the network's status key for notification once the configuration
          // change is complete.
          data.watch(context.status(), MapEvent.Type.CHANGE, new Handler<MapEvent<String, String>>() {
            @Override
            public void handle(MapEvent<String, String> event) {
              if (event.value() != null && event.value().equals(context.version())) {
                // The network's configuration has been completely updated. Stop watching
                // the network's status key and call the async handler.
View Full Code Here

            @Override
            public void handle(MapEvent<String, String> event) {
              if (event.value() != null && event.value().equals(context.version())) {
                // The network's configuration has been completely updated. Stop watching
                // the network's status key and call the async handler.
                data.unwatch(context.status(), null, this, new Handler<AsyncResult<Void>>() {
                  @Override
                  public void handle(AsyncResult<Void> result) {
                    message.reply(new JsonObject().putString("status", "ok").putObject("context", Contexts.serialize(context)));
                  }
                });
View Full Code Here

                  } else {
                    testComplete();
                  }
                }
              });
              data.put(context.status(), "ready");
            }
          }
        });
      }
    });
View Full Code Here

                      @Override
                      public void handle(Void _) {
                        testComplete();
                      }
                    });
                    data.remove(context.status());
                  }
                }
              });
              data.put(context.status(), "ready");
            }
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.