Source:
public synchronized InterpreterLauncher loadInterpreterLauncher(String launcherPlugin, RecoveryStorage recoveryStorage) throws IOException { if (cachedLaunchers.containsKey(launcherPlugin)) { return cachedLaunchers.get(launcherPlugin); } LOGGER.info("Loading Interpreter Launcher Plugin: " + launcherPlugin); try { InterpreterLauncher launcher = (InterpreterLauncher) (Class.forName("org.apache.zeppelin.interpreter.launcher." + launcherPlugin)) .getConstructor(ZeppelinConfiguration.class, RecoveryStorage.class) .newInstance(zConf, recoveryStorage); return launcher; } catch (InstantiationException | IllegalAccessException | ClassNotFoundException | NoSuchMethodException | InvocationTargetException e) { LOGGER.warn("Fail to instantiate InterpreterLauncher from classpath directly:" + launcherPlugin); } URLClassLoader pluginClassLoader = getPluginClassLoader(pluginsDir, "Launcher", launcherPlugin); String pluginClass = "org.apache.zeppelin.interpreter.launcher." + launcherPlugin; InterpreterLauncher launcher = null; try { launcher = (InterpreterLauncher) (Class.forName(pluginClass, true, pluginClassLoader)) .getConstructor(ZeppelinConfiguration.class, RecoveryStorage.class) .newInstance(zConf, recoveryStorage); } catch (InstantiationException | IllegalAccessException | ClassNotFoundException | NoSuchMethodException | InvocationTargetException e) { LOGGER.warn("Fail to instantiate Launcher from plugin classpath:" + launcherPlugin, e); } if (launcher == null) { throw new IOException("Fail to load plugin: " + launcherPlugin); } cachedLaunchers.put(launcherPlugin, launcher); return launcher; }

Target:
public synchronized InterpreterLauncher loadInterpreterLauncher(String launcherPlugin, RecoveryStorage recoveryStorage) throws IOException { if (cachedLaunchers.containsKey(launcherPlugin)) { return cachedLaunchers.get(launcherPlugin); } LOGGER.info("Loading Interpreter Launcher Plugin: " + launcherPlugin); try { InterpreterLauncher launcher = (InterpreterLauncher) (Class.forName("org.apache.zeppelin.interpreter.launcher." + launcherPlugin)) .getConstructor(ZeppelinConfiguration.class, RecoveryStorage.class) .newInstance(zConf, recoveryStorage); return launcher; } catch (InstantiationException | IllegalAccessException | ClassNotFoundException | NoSuchMethodException | InvocationTargetException e) { LOGGER.warn("Fail to instantiate InterpreterLauncher from classpath directly:" + launcherPlugin, e); } URLClassLoader pluginClassLoader = getPluginClassLoader(pluginsDir, "Launcher", launcherPlugin); String pluginClass = "org.apache.zeppelin.interpreter.launcher." + launcherPlugin; InterpreterLauncher launcher = null; try { launcher = (InterpreterLauncher) (Class.forName(pluginClass, true, pluginClassLoader)) .getConstructor(ZeppelinConfiguration.class, RecoveryStorage.class) .newInstance(zConf, recoveryStorage); } catch (InstantiationException | IllegalAccessException | ClassNotFoundException | NoSuchMethodException | InvocationTargetException e) { LOGGER.warn("Fail to instantiate Launcher from plugin classpath:" + launcherPlugin, e); } if (launcher == null) { throw new IOException("Fail to load plugin: " + launcherPlugin); } cachedLaunchers.put(launcherPlugin, launcher); return launcher; }