注册一组事件处理对象

@param eventType
@param action
501886
public static void regist(EventType[] eventTypes, Object action) {
        if (eventTypes != null) {
            for (EventType eventType : eventTypes) {
                regist(eventType, action);
            }
        }
    }
1371484
private static EventTypeEnum mapEventTypeEnum(EventEnumType eventType) {
        if (eventType != null) {
            return EventTypeEnum.valueOf(eventType.name());
        }
        return EventTypeEnum.UNKNOWN;
    }
785097
public String putEvents(List<EventType> eventTypes) throws PutEventsFault {
        if (LOG.isLoggable(Level.INFO)) {
            LOG.info("Received event(" + eventTypes.size() + ") from Agent.");
        }
        List<Event> events = new ArrayList<Event>(eventTypes.size());

        try {
            for (EventType eventType : eventTypes) {
                events.add(EventTypeMapper.map(eventType));
            }
        } catch (RuntimeException e) {
            throwFault("004", "Could not map web service data to event." + e.getMessage(), e);
        }

        try {
            monitoringService.putEvents(events);
        } catch (MonitoringException e) {
            e.logException(Level.SEVERE);
            throwFault(e.getCode(), e.getMessage(), e);
        } catch (Throwable t) {
            throwFault("000", "Unknown error " + t.getMessage(), t);
        }

        return "success";
    }
431380
@Beta
    public boolean containsCustomEventMappingFor(final String eventType) {
        if (eventType == null || eventType.isEmpty()) {
            return false;
        } else {
            return this.eventTypeToEventDataMapping.containsKey(canonicalizeEventType(eventType));
        }
    }
562003
@Override
    public void doAction(Action action) {
        BaseComponent parent = getParent();
        
        switch (action) {
            case REMOVE:
                ActionListener.unbindActionListeners(this, actionListeners);
                detach();
                break;
            
            case HIDE:
            case COLLAPSE:
                setVisible(false);
                break;
            
            case SHOW:
            case EXPAND:
                setVisible(true);
                break;
            
            case TOP:
                parent.addChild(this, 0);
                break;
        }
        
        if (parent != null) {
            EventUtil.post(MainController.ALERT_ACTION_EVENT, parent, action);
        }
    }
671068
@Override protected void handleEvents(final String EVENT_TYPE) {
        super.handleEvents(EVENT_TYPE);
        if ("VISIBILITY".equals(EVENT_TYPE)) {
            Helper.enableNode(titleText, !gauge.getTitle().isEmpty());
            Helper.enableNode(subTitleText, !gauge.getSubTitle().isEmpty());
            Helper.enableNode(unitText, !gauge.getUnit().isEmpty());
            Helper.enableNode(valueText, gauge.isValueVisible());
            sectionsVisible = gauge.getSectionsVisible();
            redraw();
        } else if ("RECALC".equals(EVENT_TYPE)) {
            angleStep = ANGLE_RANGE / gauge.getRange();
            redraw();
            rotateNeedle(gauge.getCurrentValue());
        } else if ("INTERACTIVITY".equals(EVENT_TYPE)) {
            if (gauge.isInteractive()) {
                centerKnob.setOnMousePressed(mouseHandler);
                centerKnob.setOnMouseReleased(mouseHandler);
                buttonTooltip.setText(gauge.getButtonTooltipText());
                Tooltip.install(centerKnob, buttonTooltip);
            } else {
                centerKnob.removeEventHandler(MouseEvent.MOUSE_PRESSED, mouseHandler);
                centerKnob.removeEventHandler(MouseEvent.MOUSE_RELEASED, mouseHandler);
                Tooltip.uninstall(centerKnob, buttonTooltip);
            }
        } else if ("SECTIONS".equals(EVENT_TYPE)) {
            sectionsVisible = gauge.getSectionsVisible();
            sections        = gauge.getSections();
        }
    }
1252176
@Override protected void handleEvents(final String EVENT_TYPE) {
        super.handleEvents(EVENT_TYPE);
        if ("VISIBILITY".equals(EVENT_TYPE)) {
            title.setVisible(getSkinnable().isTitleVisible());
            title.setManaged(getSkinnable().isTitleVisible());
            text.setVisible(getSkinnable().isTextVisible());
            text.setManaged(getSkinnable().isTextVisible());
            dateText.setVisible(getSkinnable().isDateVisible());
            dateText.setManaged(getSkinnable().isDateVisible());
            second.setVisible(getSkinnable().isSecondsVisible());
            second.setManaged(getSkinnable().isSecondsVisible());
            boolean alarmsVisible = getSkinnable().isAlarmsVisible();
            for (Shape shape : alarmMap.values()) {
                shape.setManaged(alarmsVisible);
                shape.setVisible(alarmsVisible);
            }
        } else if ("SECTION".equals(EVENT_TYPE)) {
            sections          = getSkinnable().getSections();
            highlightSections = getSkinnable().isHighlightSections();
            sectionsVisible   = getSkinnable().getSectionsVisible();
            areas             = getSkinnable().getAreas();
            highlightAreas    = getSkinnable().isHighlightAreas();
            areasVisible      = getSkinnable().getAreasVisible();
            redraw();
        } else if ("FINISHED".equals(EVENT_TYPE)) {

        }
    }
