For my own hosted JAX-WS (Soap) web services, I can add handlers by defining a handler-chain file and adding them there, for instance:
@WebService(serviceName = "My_Service", portName = "My_Port_Soap12", targetNamespace = "urn:mynamespace")
@HandlerChain(file = "handler-chain.xml")
public class MyService { ... }
In my handler-chain.xml:
<?xml version="1.0" encoding="UTF-8"?>
<handler-chains xmlns="http://java.sun.com/xml/ns/javaee">
<handler-chain>
<handler>
<handler-class>MyHandler</handler-class>
</handler>
</handler-chain>
</handler-chains>
Is there any way I can do the same for a JAX-RS Rest service?
I need some custom authentication logic which I need to add to my services.