You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@archiva.apache.org by ol...@apache.org on 2012/04/06 11:33:56 UTC

svn commit: r1310262 [8/14] - in /archiva/redback/redback-components/trunk: ./ plexus-command-line/ plexus-command-line/src/ plexus-command-line/src/main/ plexus-command-line/src/main/java/ plexus-command-line/src/main/java/org/ plexus-command-line/src...

Added: archiva/redback/redback-components/trunk/spring-cache/spring-cache-api/src/main/java/org/codehaus/plexus/cache/factory/CacheFactory.java
URL: http://svn.apache.org/viewvc/archiva/redback/redback-components/trunk/spring-cache/spring-cache-api/src/main/java/org/codehaus/plexus/cache/factory/CacheFactory.java?rev=1310262&view=auto
==============================================================================
--- archiva/redback/redback-components/trunk/spring-cache/spring-cache-api/src/main/java/org/codehaus/plexus/cache/factory/CacheFactory.java (added)
+++ archiva/redback/redback-components/trunk/spring-cache/spring-cache-api/src/main/java/org/codehaus/plexus/cache/factory/CacheFactory.java Fri Apr  6 09:33:40 2012
@@ -0,0 +1,134 @@
+package org.codehaus.plexus.cache.factory;
+
+/*
+ * Copyright 2001-2007 The Codehaus.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import java.io.IOException;
+import java.net.URL;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Properties;
+
+import org.codehaus.plexus.cache.Cache;
+import org.codehaus.plexus.cache.CacheException;
+import org.codehaus.plexus.cache.CacheHints;
+import org.codehaus.plexus.cache.impl.NoCacheCache;
+
+/**
+ * CacheFactory - dynamic cache creation (and tracking) facility for non-plexus objects to use.
+ *
+ * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
+ * @version $Id$
+ */
+public class CacheFactory
+{
+    static class CacheFactoryHolder
+    {
+        static CacheFactory instance = new CacheFactory();
+    }
+
+    private static Map caches;
+
+    private static CacheCreator creator;
+
+    private CacheFactory()
+    {
+        caches = new HashMap();
+
+        try
+        {
+            ClassLoader classLoader = this.getClass().getClassLoader();
+
+            if ( classLoader == null )
+            {
+                classLoader = ClassLoader.getSystemClassLoader();
+            }
+
+            Enumeration cachePropResources = classLoader.getResources( "META-INF/plexus-cache.properties" );
+
+            if ( cachePropResources.hasMoreElements() )
+            {
+                URL propURL = (URL) cachePropResources.nextElement();
+                Properties props = new Properties();
+
+                props.load( propURL.openStream() );
+                String creatorImpl = props.getProperty( "cache.creator" );
+
+                Class creatorClass = classLoader.loadClass( creatorImpl );
+                creator = (CacheCreator) creatorClass.newInstance();
+            }
+
+            if ( cachePropResources.hasMoreElements() )
+            {
+                System.err.println( "More than 1 CacheCreator provider exists in classpath. "
+                    + "Using first one found [" + creator.getClass().getName() + "]." );
+            }
+        }
+        catch ( IOException e )
+        {
+            throw new ExceptionInInitializerError( e );
+        }
+        catch ( ClassNotFoundException e )
+        {
+            throw new ExceptionInInitializerError( e );
+        }
+        catch ( InstantiationException e )
+        {
+            throw new ExceptionInInitializerError( e );
+        }
+        catch ( IllegalAccessException e )
+        {
+            throw new ExceptionInInitializerError( e );
+        }
+    }
+
+    public static CacheFactory getInstance()
+    {
+        return CacheFactoryHolder.instance;
+    }
+
+    public void setCacheCreatorFactory( CacheCreator creator )
+    {
+        CacheFactory.creator = creator;
+    }
+
+    public Cache getCache( String id, CacheHints hints )
+        throws CacheException
+    {
+        if ( creator == null )
+        {
+            return new NoCacheCache();
+        }
+
+        if ( caches.containsKey( id ) )
+        {
+            return (Cache) caches.get( id );
+        }
+
+        if ( hints == null )
+        {
+            // Setup some defaults.
+            hints = new CacheHints();
+            hints.setName( id );
+        }
+
+        Cache cache = CacheFactory.creator.createCache( hints );
+
+        caches.put( id, cache );
+        return (Cache) cache;
+    }
+}

Propchange: archiva/redback/redback-components/trunk/spring-cache/spring-cache-api/src/main/java/org/codehaus/plexus/cache/factory/CacheFactory.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: archiva/redback/redback-components/trunk/spring-cache/spring-cache-api/src/main/java/org/codehaus/plexus/cache/factory/CacheFactory.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: archiva/redback/redback-components/trunk/spring-cache/spring-cache-api/src/main/java/org/codehaus/plexus/cache/impl/NoCacheCache.java
URL: http://svn.apache.org/viewvc/archiva/redback/redback-components/trunk/spring-cache/spring-cache-api/src/main/java/org/codehaus/plexus/cache/impl/NoCacheCache.java?rev=1310262&view=auto
==============================================================================
--- archiva/redback/redback-components/trunk/spring-cache/spring-cache-api/src/main/java/org/codehaus/plexus/cache/impl/NoCacheCache.java (added)
+++ archiva/redback/redback-components/trunk/spring-cache/spring-cache-api/src/main/java/org/codehaus/plexus/cache/impl/NoCacheCache.java Fri Apr  6 09:33:40 2012
@@ -0,0 +1,100 @@
+package org.codehaus.plexus.cache.impl;
+
+import org.codehaus.plexus.cache.Cache;
+import org.codehaus.plexus.cache.CacheStatistics;
+
+/*
+ * Copyright 2001-2007 The Codehaus.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Simple no-op provider of a Cache.
+ * 
+ * Nothing is stored, nothing is tracked, no statistics even.
+ * 
+ * @since 5 February, 2007
+ * @version $Id$
+ * @author <a href="mailto:Olivier.LAMY@accor.com">Olivier Lamy</a>
+ */
+public class NoCacheCache
+    implements Cache
+{
+    class NoStats
+        implements CacheStatistics
+    {
+
+        public void clear()
+        {
+            /* do nothing */
+        }
+
+        public double getCacheHitRate()
+        {
+            return 0;
+        }
+
+        public long getCacheHits()
+        {
+            return 0;
+        }
+
+        public long getCacheMiss()
+        {
+            return 0;
+        }
+
+        public long getSize()
+        {
+            return 0;
+        }
+    }
+
+    private CacheStatistics stats = new NoStats();
+
+    public void clear()
+    {
+        /* do nothing */
+    }
+
+    public Object get( Object key )
+    {
+        return null;
+    }
+
+    public CacheStatistics getStatistics()
+    {
+        return stats;
+    }
+
+    public boolean hasKey( Object key )
+    {
+        return false;
+    }
+
+    public Object put( Object key, Object value )
+    {
+        return null;
+    }
+
+    public void register( Object key, Object value )
+    {
+        /* do nothing */
+    }
+
+    public Object remove( Object key )
+    {
+        return null;
+    }
+}

