private void registerInterceptor ( Node source , String beanName , BeanDefinitionRegistry registry ) { List < String > methodList = buildMethodList ( source ) ; BeanDefinitionBuilder initializer = BeanDefinitionBuilder . rootBeanDefinition ( SingleServiceWrapperInterceptor . class ) ; initializer . addPropertyValue ( "methods" , methodList ) ; String perfMonitorName = beanName + "PerformanceMonitor" ; initializer . addPropertyReference ( "serviceWrapper" , perfMonitorName ) ; String interceptorName = beanName + "PerformanceMonitorInterceptor" ; registry . registerBeanDefinition ( interceptorName , initializer . getBeanDefinition ( ) ) ; }
Register a new SingleServiceWrapperInterceptor for the bean being wrapped associate it with the PerformanceMonitor and tell it which methods to intercept .