BUG-8733: Add ListenableDOMDataTreeShard 30/60630/26
authorRobert Varga <robert.varga@pantheon.tech>
Fri, 21 Jul 2017 09:45:24 +0000 (11:45 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Mon, 31 Jul 2017 12:34:54 +0000 (14:34 +0200)
Implementation reliance on DOMDataTreeChangePublisher is a mistake
coming from similarities between interfaces. DOMDataTreeShard interfaces
should work with DOMDataTreeListener instances, not DOMDataTreeChangeListener.

This patch introduces ListenableDOMDataTreeShard, which exposes a proper
SPI-level method for registering DOMDataTreeListeners.

It also adds AbstractStateAggregator, which can be used to efficiently
aggregate multiple listeners into a single upcall, without the synchronization
overhead of ShardedDOMDataTreeListenerContext.

This class is then used to build DOMDataTreeChangeListenerAggregator for
bridging the old approach with ListenableDOMDataTreeShard via a utility
proxy, CompatListenableDOMDataTreeShard.

We also introduce DOMDataTreeListenerAggregator, which performs aggregation
of multiple DOMDataTreeListeners and is useful for ListenableDOMDataTreeShard
implementations where requested subtrees live in multiple child shards.

Change-Id: I979610e032605ade6d68196d51ae62778311f8c6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>

No differences found