helper to setup the array of handlers
543949
private function setupHandlers($handlers)
    {
        $this->handlers = array();
        foreach ($handlers as $handlerClass => $handlerDetails) {
            $options = array();
            if (isset($handlerDetails[Config::KEY_OPTIONS])) {
                $options = (array)$handlerDetails[Config::KEY_OPTIONS];
            }

            if (isset($handlerDetails[Config::KEY_CLASS])) {
                $handlerClass = $handlerDetails[Config::KEY_CLASS];
            }

            if (!class_exists($handlerClass)) {
                throw new Exception(
                    'Cannot instantiate instance of '.$handlerClass
                );
            }
            $this->handlers[] = new $handlerClass($options);
        }
    }
748488
function(context, handlers/*, params*/ ) {
        var args = this.slice(arguments)
        args.shift()
        args.shift()
        this.each(handlers, function(handler) {
            if (handler) handler.apply(context, args)
        })
    }
1092974
function (method, handler) {
            if (!method || !handler) {
                return;
            }
            if (!this.handlers[method]) {
                //initialize array
                this.handlers[method] = [];
            }
            // add handler to the stack
            this.handlers[method].push(handler);
        }
50125
function (name, handler, options) {
            if (handler) {
                var _handlers = this.__handlers__;
                var _listeners = _handlers[name] = _handlers[name] || [];

                _listeners[0] = zn.extend({
                    owner: this,
                    handler: handler
                }, options);
            }

            return this;
        }
396462
def handlers(self):
        """"""
        if getattr(self, '_http'):
            yield from self.http.handlers()
        if getattr(self, '_cli'):
            yield from self.cli.handlers()
269428
def _loadHandlers(self):
        
        return {handler.name: handler for handler in map(self.createHandler, self.config['handlers'])}
266174
function patchHandlebars(Handlebars) {
  Handlebars.JavaScriptCompiler.prototype.preamble = function() {
    var out = [];

    if (!this.isChild) {
      var namespace = this.namespace;
      // 
      var copies = [
        "helpers = helpers || {};",
        "for (var key in " + namespace + ".helpers) {",
        "   helpers[key] = helpers[key] || " + namespace + ".helpers[key];",
        "}"
      ].join('\n');
      if (this.environment.usePartial) { copies = copies + " partials = partials || " + namespace + ".partials;"; }
      if (this.options.data) { copies = copies + " data = data || {};"; }
      out.push(copies);
    } else {
      out.push('');
    }

    if (!this.environment.isSimple) {
      out.push(", buffer = " + this.initializeBuffer());
    } else {
      out.push("");
    }

    // track the last context pushed into place to allow skipping the
    // getContext opcode when it would be a noop
    this.lastContext = 0;
    this.source = out;
  };
}
1103316
function(name) {
        var self = this, found = false;
        if (!name) { return found; }
        utils.each(this._handlers, function(i) {
            if (name === this.name) {
                self._handlers.splice(i, 1);
                return (found = true, false);
            }
        });
        if (!found) {
            utils.each(this._lastHandlers, function(i) {
                if (name === this.name) {
                    self._lastHandlers.splice(i, 1);
                    return (found = true, false);
                }
            });
        }
        return found;
    }
75143
private static void initHandlers() {
		Log.info("Initializing Handlers...");
		for (Handler handler : conf.getHandlers()) {
			try {
				if (!configContext.getHandlers().contains(handler)) {
					Map<String, String> handlerproperties = new HashMap<>();
					handlerproperties.putAll(configContext.getProperties());
					handler.setProperties(handlerproperties);
					handler.init();
					configContext.addHandler(handler);
				}
				Log.info(handler.getClass().getName() + " Initialized.");
			} catch (InitializationException e) {
				Log.error("There is a problem in the hander: ", handler.getClass().getName(),
						ErrorGuide.getGuide(ErrorGuide.HANDLER_ERROR));
				terminate();
				throw new InitializationException(INIT_FAILED, e);
			}
		}
	}
1374017
function addHandlers(node, handlers, thisObject){
    node = getNode(node);

    for (var eventType in handlers)
      addHandler(node, eventType, handlers[eventType], thisObject);
  }
629580
def create_handlers_map(prefix='.*'):
  
  return [
      (prefix + '/output', _BarrierHandler),
      (prefix + '/run', _PipelineHandler),
      (prefix + '/finalized', _PipelineHandler),
      (prefix + '/cleanup', _CleanupHandler),
      (prefix + '/abort', _PipelineHandler),
      (prefix + '/fanout', _FanoutHandler),
      (prefix + '/fanout_abort', _FanoutAbortHandler),
      (prefix + '/callback', _CallbackHandler),
      (prefix + '/rpc/tree', status_ui._TreeStatusHandler),
      (prefix + '/rpc/class_paths', status_ui._ClassPathListHandler),
      (prefix + '/rpc/list', status_ui._RootListHandler),
      (prefix + '(/.+)', status_ui._StatusUiHandler),
      ]
1149868
function cmd(handlers)
{
  this.fieldindex = 0;
  this.state = "start";
  this.stmt = ""
  this.params = []

  // mixin all handlers
  for (var h in handlers)
  {
    this[h] = handlers[h];
  }
  // save command name to display in debug output
  this.command_name = cmd.caller.command_name;
  this.args = Array.prototype.slice.call(cmd.caller.arguments);
}
1133992
public static function initialize()
    {
        if (static::$isConfigurationLoaded === true) {
            return;
        }
        
        foreach (static::$handlers as $handler) {
            EventManager::getInstance()->addEventHandler($handler[0], $handler[1], $handler[2], $handler[3]);
        }

        static::$isConfigurationLoaded = true;
    }
1372444
function register(handle) {
  if (Array.isArray(handle)) {
    handle.forEach(item => {
      utils.register(item);
    });
  } else {
    utils.register(handle);
  }
}
933338
function triggerIfHandlerList(handlerList, event) {
    if(handlerList !== undefined) {
        for(var n=0; n<handlerList.length; n++) {
            handlerList[n](event)
        }
    }
}
1109373
function initDomHandler(instance) {
    zrUtil.each(touchHandlerNames, function (name) {
        instance._handlers[name] = zrUtil.bind(domHandlers[name], instance);
    });

    zrUtil.each(pointerHandlerNames, function (name) {
        instance._handlers[name] = zrUtil.bind(domHandlers[name], instance);
    });

    zrUtil.each(mouseHandlerNames, function (name) {
        instance._handlers[name] = makeMouseHandler(domHandlers[name], instance);
    });

    function makeMouseHandler(fn, instance) {
        return function () {
            if (instance._touching) {
                return;
            }
            return fn.apply(instance, arguments);
        };
    }
}
423842
function(type, data) {

			var handlers,
				i,
				len,
				event = {
					type: type,
					data: data
				};

			// if there are handlers for the event, call them in order
			handlers = this._handlers[event.type];
			if (handlers instanceof Array) {
				// @NOTE: do a concat() here to create a copy of the handlers array,
				// so that if another handler is removed of the same type, it doesn't
				// interfere with the handlers array during this loop
				handlers = handlers.concat();
				for (i = 0, len = handlers.length; i < len; i++) {
					handlers[i].call(this, event);
				}
			}
		}