Method adds an handler to the internal rsb listener.

@param handler
@param wait

@throws InterruptedException
@throws CouldNotPerformException
544909
public void addHandler(final Handler handler, final boolean wait) throws InterruptedException, CouldNotPerformException {
        try {
            listener.addHandler(handler, wait);
        } catch (CouldNotPerformException ex) {
            throw new CouldNotPerformException("Could not register Handler!", ex);
        }
    }
1272892
private void notifyHandler(ZoneHandlerClass handler, ApiZone apiZone, Object userAgent) {
        Object instance = handler.newInstance();
        callHandleMethod(handler.getHandleMethod(), instance, apiZone, userAgent);
    }
1118681
public void attach(ElementHandler<T> handler) {
    	NodeState<T> state = buildState();
    	context.addElementHandler(state, handler);
    }
929736
public final void listenInline(Listener<T> onready, ISynchronizationPoint<TError> onErrorAndCancel) {
		listenInline(new AsyncWorkListener<T,TError>() {
			@Override
			public void ready(T result) {
				onready.fire(result);
			}
			
			@Override
			public void error(TError error) {
				onErrorAndCancel.error(error);
			}
			
			@Override
			public void cancelled(CancelException event) {
				onErrorAndCancel.cancel(event);
			}
			
			@Override
			public String toString() {
				return "AsyncWork.listenInline: " + onready;
			}
		});
	}
1212435
protected void enqueueEvent(Object event, EventHandler handler) {
    eventsToDispatch.get().offer(new EventWithHandler(event, handler));
  }
1208021
private boolean waitForRemove(long waitStart, long maxWait) throws InterruptedException {
        if (this.size == this.capacity) {
            if (!waitOnCondition(this.notFull, maxWait, waitStart)) {
                return false;
            }
        }

        return true;
    }
151745
public void onFailure() throws InterruptedException {
        int val = currentFailureCount.incrementAndGet();
        if (val > 50) {
            currentFailureCount.compareAndSet(val, MAX_FAILURE_COUNT);
            val = MAX_FAILURE_COUNT;
        }

        int delay = MIN_DELAY + ((MAX_DELAY - MIN_DELAY) / MAX_FAILURE_COUNT) * val;

        synchronized (this) {
            Logger.d(TAG, "onFailure: wait " + delay + " ms");
            wait(delay);
        }
    }
713745
@Override
    protected void beforeWaitForSynchronization(final T message) throws CouldNotPerformException {
        transactionIdField = ProtoBufFieldProcessor.getFieldDescriptor(message, TransactionIdProvider.TRANSACTION_ID_FIELD_NAME);
        if (transactionIdField == null) {
            throw new NotAvailableException("transaction id field for message[" + message.getClass().getSimpleName() + "]");
        }

        if (transactionIdField.getType() != Type.UINT64) {
            throw new CouldNotPerformException("Transaction id field of message[" + message.getClass().getSimpleName() + "] has an unexpected type[" + transactionIdField.getType().name() + "]");
        }
    }
898633
public static void call(Class<? extends Unit> unitClass, Handler<UnitResponse> handler) {
        call(unitClass, new HashMap<>(), handler);
    }
272053
public void addListener(IsSimplePromiseResponseHandler<T> listener) {
    if (handlers == null) {
      handlers = new LinkedList<>();
    }

    handlers.add(listener);

    if (response != null || exception != null) {
      listener.onResponse(this);
    }
  }
920525
public static void registerBlockedThreadHandler(BlockedThreadHandler handler, Thread thread) {
		synchronized (blockedHandlers) {
			blockedHandlers.put(thread, handler);
		}
	}
1154311
def on(self, handler):
        """"""
        if not hasattr(handler, '__call__'):
            raise TypeError('handler is not a callable object.')
        self.handlers.add(handler)
1129900
@Override
    public ReadStream<Buffer> handler(Handler<Buffer> handler) {
        if (handler == null) {
            throw new IllegalArgumentException("handler");
        }
        this.dataHandler = handler;
        doRead();
        return this;
    }
754231
final void addHandler(final HttpHandler handler) {
    if (handler != null) {
      if (!eventHandlers.containsKey(handler.getUriSpecification().toLowerCase())) {
        eventHandlers.put(handler.getUriSpecification().toLowerCase(), handler);
      } else {
        LOG.log(Level.WARNING, "JettyHandler handle is already registered: {0} ", handler.getUriSpecification());
      }
    }
  }
8164
public RedwoodConfiguration rootHandler(final LogRecordHandler handler){
    tasks.add(new Runnable(){ public void run(){ Redwood.appendHandler(handler); } });
    Redwood.appendHandler(handler);
    return this;
  }
1321780
public void setImageShapeLoadedHandler(final ImageShapeLoadedHandler<T> handler)
    {
        m_handler = handler;

        if ((null != m_handler) && (m_is_done))
        {
            m_handler.onImageShapeLoaded(m_image);
        }
    }
1006638
public boolean addHandler(PacketHandler handler) {
        synchronized (this.handlers){
            if (!handlers.contains(handler)) {
                handlers.add(handler);
                this.count.incrementAndGet();
                Collections.sort(this.handlers, REVERSE_COMPARATOR);
                return true;
            }
            return false;
        }
    }