Class ClientActorContext
- java.lang.Object
-
- org.opendaylight.controller.cluster.access.client.ClientActorContext
-
- All Implemented Interfaces:
Identifiable<ClientIdentifier>,Mutable,MutationBehaviour<Mutable>
@Beta public class ClientActorContext extends Object implements Identifiable<ClientIdentifier>
An actor context associated with thisAbstractClientActor.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 aTicker, which can be obtained viaticker(). This class is thread-safe.- Author:
- Robert Varga
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @NonNull ClientActorConfigconfig()@NonNull Dispatchersdispatchers()<T extends BackendInfo>
voidexecuteInActor(@NonNull InternalCommand<T> command)Execute a command in the context of the client actor.<T extends BackendInfo>
CancellableexecuteInActor(@NonNull InternalCommand<T> command, scala.concurrent.duration.FiniteDuration delay)ClientIdentifiergetIdentifier()@NonNull MessageSlicermessageSlicer()@NonNull ActorRefself()@NonNull Tickerticker()Return the time ticker for thisClientActorContext.
-
-
-
Method Detail
-
getIdentifier
public ClientIdentifier getIdentifier()
- Specified by:
getIdentifierin interfaceIdentifiable<ClientIdentifier>
-
config
public @NonNull ClientActorConfig config()
-
dispatchers
public @NonNull Dispatchers dispatchers()
-
messageSlicer
public @NonNull MessageSlicer messageSlicer()
-
ticker
public @NonNull Ticker ticker()
Return the time ticker for thisClientActorContext. This should be used for in all time-tracking done within a client actor. Subclasses ofClientActorBehaviorare encouraged to useStopwatch.- 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> Cancellable executeInActor(@NonNull InternalCommand<T> command, scala.concurrent.duration.FiniteDuration delay)
-
self
public final @NonNull ActorRef self()
-
-