public FilterReply getFilterChainDecision ( E event ) { final Filter < E > [ ] filterArrray = filterList . asTypedArray ( ) ; final int len = filterArrray . length ; for ( int i = 0 ; i < len ; i ++ ) { final FilterReply r = filterArrray [ i ] . decide ( event ) ; if ( r == FilterReply . DENY || r == FilterReply . ACCEPT ) { return r ; } } // no decision return FilterReply . NEUTRAL ; }
Loop through the filters in the list . As soon as a filter decides on ACCEPT or DENY then that value is returned . If all of the filters return NEUTRAL then NEUTRAL is returned .