Interface IBaseInterceptorService<POINTCUT extends IPointcut>

    • Method Detail

      • registerThreadLocalInterceptor

        boolean registerThreadLocalInterceptor​(Object theInterceptor)
        Register an interceptor that will be used in a ThreadLocal context. This means that events will only be broadcast to the given interceptor if they were fired from the current thread.

        Note that it is almost always desirable to call this method with a try-finally statement that removes the interceptor afterwards, since this can lead to memory leakage, poor performance due to ever-increasing numbers of interceptors, etc.

        Note that most methods such as getAllRegisteredInterceptors() and unregisterAllInterceptors() do not affect thread local interceptors as they are kept in a separate list.

        Parameters:
        theInterceptor - The interceptor
        Returns:
        Returns true if at least one valid hook method was found on this interceptor
      • registerInterceptor

        boolean registerInterceptor​(Object theInterceptor)
        Register an interceptor. This method has no effect if the given interceptor is already registered.
        Parameters:
        theInterceptor - The interceptor to register
        Returns:
        Returns true if at least one valid hook method was found on this interceptor
      • unregisterInterceptor

        boolean unregisterInterceptor​(Object theInterceptor)
        Unregister an interceptor. This method has no effect if the given interceptor is not already registered.
        Parameters:
        theInterceptor - The interceptor to unregister
        Returns:
        Returns true if the interceptor was found and removed
      • unregisterInterceptorsIf

        void unregisterInterceptorsIf​(Predicate<Object> theShouldUnregisterFunction)
        Unregisters all interceptors that are indicated by the given callback function returning true