private void apiAfterConfiguration ( ) { ProducerFilterConfig filterConfig [ ] = WebUIConfig . getInstance ( ) . getFilters ( ) ; if ( filterConfig == null || filterConfig . length == 0 ) return ; List < ProducerFilter > newProducerFilters = new ArrayList <> ( filterConfig . length ) ; for ( ProducerFilterConfig pfc : filterConfig ) { try { ProducerFilter filter = ( ProducerFilter ) Class . forName ( pfc . getClazzName ( ) ) . newInstance ( ) ; filter . customize ( pfc . getParameter ( ) ) ; newProducerFilters . add ( filter ) ; } catch ( InstantiationException e ) { log . warn ( "Can't initialize filter of class " + pfc . getClazzName ( ) ) ; } catch ( IllegalAccessException e ) { log . warn ( "Can't initialize filter of class " + pfc . getClazzName ( ) ) ; } catch ( ClassNotFoundException e ) { log . warn ( "Can't initialize filter of class " + pfc . getClazzName ( ) ) ; } } DecoratorConfig [ ] decoratorConfigs = WebUIConfig . getInstance ( ) . getDecorators ( ) ; if ( decoratorConfigs != null ) { log . debug ( "Configuring decorator configs " + Arrays . toString ( decoratorConfigs ) ) ; for ( DecoratorConfig config : decoratorConfigs ) { try { Class decoratorClass = Class . forName ( config . getDecoratorClazzName ( ) ) ; IDecorator decorator = ( IDecorator ) decoratorClass . newInstance ( ) ; DecoratorRegistryFactory . getDecoratorRegistry ( ) . addDecorator ( config . getStatClazzName ( ) , decorator ) ; } catch ( ClassNotFoundException e ) { log . warn ( "can't configure decorator " + config + " due " , e ) ; } catch ( InstantiationException e ) { log . warn ( "can't configure decorator " + config + " due " , e ) ; } catch ( IllegalAccessException e ) { log . warn ( "can't configure decorator " + config + " due " , e ) ; } } } producerFilters = newProducerFilters ; }
Called after the configuration has been read .