If I bring the system to run level 5 I would expect HK2 would consider the run level of the available services and returns an instance of PrimaryService if I try to inject/locate an instance of ServiceContract.
Right now HK2 service locator knows about all the discovered descriptors and during service location the service narrowing logic will return a service based on its natural ordering without any regard for the current run level of the system and the run level of the available services.
Ideally HK2 should return a ServiceContract implementation at or below the current service level.
Given two run level services that implement the same contract:
If I bring the system to run level 5 I would expect HK2 would consider the run level of the available services and returns an instance of PrimaryService if I try to inject/locate an instance of ServiceContract.
Right now HK2 service locator knows about all the discovered descriptors and during service location the service narrowing logic will return a service based on its natural ordering without any regard for the current run level of the system and the run level of the available services.
Ideally HK2 should return a ServiceContract implementation at or below the current service level.
Environment
Linux 64bit, Java 8
Affected Versions
[2.3.0]