From 1c1134b74f5fb4a71e5ab30cfe59545d0265b3e1 Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Thu, 20 Dec 2012 23:03:36 +0000 Subject: use a more modern way to init this bean git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1424744 13f79535-47bb-0310-9956-ffa450edef68 --- .../archiva/policies/urlcache/DefaultUrlFailureCache.java | 11 +++++------ .../src/main/resources/META-INF/spring-context.xml | 7 +------ .../src/main/webapp/WEB-INF/applicationContext.xml | 15 +++++++++++++++ 3 files changed, 21 insertions(+), 12 deletions(-) diff --git a/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/archiva/policies/urlcache/DefaultUrlFailureCache.java b/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/archiva/policies/urlcache/DefaultUrlFailureCache.java index 912ca775d..e1a5b9a69 100644 --- a/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/archiva/policies/urlcache/DefaultUrlFailureCache.java +++ b/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/archiva/policies/urlcache/DefaultUrlFailureCache.java @@ -20,22 +20,21 @@ package org.apache.archiva.policies.urlcache; */ import org.apache.archiva.redback.components.cache.Cache; +import org.springframework.stereotype.Service; +import javax.inject.Inject; import java.util.Date; /** - * DefaultUrlFailureCache - * - * + * DefaultUrlFailureCache */ +@Service( "urlFailureCache" ) public class DefaultUrlFailureCache implements UrlFailureCache { - /** - * @todo spring cache instead - */ private Cache urlCache; + @Inject public DefaultUrlFailureCache( Cache urlCache ) { this.urlCache = urlCache; diff --git a/archiva-modules/archiva-base/archiva-policies/src/main/resources/META-INF/spring-context.xml b/archiva-modules/archiva-base/archiva-policies/src/main/resources/META-INF/spring-context.xml index 3cf02da6a..a474a2cb3 100644 --- a/archiva-modules/archiva-base/archiva-policies/src/main/resources/META-INF/spring-context.xml +++ b/archiva-modules/archiva-base/archiva-policies/src/main/resources/META-INF/spring-context.xml @@ -33,12 +33,7 @@ - - - - + diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/WEB-INF/applicationContext.xml b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/WEB-INF/applicationContext.xml index 66dd17f58..bbd799b6b 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/WEB-INF/applicationContext.xml +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/WEB-INF/applicationContext.xml @@ -161,6 +161,21 @@ + + + + + + + + + + + + + +