As I understand, it's possible to get resource class and method using injected ResourceInfo, but I need to execute some method of my resource class in request filter, so I need to get this object.
Or maybe the whole idea of getting exact object is wrong in this case?
UPD: Here is a description of the original problem:
For example I have resource that returns all users and it also can return a subresource for particular user:
@Path("users") public class UsersResource {
@GET List<User> getUsers() {...}
@Path("{id}") UserSubresource getById(PathParam("id") String id) {
return new UserSubresource(getUserById(id));
}
}
Here is UserSubresource:
public class UserSubresource {
User user;
@GET public User getUser() {return user;}
...
public boolean isAccessible() {
return user.isAccessibleByCurrentUser();
}
}
And I need to check access rights for getUser() method, I can't check permissions before I find out actual user. I understand that I can add this check in getUser() method itself, but this situation is the same for some other entities in my application, so I want more common solution.