|
Generated by JDiff |
||||||||
PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES |
This file contains all the changes in documentation in the packagecom.google.inject.throwingproviders
as colored differences. Deletions are shownlike this, and additions are shown like this.
If no deletions or additions are shown in an entry, the HTML tags will be what has changed. The new HTML tags are shown in the differences. If no documentation existed, and then some was added in a later version, this change is noted in the appropriate class pages of differences, but the change is not shown on this page. Only changes in existing text are shown here. Similarly, documentation which was inherited from another class or interface is not shown here.
Note that an HTML error in the new documentation may cause the display of other documentation changes to be presented incorrectly. For instance, failure to close a <code> tag will cause all subsequent paragraphs to be displayed differently.
Annotates methods of a com.google.inject.Module to createaa CheckedProvidermethod binding that can throw exceptions.TheThe method's return type isboundbound to a CheckedProvider that canbebe injected. Guice willpasspass dependencies to the method as parameters.InstallInstall {@literal @}CheckedProvidesCheckedProvides methods by using ThrowingProviderBinder.forModule(com.google.inject.Module) on the module where the methods are declared. @author sameb@google.com (Sam Berlin) @since 3.0
Builds a binding for a CheckedProvider.
You can use a fluent API and custom providers:
or, you can use throwing provider methods:ThrowingProviderBinder.create(binder()) .bind(RemoteProvider.class, Customer.class) .to(RemoteCustomerProvider.class) .in(RequestScope.class);
You also can declare that a CheckedProvider construct a particular class whose constructor throws an exception:class MyModule extends AbstractModule { configure() { ThrowingProviderBinder.install(this, binder()); } {@literal @}CheckedProvides(RemoteProvider.class) {@literal @}RequestScope Customer provideCustomer(FlakyCustomerCreator creator) throws RemoteException { return creator.getCustomerOrThrow(); } }
@author jmourits@google.com (Jerome Mourits) @author jessewilson@google.com (Jesse Wilson) @author sameb@google.com (Sam Berlin)ThrowingProviderBinder.create(binder()) .bind(RemoteProvider.class, Customer.class) .providing(CustomerImpl.class) .in(RequestScope.class);