|
|
|
|
|
|
If I had a do-over, I'd rename the current {{Integrator}} contract as {{SessionFactoryServiceRegistryContributor}} and then create this new contract as {{Integrator}}.
But given that {{Integrator}} is released and used in the wild, it might be best to simply deprecate it (pointing to {{SessionFactoryServiceRegistryContributor}} once thats is added) and naming this new contract {{Integration}}. I am open to suggestions for the name; maybe {{ContributorSet}}? {{ContributorProvider}}? {{Module}}? etc.
Whatever the name, the sig would look something like:
{code:title=Integration.java|borderStyle=solid} public interface Integration { public List<BootstrapServiceRegistryContributor> getBootstrapServiceRegistryContributors();
public List<TypeContributor> getTypeContributors();
public List<MetadataSourceContributor> getMetadataSourceContributors();
public List<MetadataContributor> getMetadataContributors();
public List<StandardServiceRegistryContributor> getStandardServiceRegistryContributors();
public List<SessionFactoryServiceRegistryContributor> getSessionFactoryServiceRegistryContributors();
... } {code}
Generally speaking, Hibernate modules (OGM, Search, Validation, Spatial, etc) need to provide multiple contributors. Under the work done for HHH-7540, they would need to define each of those contributors they are interested in but also the corresponding JDK {{java.util.ServiceLoader}} resolution files for each. The idea here is to allow a single {{java.util.ServiceLoader}} resolution to the {{Integration}} which then supplies ORM with the related contributors.
|
|
|
|
|
|