Dominik,

Reponses inline:

[EMAIL PROTECTED] wrote:
Hmm, I wonder what kind of overhead that incurs. Of course, if you are only checking it once per HTTP request, I don't suppose it would matter. Sounds like it would be roughly equivalent to creating an exception (due to the stack trace manipulation).

You are totally right ;). At the beginning I've added this check to many
methods (which is not necessary at all) and because the generation of the
StackTrace is a very expensive operation, some pages needed long time to get
generated (about 1-2 seconds) (The check method was called more than a few
thousand times).


Heh... I knew all those years toying with chess engines would pay off somehow - your brain gets wired to search for expensive code. ;p

This is also why logging frameworks like Log4j have big warning signs next to the output options that rely on the stack trace (e.g. to print out the method name, fully-qualified class name, line number). Those stack traces are best served in moderation. Then again, nothing exceeds like excess. ;)

I've ended up in just adding the annotations to methods, which did not get
called thousand times per request ;). Mostly I am checking the access rights
via the annotations on bean creation (e.g.: It does not make sense to allow
a customer to instantiate an administration bean).

But you can easily pass the current method as parameter to the check method,
so no stack trace has to be generated, which is solving the performance
problem anyway.


Really? The examples I have seen all use the stack trace in some way. How are you accessing the current method?

Regards,

Jeff Bischoff
Kenneth L Kurz & Associates, Inc.


Reply via email to