Also new-in-2.0 ThrowingProvider and ThrowingProviderBinder

On Nov 5, 10:07 am, Bob Lee <[email protected]> wrote:
> On Thu, Nov 5, 2009 at 9:33 AM, Pedro Felix <[email protected]> wrote:
> > 1) Does this behavior apply to both checked and unchecked exceptions?
>
> Yes.
>
> > 2) Does this behavior applies to exceptions throwed during property
> > injection?
>
> Yes.
>
> > 3) If a dependency is optional, the occurrence of an exception when
> > creating the dependency object ends the "getInstance" or it this
> > dependency ignored?
>
> The exception is thrown.
>
> If you want to throw and catch an exception, I'd recommend implementing a
> custom factory that throws a checked exception. For example:
>
>   interface MyProvider<T> {
>     T get() throws MyException;
>   }
>
> Bob
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"google-guice" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/google-guice?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to