]> source.dussan.org Git - archiva.git/commitdiff
move cache configuration into Spring context file
authorBrett Porter <brett@apache.org>
Thu, 23 Dec 2010 00:19:22 +0000 (00:19 +0000)
committerBrett Porter <brett@apache.org>
Thu, 23 Dec 2010 00:19:22 +0000 (00:19 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1052117 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-base/archiva-policies/pom.xml
archiva-modules/archiva-base/archiva-policies/src/main/resources/META-INF/plexus/components-fragment.xml [deleted file]
archiva-modules/archiva-base/archiva-policies/src/main/resources/META-INF/spring-context.xml

index f9e44d9ca81bed9db3caf673e10f062ae03a0f1a..5331d51f94f704d1a3978bc5f936f0992ea2f345 100644 (file)
@@ -18,7 +18,8 @@
   ~ under the License.
   -->
 
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
   <parent>
     <groupId>org.apache.archiva</groupId>
     <artifactId>archiva-base</artifactId>
         <executions>
           <execution>
             <id>descriptor</id>
-                       <phase>generate-resources</phase>
+            <phase>generate-resources</phase>
             <goals>
               <goal>generate-metadata</goal>
             </goals>
           </execution>
-          <execution>
-            <id>merge</id>
-                       <phase>generate-resources</phase>
-            <goals>
-              <goal>merge-metadata</goal>
-            </goals>
-            <configuration>
-              <descriptors>
-                <descriptor>${basedir}/src/main/resources/META-INF/plexus/components-fragment.xml</descriptor>
-                <descriptor>${project.build.outputDirectory}/META-INF/plexus/components.xml</descriptor>
-              </descriptors>
-            </configuration>
-          </execution>
         </executions>
       </plugin>
     </plugins>
diff --git a/archiva-modules/archiva-base/archiva-policies/src/main/resources/META-INF/plexus/components-fragment.xml b/archiva-modules/archiva-base/archiva-policies/src/main/resources/META-INF/plexus/components-fragment.xml
deleted file mode 100644 (file)
index b662206..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-<component-set>
-  <components>
-    <component>
-      <role>org.codehaus.plexus.cache.Cache</role>
-      <role-hint>url-failures-cache</role-hint>
-      <implementation>org.codehaus.plexus.cache.ehcache.EhcacheCache</implementation>
-      <description>URL Failure Cache</description>
-      <configuration>
-        <disk-expiry-thread-interval-seconds>600</disk-expiry-thread-interval-seconds>
-        <disk-persistent>true</disk-persistent>
-        <disk-store-path>${java.io.tmpdir}/archiva/urlcache</disk-store-path>
-        <eternal>false</eternal>
-        <max-elements-in-memory>1000</max-elements-in-memory>
-        <memory-eviction-policy>LRU</memory-eviction-policy>
-        <name>url-failures-cache</name>
-        <overflow-to-disk>false</overflow-to-disk>
-        <!-- 45 minutes = 2700 seconds -->
-        <time-to-idle-seconds>2700</time-to-idle-seconds>
-        <!-- 30 minutes = 1800 seconds  -->
-        <time-to-live-seconds>1800</time-to-live-seconds>
-      </configuration>
-    </component>
-  </components>
-</component-set>
index 75a5d41c01e5cebce8a3525d8df419d6cf1f4c50..082069ef7b05d525e7094c1664fb69ee10e487b7 100644 (file)
   ~ under the License.
 -->
 <beans xmlns="http://www.springframework.org/schema/beans"
-  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-  xsi:schemaLocation="http://www.springframework.org/schema/beans
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
            http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
 
   <bean id="urlFailureCache"
-    class="org.apache.maven.archiva.policies.urlcache.DefaultUrlFailureCache">
+        class="org.apache.maven.archiva.policies.urlcache.DefaultUrlFailureCache" lazy-init="true">
     <!-- collaborators and configuration for this bean go here -->
-    <constructor-arg ref="cache#url-failures-cache"
-      type="org.codehaus.plexus.cache.Cache" />
+    <constructor-arg ref="url-failures-cache"
+                     type="org.codehaus.plexus.cache.Cache"/>
   </bean>
 
+  <bean id="url-failures-cache" class="org.codehaus.plexus.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>
 </beans>
\ No newline at end of file