This is used to get an mock filter which will be sending out events
@param payload
@param eventNameBase
@param debugParams
358038
function emitEvent(payload, eventNameBase, debugParams) {

        // create a copy of the payload so that nothing modifies the original object
        try {
            payload = JSON.parse(JSON.stringify(payload));
        }
        catch (err) {
            /* eslint no-console:0 */
            console.log('issue parsing during emit ' + JSON.stringify(eventNameBase));
        }

        // we don't want to emit the potentially huge resource file
        if (payload && payload.resource) {
            delete payload.resource;
        }

        // create the event data and emit the event
        var name = _.extend({}, eventNameBase, debugParams);
        var eventData = {
            name: name,
            payload: payload
        };
        var eventName = name.resource + '.' + name.adapter + '.' + name.method;
        eventName += debugParams ? '.' + name.type + '.' + name.timing : '';
        eventBus.emit(eventName, eventData);
    }
125432
@Override
	public void on(String name, Tree payload, Groups groups, boolean broadcast) throws Exception {
		FastBuildTree msg = new FastBuildTree(6);
		msg.putUnsafe("ver", ServiceBroker.PROTOCOL_VERSION);
		msg.putUnsafe("sender", currentNodeID);
		msg.putUnsafe("event", name);
		msg.putUnsafe("broadcast", broadcast);
		if (groups != null) {
			String[] array = groups.groups();
			if (array != null && array.length > 0) {
				msg.putUnsafe("groups", array);
			}
		}
		if (payload != null) {
			msg.putUnsafe("data", payload);
		}
		transporter.publish(PACKET_EVENT, nodeID, msg);
	}
930101
public void handleDebugEvents(DebugEvent[] events)
	{
		if (view == null)
		{
			return;
		}

		for (int i = 0; i < events.length; ++i)
		{
			DebugEvent event = events[i];

			append(new VdmDebugLogItem(Messages.ItemType_Event, getDebugEventKind(event)
					+ " from " + event.getSource().getClass().getName()));//$NON-NLS-1$

			if (event.getKind() == DebugEvent.CREATE)
			{
				handleCreateEvent(event);
			} else if (event.getKind() == DebugEvent.MODEL_SPECIFIC
					&& event.getDetail() == ExtendedDebugEventDetails.DGBP_NEW_CONNECTION)
			{
				if (event.getSource() instanceof IDbgpDebugingEngine)
				{
					((IDbgpDebugingEngine) event.getSource()).addRawListener(this);
				}
			} else if (event.getKind() == DebugEvent.TERMINATE)
			{
				handleTerminateEvent(event);
			}
		}
	}
185450
public void badParam(String name, String value)
            throws ParseException {
        throw new ParseException("parameter " + name + " has bad value [[" +
                value + "]] in " + ruleStack, 0);
    }
