javax.ws.rs.ext
Interface RequestFilter


public interface RequestFilter

Interface implemented by filters invoked at the Pre extension point. Filters implementing this interface MUST be annotated with Provider.

As part of the client API, these filters are executed before the HTTP invocation. As part of the server API, these filters are executed before the resource method is called but after it has been matched. If processing is required before resource matching, a PreMatchRequestFilter should be used instead.

Since:
2.0
Author:
Santiago Pericas-Geertsen, Bill Burke
See Also:
PreMatchRequestFilter

Method Summary
 void preFilter(FilterContext context)
          Filter method called at the Pre extension point.
 

Method Detail

preFilter

void preFilter(FilterContext context)
               throws IOException

Filter method called at the Pre extension point. I.e., before the HTTP invocation in the client and before the resource method invocation (but after resource matching) in the server.

Filters in a chain are ordered according to their binding priority (see BindingPriority). If a request filter produces a response by calling FilterContext.setResponse(javax.ws.rs.core.Response), the execution of the request chain is stopped and the response is returned without calling the corresponding resource method (Server API) or HTTP invocation (Client API). For example, a caching filter may produce a response in this way. Note that responses produced in this manner are still processed by the response filter chain.

Parameters:
context - invocation context
Throws:
IOException - if an I/O exception occurs


Copyright © 2007-2012 Oracle Corporation. All Rights Reserved. Use is subject to license terms.