Processes event and attach the entity listener.
346213
public function loadClassMetadata(LoadClassMetadataEventArgs $event)
    {
        /** @var ClassMetadata $metadata */
        $metadata = $event->getClassMetadata();

        if (! isset($this->entityListeners[$metadata->getClassName()])) {
            return;
        }

        foreach ($this->entityListeners[$metadata->getClassName()] as $listener) {
            $listenerClassName = $listener['class'];

            $metadata->addEntityListener($listener['event'], $listenerClassName, $listener['method']);
        }

        unset($this->entityListeners[$metadata->getClassName()]);
    }
1008884
function on(el, eventName, callback) {
  if (el.addEventListener) {
    el.addEventListener(eventName, callback, false);
  }
  else if (el.attachEvent) {
    el.attachEvent('on'+eventName, function(e) {
      callback.call(el, e || window.event);
    });
  }
}
810247
function bindFromStrings(target, entity, evt, methods){
    var methodNames = methods.split(/\s+/);

    _.each(methodNames,function(methodName) {

      var method = target[methodName];
      if(!method) {
        throwError("Method '"+ methodName +"' was configured as an event handler, but does not exist.");
      }

      target.listenTo(entity, evt, method, target);
    });
  }
535081
def emit_event(self, event):
        """"""
        with self._lock:
            listeners = list(self._event_listeners)

        for cb in list(self._event_listeners):
            # noinspection PyBroadException
            try:
                cb(event)
            except:
                # Don't let exceptions from callbacks kill our thread of execution
                logger.exception("Event callback resulted in unhandled exception")
753665
function attachEvent(obj, type, func, scope)
    {
        function handler(e)
        {
            e = e || window.event;

            if (!e.target)
            {
                e.target = e.srcElement;
                e.preventDefault = function()
                {
                    this.returnValue = false;
                };
            }

            func.call(scope || window, e);
        };

        if (obj.attachEvent)
        {
            obj.attachEvent('on' + type, handler);
        }
        else
        {
            obj.addEventListener(type, handler, false);
        }
    }
816743
def process_event(self, name, subject, data):
        
        method_mapping = Registry.get_event(name)
        if not method_mapping:
            log.info('@{}.process_event no subscriber for event `{}`'
                     .format(self.__class__.__name__, name))
            return
        for event, methods in method_mapping.items():
            event_instance = event(subject, data)
            log.info('@{}.process_event `{}` for subject `{}`'.format(
                self.__class__.__name__,
                event_instance.__class__.__name__,
                subject
            ))
            for method in methods:
                with self._context_manager:
                    log.info('>> Calling subscriber `{}`'
                             .format(method.__name__))
                    method(event_instance)
652975
function addEventListener(event, listener) {
    this._eventListeners[event] = this._eventListeners[event] || [];
    this._eventListeners[event].push(listener);
  }
301441
function attach(listener) {
    if (!listener) return;
    if (!listener[CONTEXTS_SYMBOL]) listener[CONTEXTS_SYMBOL] = Object.create(null);

    listener[CONTEXTS_SYMBOL][thisSymbol] = {
      namespace : namespace,
      context   : namespace.active
    };
  }
351961
function attachBrowserEvents(self) {
  if (isChromeApp()) {
    chrome.storage.onChanged.addListener(function (e) {
      // make sure it's event addressed to us
      if (e.db_name != null) {
        //object only has oldValue, newValue members
        self.emit(e.dbName.newValue);
      }
    });
  } else if (hasLocalStorage()) {
    if (typeof addEventListener !== 'undefined') {
      addEventListener("storage", function (e) {
        self.emit(e.key);
      });
    } else { // old IE
      window.attachEvent("storage", function (e) {
        self.emit(e.key);
      });
    }
  }
}
779842
public function processPreAdd($entity, $name, &$value, $locale=null, $hook=true, $silentException=false) {
		if($hook)
			$this->trigger('set', [$entity, $name, &$value, $locale]);

		if(!$this->hasProperty($name))
			return;

		if($this->property($name)->get('hooks.set')) {
			$hook  = $this->property($name)->get('hooks.set');
			$value = call_user_func_array($hook, [$value, $entity]);
		}

		$value = $this->property($name)->_doSet($value, $entity, $name, $silentException);
	}
701895
public void processEvent(EventObject event) {
    if (event instanceof RequestEvent) {
      processRequestEvent((RequestEvent) event);
    } else {
      LOG.error("invalid event type received: " + event.getClass().getName() + ": "
          + event.toString());
    }
  }
304350
def attach_events(self, *events, **kwargs):
        """"""
        reg = self.registry
        insert = 'insert' in kwargs
        for e in events:
            cregexp = e.compile(self.config)
            regexp = getattr(e.regexp, 're', e.regexp)
            if regexp not in reg.events[e.iotype]:
                if insert:
                    reg.events_re[e.iotype].insert(0, (regexp, cregexp))
                else:
                    reg.events_re[e.iotype].append((regexp, cregexp))
            if insert:
                reg.events[e.iotype][regexp].insert(0, e)
            else:
                reg.events[e.iotype][regexp].append(e)
714094
private void processMethods() {
    Method[] methods = listenerClass.getDeclaredMethods();
    for (Method method : methods) {
      for (CallbackType callbackType : CallbackType.values()) {
        if (method.isAnnotationPresent(callbackType.getAnnotationClass())) {
          validateMethod(method, callbackType);
          metadata.putListener(callbackType, method);
        }
      }
    }
  }
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
93579
public void processEvent(EventObject event) {
    // Don't need to do anything except resend if challenged
    // (we only get here for a stateless NOTIFY)

    if (event instanceof ResponseEvent) {
      receivedResponses.add(new SipResponse((ResponseEvent) event));
      resendWithAuthorization((ResponseEvent) event);
    }
  }
367417
@Override
    public void processListener(FacesListener listener) {
        UIComponent c = getComponent();
        UIComponent cFromStack;
        boolean didPush = false;
        FacesContext context = FacesContext.getCurrentInstance();
        cFromStack = UIComponent.getCurrentComponent(context);
        if (null == cFromStack) {
            didPush = true;
            c.pushComponentToEL(context, null);
        }
        try {
            if (listener instanceof SystemEventListener) {
                super.processListener(listener);
            } else if (listener instanceof ComponentSystemEventListener) {
                ((ComponentSystemEventListener)listener).processEvent(this);
            }
        } finally {
            if (didPush) {
                c.popComponentFromEL(context);
            }
        }
    }
387906
private void processInternalListener(Class<?> listenerClass) {
    InternalListenerMetadata listenerMetadata = InternalListenerIntrospector
        .introspect(listenerClass);
    Map<CallbackType, Method> callbacks = listenerMetadata.getCallbacks();
    if (callbacks != null) {
      for (Map.Entry<CallbackType, Method> entry : callbacks.entrySet()) {
        CallbackType callbackType = entry.getKey();
        Method callbackMethod = entry.getValue();
        CallbackMetadata callbackMetadata = new CallbackMetadata(EntityListenerType.INTERNAL,
            callbackType, callbackMethod);
        metadata.put(callbackType, callbackMetadata);
      }
    }
  }