@Override protected void configure() { bind(new TypeLiteral<RestContext<CloudStackDomainClient, CloudStackDomainAsyncClient>>() { }).to(new TypeLiteral<RestContextImpl<CloudStackDomainClient, CloudStackDomainAsyncClient>>() { }); bind(new TypeLiteral<RestContext<CloudStackGlobalClient, CloudStackGlobalAsyncClient>>() { }).to(new TypeLiteral<RestContextImpl<CloudStackGlobalClient, CloudStackGlobalAsyncClient>>() { }); bind(CredentialType.class).toProvider(CredentialTypeFromPropertyOrDefault.class); // session client is used directly for filters and retry handlers, so let's bind it explicitly bindSyncToAsyncHttpApi(binder(), SessionClient.class, SessionAsyncClient.class); bindSyncToAsyncHttpApi(binder(), CloudStackDomainClient.class, CloudStackDomainAsyncClient.class); bindSyncToAsyncHttpApi(binder(), CloudStackGlobalClient.class, CloudStackGlobalAsyncClient.class); bind(HttpRetryHandler.class).annotatedWith(ClientError.class).to(InvalidateSessionAndRetryOn401AndLogoutOnClose.class); super.configure(); }
@Override protected void bindErrorHandlers() { bind(HttpErrorHandler.class).annotatedWith(Redirection.class).to(CloudStackErrorHandler.class); bind(HttpErrorHandler.class).annotatedWith(ClientError.class).to(CloudStackErrorHandler.class); bind(HttpErrorHandler.class).annotatedWith(ServerError.class).to(CloudStackErrorHandler.class); }
@Override protected void bindErrorHandlers() { bind(HttpErrorHandler.class).annotatedWith(Redirection.class).to(CloudStackErrorHandler.class); bind(HttpErrorHandler.class).annotatedWith(ClientError.class).to(CloudStackErrorHandler.class); bind(HttpErrorHandler.class).annotatedWith(ServerError.class).to(CloudStackErrorHandler.class); }
@Override protected void configure() { bind(new TypeLiteral<RestContext<CloudStackDomainClient, CloudStackDomainAsyncClient>>() { }).to(new TypeLiteral<RestContextImpl<CloudStackDomainClient, CloudStackDomainAsyncClient>>() { }); bind(new TypeLiteral<RestContext<CloudStackGlobalClient, CloudStackGlobalAsyncClient>>() { }).to(new TypeLiteral<RestContextImpl<CloudStackGlobalClient, CloudStackGlobalAsyncClient>>() { }); bind(CredentialType.class).toProvider(CredentialTypeFromPropertyOrDefault.class); // session client is used directly for filters and retry handlers, so let's bind it explicitly bindSyncToAsyncHttpApi(binder(), SessionClient.class, SessionAsyncClient.class); bindSyncToAsyncHttpApi(binder(), CloudStackDomainClient.class, CloudStackDomainAsyncClient.class); bindSyncToAsyncHttpApi(binder(), CloudStackGlobalClient.class, CloudStackGlobalAsyncClient.class); bind(HttpRetryHandler.class).annotatedWith(ClientError.class).to(InvalidateSessionAndRetryOn401AndLogoutOnClose.class); super.configure(); }
@Override protected void installLocations() { super.installLocations(); bind(ImplicitLocationSupplier.class).to(OnlyLocationOrFirstZone.class).in(Scopes.SINGLETON); }
@Override protected void installLocations() { super.installLocations(); bind(ImplicitLocationSupplier.class).to(OnlyLocationOrFirstZone.class).in(Scopes.SINGLETON); }