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.common.api.data.AsyncDataBroker.DataChangeScope;
13 import org.opendaylight.controller.md.sal.common.api.data.AsyncDataChangeListener;
14 import org.opendaylight.controller.md.sal.dom.store.impl.DataChangeListenerRegistration;
15 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
16 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
19 * Implementation of ShardDataChangeListenerPublisher that offloads the generation and publication
20 * of data change notifications to an actor.
22 * @author Thomas Pantelis
25 class ShardDataChangeListenerPublisherActorProxy extends AbstractShardDataTreeNotificationPublisherActorProxy
26 implements ShardDataChangeListenerPublisher {
28 private final ShardDataChangeListenerPublisher delegatePublisher = new DefaultShardDataChangeListenerPublisher();
30 ShardDataChangeListenerPublisherActorProxy(ActorContext actorContext, String actorName) {
31 super(actorContext, actorName);
34 private ShardDataChangeListenerPublisherActorProxy(ShardDataChangeListenerPublisherActorProxy other) {
39 public <L extends AsyncDataChangeListener<YangInstanceIdentifier, NormalizedNode<?, ?>>>
40 DataChangeListenerRegistration<L> registerDataChangeListener(YangInstanceIdentifier path, L listener,
41 DataChangeScope scope) {
42 return delegatePublisher.registerDataChangeListener(path, listener, scope);
46 public ShardDataChangeListenerPublisher newInstance() {
47 return new ShardDataChangeListenerPublisherActorProxy(this);
51 protected ShardDataTreeNotificationPublisher getDelegatePublisher() {
52 return delegatePublisher;