1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.syncope.core.persistence.jpa.spring;
20
21 import org.springframework.beans.BeansException;
22 import org.springframework.beans.factory.config.BeanDefinition;
23 import org.springframework.beans.factory.config.BeanFactoryPostProcessor;
24 import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
25 import org.springframework.transaction.interceptor.TransactionInterceptor;
26
27
28
29
30 public class DomainTransactionInterceptorInjector implements BeanFactoryPostProcessor {
31
32 @Override
33 public void postProcessBeanFactory(final ConfigurableListableBeanFactory beanFactory) throws BeansException {
34 for (String name : beanFactory.getBeanNamesForType(TransactionInterceptor.class, false, false)) {
35 BeanDefinition bd = beanFactory.getBeanDefinition(name);
36 bd.setBeanClassName(DomainTransactionInterceptor.class.getName());
37 bd.setFactoryBeanName(null);
38 bd.setFactoryMethodName(null);
39 }
40 }
41 }