Interface IBaseInterceptorService<POINTCUT extends IPointcut>
- All Superinterfaces:
IBaseInterceptorBroadcaster<POINTCUT>
- All Known Subinterfaces:
IInterceptorService
- All Known Implementing Classes:
BaseInterceptorService,InterceptorService
-
Method Summary
Modifier and TypeMethodDescriptionReturns all currently registered interceptors (excluding any thread local interceptors).booleanregisterInterceptor(Object theInterceptor) Register an interceptor.voidregisterInterceptors(Collection<?> theInterceptors) booleanregisterThreadLocalInterceptor(Object theInterceptor) Deprecated.Threadlocal interceptors have been deprecated as of HAPI FHIR 6.2.0 and will be removed in a future release due to lack of use.voidUnregisters all anonymous interceptors (i.e.voidUnregisters all registered interceptors.booleanunregisterInterceptor(Object theInterceptor) Unregister an interceptor.voidunregisterInterceptors(Collection<?> theInterceptors) voidunregisterInterceptorsIf(Predicate<Object> theShouldUnregisterFunction) Unregisters all interceptors that are indicated by the given callback function returningtruevoidunregisterThreadLocalInterceptor(Object theInterceptor) Deprecated.Threadlocal interceptors have been deprecated as of HAPI FHIR 6.2.0 and will be removed in a future release due to lack of use.Methods inherited from interface ca.uhn.fhir.interceptor.api.IBaseInterceptorBroadcaster
callHooks, callHooksAndReturnObject, hasHooks
-
Method Details
-
registerThreadLocalInterceptor
Deprecated.Threadlocal interceptors have been deprecated as of HAPI FHIR 6.2.0 and will be removed in a future release due to lack of use. If you feel that this is a bad decision, please speak up on the HAPI FHIR mailing list.Register an interceptor that will be used in aThreadLocalcontext. 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()andunregisterAllInterceptors()do not affect thread local interceptors as they are kept in a separate list.ThreadLocal interceptors are now disabled by default as of HAPI FHIR 6.2.0 and must be manually enabled by calling
BaseInterceptorService.setThreadlocalInvokersEnabled(boolean). They are now deprecated. Registering a threadlocal interceptor without enabling this feature will result in aIllegalArgumentException.- Parameters:
theInterceptor- The interceptor- Returns:
- Returns
trueif at least one valid hook method was found on this interceptor
-
unregisterThreadLocalInterceptor
Deprecated.Threadlocal interceptors have been deprecated as of HAPI FHIR 6.2.0 and will be removed in a future release due to lack of use. If you feel that this is a bad decision, please speak up on the HAPI FHIR mailing list.Unregisters a ThreadLocal interceptorThreadLocal interceptors are now disabled by default as of HAPI FHIR 6.2.0 and must be manually enabled by calling
BaseInterceptorService.setThreadlocalInvokersEnabled(boolean). They are now deprecated. Registering a threadlocal interceptor without enabling this feature will result in aIllegalArgumentException.- Parameters:
theInterceptor- The interceptor- See Also:
-
registerInterceptor
Register an interceptor. This method has no effect if the given interceptor is already registered.- Parameters:
theInterceptor- The interceptor to register- Returns:
- Returns
trueif at least one valid hook method was found on this interceptor
-
unregisterInterceptor
Unregister an interceptor. This method has no effect if the given interceptor is not already registered.- Parameters:
theInterceptor- The interceptor to unregister- Returns:
- Returns
trueif the interceptor was found and removed
-
getAllRegisteredInterceptors
Returns all currently registered interceptors (excluding any thread local interceptors). -
unregisterAllInterceptors
void unregisterAllInterceptors()Unregisters all registered interceptors. Note that this method does not unregister anythread local interceptors. -
unregisterInterceptors
-
registerInterceptors
-
unregisterInterceptorsIf
Unregisters all interceptors that are indicated by the given callback function returningtrue -
unregisterAllAnonymousInterceptors
Unregisters all anonymous interceptors (i.e. all interceptors registered withregisterAnonymousInterceptor)
-