I have to use a library which provides a jaxrs rest-api for some task. This api is a class implementing an jaxrs annotated interface. Now I have the requirement to build a "wrapper" around one of those endpoints, because some server side checks are required before the access to those resources.
The only working way I found to accomplish this is to disallow the access to those resources completely, add a new resources at a new path and call the original resource via a server-side "rest proxy". Is there any nicer way to do that? I hoped maybe there would be a way to "override" this resource somehow, but I could not find anything anywhere. I also read about sub-resource locators but this did not work since the locator seems to be ignored even at the root path, if there is a matching resource underneath annotated with the full path.
I am using Resteasy. What is the best practice to accomplish this?