TimeoutCache.java :  » MVC » fulworx » org » fulworx » core » util » cache » Java Open Source

Java Open Source » MVC » fulworx 
fulworx » org » fulworx » core » util » cache » TimeoutCache.java
package org.fulworx.core.util.cache;

import org.fulworx.core.util.cache.entry.TimeoutEntry;
import org.fulworx.core.rest.restlet.CacheKey;

/**
 * @author teastlack
 * @date Oct 22, 2007
 */
public class TimeoutCache extends SimpleCache
{

    public TimeoutCache(CacheMap cacheObjects)
    {
        super(cacheObjects);
    }

    @Override
    public void addEntry(CacheKey key, Object value)
    {
        addEntry(key, value, -1l);
    }

    public void addEntry(CacheKey key, Object value, long timeoutMilliseconds)
    {
        this.getCacheObjects().put(key, new TimeoutEntry(key, value, timeoutMilliseconds));
    }

}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.