Finds the exception handlers as configured in the props.

@return a collection of exception handler classes.
421937
@SuppressWarnings({"unchecked"})
    Set<Class<? extends TrailExceptionHandler<?>>> findTrailExceptionHandlers() {
        Set<Class<? extends TrailExceptionHandler<?>>> trailExceptionHandlers = auditConfig.getExceptionHandlers();
        if (trailExceptionHandlers.isEmpty()) {
            Collection<Class<?>> scannedTrailExceptionHandlers = auditClasses.get(TrailExceptionHandler.class);
            LOGGER.info("No audit TrailExceptionHandler specified, using every handler found");
            Set<Class<? extends TrailExceptionHandler<?>>> foundExceptionHandlers = new HashSet<>();
            for (Class<?> scannedTrailExceptionHandler : scannedTrailExceptionHandlers) {
                foundExceptionHandlers.add((Class<? extends TrailExceptionHandler<?>>) scannedTrailExceptionHandler);
                LOGGER.info("Registered audit exception handler {}", scannedTrailExceptionHandler);
            }
            return foundExceptionHandlers;
        } else {
            return trailExceptionHandlers;
        }
    }
1257988
protected List<ResourceTypeHandler<?>> getResourceTypeHandlers() {
        final List<ResourceTypeHandler<?>> handlers = new ArrayList<ResourceTypeHandler<?>>();
        handlers.add(new FileResourceTypeHandler(getRelativeParentDirectory()));
        handlers.add(new UrlResourceTypeHandler());
        handlers.add(new ClasspathResourceTypeHandler());
        handlers.add(new VfsResourceTypeHandler());
        return handlers;
    }
491537
public com.google.appengine.v1.ErrorHandler getErrorHandlers(int index) {
    return errorHandlers_.get(index);
  }
52609
public HashMap<String, Class> discoverHandlerClasses(List<String> basePackages) {
        //always include the Chorus handlers package
        HashMap<String, Class> handlerNameToHandlerClass = new HashMap<>();

        HandlerAnnotationFilter handlerAnnotationFilter = new HandlerAnnotationFilter();
        ClassFilter filter = new ClassFilterDecorator().decorateWithPackageNameFilters(handlerAnnotationFilter, basePackages);

        Set<Class> classes = ClasspathScanner.doScan(filter, log);
        for (Class handlerClass : classes) {
            Handler f = (Handler) handlerClass.getAnnotation(Handler.class);
            String handlerName = f.value();
            if (handlerNameToHandlerClass.containsKey(handlerName)) {
                String currentHandler = handlerNameToHandlerClass.get(handlerName).getName();
                String newHandler = handlerClass.getName();

                //since we test the log output, inconsistencies in the order can break the test
                String handlerTxt = currentHandler.compareTo(newHandler) < 0 ?
                        newHandler + " and " + currentHandler :
                        currentHandler + " and " + newHandler;

                if ( log.isDebugEnabled()) {
                    log.debug("More than one handler class is defined with the name [" + handlerName + "]");
                    log.debug("The value of the @Handler annotation is [" + handlerName + "] for both " + handlerTxt);
                    log.debug("Any features which attempt to use handler [" + handlerName + "] will fail");
                }

                //put a special class into the map which tells the interpreter to fail any features
                handlerNameToHandlerClass.put(handlerName, DuplicateHandlers.class);
                duplicateNameToDescription.put(handlerName, handlerTxt);
            } else {
                handlerNameToHandlerClass.put(handlerName, handlerClass);
            }
        }
        
        if ( log.isTraceEnabled()) {
            log.trace("These were the handler classes discovered by handler class scanning " + handlerNameToHandlerClass);
        }
        return handlerNameToHandlerClass;
    }
1065810
public java.util.ArrayList getExceptions() {
        if (exceptions != null)
            return (java.util.ArrayList) exceptions.clone();
        else
            return null;
    }
206622
public TypeDesc[] getExceptions() {
        if (mExceptions == null) {
            return new TypeDesc[0];
        }

        ConstantClassInfo[] classes = mExceptions.getExceptions();
        TypeDesc[] types = new TypeDesc[classes.length];
        for (int i=0; i<types.length; i++) {
            types[i] = classes[i].getType();
        }

        return types;
    }
355451
private Set<JavaClass> getDeclaredExceptions(Method method) throws ClassNotFoundException {
        ExceptionTable et = method.getExceptionTable();
        if ((et == null) || (et.getLength() == 0)) {
            return Collections.<JavaClass> emptySet();
        }

        Set<JavaClass> exceptions = new HashSet<>();
        for (String en : et.getExceptionNames()) {
            JavaClass exCls = Repository.lookupClass(en);
            if (!exCls.instanceOf(runtimeExceptionClass)) {
                exceptions.add(exCls);
            }
        }

        return exceptions;
    }
