archiva-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1424744 - in /archiva/trunk/archiva-modules: archiva-base/archiva-policies/src/main/java/org/apache/archiva/policies/urlcache/ archiva-base/archiva-policies/src/main/resources/META-INF/ archiva-web/archiva-webapp-js/src/main/webapp/WEB-INF/
Date Thu, 20 Dec 2012 23:03:37 GMT
Author: olamy
Date: Thu Dec 20 23:03:36 2012
New Revision: 1424744

URL: http://svn.apache.org/viewvc?rev=1424744&view=rev
Log:
use a more modern way to init this bean

Modified:
    archiva/trunk/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/archiva/policies/urlcache/DefaultUrlFailureCache.java
    archiva/trunk/archiva-modules/archiva-base/archiva-policies/src/main/resources/META-INF/spring-context.xml
    archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/WEB-INF/applicationContext.xml

Modified: archiva/trunk/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/archiva/policies/urlcache/DefaultUrlFailureCache.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/archiva/policies/urlcache/DefaultUrlFailureCache.java?rev=1424744&r1=1424743&r2=1424744&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/archiva/policies/urlcache/DefaultUrlFailureCache.java
(original)
+++ archiva/trunk/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/archiva/policies/urlcache/DefaultUrlFailureCache.java
Thu Dec 20 23:03:36 2012
@@ -20,22 +20,21 @@ package org.apache.archiva.policies.urlc
  */
 
 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;

Modified: archiva/trunk/archiva-modules/archiva-base/archiva-policies/src/main/resources/META-INF/spring-context.xml
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-base/archiva-policies/src/main/resources/META-INF/spring-context.xml?rev=1424744&r1=1424743&r2=1424744&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-base/archiva-policies/src/main/resources/META-INF/spring-context.xml
(original)
+++ archiva/trunk/archiva-modules/archiva-base/archiva-policies/src/main/resources/META-INF/spring-context.xml
Thu Dec 20 23:03:36 2012
@@ -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">

Modified: archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/WEB-INF/applicationContext.xml
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/WEB-INF/applicationContext.xml?rev=1424744&r1=1424743&r2=1424744&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/WEB-INF/applicationContext.xml
(original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/WEB-INF/applicationContext.xml
Thu Dec 20 23:03:36 2012
@@ -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 -->
   <!--



Mime
View raw message