Interface InterceptorStrategy
Strategy for resolving and managing
Interceptor instances
across session lifecycle boundaries.- Since:
- 8.0
-
Method Summary
Modifier and TypeMethodDescriptiondefault InterceptorDeprecated.default ManagedBean<? extends Interceptor> Return a managed bean wrapping the factory-level interceptor, ornullif this strategy does not provide one.getInterceptorForSession(SessionFactoryImplementor sessionFactory) Obtain an interceptor for a newly created session.default booleanisScoped()Does this strategy produce session-scoped interceptors, i.e.default voidregisterSharedUse(Interceptor interceptor) Register an additional holder of the given interceptor, which was already obtained fromgetInterceptorForSession(SessionFactoryImplementor), so that the strategy can track how many sessions are sharing it.default voidreleaseInterceptor(Interceptor interceptor) Release an interceptor when its session closes.
-
Method Details
-
getInterceptorForSession
Obtain an interceptor for a newly created session. -
releaseInterceptor
Release an interceptor when its session closes. -
isScoped
default boolean isScoped()Does this strategy produce session-scoped interceptors, i.e. a distinct interceptor instance per session?Consulted by
noSessionInterceptorCreation()to determine whether a session-level interceptor should be suppressed: scoped interceptors are suppressed, while global and explicitly-provided instance interceptors are not. -
getFactoryInterceptor
Deprecated.UsegetFactoryInterceptorBean()insteadReturn a factory-level interceptor, ornullif this strategy does not provide one. -
getFactoryInterceptorBean
Return a managed bean wrapping the factory-level interceptor, ornullif this strategy does not provide one. The bean is not resolved untilManagedBean.getBeanInstance()is called.
-
getFactoryInterceptorBean()instead