Add an event to the queue. It will be processed in the order received.

@param event Event
17293
public void addEvent(Event event) {
        if(event == null)
            throw new IllegalStateException("event must be non-null");

        if(logger.isTraceEnabled())
            logger.trace("Adding event " + event);

        eventQueue.add(event);
    }
81960
@Override
    public void send(Event event) {
        if (!closed) {
            queue.add(withPayload(new EventSubmitter(id, event)));
        }
    }
838680
@Override
  public void onNext(final T event) {
    LOG.log(Level.FINEST, "Invoked for event: {0}", event);
    lock.readLock().lock();
    final List<EventHandler<? extends T>> list;
    try {
      list = clazzToListOfHandlersMap.get(event.getClass());
      if (list == null) {
        throw new WakeRuntimeException("No event " + event.getClass() + " handler");
      }
      for (final EventHandler<? extends T> handler : list) {
        LOG.log(Level.FINEST, "Invoking {0}", handler);
        ((EventHandler<T>) handler).onNext(event);
      }
    } finally {
      lock.readLock().unlock();
    }
  }
262192
public void addEvent(final EventType _eventtype,
                         final EventDefinition _eventdef)
        throws CacheReloadException
    {
        List<EventDefinition> evenList = this.events.get(_eventtype);
        if (evenList == null) {
            evenList = new ArrayList<>();
            this.events.put(_eventtype, evenList);
        }
        if (!evenList.contains(_eventdef)) {
            evenList.add(_eventdef);
        }
        // if there are more than one event they must be sorted by their index
        // position
        if (evenList.size() > 1) {
            Collections.sort(evenList, new Comparator<EventDefinition>()
            {
                @Override
                public int compare(final EventDefinition _eventDef0,
                                   final EventDefinition _eventDef1)
                {
                    return Long.compare(_eventDef0.getIndexPos(), _eventDef1.getIndexPos());
                }
            });
        }
        setDirty();
    }
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());
    }
  }
349764
protected void notifyStatus(String event){
		BlockingQueue<String> eventsQueue = (LinkedBlockingQueue<String>)getServletContext().getAttribute("eventsQueue");
//		if (eventsQueue == null) eventsQueue = new LinkedBlockingQueue<String>();
//		getServletContext().setAttribute("eventsQueue", eventsQueue);
		
		try {
			eventsQueue.put(event);
		} catch (InterruptedException e) {
			e.printStackTrace();
		}		
	}
815161
@Override
    public void add(Event event) {
        if (getNumStoredEvents() >= maxEvents) {
            logger.warn("Not adding Event because at least "
                + Integer.toString(maxEvents) + " events are already stored: " + event.getId());
            return;
        }

        File eventFile = new File(bufferDir.getAbsolutePath(), event.getId().toString() + FILE_SUFFIX);
        if (eventFile.exists()) {
            logger.trace("Not adding Event to offline storage because it already exists: "
                + eventFile.getAbsolutePath());
            return;
        } else {
            logger.debug("Adding Event to offline storage: " + eventFile.getAbsolutePath());
        }

        try (FileOutputStream fileOutputStream = new FileOutputStream(eventFile);
             ObjectOutputStream objectOutputStream = new ObjectOutputStream(fileOutputStream)) {
            objectOutputStream.writeObject(event);
        } catch (Exception e) {
            logger.error("Error writing Event to offline storage: " + event.getId(), e);
        }

        logger.debug(Integer.toString(getNumStoredEvents())
            + " stored events are now in dir: "
            + bufferDir.getAbsolutePath());
    }
691750
private void fireEvent(RecorderEventImpl event) {
        eventSender.event = event;
        scheduler.submit(eventSender, PriorityQueueScheduler.INPUT_QUEUE);
    }
