@class
Jah Event

@memberOf events
491195
function Event (type, cancelable) {
    if (cancelable) {
        Object.defineProperty(this, 'cancelable', { value: true, writable: false })
    }
    this.type = type
}
56982
function(nativeEvent, typeOverride) {
  var evt = eventWrapper(nativeEvent);
  if (typeOverride !== undefined) {
    evt.type = typeOverride;
  }
  var activePath = [];
  var elem = evt.target;
  var events;

  /**
   * Handle calling bound functions with the proper targets set
   * @TODO move this outside eventHandler
   * @param  {Element}         elem      DOM element to trigger events on
   * @param  {Array<Function>} funcArr   Array of bound functions to trigger
   * @param  {String}          selector  Selector string that the event was bound to
   * @param  {Element}         delegate  DOM element this event was bound to for delegation
   */
  var triggerEventFunctions = function(elem, funcArr, selector, delegate) {
    var result;
    evt.currentTarget = elem;
    evt.delegateTarget = delegate;
    for (var i = 0; i < funcArr.length; i++) {
      if (!evt.isImmediatePropagationStopped()) {
        evt.vEvent = {
          handler: funcArr[i].method,
          selector: selector
        };

        result = funcArr[i].method(evt);
        if (result === false) {
          falseHandler(evt);
        }
      }
    }
  };

  /**
   * Checks if bound events should fire
   * @param  {Object}    typeEvents        Event object of events to check if should fire
   */
  var checkEvents = function(typeEvents) {
    var elemClasses, elemClass;

    // Iterate over previously passed elements to check for any delegated events
    var activePathLength = activePath.length;
    for (var i = 0; i < activePathLength; i++) {
      elemClasses = activePath[i].classes;
      // Once stopPropagation is called stop
      if (!evt.isPropagationStopped()) {
        var elemClassesLength = elemClasses.length;
        for (var j = 0; j < elemClassesLength; j++) {
          elemClass = elemClasses[j];
          if (typeEvents[elemClass]) {
            triggerEventFunctions(activePath[i].element, typeEvents[elemClass], elemClass, elem);
          }
        }
      }
    }

    // Check for any non-delegated events
    if (!evt.isPropagationStopped() && typeEvents.self) {
      triggerEventFunctions(elem, typeEvents.self);
    }
  };

  while (elem && !evt.isPropagationStopped()) {
    events = module.exports.getEvents(elem);
    if (events) {
      // Generic events
      if (events[evt.type]) {
        checkEvents(events[evt.type]);
      }
    }
    // Create array of class names that match our pattern to check for delegation later
    var elemActiveClasses = module.exports.getActiveClasses(elem);
    if (elemActiveClasses.length) {
      activePath.push({
        element: elem,
        classes: elemActiveClasses
      });
    }
    elem = elem.parentNode;
  }
}
306970
function( type ) {
                var args, events, allEvents;
    
                if ( !this._events || !type ) {
                    return this;
                }
    
                args = slice.call( arguments, 1 );
                events = findHandlers( this._events, type );
                allEvents = findHandlers( this._events, 'all' );
    
                return triggerHanders( events, args ) &&
                        triggerHanders( allEvents, arguments );
            }
974498
function EventReactor(options, proto) {
    // allow initialization without a new prefix
    if (!(this instanceof EventReactor)) return new EventReactor(options, proto);

    options = options || {};
    this.restore = {};

    // don't attach the extra event reactor methods, we are going to apply them
    // manually to the prototypes
    if (options.manual) return this;

    var methods = EventReactor.generation
      , method;

    for (method in methods) {
      if (methods.hasOwnProperty(method)) {
        this[method](proto);
      }
    }

    // such as aliases and emit overrides
    this.aliases(proto);
    this.emit(proto);
  }
403160
public void subscribeEvent(Object object) {
        if (object instanceof Class) {
            object = locator.createAndInitialize((Class) object);
        } else {
            locator.inject(object);
            locator.postConstruct(object);
        }
        getEventBus().subscribe(object);
    }
1223642
private Object getEvent(EventEnvelope eventEnvelope) {
        Object event = eventEnvelope.getEvent();
        if (event instanceof Data) {
            event = eventService.nodeEngine.toObject(event);
        }
        return event;
    }
59184
function(proto) {
        function F() {}
        this.merge(F.prototype, proto || {}, (function() {
            var Events = function() {};
            Events.prototype = EventEmitter.prototype;
            return new Events();
        })());
        return new F();
    }
552449
function(eventHash) {
      // coped from Backbone
      var delegateEventSplitter = /^(\S+)\s*(.*)$/;
      var namespacedEvents = {};
      var behaviorId = this.cid;
      _.each(eventHash, function(value, key) {
        var splitEventKey = key.match(delegateEventSplitter);
        var eventName = splitEventKey[1];
        var selector = splitEventKey[2];
        var namespacedEventName = eventName + '.behavior.' + behaviorId;
        namespacedEvents[[namespacedEventName, selector].join(' ')] = value;
      });
      return namespacedEvents;
    }
661533
function Event(type) {
    var me = this;
    return (me == null || me.constructor != Event)
      ? new Event(type)
      : (type instanceof Event)
          ? type
          : extend(me, { 'timeStamp': +new Date }, typeof type == 'string' ? { 'type': type } : type);
  }
