Couldn't it be an alternative to create all those services contributed by an initiator which implements SessionFactoryServiceInitiator through a default implementation of SessionFactoryServiceRegistry and manage them on the SF level? This would allow to specify all initiators in one place (the integrator) and would avoid the need for a custom SessionFactoryServiceRegistry, its initiator etc. Of course this would require changes on the ORM side.
I am not quite following you but from what I understand you describes the last part of the issue description:
Bonus point if we can devise an easier solution to register these SF aware ServiceInitiator. non SF aware service initiators can be registered by an Integrator implementing ServiceContributingIntegrator. We could imagine a SessionFactoryServiceContributingIntegrator. any better solution? A potential complex point is to see if the Integrator is still around when the SesisonFactoryServiceRegistry is created.
|