Process event.

@param event
the event
@return true, if successful
769605
public boolean process(ContentEvent event) {
        // distinguish between ClusteringContentEvent and ClusteringEvaluationContentEvent
        if (event instanceof ClusteringContentEvent) {
            ClusteringContentEvent cce = (ClusteringContentEvent) event;
            outputStream.put(event);
            if (cce.isSample()) {
                evaluationStream.put(new ClusteringEvaluationContentEvent(null, new DataPoint(cce.getInstance(), numInstances++), cce.isLastEvent()));
            }
        } else if (event instanceof ClusteringEvaluationContentEvent) {
            evaluationStream.put(event);
        }
        return true;
    }
1077632
public boolean isDeathRelatedEvent(final Attribute event) {
        if (isDeathEvent(event)) {
            return true;
        }
        if (isPostDeathEvent(event)) {
            return true;
        }
        return isUnorderedEvent(event);
    }
289999
public CompletableFuture<Void> accept(T event) {
    List<CompletableFuture<Void>> futures = new ArrayList<>(listeners.size());
    for (ListenerHolder listener : listeners) {
      if (listener.context != null) {
        futures.add(listener.context.execute(() -> listener.listener.accept(event)));
      } else {
        listener.listener.accept(event);
      }
    }
    return CompletableFuture.allOf(futures.toArray(new CompletableFuture[futures.size()]));
  }
739285
def send(self, event):
        
        try:
            processed_event = self.process_event(event)
        except EventEmissionExit:
            return
        else:
            self.send_to_backends(processed_event)
566736
public void processEvent(SystemEvent event) throws AbortProcessingException {
		FacesContext context = FacesContext.getCurrentInstance();
		UIViewRoot root = context.getViewRoot();

		// render the resources only if there is at least one bsf component
		if (ensureExistBootsfacesComponent(root, context)) {
			addCSS(root, context);
			addJavascript(root, context);
			addMetaTags(root, context);
		}
	}
1285796
public void handleEvent(Event event) {
        String topic = event.getTopic();
        if (topic.equals(TOPIC_QUEUED_WORK_NAME)) {
            Runnable r = event.getProperty(KEY_RUNNABLE, Runnable.class);
            if (null != r) {
                r.run();
            } else {
                if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
                    Tr.event(tc, "Unable to find runnable in event; " + topic);
                }
            }
        }
    }
283136
@Override
	public void processEvent(SystemEvent event) throws AbortProcessingException {
		if (!FacesContext.getCurrentInstance().isPostback()) {
			// if (!(getParent() instanceof Column)) {
			insertLabelBeforeThisInputField();
			insertMessageBehindThisInputField();
		}
		// }
	}
335484
protected void process(BufferedReader bufferedReader) throws IOException {
        Matcher eventMatcher;
        Matcher exceptionMatcher;
        String line;
        while ((line = bufferedReader.readLine()) != null) {
            //skip empty line entries
            eventMatcher = regexpPattern.matcher(line);
            if (line.trim().equals("")) {continue;}
            exceptionMatcher = exceptionPattern.matcher(line);
            if (eventMatcher.matches()) {
                //build an event from the previous match (held in current map)
                LoggingEvent event = buildEvent();
                if (event != null) {
                    if (passesExpression(event)) {
                        doPost(event);
                    }
                }
                currentMap.putAll(processEvent(eventMatcher.toMatchResult()));
            } else if (exceptionMatcher.matches()) {
                //an exception line
                additionalLines.add(line);
            } else {
                //neither...either post an event with the line or append as additional lines
                //if this was a logging event with multiple lines, each line will show up as its own event instead of being
                //appended as multiple lines on the same event..
                //choice is to have each non-matching line show up as its own line, or append them all to a previous event
                if (appendNonMatches) {
                    //hold on to the previous time, so we can do our best to preserve time-based ordering if the event is a non-match
                    String lastTime = (String)currentMap.get(TIMESTAMP);
                    //build an event from the previous match (held in current map)
                    if (currentMap.size() > 0) {
                        LoggingEvent event = buildEvent();
                        if (event != null) {
                            if (passesExpression(event)) {
                              doPost(event);
                            }
                        }
                    }
                    if (lastTime != null) {
                        currentMap.put(TIMESTAMP, lastTime);
                    }
                    currentMap.put(MESSAGE, line);
                } else {
                    additionalLines.add(line);
                }
            }
        }

        //process last event if one exists
        LoggingEvent event = buildEvent();
        if (event != null) {
            if (passesExpression(event)) {
                doPost(event);
            }
        }
    }
