code: private CompletableFuture<Void> closeClusterComponent(ApplicationStatus applicationStatus, @Nullable String diagnostics) {
  		synchronized (lock) {
  			if (clusterComponent != null) {
  				return clusterComponent.deregisterApplicationAndClose(applicationStatus, diagnostics);
  			} else {
  				return CompletableFuture.completedFuture(null);
  			}
  		}
  	}
docs: Deregister the Flink application from the resource management system by signalling
  the {@link ResourceManager}.
  
  @param applicationStatus to terminate the application with
  @param diagnostics additional information about the shut down, can be {@code null}
  @return Future which is completed once the shut down