|
Currently, StartStoppable implementations are invoked at a point of time at which the passed session factory is not yet completely set up (the call indirectly originates from the session factory constructor). Thus one can't access entity persisters from the factory etc.
The contract would be more useful if implementations were invoked at a later time, where the factory is already completely set up. This could be realized using a a custom session factory observer (which itself is invoked when the factory bootstrap is complete) which gets all services from the factory that implement StartStoppable and invokes their start method.
|