I am participating in the hk2 training process coming from Guice. Honestly, I'm still weedy with hk2 complexity and simplicity. I found this solution to work for me, and it is very similar to Guice builder. This looked a little more straightforward than using the ServiceLocatorUtilities class.
public class IOCMockRestModule extends AbstractBinder bind(20000).to(Integer.class).named("MAX_REQUEST_TIMEOUT"); }
And use the entered value:
@Inject protected CustomerResource(ICustomerProvider customerProvider, @Named("MAX_REQUEST_TIMEOUT") int maxTimeoutMillis) {
source share