1358300
def get_event_handler_classes(categories=None):
    """"""
    classes = [c for c in all_subclasses(EventHandler) if c not in _ABC_EVHANDLER_CLASSES]
    return classes
941230
@PostConstruct
    private void configureMessagesExceptionArgumentResolvers() {
        this.handlerExceptionResolver = this.applicationContext.getBean("handlerExceptionResolver", HandlerExceptionResolver.class);

        for (final HandlerExceptionResolver resolver : ((HandlerExceptionResolverComposite) this.handlerExceptionResolver).getExceptionResolvers()) {
            if (resolver instanceof ExceptionHandlerExceptionResolver) {
                configureCustomHandlerMethodArgumentResolver((ExceptionHandlerExceptionResolver) resolver);
            }
        }
    }
90465
protected Method getExceptionHandlerMethod( FlowControllerHandlerContext context, String methodName, Throwable ex,
                                                Object formBean )
    {
        FlowController flowController = context.getFlowController();
        String cacheKey = methodName + '/' + ex.getClass().getName();
        ClassLevelCache cache = ClassLevelCache.getCache( flowController.getClass() );
        Method method = ( Method ) cache.get( CACHEID_EXCEPTION_HANDLER_METHODS, cacheKey );
        
        if ( method != null )
        {
            return method;
        }
     
        Class flowControllerClass = flowController.getClass();
        for ( Class exClass = ex.getClass(); exClass != null; exClass = exClass.getSuperclass() )
        {
            Class[] args = new Class[]{ exClass, String.class, String.class, Object.class };
            Method foundMethod = InternalUtils.lookupMethod( flowControllerClass, methodName, args );
            
            //
            // If we didn't find an exception-handler with the right signature, look for the deprecated signature with
            // FormData as the last argument.
            //
            if ( foundMethod == null && ( formBean == null || formBean instanceof FormData ) )
            {
                args = new Class[]{ exClass, String.class, String.class, FormData.class };         
                foundMethod = InternalUtils.lookupMethod( flowControllerClass, methodName, args );
            }
            
            //
            // If we didn't find an exception-handler with the right signature, look for the deprecated signature with
            // ActionForm as the last argument.
            //
            if ( foundMethod == null && ( formBean == null || formBean instanceof ActionForm ) )
            {
                args = new Class[]{ exClass, String.class, String.class, ActionForm.class };         
                foundMethod = InternalUtils.lookupMethod( flowControllerClass, methodName, args );
            }
            
            if ( foundMethod != null )
            {
                if ( _log.isDebugEnabled() )
                {
                    _log.debug( "Found exception handler for " + exClass.getName() );
                }
                
                if ( ! Modifier.isPublic( foundMethod.getModifiers() ) ) foundMethod.setAccessible( true );
                cache.put( CACHEID_EXCEPTION_HANDLER_METHODS, cacheKey, foundMethod );
                return foundMethod;
            }
            else
            {
                if ( _log.isErrorEnabled() )
                {
                    InternalStringBuilder msg = new InternalStringBuilder( "Could not find exception handler method " );
                    msg.append( methodName ).append( " for " ).append( exClass.getName() ).append( '.' );
                    _log.error( msg.toString() );
                }
            }
        }
        
        return null;
    }
1143637
@SuppressWarnings("unchecked") public Class<T> getAnnotationHandledByThisHandler() {
		return (Class<T>) SpiLoadUtil.findAnnotationClass(getClass(), JavacAnnotationHandler.class);
	}
581375
public <T extends Exception> Javalin exception(@NotNull Class<T> exceptionClass, @NotNull ExceptionHandler<? super T> exceptionHandler) {
        servlet.getExceptionMapper().getHandlers().put(exceptionClass, (ExceptionHandler<Exception>) exceptionHandler);
        return this;
    }
1341050
protected String prepareEventHandlers() {
		StringBuffer handlers = new StringBuffer();

		prepareMouseEvents(handlers);
		prepareKeyEvents(handlers);

		return handlers.toString();
	}
608359
@Expose
    protected List<Exception> getExceptions() {
        List<Exception> exceptions = new ArrayList<Exception>();
        exceptions.add(exception);

        Throwable currentThrowable = exception.getThrowable().getCause();
        while (currentThrowable != null) {
            exceptions.add(new Exception(config, currentThrowable));
            currentThrowable = currentThrowable.getCause();
        }

        return exceptions;
    }
