Exemple #1
0
 @Override
 public void removeObserver(final Observer listener) {
   final AutowiredEventListener autowiredEventListener = _observers.remove(listener);
   if (autowiredEventListener != null) {
     _dispatcher.removeListener(autowiredEventListener);
   }
 }
Exemple #2
0
  protected CallImpl(ExecutionContext context) {

    _context = context;
    _dispatcher.setExecutor(getThreadPool(), true);
    _id = IDGenerator.generateId(_context, RemoteParticipant.RemoteParticipant_TYPE_CALL);

    context.addCall(this);
  }
Exemple #3
0
 @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);
         }
       }
     }
   }
 }
Exemple #4
0
 @Override
 public <S extends EventSource, T extends Event<S>> Future<T> dispatch(
     final T event, final Runnable afterExec) {
   return _dispatcher.fire(event, true, afterExec);
 }
Exemple #5
0
 public <S extends EventSource, T extends Event<S>> Future<T> internalDispatch(final T event) {
   return _dispatcher.fire(event, true, null);
 }