Fix unit test regression introduced in previous fix for OPENDJ-866 (Local RS is named differently).
This commit addresses the InternalSearchMonitorTestCase unit test regression introduced by my previous fix for OPENDJ-866.
Monitor provider instance names are required to be stable so that deregistration attempts succeed. This is not the case for many of our replication monitors which include mutable components such as host addresses or connected RS identifiers (as a parent RDN). Before my fix for OPENDJ-866 these "mutating" monitors took care to re-register themselves whenever they detected that the name was about to change. Unfortunately my fix for OPENDJ-866 made the names of local replica monitors mutable as well by including the local address. The side effect was that the monitor providers would sometimes not be deregistered which was causing the org.opends.server.monitors.InternalSearchMonitorTestCase unit test to fail.
This fix modifies the replication domain monitor provider so that it re-registers itself whenever it senses a potential name change (i.e. connection establishment). The change was not as simple as I hoped because many unit tests create replication brokers with null replication domains.
I've refactored the code a little and pushed ownership of the monitor provider into the broker in order to make its lifecycle clearer.