hibernate/hibernate-ogm — pull request #200 by DavideD (2013-07-20 13:52:26+00:00)
Title: OGM-299 Use SessionFactoryServiceInitiator instead of sessionFactory.addObserver to inject SessionFactory in DatastoreProvider

https://hibernate.atlassian.net/browse/OGM-299

I've removed the Observer and now there is an implementation of SessionFactoryServiceRegistry that registers all the services requirinq a SessionFactory.

Those initiators don't extend anymore OptionalServiceInitiator and they implement SessionFactoryServiceInitiator
This interface add two initateService methods, one receiving a Configuration and one receiveing a MetadataImplementor has parameter. I don't know how to create some services using the MetadataImplementor so for now that method is throwing a UnsupportedOperationException.
Some of the services don't directly require a SessionFactory but I had to include them in the same registry or they weren't able to find some other services.

I've also changed the DatastoreWithStartStoppabbleTest because now the exception is thrown from a different place

In OgmSessionFactoryServiceRegistryFactoryImpl I had to add a control so that the registry is not created more than once.