Handles a primitive 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));
    }
  }
136231
private void handleDone() {
        // Attempt to complete the current token token
        performCompletion();

        // Hide the keyboard
        InputMethodManager imm = (InputMethodManager) getContext().getSystemService(
                Context.INPUT_METHOD_SERVICE);
        if (imm != null) {
            imm.hideSoftInputFromWindow(getWindowToken(), 0);
        }
    }
1043246
def handle_event(self, event):
        """"""
        if event.get('command'):
            if event['command'] == 'on':
                cmd = 'off'
            else:
                cmd = 'on'

            task = self.send_command_ack(event['id'], cmd)
            self.loop.create_task(task)
1268855
def write_event(self, event):
        """"""
        # Check if event is of type event_pb2.Event proto.
        if not isinstance(event, event_pb2.Event):
            raise TypeError("expected an event_pb2.Event proto, "
                            " but got %s" % type(event))
        return self._write_serialized_event(event.SerializeToString())
226167
@Override protected void handleEvents(final String EVENT_TYPE) {
        super.handleEvents(EVENT_TYPE);
        if ("RECALC".equals(EVENT_TYPE)) {
            angleRange = Helper.clamp(90.0, 180.0, gauge.getAngleRange());
            minValue   = gauge.getMinValue();
            range      = gauge.getRange();
            angleStep  = angleRange / range;
            redraw();
        }
    }
1194654
private void _handleEmptyValue(TypedValueDecoder dec)
        throws XMLStreamException
    {
        try { // default action is to throw an exception
            dec.handleEmptyValue();
        } catch (IllegalArgumentException iae) {
            throw _constructTypeException(iae, "");
        }
    }
360456
function onPointerEvent(e)  {
        // normalize eventTypes
        normalizeEvent(e);

        // remember/use the first "primary" normalized event for pointer.bind
        var button = normalizedEvents[0].button;

        // dispatch event to registered objects
        if (dispatchEvent(normalizedEvents) || e.type === "wheel") {
            // always preventDefault for wheel event (?legacy code/behavior?)
            if (api.preventDefault === true) {
                e.preventDefault();
            }
        }

        var keycode = api.pointer.bind[button];

        // check if mapped to a key
        if (keycode) {
            me.input.triggerKeyEvent(keycode, POINTER_DOWN.includes(e.type), button + 1)
        }
    }
120793
def _trigger_event(self, event, namespace, *args):
        """"""
        # first see if we have an explicit handler for the event
        if namespace in self.handlers and event in self.handlers[namespace]:
            return self.handlers[namespace][event](*args)

        # or else, forward the event to a namespace handler if one exists
        elif namespace in self.namespace_handlers:
            return self.namespace_handlers[namespace].trigger_event(
                event, *args)
53328
private void handleEvent(CmsEvent event) {

        switch (event.getType()) {
            case I_CmsEventListener.EVENT_PUBLISH_PROJECT:
                //System.out.print(getEventName(event.getType()));
                String publishIdStr = (String)event.getData().get(I_CmsEventListener.KEY_PUBLISHID);
                if (publishIdStr != null) {
                    CmsUUID publishId = new CmsUUID(publishIdStr);
                    try {
                        List<CmsPublishedResource> publishedResources = m_cms.readPublishedResources(publishId);
                        if (!publishedResources.isEmpty()) {
                            String[] typesToMatch = new String[] {TYPE_PROPERTIES_BUNDLE, TYPE_XML_BUNDLE};
                            boolean reload = false;
                            for (CmsPublishedResource res : publishedResources) {
                                for (String typeName : typesToMatch) {
                                    if (OpenCms.getResourceManager().matchResourceType(typeName, res.getType())) {
                                        reload = true;
                                        break;
                                    }
                                }
                            }
                            if (reload) {
                                scheduleReload();
                            }
                        }
                    } catch (CmsException e) {
                        LOG.error(e.getLocalizedMessage(), e);
                    }
                }
                break;
            case I_CmsEventListener.EVENT_CLEAR_CACHES:
                scheduleReload();
                break;
            default:
        }
    }
195039
public void processEvent(EventObject event) {
    if (event instanceof RequestEvent) {
      processRequest((RequestEvent) event);
    } else if (event instanceof ResponseEvent) {
      processResponse((ResponseEvent) event);
    } else if (event instanceof TimeoutEvent) {
      processTimeout((TimeoutEvent) event);
    } else {
      LOG.error("invalid event type received: {}: {}", event.getClass().getName(), event.toString());
    }
  }
