|
Yes, it's related to that. I think it would be nice to do the following:
public class OgmIntegrator implements Integrator, ServiceContributingIntegrator {
...
public void prepareServices(ServiceRegistryBuilder srb) {
srb.addInitiator( ConfigurationServiceInitiator.INSTANCE ); srb.addInitiator( GridDialectFactoryInitiator.INSTANCE );
...
}
}
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.
|