/* (non-Javadoc)
@see org.apereo.portal.spring.context.FilteringApplicationListener#onFilteredApplicationEvent(org.springframework.context.ApplicationEvent)
337075
@Override
    protected void onFilteredApplicationEvent(ApplicationEvent event) {
        if (this.eventLogger.isInfoEnabled()) {
            this.eventLogger.info(event.toString());
        }
    }
1194313
@Override
    public void onApplicationEvent(LoginEvent loginEvent) {
        if (enableMarketplacePreloading) {
            final IPerson person = loginEvent.getPerson();
            /*
             * Passing an empty collection pre-loads an unfiltered collection;
             * instances of PortletMarketplace that specify filtering will
             * trigger a new collection to be loaded.
             */
            final Set<PortletCategory> empty = Collections.emptySet();
            loadMarketplaceEntriesFor(person, empty);
        }
    }
440145
@Override
    public FilterReply decide(final ILoggingEvent event) {
        final Marker marker = event.getMarker();

        if (marker == this.marker) {
            return FilterReply.NEUTRAL;
        } else {
            return FilterReply.DENY;
        }
    }
601760
public int subscribe_event(String attr_name, int event, CallBack callback, String[] filters)
            throws DevFailed {
        if (!useEvents())
            Except.throw_exception("NO_EVENT", "Event system not available", "DeviceProxy.subscribe_event()");
        if (event==TangoConst.INTERFACE_CHANGE)
            Except.throw_exception("BAD_EVENT",
                    TangoConst.eventNames[event] + " cannot be applied to an attribute");
        return deviceProxyDAO.subscribe_event(this, attr_name, event, callback, filters, false);
    }
1313778
protected boolean processEntryEventFilter(EventFilter filter, Data dataKey) {
        EntryEventFilter eventFilter = (EntryEventFilter) filter;
        return eventFilter.eval(dataKey);
    }
1257237
@Override
    public Router onCreated(BeanCreatedEvent<Router> event) {
        return new FilteredRouter(event.getBean(), routeVersionFilter);
    }
693960
public void onFilterDestroyError(FilterErrorEvent evt) {
	    if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)){
	    	logger.logp(Level.FINE, CLASS_NAME,"onFilterDestroyError", "onFilterStartDoFilter -->" + evt.getFilterName() + " error -->" + evt.getError());
	    }

	}
1002674
private static void parseFilters(final FilterType filterType, final WebApp webApp) {
		final WebAppFilter filter = new WebAppFilter();
		if (filterType.getFilterName() != null) {
			filter.setFilterName(filterType.getFilterName().getValue());
		}
		if (filterType.getFilterClass() != null) {
			filter.setFilterClass(filterType.getFilterClass().getValue());
		}

		if (filterType.getAsyncSupported() != null) {
			filter.setAsyncSupported(filterType.getAsyncSupported().isValue());
		}

		webApp.addFilter(filter);
		List<ParamValueType> initParams = filterType.getInitParam();
		if (initParams != null && initParams.size() > 0) {
			for (ParamValueType initParamElement : initParams) {
				final WebAppInitParam initParam = new WebAppInitParam();
				initParam.setParamName(initParamElement.getParamName().getValue());
				initParam.setParamValue(initParamElement.getParamValue().getValue());
				filter.addInitParam(initParam);
			}
		}

		List<DescriptionType> description = filterType.getDescription();
		for (DescriptionType descriptionType : description) {
			filter.addDispatcherType(DispatcherType.valueOf(descriptionType.getValue()));
		}
	}
1038104
public static void processAllExitProbeExtensions(Event event, RequestContext requestContext) {

		List<ProbeExtension> probeExtnList = RequestProbeService.getProbeExtensions();
		for (int i = 0; i < probeExtnList.size(); i ++) {
			ProbeExtension probeExtension = probeExtnList.get(i);
			try{
				// Exit enabled??
				if (probeExtension.invokeForEventExit()) {
					// To be sampled ??
					if (requestContext.getRequestId().getSequenceNumber() % probeExtension.getRequestSampleRate() == 0) {
						if (event == requestContext.getRootEvent() && probeExtension.invokeForRootEventsOnly() == true
								&& (probeExtension.invokeForEventTypes() == null || probeExtension.invokeForEventTypes().contains(event.getType()))) {
							probeExtension.processExitEvent(event, requestContext);
						}
						if (probeExtension.invokeForRootEventsOnly() == false
								&& (probeExtension.invokeForEventTypes() == null || probeExtension.invokeForEventTypes().contains(event.getType()))) {
							probeExtension.processExitEvent(event, requestContext);
						}
					}
				}
			}catch(Exception e){
				if(TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()){
					Tr.debug(tc, "----------------Probe extension invocation failure---------------");
					Tr.debug(tc, probeExtension.getClass().getName() + ".processExitEvent failed because of the following reason:" );
					Tr.debug(tc, e.getMessage());
				}
				FFDCFilter.processException(e, RequestProbeService.class.getName() + ".processAllExitProbeExtensions", "185");
			}
		}
		if (event == requestContext.getRootEvent()) {
			// Remove the request from active request list
			try{
				RequestContext storedRequestContext = activeRequests.get(requestContext.getRequestContextIndex());
				// 1) Check to handle stale requests.
				// A long running stale request from the last time the feature was enabled could potentially 
				// end up evicting a valid request that is occupying the same slot in the list.
				// 2) Also check if the returned request context is null, this can happen when we remove the feature while
				// a request is executing as we clean up the active requests list and the slot no longer holds a request context.
				if(storedRequestContext != null && (storedRequestContext.getRequestId() == requestContext.getRequestId()))
					activeRequests.remove(requestContext.getRequestContextIndex());
			}catch(ArrayIndexOutOfBoundsException e){
				//Do nothing as this can fail for an in-flight request when the feature is disabled
				//Rational being, the active request list gets reset and this index can no longer be valid.
			}
		}
	}
