创建并初始化监听
@param uri URI
@param events 监听的事件列表
@return 监听对象
185092
public static WatchMonitor create(URI uri, WatchEvent.Kind<?>... events){
		return create(uri, 0, events);
	}
784813
public org.jsoup.nodes.Document getFromJson(String uri){
        // 取回資料，並轉化為XML格式
        String json = getFromRemote(uri);

        // 將 json 轉化為 xml
        String xml  = jsonToXml(json);

        // 轉化為 Jsoup 物件
        return xmlToJsoupDoc(xml);
    }
399578
public java.util.List<EventTopic> getEventTopics() {
        if (eventTopics == null) {
            eventTopics = new com.amazonaws.internal.SdkInternalList<EventTopic>();
        }
        return eventTopics;
    }
24444
@Beta
    public EventGridEvent[] deserializeEventGridEvents(final String requestContent, final SerializerAdapter<ObjectMapper> serializerAdapter) throws IOException {
        EventGridEvent[] eventGridEvents = serializerAdapter.<EventGridEvent[]>deserialize(requestContent, EventGridEvent[].class);
        for (EventGridEvent receivedEvent : eventGridEvents) {
            if (receivedEvent.data() == null) {
                continue;
            } else {
                final String eventType = receivedEvent.eventType();
                final Type eventDataType;
                if (SystemEventTypeMappings.containsMappingFor(eventType)) {
                    eventDataType = SystemEventTypeMappings.getMapping(eventType);
                } else if (containsCustomEventMappingFor(eventType)) {
                    eventDataType = getCustomEventMapping(eventType);
                } else {
                    eventDataType = null;
                }
                if (eventDataType != null) {
                    final String eventDataAsString = serializerAdapter.serializeRaw(receivedEvent.data());
                    final Object eventData = serializerAdapter.<Object>deserialize(eventDataAsString, eventDataType);
                    setEventData(receivedEvent, eventData);
                }
            }
        }
        return eventGridEvents;
    }
1344784
@RequestMapping(value = "root", method = RequestMethod.GET)
    public Resources<UIEvent> getEvents(
            @RequestParam(required = false, defaultValue = "0") int offset,
            @RequestParam(required = false, defaultValue = "20") int count) {
        // Gets the events
        Resources<UIEvent> resources = Resources.of(
                eventQueryService.getEvents(offset, count).stream()
                        .map(this::toUIEvent)
                        .collect(Collectors.toList()),
                uri(on(getClass()).getEvents(offset, count))).forView(UIEvent.class);
        // Pagination information
        Pagination pagination = Pagination.of(offset, count, -1);
        // Previous page
        if (offset > 0) {
            pagination = pagination.withPrev(
                    uri(on(EventController.class).getEvents(
                            Math.max(0, offset - count),
                            count
                    ))
            );
        }
        // Next page
        pagination = pagination.withNext(
                uri(on(EventController.class).getEvents(
                        offset + count,
                        count
                ))
        );
        return resources.withPagination(pagination);
    }
393282
public static String getUri(String uri) throws IOException {
        CloseableHttpClient c = newHttpClient(new URL(uri));
        HttpGet get = new HttpGet(uri);
        LOG.debug("GET {}", uri);
        CloseableHttpResponse res = c.execute(get, HttpClientContext.create());
        return checkResponse(res);
    }
706954
private Events<Event> getEvents(CanalEventStore eventStore, Position start, int batchSize, Long timeout,
                                    TimeUnit unit) {
        if (timeout == null) {
            return eventStore.tryGet(start, batchSize);
        } else {
            try {
                if (timeout <= 0) {
                    return eventStore.get(start, batchSize);
                } else {
                    return eventStore.get(start, batchSize, timeout, unit);
                }
            } catch (Exception e) {
                throw new CanalServerException(e);
            }
        }
    }
748615
public EventBase getEvent(final String eventId) throws Exception {
        final String eventPath = StringUtils.join(new String[]{
                getUri(),
                "events",
                eventId
        }, '/');
        final JSONObject jsonObject = toJSONObject(client.get(eventPath, null));
        return new EventBase(jsonObject);
    }
470312
function listEvents(req, res, next){
  var logger = log.logger;
  var EventModel = models.getModels().Event;
  var listReq = RequestTranslator.parseListEventsRequest(req);
  if(! listReq.uid || ! listReq.env || ! listReq.domain){
    return next({"error":"invalid params missing uid env or domain","code":400});
  }
  EventModel.queryEvents(listReq.uid, listReq.env, listReq.domain, function(err, events){
    if(err) {
      logger.error(loggerPrefix + 'Events Query Error: ', err);
      return next(err);
    } else {
      req.resultData =  ResponseTranslator.mapEventsToResponse(events);
      next();
    }
  });
}
122176
public Event getEvents(int i) {
    if (Document_Type.featOkTst && ((Document_Type)jcasType).casFeat_events == null)
      jcasType.jcas.throwFeatMissing("events", "de.julielab.jules.types.ace.Document");
    jcasType.jcas.checkArrayBounds(jcasType.ll_cas.ll_getRefValue(addr, ((Document_Type)jcasType).casFeatCode_events), i);
    return (Event)(jcasType.ll_cas.ll_getFSForRef(jcasType.ll_cas.ll_getRefArrayValue(jcasType.ll_cas.ll_getRefValue(addr, ((Document_Type)jcasType).casFeatCode_events), i)));}
