I think you have a leak here, as the ServiceManager does reference counting and I'm not clear here where the balancing close is happening.

And it looks like tricky to solve too :-/

Since we decided the _ClassLoaderService_ is quite a special one, we could maybe consider it not as a Service, and have it retrived by a simple getter. This would maybe also make it clearer for the SearchConfiguration implementor that we definitely expect this to be provided.. WDYT?

On a different approach, I'd like to see if we can reuse the ServiceManager "as is" when doing an hot-reboot: many services could be reused. But this would need a thourough investigation, as one of the reasons we do the restart is that some aspects of the configuration might be changes. If some service is still alive and doesn't get restarted, and happens to be configured via one of the configuration settings which changed we end up in trouble. I guess we could check if in fact Service are ever affected by configuration, then impose a limitation on it.