Class ClientActorContext

  • All Implemented Interfaces:
    org.opendaylight.yangtools.concepts.Identifiable<org.opendaylight.controller.cluster.access.concepts.ClientIdentifier>, org.opendaylight.yangtools.concepts.Mutable, org.opendaylight.yangtools.concepts.MutationBehaviour<org.opendaylight.yangtools.concepts.Mutable>

    @Beta
    public class ClientActorContext
    extends Object
    implements org.opendaylight.yangtools.concepts.Identifiable<org.opendaylight.controller.cluster.access.concepts.ClientIdentifier>
    An actor context associated with this AbstractClientActor.

    Time-keeping in a client actor is based on monotonic time. The precision of this time can be expected to be the same as System.nanoTime(), but it is not tied to that particular clock. Actor clock is exposed as a Ticker, which can be obtained via ticker(). This class is thread-safe.

    Author:
    Robert Varga
    • Method Detail

      • getIdentifier

        public org.opendaylight.controller.cluster.access.concepts.ClientIdentifier getIdentifier()
        Specified by:
        getIdentifier in interface org.opendaylight.yangtools.concepts.Identifiable<org.opendaylight.controller.cluster.access.concepts.ClientIdentifier>
      • dispatchers

        public @NonNull org.opendaylight.controller.cluster.common.actor.Dispatchers dispatchers()
      • messageSlicer

        public @NonNull org.opendaylight.controller.cluster.messaging.MessageSlicer messageSlicer()
      • ticker

        public @NonNull com.google.common.base.Ticker ticker()
        Return the time ticker for this ClientActorContext. This should be used for in all time-tracking done within a client actor. Subclasses of ClientActorBehavior are encouraged to use Stopwatch.
        Returns:
        Client actor time source
      • executeInActor

        public <T extends BackendInfo> void executeInActor​(@NonNull InternalCommand<T> command)
        Execute a command in the context of the client actor.
        Type Parameters:
        T - BackendInfo type
        Parameters:
        command - Block of code which needs to be execute
      • executeInActor

        public <T extends BackendInfo> akka.actor.Cancellable executeInActor​(@NonNull InternalCommand<T> command,
                                                                             scala.concurrent.duration.FiniteDuration delay)
      • self

        public final @NonNull akka.actor.ActorRef self()