Appends the given handlers to our handler list.

        Host patterns are processed sequentially in the order they were
        added. All matching patterns will be considered.
497847
def add_handlers(self, host_pattern: str, host_handlers: _RuleList) -> None:
        
        host_matcher = HostMatches(host_pattern)
        rule = Rule(host_matcher, _ApplicationRouter(self, host_handlers))

        self.default_router.rules.insert(-1, rule)

        if self.default_host is not None:
            self.wildcard_router.add_rules(
                [(DefaultHostMatches(self, host_matcher.host_pattern), host_handlers)]
            )
593617
static void initChains() {
		if (config != null && config.getChains() != null) {
			// add the chains to the handler list by id list.
			for (String chainName : config.getChains().keySet()) {
				List<String> chain = config.getChains().get(chainName);
				List<HttpHandler> handlerChain = new ArrayList<>();
				for (String chainItemName : chain) {
					HttpHandler chainItem = handlers.get(chainItemName);
					if (chainItem == null)
						throw new RuntimeException("Chain " + chainName + " uses Unknown handler: " + chainItemName);
					handlerChain.add(chainItem);
				}
				handlerListById.put(chainName, handlerChain);
			}
		}
	}
820302
def _attach_handler_events(self, handler, events=None):
        
        if not events:
            events = self
        for name in events:
            meth = getattr(handler, name, None)
            if meth:
                self.events[name] += meth
284333
public void postRegisterUrlHandlers(Map<String, Object> wsHandlers) {
        registerHandlers(wsHandlers);

        for (Object handler : wsHandlers.values()) {
            if (handler instanceof Lifecycle) {
                ((Lifecycle) handler).start();
            }
        }
    }
49930
static void initDefaultHandlers() {
		if (config != null && config.getDefaultHandlers() != null) {
			defaultHandlers = getHandlersFromExecList(config.getDefaultHandlers());
			handlerListById.put("defaultHandlers", defaultHandlers);
		}
	}
191729
def _add_static_handlers(self, handlers):
        
        for url, path in self.static_dirs:
            handlers.append((url.rstrip("/") + "/(.*)", StaticFileHandler, {"path": path}))
731535
protected void addRequestHandler(I_CmsRequestHandler handler) {

        if (handler == null) {
            return;
        }
        String[] names = handler.getHandlerNames();
        for (int i = 0; i < names.length; i++) {
            String name = names[i];
            if (m_requestHandlers.get(name) != null) {
                CmsLog.INIT.error(Messages.get().getBundle().key(Messages.LOG_DUPLICATE_REQUEST_HANDLER_1, name));
                continue;
            }
            m_requestHandlers.put(name, handler);
            if (CmsLog.INIT.isInfoEnabled()) {
                CmsLog.INIT.info(
                    Messages.get().getBundle().key(
                        Messages.INIT_ADDED_REQUEST_HANDLER_2,
                        name,
                        handler.getClass().getName()));
            }
        }
    }
1101512
public void ensureHandlers(int index) {

        if (m_handlers.size() <= index) {
            // make sure the handler maps are available
            // this may be necessary
            for (int i = m_handlers.size(); i <= index; i++) {
                insertHandlers(i);
            }
        }
    }
480342
def add_request_handler(self, request_handler):
        # type: (AbstractRequestHandler) -> None
        
        if request_handler is None:
            raise RuntimeConfigException(
                "Valid Request Handler instance to be provided")

        if not isinstance(request_handler, AbstractRequestHandler):
            raise RuntimeConfigException(
                "Input should be a RequestHandler instance")

        self.request_handler_chains.append(GenericRequestHandlerChain(
            request_handler=request_handler))
167362
def add(self, handler):
        ''' 

        '''
        self._handlers.append(handler)

        # make sure there is at most one static path
        static_paths = set(h.static_path() for h in self.handlers)
        static_paths.discard(None)
        if len(static_paths) > 1:
            raise RuntimeError("More than one static path requested for app: %r" % list(static_paths))
        elif len(static_paths) == 1:
            self._static_path = static_paths.pop()
        else:
            self._static_path = None
1263122
def handlers(self):
        """"""
        used = []
        for base_url, mapping in self.routes.items():
            for url, methods in mapping.items():
                for method, versions in methods.items():
                    for version, handler in versions.items():
                        if not handler in used:
                            used.append(handler)
                            yield handler
296284
def _visit_handlers(handlers, visitor, prefix, suffixes):
    

    results = []
    for handler in handlers:
        for suffix in suffixes:
            func = getattr(handler, '{}_{}'.format(prefix, suffix).lower(), None)
            if func:
                results.append(visitor(suffix, func))

    return results
1118681
public void attach(ElementHandler<T> handler) {
    	NodeState<T> state = buildState();
    	context.addElementHandler(state, handler);
    }
275120
protected void addClientRequestHandlers() {
        Set<String> commands = 
                context.getClientRequestCommands();
        for(String command : commands)
            addClientRequestHandler(command);
    }
1317399
public void insertHandler(Class<?> restrictionClass, H handler) {
    // note that the handlers list is kept in a list that is traversed in
    // backwards order.
    handlers.add(new Pair<Class<?>, H>(restrictionClass, handler));
  }
731968
protected void addServerEventHandlers() {
		Map<Object, Class<?>> handlers =  getServerEventHandlers();
		Set<Entry<Object, Class<?>>> entries = handlers.entrySet();
		for(Entry<Object, Class<?>> entry : entries) {
			SFSEventType type = SFSEventType.valueOf(
					entry.getKey().toString());
			ServerEventHandler handler = createServerEventHandler(
					type, entry.getValue());
			addEventHandler(type, handler);
		}
	}
1119490
public Router trace(@NotNull final String pattern, @NotNull final IMiddleware... handlers) {
        addPattern("TRACE", pattern, handlers, traceBindings);
        return this;
    }