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; }
public String store(Object data) throws IOException { String id = idGenerator.generateId(); store(id, data); return id; }