927007
void addActionReleased(int click, EventAction action)
    {
        final Integer key = Integer.valueOf(click);
        final List<EventAction> list;
        if (actionsReleased.get(key) == null)
        {
            list = new ArrayList<>();
            actionsReleased.put(key, list);
        }
        else
        {
            list = actionsReleased.get(key);
        }
        list.add(action);
    }
92221
public Webhook addEventTypes(final String eventType) {
		if (this.eventTypes == null) {
			this.eventTypes = new ArrayList<String>();
		}
		this.eventTypes.add(eventType);
		return this;
	}
1226205
private void putEvent(EventType eventType) throws Exception {
        List<EventType> eventTypes = Collections.singletonList(eventType);

        int i;
        for (i = 0; i < retryNum; ++i) {
            try {
                monitoringService.putEvents(eventTypes);
                break;
            } catch (Exception e) {
                LOG.log(Level.SEVERE, e.getMessage(), e);
            }
            Thread.sleep(retryDelay);
        }

        if (i == retryNum) {
            LOG.warning("Could not send events to monitoring service after " + retryNum + " retries.");
            throw new Exception("Send SERVER_START/SERVER_STOP event to SAM Server failed");
        }

    }
1301148
private void fireEvent(int eventType, Object eventObject) {
        AgentRosterListener[] listeners;
        synchronized (this.listeners) {
            listeners = new AgentRosterListener[this.listeners.size()];
            this.listeners.toArray(listeners);
        }
        for (int i = 0; i < listeners.length; i++) {
            switch (eventType) {
                case EVENT_AGENT_ADDED:
                    listeners[i].agentAdded((EntityBareJid) eventObject);
                    break;
                case EVENT_AGENT_REMOVED:
                    listeners[i].agentRemoved((EntityBareJid) eventObject);
                    break;
                case EVENT_PRESENCE_CHANGED:
                    listeners[i].presenceChanged((Presence) eventObject);
                    break;
            }
        }
    }
1246085
protected void fireEvent(SerialPortEventTypes eventType) {
        executor.submit(new Runnable() {
            @Override
            public void run() {
                for (SerialPortEventListener listener : eventListeners) {
                    listener.serialEvent(new SerialPortEvent(eventType));
                }

            }
        });
    }
281610
public void setActionTypes(java.util.Collection<ActionType> actionTypes) {
        if (actionTypes == null) {
            this.actionTypes = null;
            return;
        }

        this.actionTypes = new java.util.ArrayList<ActionType>(actionTypes);
    }
688992
@Override protected void handleEvents(final String EVENT_TYPE) {
        super.handleEvents(EVENT_TYPE);
        if ("VISIBILITY".equals(EVENT_TYPE)) {
            Helper.enableNode(valueText, gauge.isValueVisible());
            Helper.enableNode(titleText, !gauge.getTitle().isEmpty());
            Helper.enableNode(unitText, gauge.isValueVisible() && !gauge.getUnit().isEmpty());
        } else if ("SECTION".equals(EVENT_TYPE)) {
            sections = gauge.getSections();
            resize();
        } else if ("RECALC".equals(EVENT_TYPE)) {
            redraw();
            setBar(gauge.getCurrentValue());
        }
    }
49616
@Override protected void handleEvents(final String EVENT_TYPE) {
        super.handleEvents(EVENT_TYPE);
        if ("RECALC".equals(EVENT_TYPE)) {
            range     = gauge.getRange();
            angleStep = ANGLE_RANGE / range;
            minValue  = gauge.getMinValue();
            sections  = gauge.getSections();
            resize();
            redraw();
            setBar(gauge.getCurrentValue());
        } else if ("VISIBILITY".equals(EVENT_TYPE)) {
            Helper.enableNode(valueText, gauge.isValueVisible());
            Helper.enableNode(titleText, !gauge.getTitle().isEmpty());
            Helper.enableNode(unitText, !gauge.getUnit().isEmpty());
            boolean tickLabelsVisible = gauge.getTickLabelsVisible();
            Helper.enableNode(minText, tickLabelsVisible);
            Helper.enableNode(maxText, tickLabelsVisible);
            boolean thresholdVisible = gauge.isThresholdVisible();
            Helper.enableNode(threshold, thresholdVisible);
            Helper.enableNode(thresholdText, thresholdVisible);
            resize();
            redraw();
        }
    }
490491
public void subscribeToEvent(EventListener eventListener, Class<? extends AbstractTaskEvent> eventType) {
		this.outputGate.subscribeToEvent(eventListener, eventType);
	}
697644
@Override protected void handleEvents(final String EVENT_TYPE) {
        super.handleEvents(EVENT_TYPE);
        if ("RECALC".equals(EVENT_TYPE)) {
            minValue = gauge.getMinValue();
            maxValue = gauge.getMaxValue();
            range    = gauge.getRange();
            stepSize = size / range;
            redraw();
        } else if ("VISIBLITY".equals(EVENT_TYPE)) {
            Helper.enableNode(titleText, !gauge.getTitle().isEmpty());
            Helper.enableNode(valueText, gauge.isValueVisible());
            Helper.enableNode(unitText, !gauge.getUnit().isEmpty());
        } else if ("SECTION".equals(EVENT_TYPE)) {
            sections = gauge.getSections();
        }
    }