1076274
protected void handleEvents(final String EVENT_TYPE) {
        if ("REDRAW".equals(EVENT_TYPE)) {
            pane.setEffect(clock.getShadowsEnabled() ? mainInnerShadow1 : null);
            shadowGroup.setEffect(clock.getShadowsEnabled() ? FOREGROUND_SHADOW : null);
            updateLcdDesign(height);
            redraw();
        } else if ("RESIZE".equals(EVENT_TYPE)) {
            resize();
            redraw();
        } else if ("LCD".equals(EVENT_TYPE)) {
            updateLcdDesign(height);
        } else if ("VISIBILITY".equals(EVENT_TYPE)) {
            boolean crystalEnable = clock.isLcdCrystalEnabled();
            crystalOverlay.setManaged(crystalEnable);
            crystalOverlay.setVisible(crystalEnable);
            boolean secondsVisible = clock.isSecondsVisible();
            backgroundSecondText.setManaged(secondsVisible);
            backgroundSecondText.setVisible(secondsVisible);
            secondText.setManaged(secondsVisible);
            secondText.setVisible(secondsVisible);
            boolean dateVisible = clock.isDateVisible();
            dateText.setManaged(dateVisible);
            dateText.setVisible(dateVisible);
            dayOfWeekText.setManaged(dateVisible);
            dayOfWeekText.setVisible(dateVisible);
            boolean titleVisible = clock.isTitleVisible();
            title.setManaged(titleVisible);
            title.setVisible(titleVisible);
            boolean alarmVisible = clock.getAlarms().size() > 0;
            alarm.setManaged(alarmVisible);
            alarm.setVisible(alarmVisible);
            resize();
            redraw();
        } else if ("RECALC".equals(EVENT_TYPE)) {
            adjustDateFormat();
            redraw();
        }
    }
610890
async def handler(event):
    """"""
    await asyncio.wait([
        event.delete(),
        event.respond(READ_FULL, reply_to=event.reply_to_msg_id)
    ])
852918
@Override protected void handleEvents(final String EVENT_TYPE) {
        super.handleEvents(EVENT_TYPE);

        if ("VISIBILITY".equals(EVENT_TYPE)) {
            Helper.enableNode(titleText, !tile.getTitle().isEmpty());
            Helper.enableNode(valueText, tile.isValueVisible());
            Helper.enableNode(unitText, !tile.getUnit().isEmpty());
        }
    }
1047904
def event(self, event):
        """"""
        if event.type() in (QEvent.Shortcut, QEvent.ShortcutOverride):
            return True
        else:
            return super(ShortcutEditor, self).event(event)
217960
public void processResponseEvent(FireableEventType eventType, ResponseEvent event, XCAPResourceAdaptorActivityHandle handle){
        
    	if (tracer.isFineEnabled()) {    		            		
    		tracer.fine("NEW RESPONSE EVENT");        
    	}
                        
        try {                	
            sleeEndpoint.fireEvent(handle,eventType, event, null, null);
        } catch (Exception e) {           
            tracer.severe("unable to fire event",e);
        }        
    }
636698
protected function handleItself()
    {
        if (!$this->isNew && $this->isCreated($this->event)) {
            $this->unwatch($this->id);
            $this->reindexChildCheckers();
            $this->event = null;
        }
        $this->isNew = false;
    }
