use of org.opendaylight.genius.datastoreutils.ChainableDataTreeChangeListener in project genius by opendaylight.
the class TestableDataTreeChangeListenerModule method getTestableDataTreeChangeListener.
@SuppressWarnings({ "unchecked", "rawtypes" })
protected TestableDataTreeChangeListener getTestableDataTreeChangeListener(Injector injector) {
TestableDataTreeChangeListener beforeTestableDataTreeChangeListener = new TestableDataTreeChangeListener();
DataTreeChangeListener afterTestableDataTreeChangeListener = new DecrementingTestableDataTreeChangeDecoratorListener(beforeTestableDataTreeChangeListener);
for (Key<?> key : injector.getAllBindings().keySet()) {
if (ChainableDataTreeChangeListener.class.isAssignableFrom(key.getTypeLiteral().getRawType())) {
ChainableDataTreeChangeListener chainableListener = (ChainableDataTreeChangeListener) injector.getInstance(key);
chainableListener.addBeforeListener(beforeTestableDataTreeChangeListener);
chainableListener.addAfterListener(afterTestableDataTreeChangeListener);
LOG.info("AsyncEventsWaiter: {}", chainableListener);
}
}
return beforeTestableDataTreeChangeListener;
}
Aggregations