- public DistributedDataStore(ActorContext actorContext, String type) {
- this.type = type;
- this.actorContext = actorContext;
- }
-
-
- @Override
- public <L extends AsyncDataChangeListener<YangInstanceIdentifier, NormalizedNode<?, ?>>> ListenerRegistration<L> registerChangeListener(
- YangInstanceIdentifier path, L listener,
- AsyncDataBroker.DataChangeScope scope) {
-
- ActorRef dataChangeListenerActor = actorContext.getActorSystem().actorOf(
- DataChangeListener.props(schemaContext,listener,path ));
-
- String shardName = ShardStrategyFactory.getStrategy(path).findShard(path);
-
- Object result = actorContext.executeLocalShardOperation(shardName,
- new RegisterChangeListener(path, dataChangeListenerActor.path(),
- scope),
- ActorContext.ASK_DURATION
- );
-
- if (result != null) {
- RegisterChangeListenerReply reply = (RegisterChangeListenerReply) result;
- return new DataChangeListenerRegistrationProxy(actorContext
- .actorSelection(reply.getListenerRegistrationPath()), listener,
- dataChangeListenerActor);
- }
-
- LOG.debug(
- "No local shard for shardName {} was found so returning a noop registration",
- shardName);
- return new NoOpDataChangeListenerRegistration(listener);
+ @VisibleForTesting
+ DistributedDataStore(final ActorContext actorContext, final ClientIdentifier identifier) {
+ super(actorContext, identifier);
+ this.txContextFactory = new TransactionContextFactory(getActorContext(), getIdentifier());