78627
private void handleInheritedEvent(ProcessExecutor engine, ProcessInstance processInstVO,
            Process processVO, InternalEvent messageDoc, Integer eventType)
      throws ProcessException {
        try {
            if (logger.isInfoEnabled()) {
                if (messageDoc.isProcess())  // Process SLA (Delay handler)
                    logger.info(logtag(processVO.getId(), processInstVO.getId(), processInstVO.getMasterRequestId()), "Inherited Event - type="
                            + eventType + ", compcode=" + messageDoc.getCompletionCode());
                else
                    logger.info(logtag(processVO.getId(), processInstVO.getId(),
                            messageDoc.getWorkId(), messageDoc.getWorkInstanceId()), "Inherited Event - type="
                            + eventType + ", compcode=" + messageDoc.getCompletionCode());
            }
            engine.notifyMonitors(processInstVO, WorkStatus.LOGMSG_PROC_ERROR);
            String compCode = messageDoc.getCompletionCode();
            ProcessInstance originatingInstance = processInstVO;
            Process embeddedHandlerProc = processVO.findSubprocess(eventType, compCode);
            while (embeddedHandlerProc == null && processInstVO.getOwner().equals(OwnerType.PROCESS_INSTANCE)) {
                processInstVO = engine.getProcessInstance(processInstVO.getOwnerId());
                processVO = getProcessDefinition(processInstVO);
                embeddedHandlerProc = processVO.findSubprocess(eventType, compCode);
            }

            if (embeddedHandlerProc != null) {
                if (isRecursiveCall(originatingInstance, processVO, embeddedHandlerProc.getId())) {
                    logger.warn("Invoking embedded process recursively - not allowed: " + embeddedHandlerProc.getName());
                }
                else {
                    Long secondaryOwnerId = null;
                    String secondaryOwnerType = null;
                    if (!eventType.equals(EventType.ABORT)) {
                        Long secondOwnerId = messageDoc.getWorkInstanceId();
                        if (secondOwnerId != null && secondOwnerId > 0) {
                            if (!messageDoc.isProcess()) {
                                secondaryOwnerId = secondOwnerId;
                                secondaryOwnerType = OwnerType.ACTIVITY_INSTANCE;
                            }
                            // Update the Process Variable "exception" with the exception handler's triggering Activity exception
                            if (processVO.getVariable("exception") != null &&
                                    messageDoc.getSecondaryOwnerId() != null && messageDoc.getSecondaryOwnerId() > 0) {
                                VariableInstance exceptionVar = processInstVO.getVariable("exception");
                                if (exceptionVar == null)
                                    engine.createVariableInstance(processInstVO, "exception", new DocumentReference(messageDoc.getSecondaryOwnerId()));
                                else
                                    engine.updateVariableInstance(exceptionVar);
                            }
                        }
                        else {
                            if (eventType.equals(EventType.ERROR)) {
                                logger.warn("Creating fallout embedded process without activity instance as secondary owner");
                                logger.warn("--- completion code " + messageDoc.getCompletionCode());
                                logger.warn("--- trans inst ID " + messageDoc.getTransitionInstanceId());
                                logger.warn("--- work ID " + messageDoc.getWorkId());
                                String[] stack = this.getStackTrace();
                                for (int i = 0; i < stack.length; i++) {
                                    logger.warn("--- stack " + i + ": " + stack[i]);
                                }
                            }
                            messageDoc.setSecondaryOwnerType(null);
                        }
                    }
                    else {
                        messageDoc.setSecondaryOwnerType(null);
                    }
                    String ownerType = OwnerType.MAIN_PROCESS_INSTANCE;
                    ProcessInstance procInst = engine.createProcessInstance(
                            embeddedHandlerProc.getId(), ownerType, processInstVO.getId(),
                            secondaryOwnerType, secondaryOwnerId, processInstVO.getMasterRequestId(), null);
                    engine.startProcessInstance(procInst, 0);
                }
            }
            else {
                // try package-level handler
                Process packageHandlerProc = null;
                // TODO ugly test to avoid dup errors for service subproc invokes
                if (messageDoc.getStatusMessage() == null || !messageDoc.getStatusMessage().startsWith("com.centurylink.mdw.activity.ActivityException: At least one subprocess is not completed\n"))
                    packageHandlerProc = getPackageHandler(processInstVO, eventType);
                if (packageHandlerProc != null) {
                    Map<String,String> params = new HashMap<>();
                    Variable exVar = packageHandlerProc.getVariable("exception");
                    if (exVar == null || !exVar.isInput()) {
                        logger.warn("Handler proc " + packageHandlerProc.getFullLabel() + " does not declare input var: 'exception'");
                    }
                    else {
                        params.put("exception", new DocumentReference(messageDoc.getSecondaryOwnerId()).toString());
                    }
                    if (packageHandlerProc.isService()) {
                        invokeService(packageHandlerProc.getId(), OwnerType.ERROR,
                                messageDoc.getSecondaryOwnerId(),
                                originatingInstance.getMasterRequestId(), null, params, null, 0,
                                messageDoc.isProcess() ? OwnerType.PROCESS_INSTANCE : OwnerType.ACTIVITY_INSTANCE, messageDoc.getWorkInstanceId(), null);
                    }
                    else {
                        startProcess(packageHandlerProc.getId(), originatingInstance.getMasterRequestId(), OwnerType.ERROR,
                                messageDoc.getSecondaryOwnerId(), params, messageDoc.isProcess() ? OwnerType.PROCESS_INSTANCE : OwnerType.ACTIVITY_INSTANCE, messageDoc.getWorkInstanceId(), null);
                    }
                }
                else if (eventType.equals(EventType.ABORT)) {
                    // abort the root process instance
                    InternalEvent event = InternalEvent.createProcessAbortMessage(processInstVO);
                    engine.abortProcessInstance(event);
                }
                else {
                    logger.info("Transition has not been defined for event of type " + eventType);
                }
            }
        }
        catch (Exception ex) {
            logger.severeException(ex.getMessage(), ex);
            throw new ProcessException(ex.getMessage());
        }
    }