KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > slide > projector > store > AbstractStore


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