434931
@SuppressWarnings("unchecked")
    @EventMapping(SearchConstants.SEARCH_REQUEST_QNAME_STRING)
    public void handleSearchRequest(EventRequest request, EventResponse response) {
        // UP-3887 Design flaw.  Both the searchLauncher portlet instance and the search portlet
        // instance receive
        // searchRequest and searchResult events because they are in the same portlet code base (to
        // share
        // autosuggest_handler.jsp and because we have to calculate the search portlet url for the
        // ajax call)
        // and share the portlet.xml which defines the event handling behavior.
        // If this instance is the searchLauncher, ignore the searchResult. The search was submitted
        // to the search
        // portlet instance.
        final String searchLaunchFname =
                request.getPreferences().getValue(SEARCH_LAUNCH_FNAME, null);
        if (searchLaunchFname != null) {
            // Noisy in debug mode so commented out log statement
            // logger.debug("SearchLauncher does not participate in SearchRequest events so
            // discarding message");
            return;
        }

        final Event event = request.getEvent();
        final SearchRequest searchQuery = (SearchRequest) event.getValue();

        // Map used to track searches that have been handled, used so that one search doesn't get
        // duplicate results
        ConcurrentMap<String, Boolean> searchHandledCache;
        final PortletSession session = request.getPortletSession();
        synchronized (org.springframework.web.portlet.util.PortletUtils.getSessionMutex(session)) {
            searchHandledCache =
                    (ConcurrentMap<String, Boolean>)
                            session.getAttribute(
                                    SEARCH_HANDLED_CACHE_NAME, PortletSession.APPLICATION_SCOPE);
            if (searchHandledCache == null) {
                searchHandledCache =
                        CacheBuilder.newBuilder()
                                .maximumSize(20)
                                .expireAfterAccess(5, TimeUnit.MINUTES)
                                .<String, Boolean>build()
                                .asMap();
                session.setAttribute(
                        SEARCH_HANDLED_CACHE_NAME,
                        searchHandledCache,
                        PortletSession.APPLICATION_SCOPE);
            }
        }

        final String queryId = searchQuery.getQueryId();
        if (searchHandledCache.putIfAbsent(queryId, Boolean.TRUE) != null) {
            // Already handled this search request
            return;
        }

        // Create the results
        final SearchResults results = new SearchResults();
        results.setQueryId(queryId);
        results.setWindowId(request.getWindowID());
        final List<SearchResult> searchResultList = results.getSearchResult();

        // Run the search for each service appending the results
        for (IPortalSearchService searchService : searchServices) {
            try {
                logger.debug(
                        "For queryId {}, query '{}', searching search service {}",
                        queryId,
                        searchQuery.getSearchTerms(),
                        searchService.getClass().toString());
                final SearchResults serviceResults =
                        searchService.getSearchResults(request, searchQuery);
                logger.debug(
                        "For queryId {}, obtained {} results from search service {}",
                        queryId,
                        serviceResults.getSearchResult().size(),
                        searchService.getClass().toString());
                searchResultList.addAll(serviceResults.getSearchResult());
            } catch (Exception e) {
                logger.warn(
                        searchService.getClass()
                                + " threw an exception when searching, it will be ignored. "
                                + searchQuery,
                        e);
            }
        }

        // Respond with a results event if results were found
        if (!searchResultList.isEmpty()) {
            response.setEvent(SearchConstants.SEARCH_RESULTS_QNAME, results);
        }
    }
266184
@Override
    public EventDispatcher getEventDispatcher(EventPublisher source) {
	checkPermission();
	if (source == null) {
	    throw new IllegalArgumentException("Parameter cannot be null");
	}
	return super.getEventDispatcher(source);
    }
936129
private EventParameters createEventParameters(Map<String,String> pParams){
        EventParameters evParams = EventParameters.Factory.newInstance();
        for (String name : pParams.keySet()) {
             String val = pParams.get(name);
             if(val == null){
                 continue;
             }
             Parameter evParam = evParams.addNewParameter();
             evParam.setName(name);
             evParam.setStringValue(val);
         }
         return evParams;

    }
489104
public Observable<ServiceResponse<List<EventTypeInner>>> listEventTypesWithServiceResponseAsync(String topicTypeName) {
        if (topicTypeName == null) {
            throw new IllegalArgumentException("Parameter topicTypeName is required and cannot be null.");
        }
        if (this.client.apiVersion() == null) {
            throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
        }
        return service.listEventTypes(topicTypeName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent())
            .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<List<EventTypeInner>>>>() {
                @Override
                public Observable<ServiceResponse<List<EventTypeInner>>> call(Response<ResponseBody> response) {
                    try {
                        ServiceResponse<PageImpl<EventTypeInner>> result = listEventTypesDelegate(response);
                        List<EventTypeInner> items = null;
                        if (result.body() != null) {
                            items = result.body().items();
                        }
                        ServiceResponse<List<EventTypeInner>> clientResponse = new ServiceResponse<List<EventTypeInner>>(items, result.response());
                        return Observable.just(clientResponse);
                    } catch (Throwable t) {
                        return Observable.error(t);
                    }
                }
            });
    }
