@Override
@SuppressWarnings({ "unchecked" })
protected <T extends Service> T createService(Class<T> serviceRole) {
SessionFactoryServiceInitiator<T> initiator = serviceInitiatorMap.get( serviceRole );
if ( initiator == null ) {
throw new UnknownServiceException( serviceRole );
}
try {
T service = initiator.initiateService( sessionFactory, configuration, this );
// IMPL NOTE : the register call here is important to avoid potential stack overflow issues
// from recursive calls through #configureService