jclouds/jclouds — pull request #300 by aledsage (2012-01-09 18:07:36+00:00)
Title: Issue 764: added Suppliers2.memoizeWithExpirationOnAbsoluteInterval

Fix for issue 764:

* Added Suppliers2.memoizeWithExpirationOnAbsoluteInterval

* Added Suppliers2Test with copy of guava tests, plus testMemoizeKeepsValueForFullDurationWhenDelegateCallIsSlow

---
Did manual test in AWS using the code below (not included):

public void testGetImagesUsesCacheForFullTimePeriod() throws Exception {
Stopwatch stopwatch = new Stopwatch();
stopwatch.start();

for (int i = 0; i < 60*2; i++) {
long precall = stopwatch.elapsedMillis();
context.getComputeService().listImages();
System.out.println("Got image list at time "+stopwatch.elapsedMillis()+"; call took "+(stopwatch.elapsedMillis()-precall));
Thread.sleep(1000);
}
}