users@jersey.java.net

Intercepting requests to resources and invoking other methods which in turn invokes the resource method

From: DaHoopster <hwang_at_myvest.com>
Date: Thu, 9 Sep 2010 15:04:19 -0700 (PDT)

Hi all,

So I am developing web services that need to have change of roles
dynamically. The users have a hierarchical role system. When user first logs
in, it's at the top of the role hierarchy. So by default, the service only
access resources available to the top level hierarchy. We have requirements
that the web services should be able to take a query param of role and the
services will access the the resources available to the provided role.

The complication is that at the business logic layer, we can only do
"getCurrentRole()". There is a framework in our current code base that
allows this to happen:

ApplicationServices.asRole(int roleID){
    public void invoke()
    {
        // other code
    }
}

I would like to execute the appropriate resource method inside the invoke()
method there after intercepting the request.

Can someone advise me on how to do this?
-- 
View this message in context: http://jersey.576304.n2.nabble.com/Intercepting-requests-to-resources-and-invoking-other-methods-which-in-turn-invokes-the-resource-metd-tp5516338p5516338.html
Sent from the Jersey mailing list archive at Nabble.com.