Issue 279: code glitch caught by byteman

This commit is contained in:
Adrian Cole 2010-06-11 18:32:51 -07:00
parent c2e1d33d0c
commit bb3de69eb8
1 changed files with 7 additions and 7 deletions

View File

@ -162,14 +162,14 @@ public abstract class BaseVCloudRestClientModule<S extends VCloudClient, A exten
return new ExpirableSupplier<VCloudSession>( return new ExpirableSupplier<VCloudSession>(
new RetryOnTimeOutExceptionSupplier<VCloudSession>(new Supplier<VCloudSession>() { new RetryOnTimeOutExceptionSupplier<VCloudSession>(new Supplier<VCloudSession>() {
public VCloudSession get() { public VCloudSession get() {
// http://code.google.com/p/google-guice/issues/detail?id=483
// guice doesn't remember when singleton providers throw exceptions.
// in this case, if describeRegions fails, it is called again for
// each provider method that depends on it. To short-circuit this,
// we remember the last exception trusting that guice is single-threaded
if (authException != null)
throw authException;
try { try {
// http://code.google.com/p/google-guice/issues/detail?id=483
// guice doesn't remember when singleton providers throw exceptions.
// in this case, if describeRegions fails, it is called again for
// each provider method that depends on it. To short-circuit this,
// we remember the last exception trusting that guice is single-threaded
if (authException != null)
throw authException;
return login.login().get(10, TimeUnit.SECONDS); return login.login().get(10, TimeUnit.SECONDS);
} catch (AuthorizationException e) { } catch (AuthorizationException e) {
BaseVCloudRestClientModule.this.authException = e; BaseVCloudRestClientModule.this.authException = e;