Fix compiler error due to removal of InMemoryDataTreeFactory.create
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / java / org / opendaylight / controller / cluster / datastore / utils / ActorContext.java
index 68ac6412e8ad1346f46686e7d5103be5d0824b76..ee0a4796cac87e8cb79b004a36ad3748f8f52c68 100644 (file)
@@ -398,21 +398,19 @@ public class ActorContext {
 
     /**
      * Send the message to each and every shard
-     *
-     * @param message
      */
-    public void broadcast(final Function<Short, Object> messageSupplier){
+    public void broadcast(final Function<Short, Object> messageSupplier, Class<?> messageClass){
         for(final String shardName : configuration.getAllShardNames()){
 
             Future<PrimaryShardInfo> primaryFuture = findPrimaryShardAsync(shardName);
             primaryFuture.onComplete(new OnComplete<PrimaryShardInfo>() {
                 @Override
                 public void onComplete(Throwable failure, PrimaryShardInfo primaryShardInfo) {
-                    Object message = messageSupplier.apply(primaryShardInfo.getPrimaryShardVersion());
                     if(failure != null) {
                         LOG.warn("broadcast failed to send message {} to shard {}:  {}",
-                                message.getClass().getSimpleName(), shardName, failure);
+                            messageClass.getSimpleName(), shardName, failure);
                     } else {
+                        Object message = messageSupplier.apply(primaryShardInfo.getPrimaryShardVersion());
                         primaryShardInfo.getPrimaryShardActor().tell(message, ActorRef.noSender());
                     }
                 }