I have successfully created a Guice binding annotation to inject single threaded java.util.concurrent.ExecutorService instances into a constructor.
here is an exampl
Look at NamedImpl that implements @Named and method Names.named(). I think you should have same implementation.
UPDATED
Guice
compares annotations by hashCode(). So, if you wont use @MultiThreaded(poolSize = 5) you should map it before instancing. It seems like dirty workaround, but you can write smt like
for (int i = 1; i < 20; i++){
bind(ExecutorService.class).annotatedWith(Qualifiers.withValue(i)).toProvider(new DependencyProvider(i));
}
If you would like to do this. Remember, that your MultiThreadedImpl should override hashCode in proper way. It could be smt like
@Override
public int hashCode() {
return (127 * "poolSize".hashCode()) ^ value;
}