@Service @Named(value="isisExtensionsCommandReplaySecondary.TickingClockService") @Order(value=0) public class TickingClockService extends Object
TickingFixtureClock so that time can be changed
dynamically when running.
As an additional safeguard, if the configuration keys to access the primary are not provided, then the service will not initialize.
IMPORTANT: the methods provided by this service are not thread-safe, because the clock is a globally-scoped singleton rather than a thread-local. These methods should therefore only be used in single-user systems, eg a replay secondary.
| Constructor and Description |
|---|
TickingClockService(org.apache.isis.core.config.IsisConfiguration isisConfiguration) |
| Modifier and Type | Method and Description |
|---|---|
void |
at(Timestamp timestamp,
Runnable runnable)
Executes the runnable, setting the clock to be the specified time
beforehand (and reinstating it to its original time afterwards).
|
<T> T |
at(Timestamp timestamp,
Supplier<T> supplier)
Executes the callable, setting the clock to be the specified time
beforehand (and reinstating it to its original time afterwards).
|
void |
init() |
boolean |
isInitialized() |
public TickingClockService(org.apache.isis.core.config.IsisConfiguration isisConfiguration)
@PostConstruct public void init()
public boolean isInitialized()
public void at(Timestamp timestamp, Runnable runnable)
IMPORTANT: this method is not thread-safe, because the clock is a globally-scoped singleton rather than a thread-local. This method should therefore only be used in single-user systems, eg a replay secondary.
public <T> T at(Timestamp timestamp, Supplier<T> supplier)
IMPORTANT: this method is not thread-safe, because the clock is a globally-scoped singleton rather than a thread-local. This method should therefore only be used in single-user systems, eg a replay secondary.
Copyright © 2010–2020 The Apache Software Foundation. All rights reserved.