[hibernate-dev] API/SPI in 5.0

Emmanuel Bernard emmanuel at hibernate.org
Thu Feb 6 15:31:20 EST 2014


On 06 Feb 2014, at 15:10, Steve Ebersole <steve at hibernate.org> wrote:

> 
> On Thu, Feb 6, 2014 at 6:46 AM, Emmanuel Bernard <emmanuel at hibernate.org> wrote:
> 
> Configuration.getreflectionManager (optional)
> 
> We do not use commons-annotations anymore at all (yaay!).  If you need access to this type of functionality, I have been thinking about passing along access to the Jandex index we use.
> 
>  
> The properties are used to bootstrap Hibernate Search as we receive our
> properties form the Hibernate ORM configurations
> 
> Settings/configuration values are now available via either the SessionFactory or the ConfigurationService (which just holds the settings and exposes them in various type-safe ways).
>  
> 
> The class mappings is necessary for us as it offers the list of entities
> we need to look at. From them, we bootstrap with the subsection that are
> @Indexed entities.
> 
> "Mapping information" is MetadataImplementor.  Though tbh it sounds like you really just want/need Jandex.

That’s all super useful. I’ve updated https://hibernate.atlassian.net/browse/HSEARCH-856 to track the necessary changes. It’s much less painful that I anticipated.

>  
> We do that by associating a SF Observer and passing in the Configuration
> object and using the SF instance passed.
> This observer is initialized by the Integrator.
> 
> I am not understanding this part at all.  Integrator is called during the process of creating a SessionFactory, so I would think that the sessionFactoryCreated callback would be moot here.  And you already have a hook for a sessionFactoryClosed callback in Integrator#disintegrate.  So you'll need to explain this some more.
> 
> Regardless, if you really really really want to use a SessionFactoryObserver then you'd just call SessionFactoryImplementor#addObserver from your Integrator

It is related to a recent change by Sanne and Hardy to have access to a fully initialized SessionFactory to bootstrap Hibernate Search I think. But they can tell more about this.


More information about the hibernate-dev mailing list