Creates a redeploy handler.
968718
private Handler<AsyncResult<String>> createRedeployHandler(final JsonObject deploymentInfo, final CountDownLatch latch) {
    return new Handler<AsyncResult<String>>() {
      @Override
      public void handle(AsyncResult<String> result) {
        if (result.failed()) {
          log.error(result.cause());
          latch.countDown();
        } else {
          addMappedDeployment(result.result(), deploymentInfo, new Handler<AsyncResult<String>>() {
            @Override
            public void handle(AsyncResult<String> result) {
              latch.countDown();
            }
          });
        }
      }
    };
  }
86860
def make(self, cwl):
        """"""
        load = load_tool.load_tool(cwl, self.loading_context)
        if isinstance(load, int):
            raise Exception("Error loading tool")
        return Callable(load, self)
772470
private void doDeployModule(final Message<JsonObject> message) {
    String moduleName = message.body().getString("module");
    if (moduleName == null) {
      message.reply(new JsonObject().putString("status", "error").putString("message", "No module name specified."));
      return;
    }

    JsonObject config = message.body().getObject("config");
    if (config == null) {
      config = new JsonObject();
    }
    int instances = message.body().getInteger("instances", 1);
    platform.deployModule(moduleName, config, instances, new Handler<AsyncResult<String>>() {
      @Override
      public void handle(AsyncResult<String> result) {
        if (result.failed()) {
          message.reply(new JsonObject().putString("status", "error").putString("message", result.cause().getMessage()));
        } else {
          final String deploymentID = result.result();
          context.execute(new Action<String>() {
            @Override
            public String perform() {
              deployments.put(node, message.body().copy().putString("id", deploymentID).encode());
              return deploymentID;
            }
          }, new Handler<AsyncResult<String>>() {
            @Override
            public void handle(AsyncResult<String> result) {
              message.reply(new JsonObject().putString("status", "ok").putString("id", deploymentID));
            }
          });
        }
      }
    });
  }
559548
function createRemoveNodeHandler(el, fn) {
  return function (mutations, observer) {
    mutations.forEach(function (mutation) {
      if (_includes(mutation.removedNodes, el)) {
        fn();
        observer.disconnect();
      }
    });
  };
}
1194123
def reload(*command, ignore_patterns=[]):
    """"""
    path = "."
    sig = signal.SIGTERM
    delay = 0.25
    ignorefile = ".reloadignore"

    ignore_patterns = ignore_patterns or load_ignore_patterns(ignorefile)

    event_handler = ReloadEventHandler(ignore_patterns)
    reloader = Reloader(command, signal)

    observer = Observer()
    observer.schedule(event_handler, path, recursive=True)
    observer.start()

    reloader.start_command()

    try:
        while True:
            time.sleep(delay)
            sys.stdout.write(reloader.read())
            sys.stdout.flush()
            if event_handler.modified:
                reloader.restart_command()
    except KeyboardInterrupt:
        observer.stop()
    observer.join()

    reloader.stop_command()
    sys.stdout.write(reloader.read())
    sys.stdout.flush()
54725
function undeploy(mode, target, system, containerDef, container, out, cb) {
    logger.info('undeploying');
    out.stdout('undeploying');
    cb();
  }
674392
private void clearDeployments(final Handler<AsyncResult<Void>> doneHandler) {
    context.execute(new Action<Void>() {
      @Override
      public Void perform() {
        Collection<String> sdeploymentsInfo = deployments.get(group);
        for (String sdeploymentInfo : sdeploymentsInfo) {
          JsonObject deploymentInfo = new JsonObject(sdeploymentInfo);
          if (deploymentInfo.getString("address").equals(internal)) {
            deployments.remove(group, sdeploymentInfo);
          }
        }
        return null;
      }
    }, doneHandler);
  }
301169
function createHandler(to, except, pathFunc, protocol) {
    return function(req, res, next) {
        var host = req.hostname || '';
        var url = req.url;

        if (host in except) {
            next();
        } else {
            var target = new URIjs(pathFunc(host, url))
              .host(to)
              .protocol(protocol || '')
              .href();

            res.redirect(301, target);
        }
    };
}
364050
private NettyServerHandler createHandler(
      ServerTransportListener transportListener, ChannelPromise channelUnused) {
    return NettyServerHandler.newHandler(
        transportListener,
        channelUnused,
        streamTracerFactories,
        transportTracer,
        maxStreams,
        flowControlWindow,
        maxHeaderListSize,
        maxMessageSize,
        keepAliveTimeInNanos,
        keepAliveTimeoutInNanos,
        maxConnectionIdleInNanos,
        maxConnectionAgeInNanos,
        maxConnectionAgeGraceInNanos,
        permitKeepAliveWithoutCalls,
        permitKeepAliveTimeInNanos);
  }
