use of org.opendaylight.controller.md.sal.binding.api.ClusteredDataTreeChangeListener in project controller by opendaylight.
the class BindingDOMDataTreeChangeServiceAdapter method registerDataTreeChangeListener.
@Override
public <T extends DataObject, L extends DataTreeChangeListener<T>> ListenerRegistration<L> registerDataTreeChangeListener(final DataTreeIdentifier<T> treeId, final L listener) {
final DOMDataTreeIdentifier domIdentifier = toDomTreeIdentifier(treeId);
@SuppressWarnings({ "rawtypes", "unchecked" }) final BindingDOMDataTreeChangeListenerAdapter<T> domListener = listener instanceof ClusteredDataTreeChangeListener ? new BindingClusteredDOMDataTreeChangeListenerAdapter<>(codec, (ClusteredDataTreeChangeListener) listener, treeId.getDatastoreType()) : new BindingDOMDataTreeChangeListenerAdapter<>(codec, listener, treeId.getDatastoreType());
final ListenerRegistration<BindingDOMDataTreeChangeListenerAdapter<T>> domReg = dataTreeChangeService.registerDataTreeChangeListener(domIdentifier, domListener);
return new BindingDataTreeChangeListenerRegistration<>(listener, domReg);
}
Aggregations