Propchange: archiva/redback/redback-components/trunk/spring-cache/spring-cache-api/src/main/java/org/codehaus/plexus/cache/impl/NoCacheCache.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: archiva/redback/redback-components/trunk/spring-cache/spring-cache-api/src/main/java/org/codehaus/plexus/cache/impl/NoCacheCache.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: archiva/redback/redback-components/trunk/spring-cache/spring-cache-api/src/main/resources/META-INF/spring-context.xml
URL: http://svn.apache.org/viewvc/archiva/redback/redback-components/trunk/spring-cache/spring-cache-api/src/main/resources/META-INF/spring-context.xml?rev=1310262&view=auto
==============================================================================
--- archiva/redback/redback-components/trunk/spring-cache/spring-cache-api/src/main/resources/META-INF/spring-context.xml (added)
+++ archiva/redback/redback-components/trunk/spring-cache/spring-cache-api/src/main/resources/META-INF/spring-context.xml Fri Apr  6 09:33:40 2012
@@ -0,0 +1,33 @@
+<?xml version="1.0"?>
+
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+  -->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+           http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+           http://www.springframework.org/schema/context 
+           http://www.springframework.org/schema/context/spring-context-3.0.xsd">
+
+  <context:annotation-config />
+  <context:component-scan 
+    base-package="org.codehaus.plexus.cache.builder"/>
+ 
+</beans>
\ No newline at end of file