717936
public void onSelectFilterFunction() {
        int selectedIdx = view.getSelectedFunctionIndex();
        if (selectedIdx >= 0) {
            CoreFunctionFilter coreFilter = getCoreFilter();
            CoreFunctionType functionType = getAvailableFunctions(coreFilter).get(selectedIdx);

            ColumnType columnType = metadata.getColumnType(coreFilter.getColumnId());
            List params = FilterFactory.createParameters(columnType, functionType);
            coreFilter.setType(functionType);
            coreFilter.setParameters(params);

            initFilterSelector();
            fireFilterChanged();

            if (!initFilterConfig().isEmpty()) {
                view.showFilterConfig();
            }
        }
    }
55473
@Override
    public void onFilterEnabled(Displayer displayer, DataSetGroup groupOp) {
        view.gotoFirstPage();
        super.onFilterEnabled(displayer, groupOp);
    }
1344498
private void filterLogEvent(final LogEvent logEvent) {
        for ( ILogEventFilter filter: this.filters) {
            // do nothing if one of the filters doesn't accept the event
            if ( !filter.acceptEvent( logEvent ) ) {
                return;
            }
        }
        // if all the filters accepted the event, signal the creation
        // of the event
        logEventCreated( logEvent );
    }
636767
@Override
	public void addEventHandler(EventHandler eventHandler) {
		Preconditions.checkNotNull(eventHandler.getName(), "Missing Name");
		if(getEventHandler(eventHandler.getName()) != null) {
			throw new ApplicationException(Code.CONFLICT, "EventHandler with name " + eventHandler.getName() + " already exists!");
		}
		index(eventHandler);
		dynoClient.hset(nsKey(EVENT_HANDLERS), eventHandler.getName(), toJson(eventHandler));
		recordRedisDaoRequests("addEventHandler");
	}
1060691
public void notifySipApplicationSessionListeners(SipApplicationSessionEventType sipApplicationSessionEventType) {
		List<SipApplicationSessionListener> listeners =
			sipContext.getListeners().getSipApplicationSessionListeners();
		if(listeners.size() > 0) {
			ClassLoader oldClassLoader = java.lang.Thread.currentThread().getContextClassLoader();
			sipContext.enterSipContext();
			SipApplicationSessionEvent event = new SipApplicationSessionEvent(this.getFacade());
			if(logger.isDebugEnabled()) {
				logger.debug("notifying sip application session listeners of context " +
						key.getApplicationName() + " of following event " + sipApplicationSessionEventType);
			}
			for (SipApplicationSessionListener sipApplicationSessionListener : listeners) {
				try {
					if(logger.isDebugEnabled()) {
						logger.debug("notifying sip application session listener " + sipApplicationSessionListener.getClass().getName() + " of context " +
								key.getApplicationName() + " of following event " + sipApplicationSessionEventType);
					}
					if(SipApplicationSessionEventType.CREATION.equals(sipApplicationSessionEventType)) {
						sipApplicationSessionListener.sessionCreated(event);
					} else if (SipApplicationSessionEventType.DELETION.equals(sipApplicationSessionEventType)) {
						sipApplicationSessionListener.sessionDestroyed(event);
					} else if (SipApplicationSessionEventType.EXPIRATION.equals(sipApplicationSessionEventType)) {
						sipApplicationSessionListener.sessionExpired(event);
					} else if (SipApplicationSessionEventType.READYTOINVALIDATE.equals(sipApplicationSessionEventType)) {
						sipApplicationSessionListener.sessionReadyToInvalidate(event);
					}

				} catch (Throwable t) {
					logger.error("SipApplicationSessionListener threw exception", t);
				}
			}
			sipContext.exitSipContext(oldClassLoader);
		}
	}
1254352
public static void processAllCounterProbeExtensions(Event event){

		List<ProbeExtension> probeExtnList = RequestProbeService.getProbeExtensions();
		for (int i = 0; i < probeExtnList.size(); i ++) {
			ProbeExtension probeExtension = probeExtnList.get(i);
			try{
				//Check if this probe extension is interested in 
				//counter events
				if(probeExtension.invokeForCounter()){
					probeExtension.processCounter(event);
				}
			}catch(Exception e){
				if(TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()){
					Tr.debug(tc, "----------------Probe extension invocation failure---------------");
					Tr.debug(tc, probeExtension.getClass().getName() + ".processCounterEvent failed because of the following reason:" );
					Tr.debug(tc, e.getMessage());
				}
				FFDCFilter.processException(e, RequestProbeService.class.getName() + ".processAllCounterProbeExtensions", "215");
			}
		}
	}
695814
private boolean filter(Event event) {
        for (EventFilter filter : eventFilters) {
            if (filter.filter(event)) {
                return true;
            }
        }
        return false;
    }
1224467
public function onKernelResponse(FilterResponseEvent $event)
    {
        $response = $event->getResponse();
        $request  = $event->getRequest();
        if (!$event->isMasterRequest())
        {
            return;
        }
        if ($request->isXmlHttpRequest())
        {
            return;
        }
        $this->_injectDatatableScript($response, $request);
    }