Unfortunately this one is not really fixed.. I thought so but missed a bit.
When the GeoServerLoader does the reload it calls destroy on GeoServerImpl, that in turn clears up all the listeners.
This means the listeners setup by the initializers are lost, and since the initializer are called just once, they are lost forever.
This is btw also the cause for the problem reported on the user list about the status page going NPE, it's due to the jai initializer code not rerunning and not setting up jai properly (which results in some null objects around, thus the NPE).
Now, I have in mind two solutions for this one:
- go back and apply the solution originally suggested by Alessio. That one is simple, but some initializers will have to be re-coded to know they can be called multiple times (but that they have to reattach listeners... might get a bit convoluted)
- make a copy of the listeners list before destroy, and set it back. Tried this one and it works, it also makes sense from the p.o.v of the initializers, but unfortunately it also results in a leak, because there are other parts that are reattaching listeners, so the list grows, first 9 listeners, reload, 11, reload, 13 and so on
Justin, opinions on this one? I guess the path chosen by Alessio works better, but that will require changes in the way some services (monitoring afaik) do their initialization