1155838
private void handleJoinEvent(Node node) {
    SwimMember member = new SwimMember(MemberId.from(node.id().id()), node.address());
    if (!members.containsKey(member.id())) {
      probe(member.copy());
    }
  }
553732
function(eventhandlerfactory) {

    var eventhandler = new function(){

    }

    var thehandler = function() {};
    thehandler.prototype.onStartDocument = function (funct){
      eventhandler.onStartDocument = funct;
    }
    thehandler.prototype.onEndDocument = function (funct){
      eventhandler.onEndDocument = funct;
    }
    thehandler.prototype.onStartElementNS = function (funct){
      eventhandler.onStartElementNS = funct;
    }
    thehandler.prototype.onEndElementNS = function (funct){
      eventhandler.onEndElementNS = funct;
    }
    thehandler.prototype.onCharacters = function(funct) {
      eventhandler.onCharacters = funct;
    }
    thehandler.prototype.onCdata = function(funct) {
      eventhandler.onCdata = funct;
    }
    thehandler.prototype.onComment = function(funct) {
      eventhandler.onComment = funct;
    }
    thehandler.prototype.onWarning = function(funct) {
      eventhandler.onWarning = funct;
    }

    thehandler.prototype.onError = function(funct) {
      eventhandler.onError = funct;
    }


    eventhandlerfactory(new thehandler());
    //eventhandler = eventhandler(eventhandler);
    this.m_hndDoc = eventhandler;
    this.m_hndErr = eventhandler;
    this.m_hndLex = eventhandler;
    this.m_interrupted = false;
}
422414
function addEvent(eventName, {
    onElement,
    withCallback,
    avoidDuplicate = true,
    once = false,
    useCapture = false} = { }, thisArg) {
    let element = onElement || []
    if (utils.isString(element)) {
        element =  document.querySelectorAll(element)
    }
    function handler(event) {
        if (utils.isFunction(withCallback)) {
            withCallback.call(thisArg, event, this)
        }
        if (once) {
            handler.destroy();
        }
    }
    handler.destroy = function() {
        each(element, (el) => {
            const events = getNodeEvents(el, eventName, handler);
            if (events.found) { events.all.splice(events.evt, 1); }
            if (el.removeEventListener) el.removeEventListener(eventName, handler, useCapture)
        })
    }
    each(element, (el) => {
        const events = getNodeEvents(el, eventName, handler);
        if (el.addEventListener && (avoidDuplicate && !events.found) || !avoidDuplicate) {
            el.addEventListener(eventName, handler, useCapture)
            events.all.push({ eventName: eventName, fn: handler});
        }
    })
    return handler
}
819151
@Override
    public void onEvent(final WorkerEvent event, final Worker worker, final String queue,
            final net.greghaines.jesque.Job job, final Object runner, final Object result, final Throwable t) {
        if (t == null) {
            LOG.debug("{} {} {} {} {} {} {}", new Object[]{ event, worker, queue, job, runner, result, t });
        } else {
            LOG.error(event + " " + worker + " " + queue + " " + job + " " + runner + " " + result, t);
        }
    }
471781
function(object, events, callback) {
      var listeners = this._listeners;
      if (!listeners) return;
      if (object) {
        object.off(events, callback, this);
        if (!events && !callback) delete listeners[object._listenerId];
      } else {
        for (var id in listeners) {
          listeners[id].off(null, null, this);
        }
        this._listeners = {};
      }
      return this;
    }
1137979
function event(publicAPI, model, eventName, asynchrounous = true) {
  const callbacks = [];
  const previousDestroy = publicAPI.destroy;

  function off(index) {
    callbacks[index] = null;
  }

  function on(index) {
    function unsubscribe() {
      off(index);
    }
    return Object.freeze({ unsubscribe });
  }

  publicAPI[`fire${capitalize(eventName)}`] = (...args) => {
    if (model.deleted) {
      console.log('instance deleted - can not call any method');
      return;
    }

    function processCallbacks() {
      callbacks.forEach((callback) => {
        if (callback) {
          try {
            callback.apply(publicAPI, args);
          } catch (errObj) {
            console.log('Error event:', eventName, errObj);
          }
        }
      });
    }

    if (asynchrounous) {
      setImmediate(processCallbacks);
    } else {
      processCallbacks();
    }
  };

  publicAPI[`on${capitalize(eventName)}`] = (callback) => {
    if (model.deleted) {
      console.log('instance deleted - can not call any method');
      return null;
    }

    const index = callbacks.length;
    callbacks.push(callback);
    return on(index);
  };

  publicAPI.destroy = () => {
    previousDestroy();
    callbacks.forEach((el, index) => off(index));
  };
}
1007568
public WeldEvent<Object> event() {
        checkIsRunning();
        if (event == null) {
            synchronized (this) {
                if (event == null) {
                    event = beanManager().event();
                }
            }
        }
        return event;
    }
652744
private void handleMembershipEvent(GroupMembershipEvent event) {
    post(new ClusterMembershipEvent(ClusterMembershipEvent.Type.valueOf(event.type().name()), event.member()));
  }