496725
public void fire(T event) {
		ArrayList<Listener<T>> list1;
		ArrayList<Runnable> list2;
		synchronized (this) {
			if (listeners == null) list1 = null;
			else list1 = new ArrayList<>(listeners);
			if (listenersRunnable == null) list2 = null;
			else list2 = new ArrayList<>(listenersRunnable);
		}
		if (list1 != null)
			for (int i = 0; i < list1.size(); ++i)
				try { list1.get(i).fire(event); }
				catch (Throwable t) {
					LCCore.getApplication().getDefaultLogger().error("Event listener error: " + list1.get(i), t);
				}
		if (list2 != null)
			for (int i = 0; i < list2.size(); ++i)
				try { list2.get(i).run(); }
				catch (Throwable t) {
					LCCore.getApplication().getDefaultLogger().error("Event listener error: " + list2.get(i), t);
				}
	}
750127
public void addEvent(LogEvent event) {
        try {
            write(getString(event));
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
414923
@Override
  public synchronized void handleEvent(final Event event) {
    if (event.getType() == EventType.JOB_FINISHED && Status.FAILED
        .equals(event.getData().getStatus())) {
      this.value = this.value + 1;
    }
  }
416123
protected void scheduleEvent(final Event event, final long delay, final long period) {
        final Timer timer = new Timer();
        timer.schedule(new ScheduleEvent().event(event), delay, period);
        timers.add(timer);
    }
1112308
@Override
    public void onEvent(InteractionEvent event) {
        switch (event.getType()) {
        case BEFORE_WAIT:
            onBeforeWaitEvent((BeforeWaitInteractionEvent) event);
            break;
        case BEFORE:
            onBeforeEvent((BeforeInteractionEvent) event);
            break;
        case AFTER_SUCCESS:
            onAfterSuccessEvent((AfterSuccessInteractionEvent) event);
            onAfterEvent((AfterInteractionEvent) event);
            break;
        case AFTER_FAIL:
            onAfterFailEvent((AfterFailInteractionEvent) event);
            onAfterEvent((AfterInteractionEvent) event);
            break;
        }
    }
334082
public void processEvent(EventObject event) // for asynchronous
  // (nonblocking) response
  // handling
  {
    synchronized (this) {
    } // wail til message sending has finished (transaction attribute set)

    if (event instanceof ResponseEvent) {
      processResponse((ResponseEvent) event);
    } else if (event instanceof TimeoutEvent) {
      processTimeout((TimeoutEvent) event);
    }

    // note, requests don't come through here, they are handled via the
    // listen/waitFor methods.
  }
537533
private void print( Queue<Runnable> queue, IoEvent event) {
        StringBuilder sb = new StringBuilder();
        sb.append( "Adding event " ).append( event.getType() ).append( " to session " ).append(event.getSession().getId() );
        boolean first = true;
        sb.append( "\nQueue : [" );
        for (Runnable elem:queue) {
            if ( first ) {
                first = false;
            } else {
                sb.append( ", " );
            }
                
            sb.append(((IoEvent)elem).getType()).append(", ");
        }
        sb.append( "]\n" );
        LOGGER.debug( sb.toString() );
    }
380365
public void enqueue(SnackbarEvent event) {
        synchronized (this) {
            if (!eventsSet.contains(event)) {
                eventsSet.add(event);
                eventQueue.offer(event);
            } else if (currentEvent == event && pauseTransition != null) {
                pauseTransition.playFromStart();
            }
        }
        if (processingQueue.compareAndSet(false, true)) {
            Platform.runLater(() -> {
                currentEvent = eventQueue.poll();
                if (currentEvent != null) {
                    show(currentEvent);
                }
            });
        }
    }
769719
final void performAction(final AbstractEventQueue eventQueue, final Event<?> event) {
        final Event<T> eventObject = (Event<T>) event;

        try {
            action(eventObject);
        } catch (final Exception e) {
            LOGGER.log(Level.WARN, "Event perform failed", e);
        } finally { // remove event from event queue
            if (eventQueue instanceof SynchronizedEventQueue) {
                final SynchronizedEventQueue synchronizedEventQueue = (SynchronizedEventQueue) eventQueue;

                synchronizedEventQueue.removeEvent(eventObject);
            }
        }
    }