On 2/16/06, Frank W. Zammetti <[EMAIL PROTECTED]> wrote: > I saw a very similar question asked a few months back in a general Java > forum, and I suggested an answer that I've never had the chance to > actually try out... the theory is interesting though... > > In the method you want to "protect", immediately throw an exception and > catch it. Then, parse the stack trace and see who the caller was. If > it's not a class you want to have access to the method, throw an > IllegalAccessException.
I guess it can be costly if the callers are mostly the ones that you want to allow access to. On the other hand, I don't know the metrics on how costly is to create and throw an exception. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]