844673
private List<ModelProcessorUtil.Method> getEnhancingMethods(final RuntimeResource runtimeResource) {
        final List<ModelProcessorUtil.Method> newMethods = Lists.newArrayList();

        for (final Resource resource : runtimeResource.getResources()) {
            // Handler classes.
            for (final Class<?> handlerClass : resource.getHandlerClasses()) {
                createEnhancingMethods(handlerClass, null, newMethods);
            }

            // Names - if there are no handler classes / instances.
            if (resource.getHandlerClasses().isEmpty() && resource.getHandlerInstances().isEmpty()) {
                for (String resourceName : resource.getNames()) {
                    final Class<Object> resourceClass = AccessController
                            .doPrivileged(ReflectionHelper.classForNamePA(resourceName));
                    if (resourceClass != null) {
                        createEnhancingMethods(resourceClass, null, newMethods);
                    }
                }
            }

            // Handler instances.
            Errors.process((Producer<Void>) () -> {
                for (final Object handlerInstance : resource.getHandlerInstances()) {
                    final Class<?> handlerInstanceClass = handlerInstance.getClass();

                    if (!resource.getHandlerClasses().contains(handlerInstanceClass)) {
                        createEnhancingMethods(handlerInstanceClass, handlerInstance, newMethods);
                    } else {
                        Errors.warning(resource,
                                LocalizationMessages.TEMPLATE_HANDLER_ALREADY_ENHANCED(handlerInstanceClass));
                    }
                }

                return null;
            });
        }

        return newMethods;
    }
554420
private List<ContextHandler> collectResourceHandlers() throws ClassNotFoundException, InstantiationException, IllegalAccessException {

		final List<ContextHandler> resourceHandlers = new LinkedList<>();
		final String resourceHandlerList            = Settings.ResourceHandlers.getValue();

		if (resourceHandlerList != null) {

			for (String resourceHandlerName : resourceHandlerList.split("[ \\t]+")) {

				if (StringUtils.isNotBlank(resourceHandlerName)) {

					final String contextPath = Settings.getOrCreateStringSetting(resourceHandlerName, "contextPath").getValue();
					if (contextPath != null) {

						final String resourceBase = Settings.getOrCreateStringSetting(resourceHandlerName, "resourceBase").getValue();
						if (resourceBase != null) {

							final ResourceHandler resourceHandler = new ResourceHandler();
							resourceHandler.setDirectoriesListed(Settings.getBooleanSetting(resourceHandlerName, "directoriesListed").getValue());

							final String welcomeFiles = Settings.getOrCreateStringSetting(resourceHandlerName, "welcomeFiles").getValue();
							if (welcomeFiles != null) {

								resourceHandler.setWelcomeFiles(StringUtils.split(welcomeFiles));
							}

							resourceHandler.setResourceBase(resourceBase);
							resourceHandler.setCacheControl("max-age=0");
							//resourceHandler.setEtags(true);

							final ContextHandler staticResourceHandler = new ContextHandler();
							staticResourceHandler.setContextPath(contextPath);
							staticResourceHandler.setHandler(resourceHandler);

							resourceHandlers.add(staticResourceHandler);

						} else {

							logger.warn("Unable to register resource handler {}, missing {}.resourceBase", resourceHandlerName, resourceHandlerName);
						}

					} else {

						logger.warn("Unable to register resource handler {}, missing {}.contextPath", resourceHandlerName, resourceHandlerName);
					}
				}
			}

		} else {

			logger.warn("No resource handlers configured for HttpService.");
		}

		return resourceHandlers;
	}
1349740
private static void determineHandlers() {
        /*
         * find the handlers that we are dispatching to
         */
    	if (textHandler != null && !logRepositoryConfiguration.isTextEnabled())
    		textHandler = null ;
    			// Don't do this work if only text and text is not enabled (if so, it will always be null)  666241.1
    	if (binaryHandler != null && !logRepositoryConfiguration.isTextEnabled())
    		return ;
        Handler[] handlers = Logger.getLogger("").getHandlers();
        for (Handler handler : handlers) {
            String name = handler.getClass().getName();
            if (BINLOGGER_HANDLER_NAME.equals(name)) {
                binaryHandler = (LogRecordHandler) handler;
            } else if (TEXTLOGGER_HANDLER_NAME.equals(name)) {
                textHandler = (LogRecordTextHandler) handler;
            }
        }
    }