2017-05-10 1 views
0

In RestEasy 3.0.16.Finale Version PreProcessInterceptor-Schnittstelle ist veraltet. Also, was ist der richtige Ersatz für diese Schnittstelle. In jboss eap 7 wird RestEasy Version 3.0.16.Final verwendet.Korrekter Ersatz der PreProcessInterceptor-Schnittstelle: RestEasy

Alter Code -

@Provider 
@ServerInterceptor 
@SecurityPrecedence 
public class AbcInterceptor implements PreProcessInterceptor 
{ 
public ServerResponse preProcess(final HttpRequest httpRequest, ResourceMethod resourceMethod) throws Failure, 
     WebApplicationException { 
    // auth logic 

} 
} 

Neuer Code -

@Provider 
@ServerInterceptor 
@SecurityPrecedence 
public class AuthenticationInterceptor 
{ 
public ServerResponse preProcess(HttpRequest httpRequest, ResourceMethodInvoker method) 
     throws Failure, WebApplicationException { 
    // auth logic 

} 
} 

Antwort

1

Die org.jboss.resteasy.spi.interception.PreProcessInterceptor Schnittstelle wird durch die javax.ws.rs ersetzt. container.ContainerRequestFilter Schnittstelle in RESTEasy 3.x.

So können Sie den ContainerRequestFilter für die gleiche verwenden.