/** * Fire the given event to all listeners. */ public Exception[] fireEvent(Object event) { if (_listeners.isEmpty()) return EMPTY_EXCEPTIONS; List exceptions = null; for (Iterator itr = _listeners.iterator(); itr.hasNext();) { try { fireEvent(event, itr.next()); } catch (Exception e) { if (_failFast) return new Exception[] { e }; if (exceptions == null) exceptions = new LinkedList(); exceptions.add(e); } } if (exceptions == null) return EMPTY_EXCEPTIONS; return (Exception[]) exceptions.toArray (new Exception[exceptions.size()]); }
/** * Fire the given event to all listeners. */ public Exception[] fireEvent(Object event) { if (_listeners.isEmpty()) return EMPTY_EXCEPTIONS; List exceptions = null; for (Iterator itr = _listeners.iterator(); itr.hasNext();) { try { fireEvent(event, itr.next()); } catch (Exception e) { if (_failFast) return new Exception[] { e }; if (exceptions == null) exceptions = new LinkedList(); exceptions.add(e); } } if (exceptions == null) return EMPTY_EXCEPTIONS; return (Exception[]) exceptions.toArray (new Exception[exceptions.size()]); }
/** * Fire the given event to all listeners. */ public Exception[] fireEvent(Object event) { if (_listeners.isEmpty()) return EMPTY_EXCEPTIONS; List exceptions = null; for (Iterator itr = _listeners.iterator(); itr.hasNext();) { try { fireEvent(event, itr.next()); } catch (Exception e) { if (_failFast) return new Exception[] { e }; if (exceptions == null) exceptions = new LinkedList(); exceptions.add(e); } } if (exceptions == null) return EMPTY_EXCEPTIONS; return (Exception[]) exceptions.toArray (new Exception[exceptions.size()]); }
/** * Fire the given event to all listeners. */ public Exception[] fireEvent(Object event) { if (_listeners.isEmpty()) return EMPTY_EXCEPTIONS; List exceptions = null; for (Iterator itr = _listeners.iterator(); itr.hasNext();) { try { fireEvent(event, itr.next()); } catch (Exception e) { if (_failFast) return new Exception[] { e }; if (exceptions == null) exceptions = new LinkedList(); exceptions.add(e); } } if (exceptions == null) return EMPTY_EXCEPTIONS; return (Exception[]) exceptions.toArray (new Exception[exceptions.size()]); }