code: private void undeployModule(final InstanceContext instance, final CountingCompletionHandler<Void> counter) {
      deploymentIDs.remove(instance.address(), new Handler<AsyncResult<String>>() {
        @Override
        public void handle(AsyncResult<String> result) {
          if (result.failed()) {
            counter.fail(result.cause());
          } else if (result.result() != null) {
            cluster.undeployModule(result.result(), new Handler<AsyncResult<Void>>() {
              @Override
              public void handle(AsyncResult<Void> result) {
                unwatchInstance(instance, counter);
              }
            });
          } else {
            unwatchInstance(instance, counter);
          }
        }
      });
    }
docs: Undeploys a module component instance.