001 /* 002 @license.text@ 003 */ 004 package biz.hammurapi.cache; 005 006 import biz.hammurapi.config.Component; 007 import biz.hammurapi.util.Acceptor; 008 009 010 /** 011 * @author Pavel Vlasov 012 * @version $Revision: 1.2 $ 013 */ 014 public interface Cache extends Producer, Component { 015 /** 016 * Puts entry to cache 017 * @param key Key 018 * @param value Value 019 * @param time Timestamp (last modified) 020 * @param expirationTime Expiration time 021 */ 022 void put(Object key, Object value, long time, long expirationTime); 023 024 /** 025 * Removes all cache entries 026 */ 027 void clear(); 028 /** 029 * Removes entry with specified key 030 * @param key 031 */ 032 void remove(Object key); 033 /** 034 * Removes keys accepted by acceptor 035 * @param acceptor 036 */ 037 void remove(Acceptor acceptor); 038 039 /** 040 * 041 * @return true if not shut down 042 */ 043 boolean isActive(); 044 }