title: Persist guava cache on shutdown
body: <p>I use the following guava cache to store messages for a specific time waiting for a possible response. So I use the cache more like a timeout for messages:</p>
  
  <pre><code>Cache cache = CacheBuilder.newBuilder().expireAfterWrite(7, TimeUnit.DAYS).build();
  cache.put(id,message);
  ...
  cache.getIfPresent(id);
  </code></pre>
  
  <p>In the end I need to persist the messages with its currently 'timeout' information on shutdown
  and restore it on startup with the internal already expired times per entry. I couldn't find any methods which give me access to the time information, so I can handle it by myself.</p>
  
  <p>The <a href="http://code.google.com/p/guava-libraries/wiki/CachesExplained" rel="nofollow">gauva wiki</a> says:</p>
  
  <blockquote>
    <p>Your application will not need to store more data than what would fit in RAM. (Guava caches are local to a single run of your application. They do not store data in files, or on outside servers. If this does not fit your needs, consider a tool like Memcached.)</p>
  </blockquote>
  
  <p>Do you think this restriction address also a 'timeout' map to persist on shutdown?</p>