101151
public void sendEvent(final Map<String, String> params) {
        executor.execute(new Runnable() {
            @Override
            public void run() {
                // put user id
                params.put("cid", userId);
                Multimap queryParams = HashMultimap.create();
                for (Map.Entry<String, String> entry : params.entrySet()) {
                    String key = entry.getKey();
                    String value = entry.getValue();
                    Preconditions.checkNotNull(key, "Custom search param key must not be null.");
                    Preconditions.checkNotNull(value, "Custom search param value must not be null.");
                    queryParams.put(key, value);
                }
                viSearchHttpClient.get(ENDPOINT_SEND_ACTIONS, queryParams);
            }
        });
    }
743191
protected int subscribe_change_event(String attr_name, String[] filters, boolean stateless)
            throws DevFailed {
        return event_supplier.subscribe_event(attr_name,
                CHANGE_EVENT, this, filters, stateless);
    }
337075
@Override
    protected void onFilteredApplicationEvent(ApplicationEvent event) {
        if (this.eventLogger.isInfoEnabled()) {
            this.eventLogger.info(event.toString());
        }
    }
29197
private void filterJPAParameterInfo(Type type, String name, String fieldName) {
        String attributeName = getAttributeName(fieldName);
        Attribute entityAttribute =
            ((MetamodelImpl) kunderaMetadata.getApplicationMetadata().getMetamodel(persistenceUnit))
                .getEntityAttribute(entityClass, attributeName);
        Class fieldType = entityAttribute.getJavaType();

        if (type.equals(Type.INDEXED)) {
            typedParameter.addJPAParameter(new JPAParameter(null, Integer.valueOf(name), fieldType));
        } else {
            typedParameter.addJPAParameter(new JPAParameter(name, null, fieldType));
        }
    }
