@@ -0,0 +1,818 @@
+package tools.devnull.boteco.util;%0A%0Aimport tools.devnull.boteco.OsgiFilter;%0Aimport tools.devnull.boteco.ServiceRegistry;%0A%0Aimport java.lang.reflect.Parameter;%0Aimport java.util.function.Function;%0A%0A/**%0A * A parameter resolver that uses an OSGi Registry%0A *%0A * @see OsgiFilter%0A */%0Apublic class OsgiParameterResolver implements Function%3CParameter, Object%3E %7B%0A%0A  private final ServiceRegistry serviceRegistry;%0A%0A  public OsgiParameterResolver(ServiceRegistry serviceRegistry) %7B%0A    this.serviceRegistry = serviceRegistry;%0A  %7D%0A%0A  @Override%0A  public Object apply(Parameter parameter) %7B%0A    String query = null;%0A    if (parameter.isAnnotationPresent(OsgiFilter.class)) %7B%0A      query = parameter.getAnnotation(OsgiFilter.class).value();%0A    %7D%0A    return this.serviceRegistry.locate(parameter.getType()).filter(query).one();%0A  %7D%0A%0A%7D%0A

create a component for using the OSGi Registry as a parameter resolver