Greetings,

I'd would like to understand if @Named can be used programmatically to
resolve Guice 'managed' instances. Here's the scenario:

*  There are a bunch of Command<REQ, RESP> instances bound in a
module, say CommandModule:

for example:
                bind(new TypeLiteral<ICommand<String, Movie>>() {
                }).to(new TypeLiteral<GetMovieDetailsCommand>() {
                });

                bind(new TypeLiteral<ICommand<String, Play>>() {
                }).to(new TypeLiteral<GetPlayDetailsCommand>() {
                });

*  A client can send a command invocation request that contains the
Type of the Request, and Type of expected Response.
            GenericInvoker.invokeCommand(String.class, title,
Movie.class);

*  A CommandResolver makes use of this info to resolve to an
appropriate implementation.

Problem:
I would like to make use of @Named so that the CommandResolver
implementation can resolve cases where two or more Command
implementations can expect same Type of request and return same Type
of response.

Is it possible to make use to @Named programmatically by the
CommandResolver implementation to differentiate between Command
implementation that expect same Type of request and response.

I would appreciate if there are any other/better ideas that this could
be accomplished.

Many thanks,

Rahul
--~--~---------~--~----~------------~-------~--~----~
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