3 Replies Latest reply on Feb 23, 2005 12:11 PM by dnielben

    Intercepting TreeCache.exists(Fqn) Call

    sdanig

      I am adding a custom interceptor to my TreeCache, but it does not intercept exists(Fqn) calls because exists(Fqn) does not call invokeMethod(MethodCall). Is this just because the standard interceptor chain is not interested in this method? If so, will this change once the interceptor chain becomes customizable via XML (http://jira.jboss.com/jira/browse/JBCACHE-89)? Thanks!

        • 1. Re: Intercepting TreeCache.exists(Fqn) Call
          belaban

          exists() doesn *not* go through the interceptor chain, it will not need to acquire locks etc.

          If you want to intercept it, I suggest using JBossAOP and attach an interceptor directly to exists()

          • 2. Re: Intercepting TreeCache.exists(Fqn) Call
            sdanig

             

            "bela@jboss.com" wrote:
            exists() does *not* go through the interceptor chain, it will not need to acquire locks etc.

            So I'm correct in assuming that the reason exists() doesn't go through the interceptor chain is that the standard interceptors aren't interested in that method call?

            What about custom interceptors, though? If you are going to allow people to add their own interceptors, why should these custom interceptors be limited to the methods that the standard interceptors are interested in?

            • 3. Re: Intercepting TreeCache.exists(Fqn) Call
              dnielben

              Hi !

              I suggest you to use Aspects, it is quite easy to intercept the call using aspects with out modifiying the original program. I am using a similar approach to implement optimistic locking.

              Try JbossCache or others aspect tool as AstectJ.

              Regards
              Daniel