431846
private void handleEvent(PrimitiveEvent event) {
    log.trace("Received {}", event);
    Set<Consumer<PrimitiveEvent>> listeners = eventListeners.get(event.type());
    if (listeners != null) {
      listeners.forEach(l -> l.accept(event));
    }
  }
280130
@Override
    public void handleEvent(Event event) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
            Tr.event(this, tc, "Received event: " + event.getTopic());
        }
        // if (event.getTopic().equals(PURGE_EVENT)) {
        this.sessionMgr.startPurge();
        // }
    }
79459
def process(self):
        
        assert self.queue is not None
        while True:
            event = self.queue.get()
            if self.pre_process_event(event):
                self.invoke_handlers(event)
            self.queue.task_done()
364010
public void fire(TestSuiteEvent event) {
        TestSuiteResult testSuite = testSuiteStorage.get(event.getUid());
        event.process(testSuite);

        notifier.fire(event);
    }
796292
void processEvent(Event e) {
    assert !_processed;
    // Event e = _events[idx];
    if (e.isSend()) {
      _sends.put(e, new ArrayList<TimelineSnapshot.Event>());
      for (Event otherE : _events) {
        if ((otherE != null) && (otherE != e) && (!otherE.equals(e)) && otherE._blocked
          && otherE.match(e)) {
          _edges.put(otherE, e);
          _sends.get(e).add(otherE);
          otherE._blocked = false;
        }
      }
    } else { // look for matching send, otherwise set _blocked
      assert !_edges.containsKey(e);
      int senderIdx = e.packH2O().index();
      if (senderIdx < 0) { // binary search did not find member, should not happen?
        // no possible sender - return and do not block
        Log.warn("no sender found! port = " + e.portPack() + ", ip = " + e.addrPack().toString());
        return;
      }
      Event senderCnd = _events[senderIdx];
      if (senderCnd != null) {
        if (isSenderRecvPair(senderCnd, e)) {
          _edges.put(e, senderCnd.clone());
          _sends.get(senderCnd).add(e);
          return;
        }
        senderCnd = senderCnd.clone();
        while (senderCnd.prev()) {
          if (isSenderRecvPair(senderCnd, e)) {
            _edges.put(e, senderCnd);
            _sends.get(senderCnd).add(e);
            return;
          }
        }
      }
      e._blocked = true;
    }
    assert (e == null) || (e._eventIdx < TimeLine.MAX_EVENTS);
  }
1018946
@Override
	public boolean process(ContentEvent event) {

    	InstanceContentEvent inEvent = (InstanceContentEvent) event;
		Instance instance = inEvent.getInstance();

		if (inEvent.getInstanceIndex() < 0) {
			//end learning
			ResultContentEvent outContentEvent = new ResultContentEvent(-1, instance, 0,
					new double[0], inEvent.isLastEvent());
			outContentEvent.setClassifierIndex(this.modelId);
			outContentEvent.setEvaluationIndex(inEvent.getEvaluationIndex());
			outputStream.put(outContentEvent);
			return false;
		}
		
		if (inEvent.isTesting()){
			double[] dist = model.getVotesForInstance(instance);
			ResultContentEvent outContentEvent = new ResultContentEvent(inEvent.getInstanceIndex(),
					instance, inEvent.getClassId(), dist, inEvent.isLastEvent());
			outContentEvent.setClassifierIndex(this.modelId);
			outContentEvent.setEvaluationIndex(inEvent.getEvaluationIndex());
			logger.trace(inEvent.getInstanceIndex() + " {} {}", modelId, dist);
			outputStream.put(outContentEvent);
		}
		
		if (inEvent.isTraining()) {
			updateStats(inEvent);
		} 
		return false;
	}
1203306
private boolean filter(Event event) {
        if (null == filters) return false;

        for (EventFilter filter : filters) {
            if (filter.filter(event)) {
                return true;
            }
        }
        return false;
    }
1240209
public boolean process(ElementListener listener) {
        try {
        	Element element;
            for (Iterator i = ((Section)this.element).iterator(); i.hasNext(); ) {
            	element = (Element)i.next();
                listener.add(element);
            }
            return true;
        }
        catch(DocumentException de) {
            return false;
        }
    }
428147
def process(self):
        """"""
        try:
            self.receiver(self)
        # TODO RESTException
        except Exception as e:
            current_app.logger.exception('Could not process event.')
            self.response_code = 500
            self.response = dict(status=500, message=str(e))
        return self