Package org.hibernate.integrator.spi
Interface Integrator
- All Known Implementing Classes:
BeanValidationIntegrator
,CollectionCacheInvalidator
,EnversIntegrator
,SharedDriverManagerTypeCacheClearingIntegrator
Contract for extensions that integrate with Hibernate.
The best way to make an implementation of Integrator
available to Hibernate
is by making it discoverable via the standard Java ServiceLoader
facility.
- Since:
- 4.0
- Implementation Note:
integrate(Metadata, BootstrapContext, SessionFactoryImplementor)
is called during the process of session factory initialization. In fact, it's called directly from the constructor ofSessionFactoryImpl
. So the passed session factory is not yet fully-initialized and is in a very fragile state.
-
Method Summary
Modifier and TypeMethodDescriptiondefault void
disintegrate
(SessionFactoryImplementor sessionFactory, SessionFactoryServiceRegistry serviceRegistry) Tongue-in-cheek name for a shutdown callback.default void
integrate
(Metadata metadata, BootstrapContext bootstrapContext, SessionFactoryImplementor sessionFactory) Perform integration.
-
Method Details
-
integrate
default void integrate(Metadata metadata, BootstrapContext bootstrapContext, SessionFactoryImplementor sessionFactory) Perform integration.- Parameters:
metadata
- The fully initialized boot-time mapping modelbootstrapContext
- The context for bootstrapping of the SessionFactorysessionFactory
- The SessionFactory being created
-
disintegrate
default void disintegrate(SessionFactoryImplementor sessionFactory, SessionFactoryServiceRegistry serviceRegistry) Tongue-in-cheek name for a shutdown callback.- Parameters:
sessionFactory
- The session factory being closed.serviceRegistry
- That session factory's service registry
-