use of org.springframework.beans.factory.annotation.Autowired in project spring-boot by spring-projects.
the class MockitoAopProxyTargetInterceptor method applyTo.
@Autowired
public static void applyTo(Object source) {
Assert.state(AopUtils.isAopProxy(source), "Source must be an AOP proxy");
try {
Advised advised = (Advised) source;
for (Advisor advisor : advised.getAdvisors()) {
if (advisor instanceof MockitoAopProxyTargetInterceptor) {
return;
}
}
Object target = AopTestUtils.getUltimateTargetObject(source);
Advice advice = new MockitoAopProxyTargetInterceptor(source, target);
advised.addAdvice(0, advice);
} catch (Exception ex) {
throw new IllegalStateException("Unable to apply Mockito AOP support", ex);
}
}
use of org.springframework.beans.factory.annotation.Autowired in project Asqatasun by Asqatasun.
the class AuditStatisticsFactory method setThemeDataService.
@Autowired
public final void setThemeDataService(ThemeDataService themeDataService) {
Collection<Theme> themeList = themeDataService.findAll();
if (fullThemeMapByRef == null) {
fullThemeMapByRef = new HashMap();
}
// to be associated with a criterion
for (Theme theme : themeList) {
if (!theme.getCriterionList().isEmpty()) {
String referenceCode = theme.getCriterionList().iterator().next().getReference().getCode();
if (!fullThemeMapByRef.containsKey(referenceCode)) {
Collection<Theme> themeListByRef = new ArrayList();
themeListByRef.add(theme);
fullThemeMapByRef.put(referenceCode, themeListByRef);
} else {
fullThemeMapByRef.get(referenceCode).add(theme);
}
}
}
for (Collection<Theme> entry : fullThemeMapByRef.values()) {
sortThemeList(entry);
}
}
use of org.springframework.beans.factory.annotation.Autowired in project uPortal by Jasig.
the class RDBMUserLayoutStore method setPlatformTransactionManager.
@Autowired
public void setPlatformTransactionManager(@Qualifier(BasePortalJpaDao.PERSISTENCE_UNIT_NAME) PlatformTransactionManager platformTransactionManager) {
this.transactionOperations = new TransactionTemplate(platformTransactionManager);
final DefaultTransactionDefinition nextStructTransactionDefinition = new DefaultTransactionDefinition();
nextStructTransactionDefinition.setPropagationBehavior(DefaultTransactionDefinition.PROPAGATION_REQUIRES_NEW);
this.nextStructTransactionOperations = new TransactionTemplate(platformTransactionManager, nextStructTransactionDefinition);
}
Aggregations