Class ControlledActorClockService
java.lang.Object
io.camunda.zeebe.shared.management.ControlledActorClockService
- All Implemented Interfaces:
ActorClockService,ActorClockService.MutableClock
public final class ControlledActorClockService
extends Object
implements ActorClockService, ActorClockService.MutableClock
An implementation of
ActorClockService which wraps a mutable clock, allowing for
modification of the clock from the outside.
See ActorClockConfiguration on how to configure/wire it.
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.camunda.zeebe.shared.management.ActorClockService
ActorClockService.MutableClock -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds the offset to the current clock.longmutable()voidPins the clock to the given time.voidResets the clock to use the system time
-
Constructor Details
-
ControlledActorClockService
-
-
Method Details
-
epochMilli
public long epochMilli()- Specified by:
epochMilliin interfaceActorClockService- Returns:
- the current instant of the clock
-
mutable
- Specified by:
mutablein interfaceActorClockService- Returns:
- a mutable variant of the underlying clock, or nothing if the clock is immutable
-
addTime
Description copied from interface:ActorClockService.MutableClockAdds the offset to the current clock.- Specified by:
addTimein interfaceActorClockService.MutableClock- Parameters:
offset- the time offset to add to the current time
-
pinTime
Description copied from interface:ActorClockService.MutableClockPins the clock to the given time.- Specified by:
pinTimein interfaceActorClockService.MutableClock- Parameters:
time- the time at which to pin the current clock
-
resetTime
public void resetTime()Description copied from interface:ActorClockService.MutableClockResets the clock to use the system time- Specified by:
resetTimein interfaceActorClockService.MutableClock
-