1 Reply Latest reply on Feb 23, 2004 12:04 AM by tom.elrod

    Custom client interceptor

    maaaah

      Hi all!

      I have the following question:
      Can I re-invoke method in client interceptor?

      For example:

      public class TestInterceptor extends Interceptor {

      public Object invoke(final Invocation mi) throws Throwable
      {
      while(true) {
      try {
      return getNext().invoke(mi);
      }
      catch (SomeException e)
      {
      ...
      }
      }
      }

      }

      So, I want to handle SomeException in the TestInterceptor, to make SomeException invisible to the client.
      Can I do this? And how? Should I set transaction or security context again before repeating method call?
      Help me please!

        • 1. Re: Custom client interceptor

          It is possible to do this if just want to wrap the exception in something else and re-throw it. Is this all you are trying to do?

          If you want to re-try, you can do that as well by calling getNext().invoke(mi) again, but should not expect any differnt results.