public CallbackHandler(HelixManager manager, HelixZkClient client, PropertyKey propertyKey,
Object listener, EventType[] eventTypes, ChangeType changeType,
HelixCallbackMonitor monitor) {
if (listener == null) {
throw new HelixException("listener could not be null");
}
if (monitor != null && !monitor.getChangeType().equals(changeType)) {
throw new HelixException(
"The specified callback monitor is for different change type: " + monitor.getChangeType()
.name());
}
_manager = manager;
_accessor = manager.getHelixDataAccessor();
_zkClient = client;
_propertyKey = propertyKey;
_path = propertyKey.getPath();
_listener = listener;
_eventTypes = new HashSet<>(Arrays.asList(eventTypes));
_changeType = changeType;
_lastNotificationTimeStamp = new AtomicLong(System.nanoTime());
_monitor = monitor;
if (_changeType == MESSAGE || _changeType == MESSAGES_CONTROLLER || _changeType == CONTROLLER) {
_watchChild = false;
} else {
_watchChild = true;
}
parseListenerProperties();
init();
}