559289
final void fireProbe(long probeId, @Sensitive Object instance, @Sensitive Object target, @Sensitive Object payload) {
        try {
            //new Exception().printStackTrace();
            ProbeImpl probe = activeProbesById.get(probeId);
            ConcurrentMap<ProbeImpl, Set<ProbeListener>> listenersByProbe = this.listenersByProbe;
            if (shuttingDown || listenersByProbe == null || probe == null) {
                return;
            }
            Set<ProbeListener> listeners = listenersByProbe.get(probe);
            if (listeners == null) {
                return;
            }
            for (ProbeListener listener : listeners) {
                try {
                    Method method = listener.getTargetMethod();
                    //Class<?>[] parameterTypes = method.getParameterTypes();
                    Class<?>[] parameterTypes = listener.getParameterTypes();
                    //Annotation[][] parameterAnnotations = method.getParameterAnnotations();
                    //Annotation[][] parameterAnnotations = listener.getparameterannotations();//Performance Improvement
                    Object[] args = listener.getdefaultvalues();
                    if (args != null)
                        args = Arrays.copyOf(args, args.length);
                    boolean validated = listener.isValidated();
                    ArrayList<Integer> annList = listener.getAnnotationsList();
                    for (int i = 0; i < parameterTypes.length; i++) {

                        switch (annList.get(i)) {
                            case MonitorConstants.This:
                                if (validated || parameterTypes[i].isInstance(instance)) {
                                    args[i] = instance;
                                }
                                break;
                            case MonitorConstants.Args:
                                if (validated || Object[].class.isInstance(payload)) {
                                    args[i] = payload;
                                }
                                break;
                            case MonitorConstants.Elapsed:
                                break;
                            case MonitorConstants.Returned:
                                if (validated || parameterTypes[i].isInstance(payload)) {
                                    args[i] = payload;
                                }
                                break;
                            case MonitorConstants.FieldValue:
                                if (parameterTypes[i].isInstance(payload)) {
                                    args[i] = payload;
                                }
                                break;
                            case MonitorConstants.TargetInstance:
                                if (parameterTypes[i].isInstance(target)) {
                                    args[i] = target;
                                }
                                break;
                            case MonitorConstants.TargetMember:
                                break;
                            case MonitorConstants.Thrown:
                                if (Throwable.class.isInstance(payload) && parameterTypes[i].isInstance(payload)) {
                                    args[i] = payload;
                                }
                                break;
                            case MonitorConstants.Arg:
                                break;
                            default:
                                break;
                        }
//Below code causes performance overhead ..specifically the instanceof tag is causing overhead hence using switch case which is based on
//                        structures built the ProbeListener constructor
//                        Annotation[] annotations = parameterAnnotations[i];
//                        for (Annotation a : annotations) {
//                            if (a instanceof This) {
//                                if (parameterTypes[i].isInstance(instance)) {
//                                    System.out.println("i is " + i + " ins is This");
//                                    args[i] = instance;
//                                }
//                            } else if (a instanceof Args) { // @Args
//                                // payload instance of Object[] and Object[] can be assigned to parameter
//                                if (Object[].class.isInstance(payload) && parameterTypes[i].isAssignableFrom(Object[].class)) {
//                                    args[i] = payload;
//                                }
//                            }
//                            else if (a instanceof Elapsed) {
//                                // TODO
//                                System.out.println("elapsed");
//                                //args[i] = getDefaultValue(parameterTypes[i]);
//                            } else if (a instanceof Returned) {
//                                System.out.println("Returned");
//                                if (parameterTypes[i].isInstance(payload)) {
//                                    args[i] = payload;
//                                }
//                            } else if (a instanceof FieldValue) {
//                                System.out.println("FieldValue");
//                                if (parameterTypes[i].isInstance(payload)) {
//                                    args[i] = payload;
//                                }
//                            } else if (a instanceof TargetInstance) {
//                                System.out.println("TargetInstance");
//                                if (parameterTypes[i].isInstance(target)) {
//                                    args[i] = target;
//                                }
//                            } else if (a instanceof TargetMember) {
//                                System.out.println("TargetInstance");
//                                // TODO
//                                // args[i] = getDefaultValue(parameterTypes[i]);
//                            } else if (a instanceof Thrown) {
//                                System.out.println("Thrown");
//                                if (Throwable.class.isInstance(payload) && parameterTypes[i].isInstance(payload)) {
//                                    args[i] = payload;
//                                }
//                            } else if (a instanceof Arg) { // @Arg(n)
//                                System.out.println("Arg");
//                                Arg arg = (Arg) a;
//                                int index = arg.value() - 1;
//                                Object[] params = null;
//                                if (Object[].class.isInstance(payload)) {
//                                    params = (Object[]) payload;
//                                    if (params.length >= index && parameterTypes[i].isInstance(params[index])) {
//                                        args[i] = params[index];
//                                    }
//                                }
//                            }
//                        }
//                    }
                    }
                    listener.setValidated(true);
                    method.invoke(listener.getProbeTarget(), args);
                } catch (Throwable t) {
                    if (tc.isDebugEnabled()) {
                        Tr.debug(tc, t.getMessage());
                    }
                }
            }
        } catch (Throwable t) {
            Tr.error(tc, "PMI9999E", t.toString());
        }
    }
12706
protected int subscribe_data_ready_event(String attr_name, String[] filters, boolean stateless)
            throws DevFailed {
        return event_supplier.subscribe_event(attr_name,
                DATA_READY_EVENT, this, filters, stateless);
    }
345918
function(event_name, event_args) {

		if (Lava.schema.DEBUG && typeof(event_name) == "undefined") Lava.t();

		if (this._listeners[event_name] != null) {

			this._callListeners(this._listeners[event_name], event_args);

		}

	}
526466
protected int subscribe_archive_event(String attr_name, String[] filters, boolean stateless)
            throws DevFailed {
        return event_supplier.subscribe_event(attr_name,
                ARCHIVE_EVENT, this, filters, stateless);
    }
804684
function (oEvent) {
			oEvent.getParameters().itemsBinding.filter([
				new Filter("name", FilterOperator.Contains, oEvent.getParameters().value)
			]);
		}