mirror of
https://github.com/apache/zeppelin
synced 2026-05-24 09:38:26 +00:00
call listenerBus() using reflection
This commit is contained in:
parent
62b8c45ceb
commit
0c28561f2c
1 changed files with 3 additions and 2 deletions
|
|
@ -158,8 +158,9 @@ public class SparkInterpreter extends Interpreter {
|
|||
private static JobProgressListener setupListeners(SparkContext context) {
|
||||
JobProgressListener pl = new JobProgressListener(context.getConf());
|
||||
try {
|
||||
Method m = context.listenerBus().getClass().getMethod("addListener", pl.getClass());
|
||||
m.invoke(context.listenerBus(), pl);
|
||||
Object listenerBus = context.getClass().getMethod("listenerBus").invoke(context);
|
||||
Method m = listenerBus.getClass().getMethod("addListener", pl.getClass());
|
||||
m.invoke(listenerBus, pl);
|
||||
} catch (NoSuchMethodException | SecurityException | IllegalAccessException
|
||||
| IllegalArgumentException | InvocationTargetException e) {
|
||||
e.printStackTrace();
|
||||
|
|
|
|||
Loading…
Reference in a new issue