/**
* Producer method for proxied JAX-RS interfaces - REST Clients This method is not registered as a producer method by
* default. It is registered by {@link RestClientExtension} only if there is an appropriate injection point.
*/
public Object produceRestClient(InjectionPoint ip, ClientExecutor executor) {
RestClient qualifier = AnnotationInspector.getAnnotation(ip.getAnnotated(), RestClient.class, manager);
if (qualifier == null || !(ip.getType() instanceof Class<?>)) {
// this should never happen
throw new IllegalStateException("@RestClient injection point " + ip.getMember() + " is not valid.");
}
Class<?> clazz = (Class<?>) ip.getType();
String url = interpolator.interpolate(qualifier.value());
return ProxyFactory.create(clazz, url, executor);
}