@ PostConstruct public void process ( ) { Collection < BeanDefinition < ? > > filterDefinitions = beanContext . getBeanDefinitions ( Qualifiers . byStereotype ( Filter . class ) ) ; for ( BeanDefinition < ? > beanDefinition : filterDefinitions ) { if ( HttpClientFilter . class . isAssignableFrom ( beanDefinition . getBeanType ( ) ) ) { // ignore http client filters continue ; } String [ ] patterns = beanDefinition . getValue ( Filter . class , String [ ] . class ) . orElse ( null ) ; if ( ArrayUtils . isNotEmpty ( patterns ) ) { HttpMethod [ ] methods = beanDefinition . getValue ( Filter . class , "methods" , HttpMethod [ ] . class ) . orElse ( null ) ; String first = patterns [ 0 ] ; FilterRoute filterRoute = addFilter ( first , ( ) -> beanContext . getBean ( ( Class < HttpFilter > ) beanDefinition . getBeanType ( ) ) ) ; if ( patterns . length > 1 ) { for ( int i = 1 ; i < patterns . length ; i ++ ) { String pattern = patterns [ i ] ; filterRoute . pattern ( pattern ) ; } } if ( ArrayUtils . isNotEmpty ( methods ) ) { filterRoute . methods ( methods ) ; } } } }
Executed after the bean creation .