Get the http server for receiving scheduler requests

@param runtime the runtime configuration
@param scheduler an instance of the scheduler
@param port the port for scheduler to listen on
@return an instance of the http server
173265
protected SchedulerServer getServer(
      Config runtime, IScheduler scheduler, int port) throws IOException {

    // create an instance of the server using scheduler class and port
    return new SchedulerServer(runtime, scheduler, port);
  }
921778
@Override
  public synchronized void onNext(final RuntimeStart runtimeStart) {
    LOG.log(Level.FINEST, "HttpRuntimeStartHandler: {0}", runtimeStart);
    try {
      httpServer.start();
      LOG.log(Level.FINEST, "HttpRuntimeStartHandler complete.");
    } catch (final Exception e) {
      LOG.log(Level.SEVERE, "HttpRuntimeStartHandler cannot start the Server. {0}", e);
      throw new RuntimeException("HttpRuntimeStartHandler cannot start the Server.", e);
    }
  }
1031506
public ParallelTaskBuilder prepareHttpGet(String url) {
        reinitIfClosed();
        ParallelTaskBuilder cb = new ParallelTaskBuilder();
        
        cb.getHttpMeta().setHttpMethod(HttpMethod.GET);
        cb.getHttpMeta().setRequestUrlPostfix(url);
        
        return cb;
    }
38455
public HttpServerActionBuilder server(HttpServer httpServer) {
		HttpServerActionBuilder serverAction = new HttpServerActionBuilder(action, httpServer)
				.withApplicationContext(applicationContext);
		return serverAction;
	}
375048
public static Proxy httpProxy(String host, int port) {
        return new Proxy(Proxy.Type.HTTP, new InetSocketAddress(Objects.requireNonNull(host), port));
    }
832921
public static ResourceManagerRuntimeServices fromConfiguration(
			ResourceManagerRuntimeServicesConfiguration configuration,
			HighAvailabilityServices highAvailabilityServices,
			ScheduledExecutor scheduledExecutor) throws Exception {

		final SlotManagerConfiguration slotManagerConfiguration = configuration.getSlotManagerConfiguration();

		final SlotManager slotManager = new SlotManager(
			scheduledExecutor,
			slotManagerConfiguration.getTaskManagerRequestTimeout(),
			slotManagerConfiguration.getSlotRequestTimeout(),
			slotManagerConfiguration.getTaskManagerTimeout(),
			slotManagerConfiguration.isWaitResultConsumedBeforeRelease());

		final JobLeaderIdService jobLeaderIdService = new JobLeaderIdService(
			highAvailabilityServices,
			scheduledExecutor,
			configuration.getJobTimeout());

		return new ResourceManagerRuntimeServices(slotManager, jobLeaderIdService);
	}
964719
public static void schedule(String threadName) {
    try (LockResource r = new LockResource(sLock)) {
      ScheduledTimer timer = sTimers.get(threadName);
      if (timer == null) {
        throw new RuntimeException("Timer for thread " + threadName + " not found.");
      }
      timer.schedule();
    }
  }
1294858
private synchronized RunningJobImpl get(final String jobIdentifier) {
    final RunningJobImpl result = this.jobs.get(jobIdentifier);
    if (null == result) {
      throw new RuntimeException("Trying to get a RunningJob that is unknown: " + jobIdentifier);
    }
    return result;
  }
421822
def get_scheduler_from_hostname(self, host_name):
        
        scheduler_uuid = self.hosts_schedulers.get(host_name, None)
        return self.schedulers.get(scheduler_uuid, None)
1121004
public static SafeCloseSmtpServer start(int port) {
		SafeCloseSmtpServer server = new SafeCloseSmtpServer(port);
		Thread t = new Thread(server, "Mock SMTP Server Thread");
		t.start();

		// Block until the server socket is created
		try {
			server.startupBarrier.await();
		} catch (InterruptedException e) {
			log.log(Level.WARNING, "Interrupted", e);
		}

		return server;
	}
476425
public static HttpClient<ByteBuf, ByteBuf> newClient(String host, int port) {
        return newClient(new InetSocketAddress(host, port));
    }
309233
private Runtime getRuntime(final String requestedRuntimeName) {

    final String runtimeName =
        StringUtils.isBlank(requestedRuntimeName) ? this.defaultRuntimeName : requestedRuntimeName;

    final Runtime runtime = this.runtimes.get(runtimeName);
    Validate.notNull(runtime, "Couldn't find runtime for name " + runtimeName);

    return runtime;
  }
771620
public static NetworkPort remotePort(String hostname, int port){
        return new RemoteNetworkPort(hostname, port, NetworkPort.Type.TCP);
    }
615380
public static Server of(int port) {
        final ServerBuilder sb = new ServerBuilder();

        return sb.http(port)
                 .annotatedService("/pathPattern", new PathPatternService())
                 .annotatedService("/injection", new InjectionService())
                 .annotatedService("/messageConverter", new MessageConverterService())
                 .annotatedService("/exception", new ExceptionHandlerService())
                 .build();
    }
330381
public java.rmi.Remote getPort(Class serviceEndpointInterface) throws javax.xml.rpc.ServiceException {
        try {
            if (com.google.api.ads.admanager.axis.v201902.InventoryServiceInterface.class.isAssignableFrom(serviceEndpointInterface)) {
                com.google.api.ads.admanager.axis.v201902.InventoryServiceSoapBindingStub _stub = new com.google.api.ads.admanager.axis.v201902.InventoryServiceSoapBindingStub(new java.net.URL(InventoryServiceInterfacePort_address), this);
                _stub.setPortName(getInventoryServiceInterfacePortWSDDServiceName());
                return _stub;
            }
        }
        catch (java.lang.Throwable t) {
            throw new javax.xml.rpc.ServiceException(t);
        }
        throw new javax.xml.rpc.ServiceException("There is no stub implementation for the interface:  " + (serviceEndpointInterface == null ? "null" : serviceEndpointInterface.getName()));
    }
1168200
public Slice build() throws SchedulerException {
        if (hoster == null) {
            hoster = rp.makeHostVariable(lblPrefix, "_hoster");
        }
        if (start == null) {
            start = rp.getStart();
        }
        if (end == null) {
            end = rp.getEnd();
        }
        if (duration == null) {
            duration = makeDuration();
        }

        //UB for the time variables
        if (!start.isInstantiatedTo(0)) {
            //enforces start <= end, duration <= end, start + duration == end
            TaskMonitor.build(start, duration, end);
        }
        //start == 0 --> start <= end. duration = end enforced by TaskScheduler
        return new Slice(vm, start, end, duration, hoster);
    }
1251415
ScheduledExecutorService createSchedulerExecutor(final String prefix) {
		ThreadFactory threadFactory = new ThreadFactory() {
			private int counter = 0;
			@Override
			public Thread newThread(Runnable runnable) {
				return new Thread(runnable, prefix + ++counter);
			}
		};
		ScheduledExecutorService executor = java.util.concurrent.Executors.newSingleThreadScheduledExecutor(threadFactory);
		return executor;
	}