private static List < HttpHandler > getHandlersFromExecList ( List < String > execs ) { List < HttpHandler > handlersFromExecList = new ArrayList <> ( ) ; if ( execs != null ) { for ( String exec : execs ) { List < HttpHandler > handlerList = handlerListById . get ( exec ) ; if ( handlerList == null ) throw new RuntimeException ( "Unknown handler or chain: " + exec ) ; for ( HttpHandler handler : handlerList ) { if ( handler instanceof MiddlewareHandler ) { // add the handler to the list of handlers to execute if it is enabled in the configuration if ( ( ( MiddlewareHandler ) handler ) . isEnabled ( ) ) { handlersFromExecList . add ( handler ) ; } } else { handlersFromExecList . add ( handler ) ; } } } } return handlersFromExecList ; }
Converts the list of chains and handlers to a flat list of handlers . If a chain is named the same as a handler the chain is resolved first .