/** * {@inheritDoc} * * Before attempting to load the object, all data older than the specified timeout will first be * removed from the store. */ public Object load(String id) throws IOException { evict(); LOG.debug("Loading object with id:" + id); Entry entry = datas.remove(id); return entry == null ? null : entry.data; }
public synchronized Store open(String name) throws IOException { MemoryStore store = stores.get(name); if (store == null) { if (timeout <= 0) { store = new MemoryStore(idGenerator); } else { store = new TimeoutMemoryStore(idGenerator, timeout); } stores.put(name, store); } return store; }