[hibernate-commits] [hibernate/hibernate-search] 074572: HSEARCH-3070 Add javadoc to BeanConfigurer and rel...

Yoann Rodière noreply at github.com
Wed Apr 3 09:11:09 EDT 2019


  Branch: refs/heads/master
  Home:   https://github.com/hibernate/hibernate-search
  Commit: 074572c814c3481571d476bcaff03b78a952df39
      https://github.com/hibernate/hibernate-search/commit/074572c814c3481571d476bcaff03b78a952df39
  Author: Yoann Rodière <yoann at hibernate.org>
  Date:   2019-04-03 (Wed, 03 Apr 2019)

  Changed paths:
    M engine/src/main/java/org/hibernate/search/engine/environment/bean/spi/BeanConfigurationContext.java
    M engine/src/main/java/org/hibernate/search/engine/environment/bean/spi/BeanConfigurer.java

  Log Message:
  -----------
  HSEARCH-3070 Add javadoc to BeanConfigurer and related classes


  Commit: ffff8f2b1cb9eddee5080cd82450422b7e343e85
      https://github.com/hibernate/hibernate-search/commit/ffff8f2b1cb9eddee5080cd82450422b7e343e85
  Author: Yoann Rodière <yoann at hibernate.org>
  Date:   2019-04-03 (Wed, 03 Apr 2019)

  Changed paths:
    M engine/src/main/java/org/hibernate/search/engine/environment/bean/BeanProvider.java
    M engine/src/main/java/org/hibernate/search/engine/environment/bean/impl/BeanConfigurationContextImpl.java
    M engine/src/main/java/org/hibernate/search/engine/environment/bean/impl/BeanResolverOnlyBeanProvider.java
    M engine/src/main/java/org/hibernate/search/engine/environment/bean/impl/ConfiguredBeanProvider.java
    M engine/src/main/java/org/hibernate/search/engine/environment/bean/spi/BeanConfigurationContext.java

  Log Message:
  -----------
  HSEARCH-3070 Add a concept of "role" to register beans to use in a specific extension point

This will be useful for the Elasticsearch client in particular, to allow
registration of HTTP client configurers by external modules, and then
allow the Elasticsearch backend to retrieve all these configurers and
use them.

Relying on Java services would not be flexible enough: users would not be
able to register Spring or CDI beans, or even just beans that were
instantiated directly in their application.

Relying on Spring or CDI directly is not an option either, because our
SPIs are a bit limited and do not allow to retrieve *multiple* beans
matching a given type (they will fail if multiple beans match a single
reference).

Roles force us to register beans explicitly, which is a bit annoying,
but at least they solve the problems we had with the two solutions
above.


  Commit: e9d409444d87a3e256255de131ee3d4ac5a0e9f2
      https://github.com/hibernate/hibernate-search/commit/e9d409444d87a3e256255de131ee3d4ac5a0e9f2
  Author: Yoann Rodière <yoann at hibernate.org>
  Date:   2019-04-03 (Wed, 03 Apr 2019)

  Changed paths:
    A engine/src/test/java/org/hibernate/search/engine/environment/bean/impl/ConfiguredBeanProviderTest.java

  Log Message:
  -----------
  HSEARCH-3070 Add a basic unit test for ConfiguredBeanProviderTest


  Commit: 776448780e325530939660ab6b83b66d149a93ac
      https://github.com/hibernate/hibernate-search/commit/776448780e325530939660ab6b83b66d149a93ac
  Author: Yoann Rodière <yoann at hibernate.org>
  Date:   2019-04-03 (Wed, 03 Apr 2019)

  Changed paths:
    M backend/elasticsearch/src/main/java/org/hibernate/search/backend/elasticsearch/impl/ElasticsearchBackendFactory.java
    M backend/lucene/src/main/java/org/hibernate/search/backend/lucene/impl/LuceneBackendFactory.java
    M engine/src/main/java/org/hibernate/search/engine/backend/spi/BackendBuildContext.java
    M engine/src/main/java/org/hibernate/search/engine/common/impl/DelegatingBuildContext.java
    M engine/src/main/java/org/hibernate/search/engine/common/impl/RootBuildContext.java
    M engine/src/main/java/org/hibernate/search/engine/common/impl/SearchIntegrationBuilderImpl.java
    M engine/src/main/java/org/hibernate/search/engine/environment/classpath/spi/ClassResolver.java
    R engine/src/main/java/org/hibernate/search/engine/environment/service/impl/ServiceManagerImpl.java
    R engine/src/main/java/org/hibernate/search/engine/environment/service/spi/Service.java
    R engine/src/main/java/org/hibernate/search/engine/environment/service/spi/ServiceManager.java
    M engine/src/main/java/org/hibernate/search/engine/mapper/mapping/spi/MappingBuildContext.java
    M mapper/orm/src/main/java/org/hibernate/search/mapper/orm/mapping/impl/HibernateOrmMappingInitiator.java
    M mapper/pojo/src/main/java/org/hibernate/search/mapper/pojo/extractor/impl/ContainerExtractorBinder.java
    M mapper/pojo/src/main/java/org/hibernate/search/mapper/pojo/mapping/building/impl/BridgeBuildContextImpl.java
    M mapper/pojo/src/main/java/org/hibernate/search/mapper/pojo/mapping/building/impl/MarkerBuildContextImpl.java

  Log Message:
  -----------
  HSEARCH-3070 Remove the concept of ServiceManager

Currently we do not need services, and I don't see any reason we should
need them in the near future.

Should we ever need services, the BeanProvider will be the most obvious
place to implement this feature.

The "role" feature can already be used to get a set of beans with an
assigned role.
For services, we could use roles and expect only one bean to be
assigned a given role. That's more or less equivalent to what we already
have in Search 5, where having multiple implementations of a same
service will simply fail.

If we ever need to retrieve the exact same instance of the service
multiple times from the bean provider, or to provide a way to resolve
conflicts when there are multiple candidates for a single service,
I'm confident we could implement this fairly easily.
But as I said, currently it's just not necessary.


Compare: https://github.com/hibernate/hibernate-search/compare/88538b7f83a1...776448780e32



More information about the hibernate-commits mailing list