BUG-5280: use a lambda for createLocalHistory()/close()
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / java / org / opendaylight / controller / cluster / datastore / actors / client / ClientActorContext.java
index 9fc17b53fc4d87ece7f88a46f2d63d1453816175..3aa1a5200b077f91fda048ba2704648de98c8f88 100644 (file)
@@ -49,4 +49,13 @@ public class ClientActorContext extends AbstractClientActorContext implements Id
     public @Nonnull Ticker ticker() {
         return Ticker.systemTicker();
     }
     public @Nonnull Ticker ticker() {
         return Ticker.systemTicker();
     }
+
+    /**
+     * Execute a command in the context of the client actor.
+     *
+     * @param command Block of code which needs to be execute
+     */
+    public void executeInActor(final @Nonnull InternalCommand command) {
+        self().tell(Preconditions.checkNotNull(command), ActorRef.noSender());
+    }
 }
 }