/** * Registers a coordinatelistener that will receive events when there are changes to the status * node. Don't do any heavy lifting in the callback and don't call cloudname from the callback as * this might create a deadlock. * * @param coordinateListener */ public void registerCoordinateListener(final CoordinateListener coordinateListener) { String message = "New listener added, resending current state."; synchronized (callbacksMonitor) { coordinateListenerList.add(coordinateListener); if (isSynchronizedWithZooKeeper.get()) { coordinateListener.onCoordinateEvent(CoordinateListener.Event.COORDINATE_OK, message); } } }
/** * Registers a configlistener that will receive events when there are changes to the config node. * Don't do any heavy lifting in the callback and don't call cloudname from the callback as this * might create a deadlock. * * @param trackedConfig */ public void registerTrackedConfig(final TrackedConfig trackedConfig) { trackedConfigList.add(trackedConfig); }