public void insert(Object key, Object value) 
   {
      if( entryMap.containsKey(key) )
         throw new IllegalStateException("Attempt to insert duplicate entry");
      TimedEntry entry = null;
      if( (value instanceof TimedEntry) == false )
      {   // Wrap the value in a DefaultTimedEntry
         entry = new DefaultTimedEntry(defaultLifetime, value);
      }
      else
      {
         entry = (TimedEntry) value;
      }
      entry.init(now);
      entryMap.put(key, entry);
   }
public void insert(Object key, Object value) 
   {
      if( entryMap.containsKey(key) )
         throw new IllegalStateException("Attempt to insert duplicate entry");
      TimedEntry entry = null;
      if( (value instanceof TimedEntry) == false )
      {   
         entry = new DefaultTimedEntry(defaultLifetime, value);
      }
      else
      {
         entry = (TimedEntry) value;
      }
      entry.init(now);
      entryMap.put(key, entry);
   }
public void insert ( Object key , Object value ) { if ( entryMap . containsKey ( key ) ) throw new IllegalStateException ( "Attempt to insert duplicate entry" ) ; TimedEntry entry = null ; if ( ( value instanceof TimedEntry ) == false ) { // Wrap the value in a DefaultTimedEntry entry = new DefaultTimedEntry ( defaultLifetime , value ) ; } else { entry = ( TimedEntry ) value ; } entry . init ( now ) ; entryMap . put ( key , entry ) ; }
Insert a value into the cache. In order to have the cache entry
reshresh itself value would have to implement TimedEntry and
implement the required refresh() method logic.
@param key - the key for the cache entry
@param value - Either an instance of TimedEntry that will be inserted without
change, or an abitrary value that will be wrapped in a non-refreshing
TimedEntry.
Insert a value into the cache . In order to have the cache entry reshresh itself value would have to implement TimedEntry and implement the required refresh () method logic .