2 * Copyright (c) 2016 Brocade Communications Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.controller.cluster.datastore;
10 import akka.actor.ActorContext;
11 import javax.annotation.concurrent.NotThreadSafe;
12 import org.opendaylight.controller.md.sal.dom.api.DOMDataTreeChangeListener;
13 import org.opendaylight.yangtools.concepts.ListenerRegistration;
14 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
17 * Implementation of ShardDataTreeChangeListenerPublisher that offloads the generation and publication
18 * of data tree change notifications to an actor.
20 * @author Thomas Pantelis
23 class ShardDataTreeChangeListenerPublisherActorProxy extends AbstractShardDataTreeNotificationPublisherActorProxy
24 implements ShardDataTreeChangeListenerPublisher {
26 private final ShardDataTreeChangeListenerPublisher delegatePublisher =
27 new DefaultShardDataTreeChangeListenerPublisher();
29 ShardDataTreeChangeListenerPublisherActorProxy(ActorContext actorContext, String actorName) {
30 super(actorContext, actorName);
33 private ShardDataTreeChangeListenerPublisherActorProxy(ShardDataTreeChangeListenerPublisherActorProxy other) {
38 public <L extends DOMDataTreeChangeListener> ListenerRegistration<L> registerTreeChangeListener(
39 YangInstanceIdentifier treeId, L listener) {
40 return delegatePublisher.registerTreeChangeListener(treeId, listener);
44 public ShardDataTreeChangeListenerPublisher newInstance() {
45 return new ShardDataTreeChangeListenerPublisherActorProxy(this);
49 protected ShardDataTreeNotificationPublisher getDelegatePublisher() {
50 return delegatePublisher;