flink-instrumentation/workspace/flink-1.4.1-instrumented/flink-1.4.1/flink-runtime/src/main/java/org/apache/flink/runtime/webmonitor/WebMonitorUtils.java
/**
	 * Checks whether the flink-runtime-web dependency is available and if so returns a
	 * StaticFileServerHandler which can serve the static file contents.
	 *
	 * @param leaderRetriever to be used by the StaticFileServerHandler
	 * @param restAddressFuture of the underlying REST server endpoint
	 * @param timeout for lookup requests
	 * @param tmpDir to be used by the StaticFileServerHandler to store temporary files
	 * @param <T> type of the gateway to retrieve
	 * @return StaticFileServerHandler if flink-runtime-web is in the classpath; Otherwise Optional.empty
	 * @throws IOException if we cannot create the StaticFileServerHandler
	 */
Checks whether the flink-runtime-web dependency is available and if so returns a
StaticFileServerHandler which can serve the static file contents.


Checks whether the flink - runtime - web dependency is available and if so returns a StaticFileServerHandler which can serve the static file contents .
public static <T extends RestfulGateway> Optional<StaticFileServerHandler<T>> tryLoadWebContent(
			GatewayRetriever<T> leaderRetriever,
			CompletableFuture<String> restAddressFuture,
			Time timeout,
			File tmpDir) throws IOException {
		try {
			final String classname = "org.apache.flink.runtime.webmonitor.WebRuntimeMonitor";
			Class.forName(classname).asSubclass(WebMonitor.class);
			return Optional.of(new StaticFileServerHandler<>(
				leaderRetriever,
				restAddressFuture,
				timeout,
				tmpDir));
		} catch (ClassNotFoundException ignored) {
			return Optional.empty();
		}
	}
public static < T extends RestfulGateway > Optional < StaticFileServerHandler < T > > tryLoadWebContent ( GatewayRetriever < T > leaderRetriever , CompletableFuture < String > restAddressFuture , Time timeout , File tmpDir ) throws IOException { try { final String classname = "org.apache.flink.runtime.webmonitor.WebRuntimeMonitor" ; Class . forName ( classname ) . asSubclass ( WebMonitor . class ) ; return Optional . of ( new StaticFileServerHandler < > ( leaderRetriever , restAddressFuture , timeout , tmpDir ) ) ; } catch ( ClassNotFoundException ignored ) { return Optional . empty ( ) ; } }
Checks whether the flink-runtime-web dependency is available and if so returns a
 StaticFileServerHandler which can serve the static file contents.
Checks whether the flink - runtime - web dependency is available and if so returns a StaticFileServerHandler which can serve the static file contents .
// 1. Check if flink-runtime-web is in the classpath // class not found means that there is no flink-runtime-web in the classpath