Yes, it's related to that. I think it would be nice to be able to do the following:
{code} public class OgmIntegrator implements Integrator, ServiceContributingIntegrator {
... public void prepareServices(ServiceRegistryBuilder srb) {
srb.addInitiator( ConfigurationServiceInitiator.INSTANCE ); //implements OptionalServiceInitiator srb.addInitiator( GridDialectFactoryInitiator.INSTANCE ); //implements SessionFactoryServiceInitiator
//others...; but *no* SessionFactoryServiceRegistryFactory ... } } {code}
The registry builder in ORM would have to recognize the type of an initiator (does it implement {{SessionFactoryServiceInitiator}} or not) and based on that either create the service on the "global level" or create it on the SF level through {{SessionFactoryServiceRegistry}}. So the idea is to contribute all services through initiators instead of contributing a custom {{SessionFactoryServiceRegistry}} which has a hard-coded list of SF-level services.
|