@Override public void removeObserver(final Observer listener) { final AutowiredEventListener autowiredEventListener = _observers.remove(listener); if (autowiredEventListener != null) { _dispatcher.removeListener(autowiredEventListener); } }
protected CallImpl(ExecutionContext context) { _context = context; _dispatcher.setExecutor(getThreadPool(), true); _id = IDGenerator.generateId(_context, RemoteParticipant.RemoteParticipant_TYPE_CALL); context.addCall(this); }
@SuppressWarnings("rawtypes") @Override public void addObserver(final Observer... observers) { if (observers != null) { for (final Observer observer : observers) { if (observer instanceof EventListener) { EventListener l = (EventListener) observer; Class claz = Utils.getGenericType(observer); if (claz == null) { claz = Event.class; } _dispatcher.addListener(claz, l); } else { final AutowiredEventListener autowire = new AutowiredEventListener(observer); if (_observers.putIfAbsent(observer, autowire) == null) { _dispatcher.addListener(Event.class, autowire); } } } } }
@Override public <S extends EventSource, T extends Event<S>> Future<T> dispatch( final T event, final Runnable afterExec) { return _dispatcher.fire(event, true, afterExec); }
public <S extends EventSource, T extends Event<S>> Future<T> internalDispatch(final T event) { return _dispatcher.fire(event, true, null); }