public interface IInterceptorService extends IInterceptorBroadcaster
| Modifier and Type | Method and Description |
|---|---|
List<Object> |
getAllRegisteredInterceptors()
Returns all currently registered interceptors (excluding any thread local interceptors).
|
void |
registerAnonymousInterceptor(Pointcut thePointcut,
IAnonymousInterceptor theInterceptor) |
void |
registerAnonymousInterceptor(Pointcut thePointcut,
int theOrder,
IAnonymousInterceptor theInterceptor) |
boolean |
registerInterceptor(Object theInterceptor)
Register an interceptor.
|
void |
registerInterceptors(Collection<?> theInterceptors) |
boolean |
registerThreadLocalInterceptor(Object theInterceptor)
Register an interceptor that will be used in a
ThreadLocal context. |
void |
unregisterAllInterceptors()
Unregisters all registered interceptors.
|
boolean |
unregisterInterceptor(Object theInterceptor)
Unregister an interceptor.
|
void |
unregisterInterceptors(Collection<?> theInterceptors) |
void |
unregisterThreadLocalInterceptor(Object theInterceptor)
Unregisters a ThreadLocal interceptor
|
callHooks, callHooksAndReturnObject, hasHooksboolean registerThreadLocalInterceptor(Object theInterceptor)
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.
theInterceptor - The interceptortrue if at least one valid hook method was found on this interceptorvoid unregisterThreadLocalInterceptor(Object theInterceptor)
theInterceptor - The interceptorregisterThreadLocalInterceptor(Object)boolean registerInterceptor(Object theInterceptor)
theInterceptor - The interceptor to registertrue if at least one valid hook method was found on this interceptorboolean unregisterInterceptor(Object theInterceptor)
theInterceptor - The interceptor to unregistertrue if the interceptor was found and removedvoid registerAnonymousInterceptor(Pointcut thePointcut, IAnonymousInterceptor theInterceptor)
void registerAnonymousInterceptor(Pointcut thePointcut, int theOrder, IAnonymousInterceptor theInterceptor)
List<Object> getAllRegisteredInterceptors()
void unregisterAllInterceptors()
thread local interceptors.void unregisterInterceptors(@Nullable Collection<?> theInterceptors)
void registerInterceptors(@Nullable Collection<?> theInterceptors)
Copyright © 2014–2019 University Health Network. All rights reserved.