Propchange: archiva/redback/redback-components/trunk/spring-cache/spring-cache-api/src/main/resources/META-INF/spring-context.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: archiva/redback/redback-components/trunk/spring-cache/spring-cache-api/src/main/resources/META-INF/spring-context.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: archiva/redback/redback-components/trunk/spring-cache/spring-cache-providers/pom.xml
URL: http://svn.apache.org/viewvc/archiva/redback/redback-components/trunk/spring-cache/spring-cache-providers/pom.xml?rev=1310262&view=auto
==============================================================================
--- archiva/redback/redback-components/trunk/spring-cache/spring-cache-providers/pom.xml (added)
+++ archiva/redback/redback-components/trunk/spring-cache/spring-cache-providers/pom.xml Fri Apr  6 09:33:40 2012
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Licensed under the Apache License, Version 2.0 (the "License");
+  ~ you may not use this file except in compliance with the License.
+  ~ You may obtain a copy of the License at
+  ~
+  ~      http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
+  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~ See the License for the specific language governing permissions and
+  ~ limitations 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">
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>org.codehaus.redback.components.cache</groupId>
+    <artifactId>spring-cache</artifactId>
+    <version>2.0-SNAPSHOT</version>
+  </parent>
+  <artifactId>spring-cache-providers</artifactId>
+  <name>Spring Cache Providers</name>
+  <packaging>pom</packaging>
+
+  <description>Commons Cache API Providers Parent Pom.</description>
+
+  <dependencies>
+    <dependency>
+      <groupId>org.codehaus.redback.components.cache</groupId>
+      <artifactId>spring-cache-api</artifactId>
+      <version>${project.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.codehaus.redback.components.cache</groupId>
+      <artifactId>spring-cache-test</artifactId>
+      <version>${project.version}</version>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+
+  <modules>
+    <module>spring-cache-hashmap</module>
+    <module>spring-cache-ehcache</module>
+    <module>spring-cache-oscache</module>
+  </modules>
+</project>

Propchange: archiva/redback/redback-components/trunk/spring-cache/spring-cache-providers/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: archiva/redback/redback-components/trunk/spring-cache/spring-cache-providers/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: archiva/redback/redback-components/trunk/spring-cache/spring-cache-providers/spring-cache-ehcache/pom.xml
URL: http://svn.apache.org/viewvc/archiva/redback/redback-components/trunk/spring-cache/spring-cache-providers/spring-cache-ehcache/pom.xml?rev=1310262&view=auto
==============================================================================
--- archiva/redback/redback-components/trunk/spring-cache/spring-cache-providers/spring-cache-ehcache/pom.xml (added)
+++ archiva/redback/redback-components/trunk/spring-cache/spring-cache-providers/spring-cache-ehcache/pom.xml Fri Apr  6 09:33:40 2012
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Licensed under the Apache License, Version 2.0 (the "License");
+  ~ you may not use this file except in compliance with the License.
+  ~ You may obtain a copy of the License at
+  ~
+  ~      http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
+  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~ See the License for the specific language governing permissions and
+  ~ limitations 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">
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>org.codehaus.redback.components.cache</groupId>
+    <artifactId>spring-cache-providers</artifactId>
+    <version>2.0-SNAPSHOT</version>
+  </parent>
+
+  <artifactId>spring-cache-ehcache</artifactId>
+  <name>Spring Cache Provider :: ehcache</name>
+
+  <description>Commons Cache API : ehcache implementation.</description>
+
+  <packaging>jar</packaging>
+
+  <dependencies>
+    <dependency>
+      <groupId>net.sf.ehcache</groupId>
+      <artifactId>ehcache-core</artifactId>
+      <version>2.5.0</version>
+      <exclusions>
+        <exclusion>
+          <groupId>commons-logging</groupId>
+          <artifactId>commons-logging</artifactId>
+        </exclusion>
+      </exclusions>
+    </dependency>
+    <dependency>
+      <groupId>commons-collections</groupId>
+      <artifactId>commons-collections</artifactId>
+      <version>3.2</version>
+    </dependency>
+  </dependencies>
+</project>

Propchange: archiva/redback/redback-components/trunk/spring-cache/spring-cache-providers/spring-cache-ehcache/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: archiva/redback/redback-components/trunk/spring-cache/spring-cache-providers/spring-cache-ehcache/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: archiva/redback/redback-components/trunk/spring-cache/spring-cache-providers/spring-cache-ehcache/src/main/java/org/codehaus/plexus/cache/ehcache/EhcacheCache.java
URL: http://svn.apache.org/viewvc/archiva/redback/redback-components/trunk/spring-cache/spring-cache-providers/spring-cache-ehcache/src/main/java/org/codehaus/plexus/cache/ehcache/EhcacheCache.java?rev=1310262&view=auto
==============================================================================
--- archiva/redback/redback-components/trunk/spring-cache/spring-cache-providers/spring-cache-ehcache/src/main/java/org/codehaus/plexus/cache/ehcache/EhcacheCache.java (added)
+++ archiva/redback/redback-components/trunk/spring-cache/spring-cache-providers/spring-cache-ehcache/src/main/java/org/codehaus/plexus/cache/ehcache/EhcacheCache.java Fri Apr  6 09:33:40 2012
@@ -0,0 +1,391 @@
+package org.codehaus.plexus.cache.ehcache;
+
+/*
+ * Copyright 2001-2007 The Codehaus.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import net.sf.ehcache.Cache;
+import net.sf.ehcache.CacheManager;
+import net.sf.ehcache.Element;
+import net.sf.ehcache.Status;
+import net.sf.ehcache.store.MemoryStoreEvictionPolicy;
+import org.codehaus.plexus.cache.CacheStatistics;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.annotation.PostConstruct;
+
+/**
+ * EhcacheCache 
+ * configuration document  available <a href="http://ehcache.sourceforge.net/EhcacheUserGuide.html>EhcacheUserGuide</a>
+ *  
+ * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
+ * @version $Id$
+ * 
+ * @plexus.component role="org.codehaus.plexus.cache.Cache" role-hint="ehcache"
+ */
+public class EhcacheCache
+    implements org.codehaus.plexus.cache.Cache
+{
+    
+    private Logger log = LoggerFactory.getLogger( getClass() );    
+    
+    class Stats
+        implements CacheStatistics
+    {
+        public void clear()
+        {
+            ehcache.clearStatistics();
+        }
+
+        public double getCacheHitRate()
+        {
+            double hits = getCacheHits();
+            double miss = getCacheMiss();
+
+            if ( ( hits == 0 ) && ( hits == 0 ) )
+            {
+                return 0.0;
+            }
+
+            return (double) hits / (double) ( hits + miss );
+        }
+
+        public long getCacheHits()
+        {
+            return ehcache.getStatistics().getCacheHits();
+        }
+
+        public long getCacheMiss()
+        {
+            return ehcache.getStatistics().getCacheMisses();
+        }
+
+        public long getSize()
+        {
+            return ehcache.getMemoryStoreSize() + ehcache.getDiskStoreSize();
+        }
+
+    }
+
+    /**
+     * how often to run the disk store expiry thread. A large number of 120 seconds plus is recommended
+     * 
+     * @plexus.configuration default-value="600"
+     */
+    private long diskExpiryThreadIntervalSeconds = 600;
+
+    /**
+     * Whether to persist the cache to disk between JVM restarts.
+     * 
+     * @plexus.configuration default-value="true"
+     */
+    private boolean diskPersistent = true;
+
+    /**
+     * Location on disk for the ehcache store.
+     * 
+     * @plexus.configuration default-value="${java.io.tmpdir}/ehcache"
+     */
+    private String diskStorePath = System.getProperty( "java.io.tmpdir" ) + "/ehcache";
+
+    /**
+     * @plexus.configuration default-value="false"
+     */
+    private boolean eternal = false;
+
+    /**
+     * @plexus.configuration default-value="1000"
+     */
+    private int maxElementsInMemory = 1000;
+
+    /**
+     * @plexus.configuration default-value="LRU"
+     */
+    private String memoryEvictionPolicy = "LRU";
+
+    /**
+     * @plexus.configuration default-value="cache"
+     */
+    private String name = "cache";
+
+    /**
+     * Flag indicating when to use the disk store.
+     * 
+     * @plexus.configuration default-value="false"
+     */
+    private boolean overflowToDisk = false;
+
+    /**
+     * @plexus.configuration default-value="600"
+     */
+    private int timeToIdleSeconds = 600;
+
+    /**
+     * @plexus.configuration default-value="300"
+     */
+    private int timeToLiveSeconds = 300;
+    
+    /**
+     * @plexus.configuration default-value="false"
+     */    
+    private boolean failOnDuplicateCache = false;
+
+    private boolean statisticsEnabled = true;
+
+    private CacheManager cacheManager = CacheManager.getInstance();
+
+    private net.sf.ehcache.Cache ehcache;
+
+    private Stats stats;
+
+    public void clear()
+    {
+        ehcache.removeAll();
+        stats.clear();
+    }
+
+    @PostConstruct
+    public void initialize()
+    {
+        stats = new Stats();
+
+        boolean cacheExists = cacheManager.cacheExists( getName() );
+
+        if ( cacheExists )
+        {
+            if ( failOnDuplicateCache )
+            {
+                throw new RuntimeException( "A previous cache with name [" + getName() + "] exists." );
+            }
+            else
+            {
+                log.warn( "skip duplicate cache " + getName() );
+                ehcache = cacheManager.getCache( getName() );
+            }
+        }
+
+        if (!cacheExists)
+        {
+            ehcache = new Cache( getName(), getMaxElementsInMemory(), getMemoryStoreEvictionPolicy(), isOverflowToDisk(),
+                                 getDiskStorePath(), isEternal(), getTimeToLiveSeconds(), getTimeToIdleSeconds(),
+                                 isDiskPersistent(), getDiskExpiryThreadIntervalSeconds(), null );
+
+
+            cacheManager.addCache( ehcache );
+            ehcache.setStatisticsEnabled( statisticsEnabled );
+        }
+    }    
+
+    public void dispose()
+    {
+        if ( cacheManager.getStatus().equals( Status.STATUS_ALIVE ) )
+        {
+            log.info( "Disposing cache: " + ehcache );
+            if ( this.ehcache != null )
+            {
+                cacheManager.removeCache( this.ehcache.getName() );
+                ehcache = null;
+            }
+        }
+        else
+        {
+            log.debug( "Not disposing cache, because cacheManager is not alive: " + ehcache );
+        }
+    }
+
+    public Object get( Object key )
+    {
+        if (key == null)
+        {
+            return null;
+        }
+        Element elem = ehcache.get( key );
+        if ( elem == null )
+        {
+            return null;
+        }
+        return elem.getObjectValue();
+    }
+
+    public long getDiskExpiryThreadIntervalSeconds()
+    {
+        return diskExpiryThreadIntervalSeconds;
+    }
+
+    public String getDiskStorePath()
+    {
+        return diskStorePath;
+    }
+
+    public int getMaxElementsInMemory()
+    {
+        return maxElementsInMemory;
+    }
+
+    public String getMemoryEvictionPolicy()
+    {
+        return memoryEvictionPolicy;
+    }
+
+    public MemoryStoreEvictionPolicy getMemoryStoreEvictionPolicy()
+    {
+        return MemoryStoreEvictionPolicy.fromString( memoryEvictionPolicy );
+    }
+
+    public String getName()
+    {
+        return name;
+    }
+
+    public CacheStatistics getStatistics()
+    {
+        return stats;
+    }
+
+    public int getTimeToIdleSeconds()
+    {
+        return timeToIdleSeconds;
+    }
+
+    public int getTimeToLiveSeconds()
+    {
+        return timeToLiveSeconds;
+    }
+
+    public boolean hasKey( Object key )
+    {
+        return ehcache.isKeyInCache( key );
+    }
+
+    public boolean isDiskPersistent()
+    {
+        return diskPersistent;
+    }
+
+    public boolean isEternal()
+    {
+        return eternal;
+    }
+
+    public boolean isOverflowToDisk()
+    {
+        return overflowToDisk;
+    }
+
+    public void register( Object key, Object value )
+    {
+        ehcache.put( new Element( key, value ) );
+    }
+    
+    public Object put( Object key, Object value )
+    {
+        // Multiple steps done to satisfy Cache API requirement for Previous object return.
+        Element elem = null;
+        Object previous = null;
+        elem = ehcache.get( key );
+        if ( elem != null )
+        {
+            previous = elem.getObjectValue();
+        }
+        elem = new Element( key, value );
+        ehcache.put( elem );
+        return previous;
+    }
+
+    public Object remove( Object key )
+    {
+        Element elem = null;
+        Object previous = null;
+        elem = ehcache.get( key );
+        if ( elem != null )
+        {
+            previous = elem.getObjectValue();
+            ehcache.remove( key );
+        }
+
+        return previous;
+    }
+
+    public void setDiskExpiryThreadIntervalSeconds( long diskExpiryThreadIntervalSeconds )
+    {
+        this.diskExpiryThreadIntervalSeconds = diskExpiryThreadIntervalSeconds;
+    }
+
+    public void setDiskPersistent( boolean diskPersistent )
+    {
+        this.diskPersistent = diskPersistent;
+    }
+
+    public void setDiskStorePath( String diskStorePath )
+    {
+        this.diskStorePath = diskStorePath;
+    }
+
+    public void setEternal( boolean eternal )
+    {
+        this.eternal = eternal;
+    }
+
+    public void setMaxElementsInMemory( int maxElementsInMemory )
+    {
+        this.maxElementsInMemory = maxElementsInMemory;
+    }
+
+    public void setMemoryEvictionPolicy( String memoryEvictionPolicy )
+    {
+        this.memoryEvictionPolicy = memoryEvictionPolicy;
+    }
+
+    public void setName( String name )
+    {
+        this.name = name;
+    }
+
+    public void setOverflowToDisk( boolean overflowToDisk )
+    {
+        this.overflowToDisk = overflowToDisk;
+    }
+
+    public void setTimeToIdleSeconds( int timeToIdleSeconds )
+    {
+        this.timeToIdleSeconds = timeToIdleSeconds;
+    }
+
+    public void setTimeToLiveSeconds( int timeToLiveSeconds )
+    {
+        this.timeToLiveSeconds = timeToLiveSeconds;
+    }
+
+    public boolean isStatisticsEnabled()
+    {
+        return statisticsEnabled;
+    }
+
+    public void setStatisticsEnabled( boolean statisticsEnabled )
+    {
+        this.statisticsEnabled = statisticsEnabled;
+    }
+
+    public boolean isFailOnDuplicateCache()
+    {
+        return failOnDuplicateCache;
+    }
+
+    public void setFailOnDuplicateCache( boolean failOnDuplicateCache )
+    {
+        this.failOnDuplicateCache = failOnDuplicateCache;
+    }
+}

Propchange: archiva/redback/redback-components/trunk/spring-cache/spring-cache-providers/spring-cache-ehcache/src/main/java/org/codehaus/plexus/cache/ehcache/EhcacheCache.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: archiva/redback/redback-components/trunk/spring-cache/spring-cache-providers/spring-cache-ehcache/src/main/java/org/codehaus/plexus/cache/ehcache/EhcacheCache.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: archiva/redback/redback-components/trunk/spring-cache/spring-cache-providers/spring-cache-ehcache/src/main/java/org/codehaus/plexus/cache/ehcache/EhcacheCreator.java
URL: http://svn.apache.org/viewvc/archiva/redback/redback-components/trunk/spring-cache/spring-cache-providers/spring-cache-ehcache/src/main/java/org/codehaus/plexus/cache/ehcache/EhcacheCreator.java?rev=1310262&view=auto
==============================================================================
--- archiva/redback/redback-components/trunk/spring-cache/spring-cache-providers/spring-cache-ehcache/src/main/java/org/codehaus/plexus/cache/ehcache/EhcacheCreator.java (added)
+++ archiva/redback/redback-components/trunk/spring-cache/spring-cache-providers/spring-cache-ehcache/src/main/java/org/codehaus/plexus/cache/ehcache/EhcacheCreator.java Fri Apr  6 09:33:40 2012
@@ -0,0 +1,70 @@
+package org.codehaus.plexus.cache.ehcache;
+
+/*
+ * Copyright 2001-2007 The Codehaus.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import org.apache.commons.lang.SystemUtils;
+import org.codehaus.plexus.cache.Cache;
+import org.codehaus.plexus.cache.CacheException;
+import org.codehaus.plexus.cache.CacheHints;
+import org.codehaus.plexus.cache.factory.CacheCreator;
+
+import java.io.File;
+
+/**
+ * EhcacheCreator - runtime creation of an ehcache.
+ *
+ * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
+ * @version $Id$
+ */
+public class EhcacheCreator
+    implements CacheCreator
+{
+
+    public Cache createCache( CacheHints hints )
+        throws CacheException
+    {
+        EhcacheCache cache = new EhcacheCache();
+
+        cache.setName( hints.getName() );
+
+        cache.setDiskPersistent( hints.isOverflowToDisk() );
+        if ( hints.isOverflowToDisk() )
+        {
+            File overflowPath = null;
+
+            if ( hints.getDiskOverflowPath() != null )
+            {
+                overflowPath = hints.getDiskOverflowPath();
+            }
+            else
+            {
+                File tmpDir = SystemUtils.getJavaIoTmpDir();
+                overflowPath = new File( tmpDir, "ehcache/" + hints.getName() );
+            }
+
+            cache.setDiskStorePath( overflowPath.getAbsolutePath() );
+        }
+
+        cache.setMaxElementsInMemory( hints.getMaxElements() );
+        cache.setTimeToLiveSeconds( hints.getMaxSecondsInCache() );
+        cache.setTimeToIdleSeconds( hints.getIdleExpirationSeconds() );
+
+        cache.initialize();
+
+        return cache;
+    }
+}

Propchange: archiva/redback/redback-components/trunk/spring-cache/spring-cache-providers/spring-cache-ehcache/src/main/java/org/codehaus/plexus/cache/ehcache/EhcacheCreator.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: archiva/redback/redback-components/trunk/spring-cache/spring-cache-providers/spring-cache-ehcache/src/main/java/org/codehaus/plexus/cache/ehcache/EhcacheCreator.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: archiva/redback/redback-components/trunk/spring-cache/spring-cache-providers/spring-cache-ehcache/src/main/resources/META-INF/plexus-cache.properties
URL: http://svn.apache.org/viewvc/archiva/redback/redback-components/trunk/spring-cache/spring-cache-providers/spring-cache-ehcache/src/main/resources/META-INF/plexus-cache.properties?rev=1310262&view=auto
==============================================================================
--- archiva/redback/redback-components/trunk/spring-cache/spring-cache-providers/spring-cache-ehcache/src/main/resources/META-INF/plexus-cache.properties (added)
+++ archiva/redback/redback-components/trunk/spring-cache/spring-cache-providers/spring-cache-ehcache/src/main/resources/META-INF/plexus-cache.properties Fri Apr  6 09:33:40 2012
@@ -0,0 +1 @@
+cache.creator=org.codehaus.plexus.cache.ehcache.EhcacheCreator
\ No newline at end of file

Propchange: archiva/redback/redback-components/trunk/spring-cache/spring-cache-providers/spring-cache-ehcache/src/main/resources/META-INF/plexus-cache.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: archiva/redback/redback-components/trunk/spring-cache/spring-cache-providers/spring-cache-ehcache/src/main/resources/META-INF/plexus-cache.properties
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: archiva/redback/redback-components/trunk/spring-cache/spring-cache-providers/spring-cache-ehcache/src/main/resources/META-INF/spring-context.xml
URL: http://svn.apache.org/viewvc/archiva/redback/redback-components/trunk/spring-cache/spring-cache-providers/spring-cache-ehcache/src/main/resources/META-INF/spring-context.xml?rev=1310262&view=auto
==============================================================================
--- archiva/redback/redback-components/trunk/spring-cache/spring-cache-providers/spring-cache-ehcache/src/main/resources/META-INF/spring-context.xml (added)
+++ archiva/redback/redback-components/trunk/spring-cache/spring-cache-providers/spring-cache-ehcache/src/main/resources/META-INF/spring-context.xml Fri Apr  6 09:33:40 2012
@@ -0,0 +1,34 @@
+<?xml version="1.0"?>
+
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+  -->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+           http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+           http://www.springframework.org/schema/context 
+           http://www.springframework.org/schema/context/spring-context-3.0.xsd"
+       default-lazy-init="true">
+
+  <context:annotation-config />
+  <context:component-scan 
+    base-package="org.codehaus.plexus.cache.ehcache"/>
+ 
+</beans>
\ No newline at end of file

Propchange: archiva/redback/redback-components/trunk/spring-cache/spring-cache-providers/spring-cache-ehcache/src/main/resources/META-INF/spring-context.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: archiva/redback/redback-components/trunk/spring-cache/spring-cache-providers/spring-cache-ehcache/src/main/resources/META-INF/spring-context.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: archiva/redback/redback-components/trunk/spring-cache/spring-cache-providers/spring-cache-ehcache/src/test/java/org/codehaus/plexus/cache/ehcache/EhcacheCacheTest.java
URL: http://svn.apache.org/viewvc/archiva/redback/redback-components/trunk/spring-cache/spring-cache-providers/spring-cache-ehcache/src/test/java/org/codehaus/plexus/cache/ehcache/EhcacheCacheTest.java?rev=1310262&view=auto
==============================================================================
--- archiva/redback/redback-components/trunk/spring-cache/spring-cache-providers/spring-cache-ehcache/src/test/java/org/codehaus/plexus/cache/ehcache/EhcacheCacheTest.java (added)
+++ archiva/redback/redback-components/trunk/spring-cache/spring-cache-providers/spring-cache-ehcache/src/test/java/org/codehaus/plexus/cache/ehcache/EhcacheCacheTest.java Fri Apr  6 09:33:40 2012
@@ -0,0 +1,84 @@
+package org.codehaus.plexus.cache.ehcache;
+
+/*
+ * Copyright 2001-2007 The Codehaus.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import org.codehaus.plexus.cache.Cache;
+import org.codehaus.plexus.cache.test.AbstractCacheTestCase;
+
+import javax.inject.Inject;
+import javax.inject.Named;
+
+/**
+ * EhcacheCacheTest 
+ *
+ * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
+ * @version $Id$
+ */
+public class EhcacheCacheTest
+    extends AbstractCacheTestCase
+{
+
+    @Inject @Named(value = "cache#ehcache")
+    Cache cache;
+
+    @Inject @Named(value = "cache#alwaysrefresh")
+    Cache cachealwaysrefresh;
+
+    @Inject @Named(value = "cache#onesecondrefresh")
+    Cache cacheonesecondrefresh;
+
+    @Inject @Named(value = "cache#onesecondrefresh")
+    Cache cachetwosecondrefresh;
+
+    @Inject @Named(value = "cache#neverrefresh")
+    Cache cacheneversecondrefresh;
+
+    @Override
+    public Cache getCache()
+    {
+        return cache;
+    }
+
+    public Cache getAlwaysRefresCache()
+        throws Exception
+    {
+        return cachealwaysrefresh;
+    }
+
+    public Cache getNeverRefresCache()
+        throws Exception
+    {
+        return cacheneversecondrefresh;
+    }
+
+    public Cache getOneSecondRefresCache()
+        throws Exception
+    {
+        return cacheonesecondrefresh;
+    }
+
+    public Cache getTwoSecondRefresCache()
+        throws Exception
+    {
+        return cachetwosecondrefresh;
+    }
+
+    public Class getCacheClass()
+    {
+        return EhcacheCache.class;
+    }
+}

Propchange: archiva/redback/redback-components/trunk/spring-cache/spring-cache-providers/spring-cache-ehcache/src/test/java/org/codehaus/plexus/cache/ehcache/EhcacheCacheTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: archiva/redback/redback-components/trunk/spring-cache/spring-cache-providers/spring-cache-ehcache/src/test/java/org/codehaus/plexus/cache/ehcache/EhcacheCacheTest.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: archiva/redback/redback-components/trunk/spring-cache/spring-cache-providers/spring-cache-ehcache/src/test/resources/spring-context.xml
URL: http://svn.apache.org/viewvc/archiva/redback/redback-components/trunk/spring-cache/spring-cache-providers/spring-cache-ehcache/src/test/resources/spring-context.xml?rev=1310262&view=auto
==============================================================================
--- archiva/redback/redback-components/trunk/spring-cache/spring-cache-providers/spring-cache-ehcache/src/test/resources/spring-context.xml (added)
+++ archiva/redback/redback-components/trunk/spring-cache/spring-cache-providers/spring-cache-ehcache/src/test/resources/spring-context.xml Fri Apr  6 09:33:40 2012
@@ -0,0 +1,95 @@
+<?xml version="1.0"?>
+
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+  -->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+           http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+           http://www.springframework.org/schema/context 
+           http://www.springframework.org/schema/context/spring-context-3.0.xsd">
+
+
+  <bean name="cache#ehcache" class="org.codehaus.plexus.cache.ehcache.EhcacheCache">
+    <property name="diskExpiryThreadIntervalSeconds" value="600"/>
+    <property name="diskPersistent" value="false"/>
+    <property name="diskStorePath" value="./target/ehcache-test-store"/>
+    <property name="eternal" value="false"/>
+    <property name="maxElementsInMemory"  value="1000"/>
+    <property name="memoryEvictionPolicy" value="LRU"/>
+    <property name="name" value="test-cache"/>
+    <property name="overflowToDisk" value="false"/>
+    <property name="timeToIdleSeconds" value="600"/>
+    <property name="timeToLiveSeconds" value="300"/>
+  </bean>
+
+  <bean name="cache#alwaysrefresh" class="org.codehaus.plexus.cache.ehcache.EhcacheCache">
+    <property name="diskExpiryThreadIntervalSeconds" value="600"/>
+    <property name="diskPersistent" value="false"/>
+    <property name="diskStorePath" value="./target/ehcache-test-store"/>
+    <property name="eternal" value="false"/>
+    <property name="maxElementsInMemory"  value="1000"/>
+    <property name="memoryEvictionPolicy" value="LRU"/>
+    <property name="name" value="alwaysrefresh"/>
+    <property name="overflowToDisk" value="false"/>
+    <property name="timeToIdleSeconds" value="-1"/>
+    <property name="timeToLiveSeconds" value="-1"/>
+  </bean>
+
+  <bean name="cache#neverrefresh" class="org.codehaus.plexus.cache.ehcache.EhcacheCache">
+    <property name="diskExpiryThreadIntervalSeconds" value="600"/>
+    <property name="diskPersistent" value="false"/>
+    <property name="diskStorePath" value="./target/ehcache-test-store"/>
+    <property name="eternal" value="true"/>
+    <property name="maxElementsInMemory"  value="1000"/>
+    <property name="memoryEvictionPolicy" value="LRU"/>
+    <property name="name" value="neverrefresh"/>
+    <property name="overflowToDisk" value="false"/>
+    <property name="timeToIdleSeconds" value="-1"/>
+    <property name="timeToLiveSeconds" value="-1"/>
+  </bean>
+
+  <bean name="cache#onesecondrefresh" class="org.codehaus.plexus.cache.ehcache.EhcacheCache">
+    <property name="diskExpiryThreadIntervalSeconds" value="600"/>
+    <property name="diskPersistent" value="false"/>
+    <property name="diskStorePath" value="./target/ehcache-test-store"/>
+    <property name="eternal" value="false"/>
+    <property name="maxElementsInMemory"  value="1000"/>
+    <property name="memoryEvictionPolicy" value="LRU"/>
+    <property name="name" value="onesecondrefresh"/>
+    <property name="overflowToDisk" value="false"/>
+    <property name="timeToIdleSeconds" value="1"/>
+    <property name="timeToLiveSeconds" value="1"/>
+  </bean>
+
+  <bean name="cache#twosecondrefresh" class="org.codehaus.plexus.cache.ehcache.EhcacheCache">
+    <property name="diskExpiryThreadIntervalSeconds" value="600"/>
+    <property name="diskPersistent" value="false"/>
+    <property name="diskStorePath" value="./target/ehcache-test-store"/>
+    <property name="eternal" value="false"/>
+    <property name="maxElementsInMemory"  value="1000"/>
+    <property name="memoryEvictionPolicy" value="LRU"/>
+    <property name="name" value="onesecondrefresh"/>
+    <property name="overflowToDisk" value="false"/>
+    <property name="timeToIdleSeconds" value="2"/>
+    <property name="timeToLiveSeconds" value="2"/>
+  </bean>
+
+</beans>
\ No newline at end of file

Propchange: archiva/redback/redback-components/trunk/spring-cache/spring-cache-providers/spring-cache-ehcache/src/test/resources/spring-context.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: archiva/redback/redback-components/trunk/spring-cache/spring-cache-providers/spring-cache-ehcache/src/test/resources/spring-context.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: archiva/redback/redback-components/trunk/spring-cache/spring-cache-providers/spring-cache-hashmap/pom.xml
URL: http://svn.apache.org/viewvc/archiva/redback/redback-components/trunk/spring-cache/spring-cache-providers/spring-cache-hashmap/pom.xml?rev=1310262&view=auto
==============================================================================
--- archiva/redback/redback-components/trunk/spring-cache/spring-cache-providers/spring-cache-hashmap/pom.xml (added)
+++ archiva/redback/redback-components/trunk/spring-cache/spring-cache-providers/spring-cache-hashmap/pom.xml Fri Apr  6 09:33:40 2012
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Licensed under the Apache License, Version 2.0 (the "License");
+  ~ you may not use this file except in compliance with the License.
+  ~ You may obtain a copy of the License at
+  ~
+  ~      http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
+  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~ See the License for the specific language governing permissions and
+  ~ limitations 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">
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>org.codehaus.redback.components.cache</groupId>
+    <artifactId>spring-cache-providers</artifactId>
+    <version>2.0-SNAPSHOT</version>
+  </parent>
+
+  <artifactId>spring-cache-hashmap</artifactId>
+  <name>Spring Cache Provider :: hashmap</name>
+
+  <description>Commons Cache API : simple in memory HashMap implementation.</description>
+
+  <packaging>jar</packaging>
+
+  <dependencies>
+  </dependencies>
+</project>

Propchange: archiva/redback/redback-components/trunk/spring-cache/spring-cache-providers/spring-cache-hashmap/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: archiva/redback/redback-components/trunk/spring-cache/spring-cache-providers/spring-cache-hashmap/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: archiva/redback/redback-components/trunk/spring-cache/spring-cache-providers/spring-cache-hashmap/src/main/java/org/codehaus/plexus/cache/hashmap/HashMapCache.java
URL: http://svn.apache.org/viewvc/archiva/redback/redback-components/trunk/spring-cache/spring-cache-providers/spring-cache-hashmap/src/main/java/org/codehaus/plexus/cache/hashmap/HashMapCache.java?rev=1310262&view=auto
==============================================================================
--- archiva/redback/redback-components/trunk/spring-cache/spring-cache-providers/spring-cache-hashmap/src/main/java/org/codehaus/plexus/cache/hashmap/HashMapCache.java (added)
+++ archiva/redback/redback-components/trunk/spring-cache/spring-cache-providers/spring-cache-hashmap/src/main/java/org/codehaus/plexus/cache/hashmap/HashMapCache.java Fri Apr  6 09:33:40 2012
@@ -0,0 +1,377 @@
+package org.codehaus.plexus.cache.hashmap;
+
+/*
+ * Copyright 2001-2007 The Codehaus.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import org.codehaus.plexus.cache.AbstractCacheStatistics;
+import org.codehaus.plexus.cache.Cache;
+import org.codehaus.plexus.cache.CacheStatistics;
+import org.codehaus.plexus.cache.CacheableWrapper;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.PostConstruct;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+/**
+ * <p>
+ * HashMapCache - this is a Cache implementation taken from the Archiva project.
+ * </p>
+ * 
+ * <p>
+ * Original class written by Edwin Punzalan for purposes of addressing the 
+ * jira ticket <a href="http://jira.codehaus.org/browse/MRM-39">MRM-39</a>
+ * </p>   
+ * <p>
+ * Configure the refreshTime in seconds value configure a ttl of object life in cache.
+ * Object get( Object key ) :
+ * <ul>
+ *   <li> &lt; 0 : method will always return null (no cache)</li>
+ *   <li> = 0 : first stored object will be return (infinite life in the cache)</li>
+ *   <li> > 0 : after a live (stored time) of refreshTime the object will be remove from the cache 
+ *              and a no object will be returned by the method</li> 
+ * </ul>
+ * </p>
+ * @author Edwin Punzalan
+ * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
+ * @version $Id$
+ * 
+ * @plexus.component role="org.codehaus.plexus.cache.Cache" role-hint="hashmap"
+ */
+@Service("cache#hashmap")
+public class HashMapCache
+    implements Cache
+{
+    
+    private Logger log = LoggerFactory.getLogger( getClass() );
+    
+    class Stats
+        extends AbstractCacheStatistics
+        implements CacheStatistics
+    {
+
+        public Stats()
+        {
+            super();
+        }
+
+        public long getSize()
+        {
+            synchronized ( cache )
+            {
+                return cache.size();
+            }
+        }
+
+    }
+
+    private Map cache;
+
+    /**
+     * @plexus.configuration default-value="1.0"
+     */
+    private double cacheHitRatio = 1.0;
+
+    /**
+     * @plexus.configuration default-value="0"
+     */
+    private int cacheMaxSize = 0;
+
+    /**
+     * 
+     * @plexus.configuration
+     *  default-value="0"
+     */
+    private int refreshTime;
+
+    private Stats stats;
+
+    public HashMapCache()
+    {
+        // noop
+    }
+
+    /**
+     * Empty the cache and reset the cache hit rate
+     */
+    public void clear()
+    {
+        synchronized ( cache )
+        {
+            stats.clear();
+            cache.clear();
+        }
+    }
+
+    /**
+     * Check for a cached object and return it if it exists. Returns null when the keyed object is not found
+     *
+     * @param key the key used to map the cached object
+     * @return the object mapped to the given key, or null if no cache object is mapped to the given key
+     */
+    public Object get( Object key )
+    {
+        CacheableWrapper retValue = null;
+        // prevent search
+        if ( !this.isCacheAvailable() )
+        {
+            return null;
+        }
+        synchronized ( cache )
+        {
+            if ( cache.containsKey( key ) )
+            {
+                // remove and put: this promotes it to the top since we use a linked hash map
+                retValue = (CacheableWrapper) cache.remove( key );
+
+                if ( needRefresh( retValue ) )
+                {
+                    stats.miss();
+                    return null;
+                }
+                else
+                {
+                    cache.put( key, retValue );
+                    stats.hit();
+                }
+            }
+            else
+            {
+                stats.miss();
+            }
+        }
+
+        return retValue == null ? null : retValue.getValue();
+    }
+
+    protected boolean needRefresh( CacheableWrapper cacheableWrapper )
+    {
+        if ( cacheableWrapper == null )
+        {
+            return true;
+        }
+        if ( this.getRefreshTime() == 0 )
+        {
+            return false;
+        }
+        boolean result = ( System.currentTimeMillis() - cacheableWrapper.getStoredTime() ) > ( this.getRefreshTime() * 1000 );
+        if ( log.isDebugEnabled() )
+        {
+            log.debug( cacheableWrapper + " is uptodate" + result );
+        }
+        return result;
+    }
+
+    public CacheStatistics getStatistics()
+    {
+        return stats;
+    }
+
+    /**
+     * Check if the specified key is already mapped to an object.
+     *
+     * @param key the key used to map the cached object
+     * @return true if the cache contains an object associated with the given key
+     */
+    public boolean hasKey( Object key )
+    {
+        // prevent search
+        if ( !this.isCacheAvailable() )
+        {
+            return false;
+        }
+        boolean contains;
+        synchronized ( cache )
+        {
+            contains = cache.containsKey( key );
+
+            if ( contains )
+            {
+                stats.hit();
+            }
+            else
+            {
+                stats.miss();
+            }
+        }
+
+        return contains;
+    }
+
+    @PostConstruct
+    public void initialize()
+    {
+        stats = new Stats();
+
+        if ( cacheMaxSize > 0 )
+        {
+            cache = new LinkedHashMap( cacheMaxSize );
+        }
+        else
+        {
+            cache = new LinkedHashMap();
+        }
+    }
+
+    /**
+     * Cache the given value and map it using the given key
+     *
+     * @param key   the object to map the valued object
+     * @param value the object to cache
+     */
+    public Object put( Object key, Object value )
+    {
+        CacheableWrapper ret = null;
+
+        // remove and put: this promotes it to the top since we use a linked hash map
+        synchronized ( cache )
+        {
+            if ( cache.containsKey( key ) )
+            {
+                cache.remove( key );
+            }
+
+            ret = (CacheableWrapper) cache.put( key, new CacheableWrapper( value, System.currentTimeMillis() ) );
+        }
+
+        manageCache();
+
+        return ret == null ? null : ret.getValue();
+    }
+
+    /**
+     * Cache the given value and map it using the given key
+     *
+     * @param key   the object to map the valued object
+     * @param value the object to cache
+     */
+    public void register( Object key, Object value )
+    {
+        // remove and put: this promotes it to the top since we use a linked hash map
+        synchronized ( cache )
+        {
+            if ( cache.containsKey( key ) )
+            {
+                cache.remove( key );
+            }
+
+            cache.put( key, new CacheableWrapper( value, System.currentTimeMillis() ) );
+        }
+
+        manageCache();
+    }
+
+    public Object remove( Object key )
+    {
+        synchronized ( cache )
+        {
+            if ( cache.containsKey( key ) )
+            {
+                return cache.remove( key );
+            }
+        }
+
+        return null;
+    }
+
+    private void manageCache()
+    {
+        synchronized ( cache )
+        {
+            Iterator iterator = cache.entrySet().iterator();
+            if ( cacheMaxSize == 0 )
+            {
+                // desired HitRatio is reached, we can trim the cache to conserve memory
+                if ( cacheHitRatio <= stats.getCacheHitRate() )
+                {
+                    iterator.next();
+                    iterator.remove();
+                }
+            }
+            else if ( cache.size() > cacheMaxSize )
+            {
+                // maximum cache size is reached
+                while ( cache.size() > cacheMaxSize )
+                {
+                    iterator.next();
+                    iterator.remove();
+                }
+            }
+            else
+            {
+                // even though the max has not been reached, the desired HitRatio is already reached,
+                // so we can trim the cache to conserve memory
+                if ( cacheHitRatio <= stats.getCacheHitRate() )
+                {
+                    iterator.next();
+                    iterator.remove();
+                }
+            }
+        }
+    }
+
+    /** 
+     * @see org.codehaus.plexus.cache.Cache#getRefreshTime()
+     */
+    public int getRefreshTime()
+    {
+        return refreshTime;
+    }
+
+    /** 
+     *
+     */
+    public void setRefreshTime( int refreshTime )
+    {
+        this.refreshTime = refreshTime;
+    }
+
+    /**
+     * @return
+     */
+    protected boolean isCacheAvailable()
+    {
+        return this.getRefreshTime() >= 0;
+    }
+
+    public double getCacheHitRatio()
+    {
+        return cacheHitRatio;
+    }
+
+    public void setCacheHitRatio( double cacheHitRatio )
+    {
+        this.cacheHitRatio = cacheHitRatio;
+    }
+
+    public int getCacheMaxSize()
+    {
+        return cacheMaxSize;
+    }
+
+    public void setCacheMaxSize( int cacheMaxSize )
+    {
+        this.cacheMaxSize = cacheMaxSize;
+    }
+
+    public Stats getStats()
+    {
+        return stats;
+    }
+}

Propchange: archiva/redback/redback-components/trunk/spring-cache/spring-cache-providers/spring-cache-hashmap/src/main/java/org/codehaus/plexus/cache/hashmap/HashMapCache.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: archiva/redback/redback-components/trunk/spring-cache/spring-cache-providers/spring-cache-hashmap/src/main/java/org/codehaus/plexus/cache/hashmap/HashMapCache.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: archiva/redback/redback-components/trunk/spring-cache/spring-cache-providers/spring-cache-hashmap/src/main/java/org/codehaus/plexus/cache/hashmap/HashMapCacheCreator.java
URL: http://svn.apache.org/viewvc/archiva/redback/redback-components/trunk/spring-cache/spring-cache-providers/spring-cache-hashmap/src/main/java/org/codehaus/plexus/cache/hashmap/HashMapCacheCreator.java?rev=1310262&view=auto
==============================================================================
--- archiva/redback/redback-components/trunk/spring-cache/spring-cache-providers/spring-cache-hashmap/src/main/java/org/codehaus/plexus/cache/hashmap/HashMapCacheCreator.java (added)
+++ archiva/redback/redback-components/trunk/spring-cache/spring-cache-providers/spring-cache-hashmap/src/main/java/org/codehaus/plexus/cache/hashmap/HashMapCacheCreator.java Fri Apr  6 09:33:40 2012
@@ -0,0 +1,44 @@
+package org.codehaus.plexus.cache.hashmap;
+
+/*
+ * Copyright 2001-2007 The Codehaus.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import org.codehaus.plexus.cache.Cache;
+import org.codehaus.plexus.cache.CacheException;
+import org.codehaus.plexus.cache.CacheHints;
+import org.codehaus.plexus.cache.factory.CacheCreator;
+
+/**
+ * HashMapCacheCreator
+ *
+ * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
+ * @version $Id$
+ */
+public class HashMapCacheCreator
+    implements CacheCreator
+{
+    public Cache createCache( CacheHints cacheHint )
+        throws CacheException
+    {
+        // Supports NO CacheHints.
+
+        HashMapCache cache = new HashMapCache();
+
+        cache.initialize();
+
+        return cache;
+    }
+}

Propchange: archiva/redback/redback-components/trunk/spring-cache/spring-cache-providers/spring-cache-hashmap/src/main/java/org/codehaus/plexus/cache/hashmap/HashMapCacheCreator.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: archiva/redback/redback-components/trunk/spring-cache/spring-cache-providers/spring-cache-hashmap/src/main/java/org/codehaus/plexus/cache/hashmap/HashMapCacheCreator.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: archiva/redback/redback-components/trunk/spring-cache/spring-cache-providers/spring-cache-hashmap/src/main/resources/META-INF/plexus-cache.properties
URL: http://svn.apache.org/viewvc/archiva/redback/redback-components/trunk/spring-cache/spring-cache-providers/spring-cache-hashmap/src/main/resources/META-INF/plexus-cache.properties?rev=1310262&view=auto
==============================================================================
--- archiva/redback/redback-components/trunk/spring-cache/spring-cache-providers/spring-cache-hashmap/src/main/resources/META-INF/plexus-cache.properties (added)
+++ archiva/redback/redback-components/trunk/spring-cache/spring-cache-providers/spring-cache-hashmap/src/main/resources/META-INF/plexus-cache.properties Fri Apr  6 09:33:40 2012
@@ -0,0 +1 @@
+cache.creator=org.codehaus.plexus.cache.hashmap.HashMapCacheCreator
\ No newline at end of file

Propchange: archiva/redback/redback-components/trunk/spring-cache/spring-cache-providers/spring-cache-hashmap/src/main/resources/META-INF/plexus-cache.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: archiva/redback/redback-components/trunk/spring-cache/spring-cache-providers/spring-cache-hashmap/src/main/resources/META-INF/plexus-cache.properties
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: archiva/redback/redback-components/trunk/spring-cache/spring-cache-providers/spring-cache-hashmap/src/main/resources/META-INF/spring-context.xml
URL: http://svn.apache.org/viewvc/archiva/redback/redback-components/trunk/spring-cache/spring-cache-providers/spring-cache-hashmap/src/main/resources/META-INF/spring-context.xml?rev=1310262&view=auto
==============================================================================
--- archiva/redback/redback-components/trunk/spring-cache/spring-cache-providers/spring-cache-hashmap/src/main/resources/META-INF/spring-context.xml (added)
+++ archiva/redback/redback-components/trunk/spring-cache/spring-cache-providers/spring-cache-hashmap/src/main/resources/META-INF/spring-context.xml Fri Apr  6 09:33:40 2012
@@ -0,0 +1,33 @@
+<?xml version="1.0"?>
+
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+  -->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+           http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+           http://www.springframework.org/schema/context 
+           http://www.springframework.org/schema/context/spring-context-3.0.xsd">
+
+  <context:annotation-config />
+  <context:component-scan 
+    base-package="org.codehaus.plexus.cache.hashmap"/>
+ 
+</beans>
\ No newline at end of file

Propchange: archiva/redback/redback-components/trunk/spring-cache/spring-cache-providers/spring-cache-hashmap/src/main/resources/META-INF/spring-context.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: archiva/redback/redback-components/trunk/spring-cache/spring-cache-providers/spring-cache-hashmap/src/main/resources/META-INF/spring-context.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: archiva/redback/redback-components/trunk/spring-cache/spring-cache-providers/spring-cache-hashmap/src/test/java/org/codehaus/plexus/cache/hashmap/HashMapCacheTest.java
URL: http://svn.apache.org/viewvc/archiva/redback/redback-components/trunk/spring-cache/spring-cache-providers/spring-cache-hashmap/src/test/java/org/codehaus/plexus/cache/hashmap/HashMapCacheTest.java?rev=1310262&view=auto
==============================================================================
--- archiva/redback/redback-components/trunk/spring-cache/spring-cache-providers/spring-cache-hashmap/src/test/java/org/codehaus/plexus/cache/hashmap/HashMapCacheTest.java (added)
+++ archiva/redback/redback-components/trunk/spring-cache/spring-cache-providers/spring-cache-hashmap/src/test/java/org/codehaus/plexus/cache/hashmap/HashMapCacheTest.java Fri Apr  6 09:33:40 2012
@@ -0,0 +1,81 @@
+package org.codehaus.plexus.cache.hashmap;
+
+/*
+ * Copyright 2001-2007 The Codehaus.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import org.codehaus.plexus.cache.Cache;
+import org.codehaus.plexus.cache.test.AbstractCacheTestCase;
+
+import javax.inject.Inject;
+import javax.inject.Named;
+
+/**
+ * HashMapCacheTest 
+ *
+ * @author <a href="mailto:joakim@erdfelt.com">Joakim Erdfelt</a>
+ * @version $Id$
+ */
+public class HashMapCacheTest
+    extends AbstractCacheTestCase
+{
+    @Inject @Named(value = "cache#hashmap")
+    Cache cache;
+
+    @Inject @Named(value = "cache#alwaysrefresh")
+    Cache cachealwaysrefresh;
+
+    @Inject @Named(value = "cache#onesecondrefresh")
+    Cache cacheonesecondrefresh;
+
+    @Inject @Named(value = "cache#onesecondrefresh")
+    Cache cachetwosecondrefresh;
+
+    @Override
+    public Cache getCache()
+    {
+        return cache;
+    }
+
+    public Cache getAlwaysRefresCache()
+        throws Exception
+    {
+        return cachealwaysrefresh;
+    }
+
+    public Cache getNeverRefresCache()
+        throws Exception
+    {
+        return cache;
+    }
+
+    public Cache getOneSecondRefresCache()
+        throws Exception
+    {
+        return cacheonesecondrefresh;
+    }
+
+    public Cache getTwoSecondRefresCache()
+        throws Exception
+    {
+        return cachetwosecondrefresh;
+    }
+
+    public Class getCacheClass()
+    {
+        return HashMapCache.class;
+    }
+
+}
\ No newline at end of file

Propchange: archiva/redback/redback-components/trunk/spring-cache/spring-cache-providers/spring-cache-hashmap/src/test/java/org/codehaus/plexus/cache/hashmap/HashMapCacheTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: archiva/redback/redback-components/trunk/spring-cache/spring-cache-providers/spring-cache-hashmap/src/test/java/org/codehaus/plexus/cache/hashmap/HashMapCacheTest.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: archiva/redback/redback-components/trunk/spring-cache/spring-cache-providers/spring-cache-hashmap/src/test/resources/spring-context.xml
URL: http://svn.apache.org/viewvc/archiva/redback/redback-components/trunk/spring-cache/spring-cache-providers/spring-cache-hashmap/src/test/resources/spring-context.xml?rev=1310262&view=auto
==============================================================================
--- archiva/redback/redback-components/trunk/spring-cache/spring-cache-providers/spring-cache-hashmap/src/test/resources/spring-context.xml (added)
+++ archiva/redback/redback-components/trunk/spring-cache/spring-cache-providers/spring-cache-hashmap/src/test/resources/spring-context.xml Fri Apr  6 09:33:40 2012
@@ -0,0 +1,54 @@
+<?xml version="1.0"?>
+
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+  -->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+           http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+           http://www.springframework.org/schema/context 
+           http://www.springframework.org/schema/context/spring-context-3.0.xsd">
+
+
+  <bean name="cache#hashmap" class="org.codehaus.plexus.cache.hashmap.HashMapCache">
+    <property name="cacheHitRatio" value="1.0"/>
+    <property name="cacheMaxSize" value="0"/>
+    <property name="refreshTime" value="0"/>
+  </bean>
+
+  <bean name="cache#alwaysrefresh" class="org.codehaus.plexus.cache.hashmap.HashMapCache">
+    <property name="cacheHitRatio" value="1.0"/>
+    <property name="cacheMaxSize" value="0"/>
+    <property name="refreshTime" value="-1"/>
+  </bean>
+
+  <bean name="cache#onesecondrefresh" class="org.codehaus.plexus.cache.hashmap.HashMapCache">
+    <property name="cacheHitRatio" value="1.0"/>
+    <property name="cacheMaxSize" value="0"/>
+    <property name="refreshTime" value="1"/>
+  </bean>
+
+  <bean name="cache#twosecondrefresh" class="org.codehaus.plexus.cache.hashmap.HashMapCache">
+    <property name="cacheHitRatio" value="1.0"/>
+    <property name="cacheMaxSize" value="0"/>
+    <property name="refreshTime" value="2"/>
+  </bean>
+ 
+</beans>
\ No newline at end of file

Propchange: archiva/redback/redback-components/trunk/spring-cache/spring-cache-providers/spring-cache-hashmap/src/test/resources/spring-context.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: archiva/redback/redback-components/trunk/spring-cache/spring-cache-providers/spring-cache-hashmap/src/test/resources/spring-context.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: archiva/redback/redback-components/trunk/spring-cache/spring-cache-providers/spring-cache-oscache/pom.xml
URL: http://svn.apache.org/viewvc/archiva/redback/redback-components/trunk/spring-cache/spring-cache-providers/spring-cache-oscache/pom.xml?rev=1310262&view=auto
==============================================================================
--- archiva/redback/redback-components/trunk/spring-cache/spring-cache-providers/spring-cache-oscache/pom.xml (added)
+++ archiva/redback/redback-components/trunk/spring-cache/spring-cache-providers/spring-cache-oscache/pom.xml Fri Apr  6 09:33:40 2012
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Licensed under the Apache License, Version 2.0 (the "License");
+  ~ you may not use this file except in compliance with the License.
+  ~ You may obtain a copy of the License at
+  ~
+  ~      http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
+  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~ See the License for the specific language governing permissions and
+  ~ limitations 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">
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>org.codehaus.redback.components.cache</groupId>
+    <artifactId>spring-cache-providers</artifactId>
+    <version>2.0-SNAPSHOT</version>
+  </parent>
+
+  <artifactId>spring-cache-oscache</artifactId>
+  <name>Spring Cache Provider :: oscache</name>
+
+  <description>Commons Cache API : oscache implementation.</description>
+
+  <packaging>jar</packaging>
+
+  <dependencies>
+    <dependency>
+      <groupId>opensymphony</groupId>
+      <artifactId>oscache</artifactId>
+      <version>2.4</version>
+      <exclusions>
+        <exclusion>
+          <groupId>javax.jms</groupId>
+          <artifactId>jms</artifactId>
+        </exclusion>
+      </exclusions>
+    </dependency>
+    <dependency>
+      <groupId>commons-logging</groupId>
+      <artifactId>commons-logging</artifactId>
+      <version>1.1.1</version>
+    </dependency>
+  </dependencies>
+</project>

Propchange: archiva/redback/redback-components/trunk/spring-cache/spring-cache-providers/spring-cache-oscache/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: archiva/redback/redback-components/trunk/spring-cache/spring-cache-providers/spring-cache-oscache/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision