Hi Sam,
Thanks for reply, I have a MapBinder defined in Module -
private MapBinder<String, ChannelHandler> handlerBinder;
Then bind some ChannelHandlers into MapBinder In the configure method -
@Override
protected void configure() {
handlerBinder.addBinding("A").to(ChannelHandlerA.class); // OK
// I want to bind a ChannelHandlerB here, which is provided by a existing
HandlerProvider (extends CheckedProvider<SSLHandler>)
// But there's no method accepts any subclass of CheckedProvider after
addBinding
handlerBinder.addBinding("B").toProvider(HandlerProvider.class); // Compile
Error
}
Here's my HandlerProvider -
public interface HandlerProvider extends CheckedProvider<ChannelHandler>{
@Override
ChannelHandler get() throws Exception;
}
So how could I handle this ? Or should we introduce "toThrowProvider" ?
Thanks.
在 2014年5月6日星期二UTC+8下午8时48分14秒,Sam Berlin写道:
>
> Can you explain what you would expect the method to do and how you would
> use its result?
>
> sam
>
>
> On Tue, May 6, 2014 at 1:05 AM, Michael <[email protected] <javascript:>>wrote:
>
>> I am using MapBinder for map binding.
>>
>> But I noticed that there's no method to inject instance which provided by
>> throwProvider into mapbinder.
>>
>> So should Guice introduce such "toThrowProvider" method to MapBinder ? (
>> as well as MultiBinder )
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "google-guice" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected] <javascript:>.
>> To post to this group, send email to [email protected]<javascript:>
>> .
>> Visit this group at http://groups.google.com/group/google-guice.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
--
You received this message because you are subscribed to the Google Groups
"google-guice" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-guice.
For more options, visit https://groups.google.com/d/optout.