(String name, Object event)
| 78 | } |
| 79 | |
| 80 | void event(String name, Object event) |
| 81 | { |
| 82 | CallStack callstack = new CallStack( namespace ); |
| 83 | BshMethod method = null; |
| 84 | |
| 85 | // handleEvent gets all events |
| 86 | try { |
| 87 | method = namespace.getMethod( |
| 88 | "handleEvent", new Class [] { null } ); |
| 89 | } catch ( UtilEvalError e ) {/*squeltch*/ } |
| 90 | |
| 91 | if (method != null) |
| 92 | try { |
| 93 | method.invoke( |
| 94 | new Object[] { event }, declaringInterpreter, callstack, null ); |
| 95 | } catch(EvalError e) { |
| 96 | declaringInterpreter.error( |
| 97 | "local event hander method invocation error:" + e ); |
| 98 | } |
| 99 | |
| 100 | // send to specific event handler |
| 101 | try { |
| 102 | method = namespace.getMethod( name, new Class [] { null } ); |
| 103 | } catch ( UtilEvalError e ) { /*squeltch*/ } |
| 104 | if (method != null) |
| 105 | try { |
| 106 | method.invoke( |
| 107 | new Object[] { event }, declaringInterpreter, callstack, null ); |
| 108 | } catch(EvalError e) { |
| 109 | declaringInterpreter.error( |
| 110 | "local event hander method invocation error:" + e ); |
| 111 | } |
| 112 | } |
| 113 | |
| 114 | // Listener interfaces |
| 115 |
no test coverage detected