-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Currently, a filter method has no parameter.
It is possible to filter a service provider with a system property but it uses a static global variable. That global variable makes it difficult to test and prevents some use cases.
It could be interesting to allow a sorter method to have one parameter to inject those properties.
@ServiceDefinition
interface MyService {
@ServiceFilter
boolean isAvailable(Properties properties);
}
@ServiceProvider
class Impl implements MyService {
@Override
public boolean isAvailable(Properties properties) {
return Objects.equals(properties.getProperty("os.name"), "Windows 10");
}
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request