Registers a handler and returns the callback key to be passed to
Javascript.

@param handler Handler to be registered.
@return A String random UUID that can be used as the callback key.
503442
public String registerHandler(GFXEventHandler handler) {
        String uuid = UUID.randomUUID().toString();
        handlers.put(uuid, handler);
        return uuid;
    }
761182
@Override
  public void registerErrorHandler(final EventHandler<Exception> handler) {
    this.clientEventListener.registerErrorHandler(handler);
    this.serverEventListener.registerErrorHandler(handler);
  }
1129900
@Override
    public ReadStream<Buffer> handler(Handler<Buffer> handler) {
        if (handler == null) {
            throw new IllegalArgumentException("handler");
        }
        this.dataHandler = handler;
        doRead();
        return this;
    }
172812
public synchronized void setHandler(Handler handler) {
        String handlerId = CollectorManagerUtils.getHandlerId(handler);
        HandlerManager hdlrMgr;
        if (!handlerMgrs.containsKey(handlerId)) {
            if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
                Tr.event(tc, "Adding handler to the list", handler.getClass());
            }
            hdlrMgr = new HandlerManager(handler);
            handlerMgrs.put(hdlrMgr.getHandlerId(), hdlrMgr);
            hdlrMgr.getHandler().init(this);
        }
    }
1069813
function(api, handler) {

        if( 0 === arguments.length )
            throw new Error('utils.handler.register needs arguments');

        if( ! _.isObject(api) )
            throw new Error('utils.handler.register needs an espressojs API');

        if( ! (handler instanceof Handler) )
            throw new Error('utils.handler.register needs a Handler');

        // Add it to _ids
        api._ids[ handler.getPattern().getExpression().toString() ] = handler;

        // Add it to _names if any
        var name = handler.getOption('name');

        if( _.isString(name) && ! _.isEmpty(name) )
            api._names[ name ] = handler;
    }
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;
        }
    }
373224
public static String parse(String commandLine, final CommandLineParser.CallbackHandler handler) throws CommandFormatException {
        return parse(commandLine, handler, true);
    }
445573
public JsHandlerRegistration addGeometryEditMoveHandler(final GeometryEditMoveHandler handler) {
		org.geomajas.plugin.editing.client.event.GeometryEditMoveHandler h;
		h = new org.geomajas.plugin.editing.client.event.GeometryEditMoveHandler() {

			public void onGeometryEditMove(GeometryEditMoveEvent event) {
				List<GeometryIndex> indices = event.getIndices();
				handler.onGeometryEditMove(new org.geomajas.plugin.editing.jsapi.client.event.GeometryEditMoveEvent(
						event.getGeometry(), indices.toArray(new GeometryIndex[indices.size()])));
			}
		};
		HandlerRegistration registration = delegate.addGeometryEditMoveHandler(h);
		return new JsHandlerRegistration(new HandlerRegistration[] { registration });
	}
997149
private static void initStringDefinedHandler(String handler) {
		// split the class name and its label, if defined
		Tuple<String, Class> namedClass = splitClassAndName(handler);

		// create an instance of the handler
		Object handlerOrProviderObject = null;
		try {
			handlerOrProviderObject = namedClass.second.newInstance();
		} catch (Exception e) {
			logger.error("Exception:", e);
			throw new RuntimeException("Could not instantiate handler class: " + namedClass.second);
		}

		HttpHandler resolvedHandler;
		if (handlerOrProviderObject instanceof HttpHandler) {
			resolvedHandler = (HttpHandler) handlerOrProviderObject;
		} else if (handlerOrProviderObject instanceof HandlerProvider) {
			resolvedHandler = ((HandlerProvider) handlerOrProviderObject).getHandler();
		} else {
			throw new RuntimeException("Unsupported type of handler provided: " + handlerOrProviderObject);
		}
		registerMiddlewareHandler(resolvedHandler);
		handlers.put(namedClass.first, resolvedHandler);
		handlerListById.put(namedClass.first, Collections.singletonList(resolvedHandler));
	}
1100521
public void registerServiceHandler(String name, Object handler) {
        Map<String, Object> serviceHandlers = getServiceHandlers();
        serviceHandlers.put(name, handler);
    }
666029
public void setHandler(Object handler){
        if(handler instanceof ContentHandler)
            setContentHandler((ContentHandler)handler);
        if(handler instanceof EntityResolver)
            setEntityResolver((EntityResolver)handler);
        if(handler instanceof ErrorHandler)
            setErrorHandler((ErrorHandler)handler);
        if(handler instanceof DTDHandler)
            setDTDHandler((DTDHandler)handler);
        if(handler instanceof LexicalHandler)
            setLexicalHandler((LexicalHandler)handler);
        if(handler instanceof DeclHandler)
            setDeclHandler((DeclHandler)handler);
    }
1066399
public CompositeHandler withUpdateHandler(final UpdateHandler handler) {
        if (handler == null) {
            throw new IllegalArgumentException();
        } // end of if

        // ---

        return new CompositeHandler(this.queryDetection,
                                    this.queryHandler,
                                    handler);
        
    }
207478
public Handler addHandler(Handler handler) throws JettyBootstrapException {
        JettyHandler jettyHandler = new JettyHandler();
        jettyHandler.setHandler(handler);

        handlers.addHandler(handler);

        return handler;
    }
900307
def _registerHandler(self, handler):
        
        self._logger.addHandler(handler)
        self._handlers.append(handler)
299175
public HandlerRegistration addInputHandler(JQMInputHandler handler) {
	    if (handler == null) return null;
	    return JQMHandlerRegistration.registerJQueryHandler(new WidgetHandlerCounter() {
            @Override
            public int getHandlerCountForWidget(GwtEvent.Type<?> type) {
                return getHandlerCount(type);
            }
        }, this, handler, JQMComponentEvents.INPUT,
        JQMEventFactory.getType(JQMComponentEvents.INPUT, JQMInputHandler.class));
	}
1060881
public HandlerRegistration setLocationNotFoundHandler(LocationNotFoundHandler handler) {
		if (handlerManager.getHandlerCount(LocationNotFoundHandler.TYPE) > 0) {
			LocationNotFoundHandler previous = handlerManager.getHandler(LocationNotFoundHandler.TYPE, 0);
			handlerManager.removeHandler(LocationNotFoundHandler.TYPE, previous);
		}
		return handlerManager.addHandler(LocationNotFoundHandler.TYPE, handler);
	}
624010
public AbstractHandlerMapping getHandlerMapping() {
		Map<String, Object> urlMap = new LinkedHashMap<>();
		for (WebMvcWampWebSocketEndpointRegistration registration : this.registrations) {
			MultiValueMap<HttpRequestHandler, String> mappings = registration
					.getMappings();
			for (HttpRequestHandler httpHandler : mappings.keySet()) {
				for (String pattern : mappings.get(httpHandler)) {
					urlMap.put(pattern, httpHandler);
				}
			}
		}
		SimpleUrlHandlerMapping hm = new SimpleUrlHandlerMapping();
		hm.setUrlMap(urlMap);
		hm.setOrder(this.order);
		if (this.urlPathHelper != null) {
			hm.setUrlPathHelper(this.urlPathHelper);
		}
		return hm;
	}