private void awaitStartupTasks(Cache cache, long startTime) {
    Runnable afterStartup = startupCompletionAction == null
        ? () -> logStartCompleted(startTime) : startupCompletionAction;

    Consumer<Throwable> exceptionAction = startupExceptionAction == null
        ? (throwable) -> logStartCompletedWithError(startTime, throwable) : startupExceptionAction;

    CompletableFuture<Void> startupTasks =
        ((InternalResourceManager) cache.getResourceManager())
            .allOfStartupTasks();

    startupTasks
        .thenRun(afterStartup)
        .exceptionally((throwable) -> {
          exceptionAction.accept(throwable);
          return null;
        })
        .join();
  }
If the default server (cache server) has not been disabled and no prior cache servers were
added to the cache, then this method will add a cache server to the Cache and start the server
Thread on the specified bind address and port.

@param cache the Cache to which the server will be added.
@throws IOException if the Cache server fails to start due to IO error.
geode-core/src/main/java/org/apache/geode/distributed/ServerLauncher.java