Search in sources :

Example 1 with ChainableDataTreeChangeListener

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;
}
Also used : DataTreeChangeListener(org.opendaylight.controller.md.sal.binding.api.DataTreeChangeListener) ChainableDataTreeChangeListener(org.opendaylight.genius.datastoreutils.ChainableDataTreeChangeListener) ChainableDataTreeChangeListener(org.opendaylight.genius.datastoreutils.ChainableDataTreeChangeListener)

Aggregations

DataTreeChangeListener (org.opendaylight.controller.md.sal.binding.api.DataTreeChangeListener)1 ChainableDataTreeChangeListener (org.opendaylight.genius.datastoreutils.ChainableDataTreeChangeListener)1