users@jsr311.java.net

JAXRS handlers

From: Sergey Beryozkin <sergey.beryozkin_at_iona.com>
Date: Fri, 28 Mar 2008 14:17:48 -0000

Hi

Is there any chance for JAX-RS to introduce a notion of handlers, such that they can be invoked before/after the
actual resource class has been invoked upon ? There's a number of container-specific ways to handle it, for ex, servlet filters can be used in a Servlet-aware container, but it would be handy to have a notion of handlers in JAX-RS as well.

For ex.

interface ResourceHandler {

    Response handle(UriInfo uriInfo, Class resourceClass);
}

For inbound handlers, if Response is null the the invocation continues otherwise this Response is what needs to be returned
Similar (if not the same) interface can be created for out-bound handlers.

Such handlers can be used to extend the base JAX-RS implementation, as far as handling of various queries is concerned.
For ex.
GET /foo?$coolFeatureQuery

will result in either a per or post handler handling the request/response somehow.

Does it make sense ?

Thanks, Sergey



----------------------------
IONA Technologies PLC (registered in Ireland)
Registered Number: 171387
Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland