move cache configuration into Spring context file

git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1052117 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Brett Porter 2010-12-23 00:19:22 +00:00
parent 1055953866
commit cdcc0f4ded
3 changed files with 22 additions and 44 deletions

View File

@ -18,7 +18,8 @@
~ under the License. ~ 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> <parent>
<groupId>org.apache.archiva</groupId> <groupId>org.apache.archiva</groupId>
<artifactId>archiva-base</artifactId> <artifactId>archiva-base</artifactId>
@ -73,19 +74,6 @@
<goal>generate-metadata</goal> <goal>generate-metadata</goal>
</goals> </goals>
</execution> </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> </executions>
</plugin> </plugin>
</plugins> </plugins>

View File

@ -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>

View File

@ -23,10 +23,24 @@
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd"> http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
<bean id="urlFailureCache" <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 --> <!-- collaborators and configuration for this bean go here -->
<constructor-arg ref="cache#url-failures-cache" <constructor-arg ref="url-failures-cache"
type="org.codehaus.plexus.cache.Cache"/> type="org.codehaus.plexus.cache.Cache"/>
</bean> </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> </beans>