1102918
private void doDeployNetwork(final String name, final Message<JsonObject> message) {
    // When deploying a bare network, we first attempt to load any existing
    // configuration from the cluster. This ensures that we don't overwrite
    // a cluster configuration. In some cases, the manager can be redeployed
    // by deploying a network name.
    String scontext = data.<String, String>getMap(String.format("%s.%s", cluster, name)).get(String.format("%s.%s", cluster, name));
    final NetworkContext context = scontext != null ? Contexts.<NetworkContext>deserialize(new JsonObject(scontext)) : ContextBuilder.buildContext(new DefaultNetworkConfig(name), cluster);

    // Simply deploy an empty network.
    if (!managers.containsKey(context.address())) {
      // If the network manager hasn't yet been deployed then deploy the manager
      // and then update the network's configuration.
      platform.deployVerticle(NetworkManager.class.getName(), new JsonObject().putString("cluster", cluster).putString("address", context.address()), 1, new Handler<AsyncResult<String>>() {
        @Override
        public void handle(AsyncResult<String> result) {
          if (result.failed()) {
            message.reply(new JsonObject().putString("status", "error").putString("message", "Failed to deploy network manager."));
          } else {
            // Once the manager has been deployed we can add the network name to
            // the set of networks that are deployed in the cluster.
            final String deploymentID = result.result();
            DefaultNodeManager.this.context.execute(new Action<Void>() {
              @Override
              public Void perform() {
                networks.add(context.name());
                return null;
              }
            }, new Handler<AsyncResult<Void>>() {
              @Override
              public void handle(AsyncResult<Void> result) {
                // And store the manager's deployment ID in the local managers map.
                managers.put(context.address(), deploymentID);
                doDeployNetwork(context, message);
              }
            });
          }
        }
      });
    } else {
      message.reply(new JsonObject().putString("status", "ok").putObject("context", Contexts.serialize(context)));
    }
  }
973372
function initRedis(config, callback) {

  var self = this;

  protos.util.checkLocalPort(config.port, function(err) {

    if (err) {
      app.log("RedisTransport [%s:%s] %s", config.host, config.port, err.code);
    } else {

      // Set redis client
      self.client = redis.createClient(config.port, config.host, self.options);

      // Handle error event
      self.client.on('error', function(err) {
        callback.call(self, err);
      });

      // Authenticate if password provided
      if (typeof config.password == 'string') {
        self.client.auth(config.password, function(err, res) {
          if (err) {
            app.log("RedisTransport: [%s:%s] %s", config.host, config.port, err.code);
          } else if (typeof config.db == 'number' && config.db !== 0) {
            self.client.select(config.db, function(err, res) {
              if (err) callback.call(self, err);
              else callback.call(self, null);
            });
          } else {
            callback.call(self, null);
          }
        });
      } else if (typeof config.db == 'number' && config.db !== 0) {
        self.client.select(config.db, function(err, res) {
          callback.call(self, err);
        });
      } else {
        callback.call(self, null);
      }

    }
  });

}
1322015
def run_with_reloader(main_func, extra_files=None, interval=1):
    """"""
    import signal
    signal.signal(signal.SIGTERM, lambda *args: sys.exit(0))
    if os.environ.get('WERKZEUG_RUN_MAIN') == 'true':
        thread.start_new_thread(main_func, ())
        try:
            reloader_loop(extra_files, interval)
        except KeyboardInterrupt:
            return
    try:
        sys.exit(restart_with_reloader())
    except KeyboardInterrupt:
        pass
1355513
public function handleRefresh(): void
	{
		if ($this->isAjax()) {
			$this->redrawControl('server');

			$this->redrawControl('load');
			$this->redrawControl('uptime');
			$this->redrawControl('users');
			$this->redrawControl('processes');

			$this->redrawControl('cpu');

			$this->redrawControl('memory');

			$this->redrawControl('fileSystem');

			$this->redrawControl('network');
		} else {
			$this->terminate();
		}
	}
1137795
@Override
    public void handleDeployment(DeploymentInfo deploymentInfo, ServletContext servletContext) {
        deploymentInfo.addAuthenticationMechanism("MP-JWT", new JWTAuthMechanismFactory());
        deploymentInfo.addInnerHandlerChainWrapper(MpJwtPrincipalHandler::new);
    }
65853
private static void createRestorerInstance() {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "createRestorerInstance");
    try {
      Class cls = Class.forName(SI_MESSAGE_HANDLE_RESTORER_CLASS);
      instance = (SIMessageHandleRestorer) cls.newInstance();
    }
    catch (Exception e) {
      FFDCFilter.processException(e, "com.ibm.wsspi.sib.core.SIMessageHandleRestorer.createRestorerInstance", "100");
       SibTr.error(tc,"UNABLE_TO_CREATE_HANDLERESTORER_CWSIB0010",e);
      NoClassDefFoundError ncdfe = new NoClassDefFoundError(e.getMessage());
      ncdfe.initCause(e);
      throw ncdfe;
    }
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "createRestorerInstance");
  }
693770
@Override
    public Promise<Void> undeploy(String deploymentID) {
        return adapter.toPromise(handler -> vertx.undeploy(deploymentID, handler));
    }
453814
public static Operation createDeployOperation(final DeploymentDescription deployment) {
        Assert.checkNotNullParam("deployment", deployment);
        final CompositeOperationBuilder builder = CompositeOperationBuilder.create(true);
        addDeployOperationStep(builder, deployment);
        return builder.build();
    }