1 package org.apache.slide.projector.store; 2 3 import java.io.IOException ; 4 import java.util.TimerTask ; 5 import java.util.logging.Level ; 6 import java.util.logging.Logger ; 7 8 import org.apache.slide.projector.Store; 9 import org.apache.slide.projector.engine.Scheduler; 10 11 public abstract class AbstractStore implements Store { 12 private final static Logger logger = Logger.getLogger(AbstractStore.class.getName()); 13 14 public void put(final String key, Object value, long timeout) throws IOException { 15 put(key, value); 16 Scheduler.getTimer().schedule(new TimerTask () { 17 public void run() { 18 try { 19 dispose(key); 20 } catch ( IOException exception ) { 21 logger.log(Level.SEVERE, "Could not dispose object with key="+key, exception); 22 } 23 } 24 }, timeout); 25 } 26 } 27 | Popular Tags |