java.lang.Object | |
↳ | com.google.inject.throwingproviders.ThrowingProviderBinder |
Builds a binding for a ThrowingProvider
.
You can use a fluent API and custom providers:
ThrowingProviderBinder.create(binder())
.bind(RemoteProvider.class, Customer.class)
.to(RemoteCustomerProvider.class)
.in(RequestScope.class);
or, you can use throwing provider methods:
class MyModule extends AbstractModule {
configure() {
ThrowingProviderBinder.install(this, binder());
}
@ThrowingProvides(RemoteProvider.class)
@RequestScope
Customer provideCustomer(FlakyCustomerCreator creator) throws RemoteException {
return creator.getCustomerOrThrow();
}
}
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
ThrowingProviderBinder.SecondaryBinder<P extends ThrowingProvider> |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Installs @
ThrowingProvides methods. |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Installs @ThrowingProvides
methods.