aboutsummaryrefslogtreecommitdiffstats
path: root/archiva-modules
diff options
context:
space:
mode:
Diffstat (limited to 'archiva-modules')
-rw-r--r--archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/archiva/policies/urlcache/DefaultUrlFailureCache.java11
-rw-r--r--archiva-modules/archiva-base/archiva-policies/src/main/resources/META-INF/spring-context.xml7
-rw-r--r--archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/WEB-INF/applicationContext.xml15
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 @@
<context:annotation-config/>
<context:component-scan base-package="org.apache.archiva.policies"/>
- <bean id="urlFailureCache"
- class="org.apache.archiva.policies.urlcache.DefaultUrlFailureCache" lazy-init="true">
- <!-- collaborators and configuration for this bean go here -->
- <constructor-arg ref="url-failures-cache"
- type="org.apache.archiva.redback.components.cache.Cache"/>
- </bean>
+
<bean id="url-failures-cache" class="org.apache.archiva.redback.components.cache.ehcache.EhcacheCache" lazy-init="true"
destroy-method="dispose">
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 @@
<property name="timeToLiveSeconds" value="14400"/>
</bean>
+ <bean id="url-failures-cache" class="org.apache.archiva.redback.components.cache.ehcache.EhcacheCache" lazy-init="true"
+ destroy-method="dispose">
+ <property name="diskExpiryThreadIntervalSeconds" value="600"/>
+ <property name="diskPersistent" value="true"/>
+ <property name="diskStorePath" value="${java.io.tmpdir}/archiva/urlcache"/>
+ <property name="maxElementsInMemory" value="1000"/>
+ <property name="memoryEvictionPolicy" value="LRU"/>
+ <property name="name" value="url-failures-cache"/>
+ <property name="overflowToDisk" value="false"/>
+ <!-- 45 minutes = 2700 seconds -->
+ <property name="timeToIdleSeconds" value="2700"/>
+ <!-- 30 minutes = 1800 seconds -->
+ <property name="timeToLiveSeconds" value="1800"/>
+ </bean>
+
<!-- override jcr repository location -->
<!-- START SNIPPET: jcr-location -->
<!--