private IMessageFilter [ ] getFilter ( Method method , Handler subscription ) { Filter [ ] filterDefinitions = collectFilters ( method , subscription ) ; if ( filterDefinitions . length == 0 ) { return null ; } IMessageFilter [ ] filters = new IMessageFilter [ filterDefinitions . length ] ; int i = 0 ; for ( Filter filterDef : filterDefinitions ) { IMessageFilter filter = filterCache . get ( filterDef . value ( ) ) ; if ( filter == null ) { try { filter = filterDef . value ( ) . newInstance ( ) ; filterCache . put ( filterDef . value ( ) , filter ) ; } catch ( Exception e ) { throw new RuntimeException ( e ) ; // propagate as runtime exception } } filters [ i ] = filter ; i ++ ; } return filters ; }
retrieve all instances of filters associated with the given subscription