code: public static void runClusterEntrypoint(ClusterEntrypoint clusterEntrypoint) {
  
  		final String clusterEntrypointName = clusterEntrypoint.getClass().getSimpleName();
  		try {
  			clusterEntrypoint.startCluster();
  		} catch (ClusterEntrypointException e) {
  			LOG.error(String.format("Could not start cluster entrypoint %s.", clusterEntrypointName), e);
  			System.exit(STARTUP_FAILURE_RETURN_CODE);
  		}
  
  		clusterEntrypoint.getTerminationFuture().whenComplete((applicationStatus, throwable) -> {
  			final int returnCode;
  
  			if (throwable != null) {
  				returnCode = RUNTIME_FAILURE_RETURN_CODE;
  			} else {
  				returnCode = applicationStatus.processExitCode();
  			}
  
  			LOG.info("Terminating cluster entrypoint process {} with exit code {}.", clusterEntrypointName, returnCode, throwable);
  			System.exit(returnCode);
  		});
  	}
docs: --------------------------------------------------