I am trying to dynamically make a single persistence unit out of multiple jars.
By dynamically, I mean that I add all jars on the classpath that contain a specific resource to the MetadataSources inside a MetadataSourcesContributor. I would like the resource name to be dynamic, therefore I would like to put it in a configuration property.
The problem is that the ServiceRegistry in MetaDataSources is a BootstrapServiceRegistry which only gives access to ClassLoaderService, StrategySelector and IntegratorService... so I cannot resolve ConfigurationService to resolve my config property.
I see multiple ways to solve this problem:
Give MetaDataSources a StandardServiceRegistry instead of a BootstrapServiceRegistry
Allow BootstrapServiceRegistry to hold a ServiceBinding<ConfigurationService>
As StandardServiceRegistry is a child registry of BootstrapServiceRegistry, add a method like BootstrapServiceRegistry.getChildRegistries()