I have successfully created a Guice binding annotation to inject single threaded java.util.concurrent.ExecutorService instances into a constructor.
here is an example usage:
public class ContainsSingleThreadedExecutorService {
private final ExecutorService executorService;
@Inject
public ContainsSingleThreadedExecutorService(@SingleThreaded ExecutorService executorService) {
this.executorService = executorService;
}
}
I now want to create a similar annotation for multi-threaded executors, specifying the ThreadPool size in the annotation. For example:
public class ContainsMultiThreadedExecutorService {
private final ExecutorService executorService;
@Inject
public ContainsMultiThreadedExecutorService(@MultiThreaded(poolSize = 5) ExecutorService executorService) {
this.executorService = executorService;
}
}
Does anyone out there know how I can access the value of the "poolSize" parameter from a Guice Provider?