I have a @Provider that implements a ClientRequestFilter. The provider itself is not discovered at all. When I register it manually, then it is discovered.
ClientBuilder.newBuilder().register(Somefilter.class);
This way however, CDI doesn't inject dependencies into Somefilter.
- AS: WildFly 10
- JAX-RS : Resteasy (built in WildFly)
The code of my Somefilter class looks like this.
@Provider
public class Somefilter implements ClientRequestFilter {
@Inject
private AccountService accountService;
@Override
public void filter(ClientRequestContext requestContext) throws IOException {
System.out.println(accountService);
}
}
The application also has a server part, configured with @Application annotation, using some classes implementing ContainerRequestFilter. These are discovered by Resteasy and even CDI injection works.
So the question is, how can I make client-api related providers inject CDI dependencies.