Register input to the request handlers list.

        :param request_handler: Request Handler instance to be
            registered.
        :type request_handler: AbstractRequestHandler
        :return: None
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))
1132270
def register_url(url, handler, name=None, kwargs=None):
    
    if name is None and kwargs is None:
        app_config.urls.append((url, handler))
        return

    if name is None:
        app_config.urls.append((url, handler, kwargs))
        return

    app_config.urls.append((url, handler, kwargs, name))
1185184
def add_error_handler(self, error_input):
        

        if isinstance(error_input, dict):
            error_response = error_input.get('response', {})
            cerr = error_response.get('command_error', NoResponse)
            qerr = error_response.get('query_error', NoResponse)

            response_dict = {'command_error': cerr,
                             'query_error': qerr}

            register_list = error_input.get('status_register', [])

            for register_dict in register_list:
                query = register_dict['q']
                register = StatusRegister(register_dict)
                self._status_registers[to_bytes(query)] = register
                for key in register.keys():
                    self._error_map[key] = register

            queue_list = error_input.get('error_queue', [])

            for queue_dict in queue_list:
                query = queue_dict['q']
                err_queue = ErrorQueue(queue_dict)
                self._error_queues[to_bytes(query)] = err_queue

        else:
            response_dict = {'command_error': error_input,
                             'query_error': error_input}

        for key, value in response_dict.items():
            self._error_response[key] = to_bytes(value)
776072
def handler(self, scheme_name=None):
		
		if scheme_name is None:
			return self.__default_handler_cls
		for handler in self.__handlers_cls:
			if handler.scheme_specification().scheme_name() == scheme_name:
				return handler
130583
def send_request(self, req):
        
        handlers = []
        if self.password_handler:
            handlers.append(self.password_handler)
        if self.ssl_verifier:
            handlers.append(self.ssl_verifier)
        opener = build_opener(*handlers)
        return opener.open(req)
753275
def register(self, event, fn):
        

        # TODO: Can we check the method signature?
        self._handler_dict.setdefault(event, [])
        if fn not in self._handler_dict[event]:
            self._handler_dict[event].append(fn)
1303837
def add_handler(self, handler):
        ''' 
        '''
        handler['logger'] = self._get_logger(handler)
        handler['reads'] = 0
        handler['data_read'] = 0

        self.capture_handlers.append(handler)
881467
def handler(self, value):
        

        if value is not None:
            assert issubclass(value, SocketServer.BaseRequestHandler), \
                "'{0}' attribute: '{1}' is not 'SocketServer.BaseRequestHandler' subclass!".format("handler", value)
        self.__handler = value
        self.__handler.container = self
35828
def handler(self,data):
		'''
		
		'''
		if isinstance(data,r.models.Response):
			self.log.debug("data is request object =  %s", str(data.content))
			data = data.content
		elif isinstance(data,str):
			self.log.info("data is json string with len %d",len(data))
			if len(data) == 0:
				self.log.warn("Handler received data of 0 length, exiting handler.")
				return
		else:
			self.log.error("Input is not valid request object or json string : %s" %str(data))
			return False
		try:
			data = json.loads(data)
			if 'async-responses' in data.keys():
				self.async_responses_callback(data)
			if 'notifications' in data.keys():
				self.notifications_callback(data)
			if 'registrations' in data.keys():
				self.registrations_callback(data)
			if 'reg-updates' in data.keys():
				self.reg_updates_callback(data)
			if 'de-registrations' in data.keys():
				self.de_registrations_callback(data)
			if 'registrations-expired' in data.keys():
				self.registrations_expired_callback(data)
		except:
			self.log.error("handle router had an issue and threw an exception")
			ex_type, ex, tb = sys.exc_info()
			traceback.print_tb(tb)
			self.log.error(sys.exc_info())
			del tb
280974
def request(self, request_type):
        '''  '''

        def _handler(func):
            self._handlers[request_type] = func
            return func

        return _handler
38438
def register_handler(alias: str, handler: callable):
        
        if SignalDispatcher.handlers.get(alias) is None:
            SignalDispatcher.handlers[alias] = [handler]
        else:
            SignalDispatcher.handlers.get(alias).append(handler)
247459
def _register_signal_handler(self, description, signal, handler):
        
        from flask import signals

        if not signals.signals_available:
            self.app.logger.warn('blinker needs to be installed in order to support %s'.format(description))
        self.app.logger.info('Enabling {}'.format(description))
        # Weak references won't work if handlers are methods rather than functions.
        signal.connect(handler, sender=self.app, weak=False)
563594
def dispatch(self, *args, **kwargs):
        
        called_handlers = set()
        for handler_list in self.handlers.values():
            for handler, argspec in handler_list:
                accept_args, accept_kwargs = argspec.accepts
                if handler in called_handlers and False:
                    continue
                else:
                    if args_match(accept_args, accept_kwargs, self.default, *args, **kwargs):
                        called_handlers.add(handler)
                        handler(*args, **kwargs)
        
        return called_handlers
860675
def register_onRsp(self, req):
        
        def wrapper(_callback):
            callbackList = self._req_callbacks.setdefault(req, [])
            callbackList.append(_callback)
            return _callback
        return wrapper
646213
def _wrap_class(request_handler, validator):
    
    METHODS = ['get', 'post', 'put', 'head', 'options', 'delete', 'patch']
    for name in METHODS:
        method = getattr(request_handler, name)
        setattr(request_handler, name, _auth_required(method, validator))

    return request_handler
533453
public void addHandler(AbstractHandler handler) {
    HandlerList handlers = new HandlerList();
    handlers.addHandler(handler);
    for (Handler h : mServer.getHandlers()) {
      handlers.addHandler(h);
    }
    mServer.setHandler(handlers);
  }
181399
def set_handler(self, handler):
        
        if self._handler:
            raise Exception('Handler was already set')
        if handler:
            self._handler = async_task(handler, loop=self._loop)