diff --git a/apis/cloudloadbalancers/src/main/java/org/jclouds/cloudloadbalancers/config/CloudLoadBalancersRestClientModule.java b/apis/cloudloadbalancers/src/main/java/org/jclouds/cloudloadbalancers/config/CloudLoadBalancersRestClientModule.java index 3bd986ff3a..b88c1f3d1c 100644 --- a/apis/cloudloadbalancers/src/main/java/org/jclouds/cloudloadbalancers/config/CloudLoadBalancersRestClientModule.java +++ b/apis/cloudloadbalancers/src/main/java/org/jclouds/cloudloadbalancers/config/CloudLoadBalancersRestClientModule.java @@ -38,6 +38,7 @@ import org.jclouds.cloudloadbalancers.functions.ConvertLB; import org.jclouds.cloudloadbalancers.handlers.ParseCloudLoadBalancersErrorFromHttpResponse; import org.jclouds.cloudloadbalancers.reference.RackspaceConstants; import org.jclouds.http.HttpErrorHandler; +import org.jclouds.http.HttpRetryHandler; import org.jclouds.http.RequiresHttp; import org.jclouds.http.annotation.ClientError; import org.jclouds.http.annotation.Redirection; @@ -51,6 +52,7 @@ import org.jclouds.location.config.ProvideRegionToURIViaProperties; import org.jclouds.logging.Logger.LoggerFactory; import org.jclouds.openstack.OpenStackAuthAsyncClient.AuthenticationResponse; import org.jclouds.openstack.config.OpenStackAuthenticationModule; +import org.jclouds.openstack.handlers.RetryOnRenew; import org.jclouds.openstack.reference.AuthHeaders; import org.jclouds.rest.ConfiguresRestClient; import org.jclouds.rest.config.RestClientModule; @@ -154,4 +156,8 @@ public class CloudLoadBalancersRestClientModule extends ParseCloudLoadBalancersErrorFromHttpResponse.class); } + @Override + protected void bindRetryHandlers() { + bind(HttpRetryHandler.class).annotatedWith(ClientError.class).to(RetryOnRenew.class); + } } diff --git a/apis/cloudloadbalancers/src/test/java/org/jclouds/cloudloadbalancers/features/BaseCloudLoadBalancersAsyncClientTest.java b/apis/cloudloadbalancers/src/test/java/org/jclouds/cloudloadbalancers/features/BaseCloudLoadBalancersAsyncClientTest.java index a97e05c109..05280b785e 100644 --- a/apis/cloudloadbalancers/src/test/java/org/jclouds/cloudloadbalancers/features/BaseCloudLoadBalancersAsyncClientTest.java +++ b/apis/cloudloadbalancers/src/test/java/org/jclouds/cloudloadbalancers/features/BaseCloudLoadBalancersAsyncClientTest.java @@ -49,6 +49,7 @@ import org.testng.annotations.BeforeClass; import com.google.common.base.Supplier; import com.google.common.base.Suppliers; import com.google.common.base.Throwables; +import com.google.common.cache.LoadingCache; import com.google.common.collect.ImmutableMap; import com.google.inject.Module; import com.google.inject.Scopes; @@ -76,8 +77,8 @@ public abstract class BaseCloudLoadBalancersAsyncClientTest extends RestClien // following from CloudLoadBalancersRestClientModule, except we are hard-coding the auth response install(new OpenStackAuthenticationModule() { @Override - protected Supplier provideAuthenticationResponseCache( - final GetAuthenticationResponse getAuthenticationResponse) { + protected Supplier provideAuthenticationResponseSupplier( + final LoadingCache cache) { return Suppliers.ofInstance(new AuthenticationResponse("token", ImmutableMap. of())); } }); diff --git a/apis/nova/src/main/java/org/jclouds/openstack/nova/config/NovaRestClientModule.java b/apis/nova/src/main/java/org/jclouds/openstack/nova/config/NovaRestClientModule.java index 03934f4b7e..205eb746eb 100644 --- a/apis/nova/src/main/java/org/jclouds/openstack/nova/config/NovaRestClientModule.java +++ b/apis/nova/src/main/java/org/jclouds/openstack/nova/config/NovaRestClientModule.java @@ -27,6 +27,7 @@ import org.jclouds.openstack.nova.NovaClient; import org.jclouds.openstack.nova.ServerManagement; import org.jclouds.openstack.nova.handlers.ParseNovaErrorFromHttpResponse; import org.jclouds.http.HttpErrorHandler; +import org.jclouds.http.HttpRetryHandler; import org.jclouds.http.RequiresHttp; import org.jclouds.http.annotation.ClientError; import org.jclouds.http.annotation.Redirection; @@ -35,6 +36,7 @@ import org.jclouds.json.config.GsonModule.DateAdapter; import org.jclouds.json.config.GsonModule.Iso8601DateAdapter; import org.jclouds.openstack.OpenStackAuthAsyncClient.AuthenticationResponse; import org.jclouds.openstack.config.OpenStackAuthenticationModule; +import org.jclouds.openstack.handlers.RetryOnRenew; import org.jclouds.openstack.reference.AuthHeaders; import org.jclouds.rest.ConfiguresRestClient; import org.jclouds.rest.config.RestClientModule; @@ -74,6 +76,11 @@ public class NovaRestClientModule extends RestClientModule