556873
private String getEventName() {
        String event = null;

        @SuppressWarnings("unchecked")
        Enumeration<String> e = request.getParameterNames();

        while (e.hasMoreElements()) {
            String originalKey = e.nextElement();
            String paramKey = StringUtil.toLowerCaseWithUnderscores(originalKey);

            if (paramKey.startsWith(DEFAULT_EVENT_PATTERN) && !StringUtil.isBlank(request.getParameter(originalKey))) {
                int startIndex = DEFAULT_EVENT_PATTERN.length();
                int endIndex = paramKey.length();

                // 支持<input type="image">
                if (paramKey.endsWith(IMAGE_BUTTON_SUFFIX_1)) {
                    endIndex -= IMAGE_BUTTON_SUFFIX_1.length();
                } else if (paramKey.endsWith(IMAGE_BUTTON_SUFFIX_2)) {
                    endIndex -= IMAGE_BUTTON_SUFFIX_2.length();
                } else if (paramKey.endsWith(IMAGE_BUTTON_SUFFIX_3)) {
                    endIndex -= IMAGE_BUTTON_SUFFIX_3.length();
                } else if (paramKey.endsWith(IMAGE_BUTTON_SUFFIX_4)) {
                    endIndex -= IMAGE_BUTTON_SUFFIX_4.length();
                }

                event = StringUtil.trimToNull(paramKey.substring(startIndex, endIndex));

                if (event != null) {
                    break;
                }
            }
        }

        return event;
    }
450120
function(uri) {
        if (this.defined(uri)) {
            history.pushState(null, null, uri);
            var event = new CustomEvent('onRouteChange');
            event.route = uri;
            document.dispatchEvent(event, uri);
        } else {
            console.error('Route "' + uri + '" is not defined.');
            return false;
        }
    }
493599
public static String getConnectionEventString(int eventID) {
        switch (eventID) {

            case ConnectionEvent.CONNECTION_CLOSED: 
                return "CONNECTION CLOSED (" + eventID + ')'; 

            case ConnectionEvent.LOCAL_TRANSACTION_STARTED: 
                return "LOCAL TRANSACTION STARTED (" + eventID + ')'; 

            case ConnectionEvent.LOCAL_TRANSACTION_COMMITTED: 
                return "LOCAL TRANSACTION COMMITTED (" + eventID + ')'; 

            case ConnectionEvent.LOCAL_TRANSACTION_ROLLEDBACK: 
                return "LOCAL TRANSACTION ROLLEDBACK (" + eventID + ')'; 

            case ConnectionEvent.CONNECTION_ERROR_OCCURRED: 
                return "CONNECTION ERROR OCCURRED (" + eventID + ')'; 

            case WSConnectionEvent.CONNECTION_ERROR_OCCURRED_NO_EVENT:
                return "CONNECTION ERROR OCCURRED NO EVENT (" + eventID + ')';

            case WSConnectionEvent.SINGLE_CONNECTION_ERROR_OCCURRED:
                return "SINGLE CONNECTION ERROR OCCURRED (" + eventID + ')';
        }

        return "UNKNOWN CONNECTION EVENT CONSTANT (" + eventID + ')'; 
    }
777828
function getDomEvents(attrs, isStdTag, $actionsKeys){
	//if ( !isStdTag || !attrs ) {
	if ( !attrs ) {
		return null;
	}

	let rs = [], keys = [];
	for ( let key in attrs ) {
		if ( REG_EVENTS.test(key) ) {
			if ( !attrs[key].trim() ) {
				continue; // 未定义，忽略
			}

			// 字符串形式改成表达式形式 onclick="fnClick" => onclick="{=$actions.fnClick}"
			if ( attrs[key].indexOf('{') < 0 ) {
				// 没有表达式，检查指定方法是否存在
				if ( !$actionsKeys.includes(attrs[key].trim()) ) {
					let msg = 'action not found: ' + attrs[key];			// TODO 定位显示
					throw new Err(msg); // 指定方法找不到，需要定义
				}else{
					attrs[key] = '{=$actions.' + attrs[key].trim() + '}'; // onclick="fnClick" => onclick="{=$actions.fnClick}"
				}
			}

			// 标准标签时，保存事件名
			if ( isStdTag ) {
				// 标准标签的事件名简化去掉on，a{onclick:...}改成 a{click:...}
				rs.push( '"' + key.substring(2).toLowerCase() + '": ' + util.getExpression(attrs[key]) );
				keys.push(key);
			}

		}
	}

	// 标准标签时，从属性中删除，后续另行移到e属性中
	isStdTag && keys.forEach(k => delete attrs[k]);

	if ( rs.length ) {
		return '{' + rs.join(',') + '}';
	}
	return null;
}
664807
public org.jsoup.nodes.Document getFromHtml(String uri){
        // 取回資料
        String html = getFromRemote(uri);

        // 轉化為 Jsoup 物件
        return htmlToJsoupDoc(html);
    }
579516
protected List<Event> filterEvents(List<Event> toFilter, Long lastIndex) {
		List<Event> events = toFilter;
		if (lastIndex != null) {
			for (int i = 0; i < events.size(); i++) {
				Event event = events.get(i);
				Long eventIndex = event.getWaitIndex();
				if (lastIndex.equals(eventIndex)) {
					events = events.subList(i + 1, events.size());
					break;
				}
			}
		}
		return events;
	}
960925
public GetCognitoEventsResult withEvents(java.util.Map<String, String> events) {
        setEvents(events);
        return this;
    }